vpelletier / python-libusb1

Python ctype-based wrapper around libusb1
GNU Lesser General Public License v2.1
168 stars 65 forks source link

LIBUSB_ERROR_NOT_SUPPORTED when trying to perform isochronous transfer #22

Closed l0ud closed 6 years ago

l0ud commented 7 years ago

Hi. I'm trying to perform simple isochronous IN transfer on existing sound card device. IN endpoint is located on interface 2, alternate setting 1.

I'm using Windows, libusbk backend. I've already tried WinUsb driver with the same result (driver is installed on root composite device using Zadig).

This is what I'm doing so far:

  1. Get libusb context (context = usb1.USBContext())
  2. Get device handle (using context.openByVendorIDAndProductID)
  3. handle.claimInterface(2)
  4. handle.setInterfaceAltSetting(2, 1)
  5. Create new transfer (handle.getTransfer(100))
  6. transfer.setIsochronous() - endpoint ID 0x81, transfer length: 17600, iso_transfer_length_list is empty.
  7. transfer.submit()

Unfortunately, call to submit throws LIBUSB_ERROR_NOT_SUPPORTED [-12] exception. I'm not sure why, as isochronous transfers should be supported in libusbk backend? Do you have any examples how to perform isochronous transfer on non-zero interface and alternate setting? It would be very helpful to solve that issue.

vpelletier commented 7 years ago

Hi,

6 . [...] iso_transfer_length_list is empty.

"empty" as in iso_transfer_length_list=[] or as in None/not provided ?

The intent is the latter, in which case iso_transfer_length_list will be internally populated. An empty list means you do not intent to use any isochronous transfer out of the current transfer - which may confuse libusb and/or the driver.

I sadly do not know of any example code using isochronous transfers, neither default interface/alt setting nor otherwise.

[EDIT] dear markdown parser, "6." is not to be converted to "1." just because there are not all the previous bullet points...