Member Avatar for m.a.u.
m.a.u.

Greetings everybody,

I have been using libusb for a few days, I developed a program to transmit data via USB port which gives no error, but when I developed a program for receive mode, it gives a run time error related to submit urb.

When I took a look at other forums, Click Here, it might be related to kernel bug or data length of the received data. So I also checked lsusb -vvv . The code length is 7 for audio, at least for my USB device. The terminal output is below:

AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined

I modified the data length, but as far as I understand, the problem is not related to the data length; it is about kernel.

I tried to install the patch file, second one, in the discussion whose link I share above. I might have either intalled it incorrectly or I am missing something else. Could you show me a way to solve this problem?

By the way, the related part of the program is below:

e=libusb_bulk_transfer(dev_handle, LIBUSB_ENDPOINT_IN, data, sizeof(data), &transferred, 10000);

I assigned the last parameter of the function, timeout parameter, to both 0 and 10000, along with 10^n, n varies from 0 up to 7 or 8.

Thanks in advance