Greetings everybody,

I have been develolping a program for isochronous USB communication.

In run time, when allocating memory for transfer, libusb_transfer, ENOMEM
error arises.

I have been looking for a solution for this problem, but I have not come to
a conclusion, yet.

What might be the reason of this problem, how I could solve; could you give me
a hint to search for?

Thanks in advance

Edited 2 Years Ago by m.a.u.

I would like to add, errno : 2 is when I try to acquire data from the web_cam, but when I try to acquire data from an audio device errno : 16 arises.

I would like to indicate that it is not a ENOMEM problem, in transfer, it works.

When I ran the program in inteuppt mode, I had no such problem as one related to input / output ( errno = 16 ) . I have been trying all the addresses and maximum packet sizes, but having the same error...

Greetings again,

I have checked my program with Valgrind/Valkyrie, and received an output indicating "...possibly lost in loss recods..." .

I have been searching for the solution of this problem. Could I ask you if anybody knows a solution for this problem? An example, web site, blog; I could learn reading if there is any useful link you could share.

Regards

I am guessing that you have some sort of memory leak or memory corruption. The out of memory error occurs either if you literally run out of memory (e.g., from a memory leak in a tight loop), or if you corrupted the heap completely (e.g., by freeing memory twice). From you valgrind tests, it would appear that you have a memory leak. In valgrind terminology, it reports "possibly lost" (or "definitely lost") for memory that has not been freed and no longer has any pointer to it, which is, by definition, a memory leak (you have memory that you cannot possibly deallocation since you no longer have a pointer to it).

Without showing us your code, there isn't much we can do to help. This is a case-by-case issue, so, there is no "solution". A memory leak generally comes from not calling "delete" on memory that you allocated with "new". Sometimes this is obvious (e.g., just forgot to put the delete), and sometimes it's less obvious (e.g., the delete is in a place that isn't reached by the execution under some or all circumstances). The general solution to solve that issue is to use RAII classes (or see wiki).

Mike,

Thank you for your time.

I guess I will use another library than libusb, at least for short term.

This question has already been answered. Start a new discussion instead.