Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous isochronous data transfer problem with libusb-1.0.27 on Windows #1487

Open
kuzzh opened this issue Apr 28, 2024 · 2 comments
Open
Labels
isoc isochronous transfer, especially under Windows windows

Comments

@kuzzh
Copy link

kuzzh commented Apr 28, 2024

Hi libusb team,

I'm using libusb-1.0.27 to read PCM data from a microphone device that supports the UAC protocol. I've tested it on both Windows 10 and Ubuntu (18.04.6), and the results show that they can both retrieve PCM data properly. However, on Windows, when I playback this PCM data, there is significant noise, and the recorded sound becomes very faint, while everything works fine on Ubuntu. I've tried different drivers on Windows, including WinUSB (v6.1.7600.16385), libusb-win32 (v1.2.7.3), libusbK (v3.1.0.0), but the results are the same. The code used on both platforms is exactly the same.

  • My test code

    const uint16_t VID = 0x1403;
    const uint16_t PID = 0x3592;
    const int IFACE_NUM = 1;
    const int ALTERNATE_SETTING = 1;
    const int EP_ISO_IN = 0x82;
    const int PACKET_SIZE = 294;
    const int NUM_TRANSFERS = 10;
    const int NUM_PACKETS = 10;
    
    static FILE* fout = NULL;
    static int bFirst = 1;
    
    static void WINAPI transfer_callback(struct libusb_transfer* xfr)
    {
        if (bFirst)
        {
            bFirst = 0;
            fout = fopen("./output_data.pcm", "w+");
            if (fout == NULL)
            {
                printf("erro to open file[%d %s] \n", __LINE__, __FUNCTION__);
            }
        }
    
        int  i = 0;
        if (fout)
        {
            for (i = 0; i < xfr->num_iso_packets; i++)
            {
                struct libusb_iso_packet_descriptor* pack = &xfr->iso_packet_desc[i];
                if (pack->status != LIBUSB_TRANSFER_COMPLETED)
                {
                    printf("erro transfer status %d %s [%d %s]\n", pack->status, libusb_error_name(pack->status), __LINE__, __FUNCTION__);
                    break;
                }
    
                const uint8_t* data = libusb_get_iso_packet_buffer_simple(xfr, i);
                printf("get out data %d [%d %s]\n", pack->actual_length, __LINE__, __FUNCTION__);
    
                fwrite(data, 1, pack->actual_length, fout);
            }
    
        }
    
        if (libusb_submit_transfer(xfr) < 0) {
            printf("error re-submitting !!!!!!!exit ----------[%d %s]\n", __LINE__, __FUNCTION__);
            exit(1);
        }
        else
        {
            printf("re-submint ok !\n");
        }
    }
    
    int main(int argc, char* argv[]) {
    
        int ret = libusb_init(NULL);
    
        libusb_set_debug(NULL, LIBUSB_LOG_LEVEL_DEBUG);
    
        if (ret < 0) {
            printf("Initialize libusb failed: %s\n", libusb_error_name(ret));
            return -1;
        }
    
        libusb_device_handle* devh = libusb_open_device_with_vid_pid(NULL, VID, PID);
        if (devh == NULL) {
            printf("Open device failed\n");
            return -1;
        }
    
        ret = libusb_kernel_driver_active(devh, IFACE_NUM);
        if (ret == 1)
        {
            ret = libusb_detach_kernel_driver(devh, IFACE_NUM);
            if (ret < 0)
            {
                printf("Detach kernel failed [%d %s]\n", __LINE__, __FUNCTION__);
                libusb_close(NULL);
                libusb_exit(NULL);
                return -1;
            }
        }
    
        ret = libusb_claim_interface(devh, IFACE_NUM);
        if (ret < 0)
        {
            printf("erro claming interface %s %d [%d %s]\n", libusb_error_name(ret), ret, __LINE__, __FUNCTION__);
            return -1;
        }
    
        libusb_set_interface_alt_setting(devh, IFACE_NUM, ALTERNATE_SETTING);
    
        int endpointBytesPerPacket = PACKET_SIZE;
        int packetsPerTransfer = NUM_PACKETS;
        int totalTransferSize = PACKET_SIZE * NUM_PACKETS;
        unsigned char* transferBuffers[NUM_TRANSFERS];
        struct libusb_transfer* transfers[NUM_TRANSFERS];
    
        for (int i = 0; i < NUM_TRANSFERS; i++)
        {
            transfers[i] = libusb_alloc_transfer(packetsPerTransfer);
            if (!transfers[i])
            {
                printf("alloc transfer err [%d %s]o\n", __LINE__, __FUNCTION__);
                return -1;
            }
            transferBuffers[i] = new uint8_t[totalTransferSize];
            memset(transferBuffers[i], 0, totalTransferSize);
            libusb_fill_iso_transfer(transfers[i], devh, EP_ISO_IN, transferBuffers[i], totalTransferSize, packetsPerTransfer, transfer_callback, NULL, 1000);
            libusb_set_iso_packet_lengths(transfers[i], endpointBytesPerPacket);
        }
    
        for (int i = 0; i < NUM_TRANSFERS; i++) {
            ret = libusb_submit_transfer(transfers[i]);
            if (ret == 0)
            {
                printf("transfer submint ok ! start capture[%d %s]\n", __LINE__, __FUNCTION__);
            }
            else
            {
                printf(" transfer submint erro %d %s [%d %s]\n", ret, libusb_error_name(ret), __LINE__, __FUNCTION__);
                return -1;
            }
        }
    
        while (1)
        {
            ret = libusb_handle_events(NULL);
            if (ret != LIBUSB_SUCCESS)
            {
                printf("handle event erro ,exit! [%d %s]\n", __LINE__, __FUNCTION__);
                break;
            }
        }
    
        for (int i = 0; i < NUM_TRANSFERS; i++) {
            ret = libusb_cancel_transfer(transfers[i]);
            if (ret != 0) {
                printf("cancel transfer failed %s %d [%d %s]\n", libusb_error_name(ret), ret, __LINE__, __FUNCTION__);
                continue;
            }
            libusb_free_transfer(transfers[i]);
        }
    
        libusb_release_interface(devh, 0);
    
        if (devh)
        {
            libusb_close(devh);
        }
    
        libusb_exit(NULL);
    
        return 0;
    }
  • The Device Info

    =========================== USB Port3 ===========================
    
    Connection Status        : 0x01 (Device is connected)
    Port Chain               : 1-1-3
    Properties               : 0x00
    IsUserConnectable       : no
    PortIsDebugCapable      : no
    PortHasMultiCompanions  : no
    PortConnectorIsTypeC    : no
    ConnectionIndex          : 0x03 (Port 3)
    
        ========================== Summary =========================
    Vendor ID                : 0x1403 (Sitronix Technology Corp.)
    Product ID               : 0x3592
    USB Version              : 1.1
    Port maximum Speed       : High-Speed
    Device maximum Speed     : Full-Speed
    Device Connection Speed  : Full-Speed
    Self powered             : no
    Demanded Current         : 100 mA
    Used Endpoints           : 2
    
        ======================== USB Device ========================
    
            +++++++++++++++++ Device Information ++++++++++++++++++
    Friendly Name            : Comica_VM30 TX
    Device Description       : Comica_VM30 TX (Composite Parent)
    Device Path 1            : \\?\USB#VID_1403&PID_3592#MA315614543#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
    Device Path 2            : \\?\USB#VID_1403&PID_3592#MA315614543#{ed320243-7471-460c-8040-a15f441537a9}
    Device Path 3            : \\?\USB#VID_1403&PID_3592#MA315614543#{dee824ef-729b-4a0e-9c14-b7117d33a817} (GUID_DEVINTERFACE_WINUSB)
    Kernel Name              : \Device\USBPDO-7
    Device ID                : USB\VID_1403&PID_3592\MA315614543
    Hardware IDs             : USB\VID_1403&PID_3592&REV_0110 USB\VID_1403&PID_3592
    Driver KeyName           : {88bae032-5a81-49f0-bc3d-a4ff138216d6}\0000 (GUID_DEVCLASS_USBDEVICE)
    Driver                   : \SystemRoot\System32\drivers\WinUsb.sys (Version: 10.0.19041.1  Date: 2019-12-07  Company: Microsoft Corporation)
    Driver Inf               : C:\windows\inf\oem2.inf
    Legacy BusType           : PNPBus
    Class                    : USBDevice
    Class GUID               : {88bae032-5a81-49f0-bc3d-a4ff138216d6} (GUID_DEVCLASS_USBDEVICE)
    Service                  : WinUSB
    Enumerator               : USB
    Location Info            : Port_#0003.Hub_#0003
    Address                  : 3
    Location IDs             : PCIROOT(0)#PCI(0801)#PCI(0004)#USBROOT(0)#USB(1)#USB(3), ACPI(_SB_)#ACPI(PCI0)#ACPI(GP17)#ACPI(XHC1)#ACPI(RHUB)#ACPI(PRT1)#USB(3)
    Container ID             : {d4bb1d9e-f67f-5549-a9c6-ee42c2d3a151}
    Manufacturer Info        : Sitronix
    Capabilities             : 0x14 (Removable, UniqueID)
    Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
    Problem Code             : 0
    Power State              : D0 (supported: D0, D2, D3, wake from D0, wake from D2)
    
            ---------------- Connection Information ---------------
    Connection Index         : 0x03 (Port 3)
    Connection Status        : 0x01 (DeviceConnected)
    Current Config Value     : 0x01 (Configuration 1)
    Device Address           : 0x04 (4)
    Is Hub                   : 0x00 (no)
    Device Bus Speed         : 0x01 (Full-Speed)
    Number of open Pipes     : 0x01 (1 pipe to data endpoints)
    Pipe[0]                  : EndpointID=6  Direction=IN   ScheduleOffset=0  Type=Interrupt  wMaxPacketSize=0x10    bInterval=6   -> 270 Bits/ms = 33750 Bytes/s
    Data (HexDump)           : 03 00 00 00 12 01 10 01 00 00 00 40 03 14 92 35   [email protected]
                            10 01 01 02 03 01 01 01 00 04 00 01 00 00 00 01   ................
                            00 00 00 07 05 86 03 10 00 06 00 00 00 00         ..............
    
            --------------- Connection Information V2 -------------
    Connection Index         : 0x03 (3)
    Length                   : 0x10 (16 bytes)
    SupportedUsbProtocols    : 0x03
    Usb110                  : 1 (yes, port supports USB 1.1)
    Usb200                  : 1 (yes, port supports USB 2.0)
    Usb300                  : 0 (no, port not supports USB 3.0)
    ReservedMBZ             : 0x00
    Flags                    : 0x00
    DevIsOpAtSsOrHigher     : 0 (Device is not operating at SuperSpeed or higher)
    DevIsSsCapOrHigher      : 0 (Device is not SuperSpeed capable or higher)
    DevIsOpAtSsPlusOrHigher : 0 (Device is not operating at SuperSpeedPlus or higher)
    DevIsSsPlusCapOrHigher  : 0 (Device is not SuperSpeedPlus capable or higher)
    ReservedMBZ             : 0x00
    Data (HexDump)           : 03 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................
    
        ---------------------- Device Descriptor ----------------------
    bLength                  : 0x12 (18 bytes)
    bDescriptorType          : 0x01 (Device Descriptor)
    bcdUSB                   : 0x110 (USB Version 1.1)
    bDeviceClass             : 0x00 (defined by the interface descriptors)
    bDeviceSubClass          : 0x00
    bDeviceProtocol          : 0x00
    bMaxPacketSize0          : 0x40 (64 bytes)
    idVendor                 : 0x1403 (Sitronix Technology Corp.)
    idProduct                : 0x3592
    bcdDevice                : 0x0110
    iManufacturer            : 0x01 (String Descriptor 1)
    Language 0x0409         : "COMICA"
    iProduct                 : 0x02 (String Descriptor 2)
    Language 0x0409         : "Comica_VM30 TX"
    iSerialNumber            : 0x03 (String Descriptor 3)
    Language 0x0409         : "MA315614543"
    bNumConfigurations       : 0x01 (1 Configuration)
    Data (HexDump)           : 12 01 10 01 00 00 00 40 03 14 92 35 10 01 01 02   [email protected]....
                            03 01                                             ..
    
        ------------------ Configuration Descriptor -------------------
    bLength                  : 0x09 (9 bytes)
    bDescriptorType          : 0x02 (Configuration Descriptor)
    wTotalLength             : 0x008D (141 bytes)
    bNumInterfaces           : 0x03 (3 Interfaces)
    bConfigurationValue      : 0x01 (Configuration 1)
    iConfiguration           : 0x00 (No String Descriptor)
    bmAttributes             : 0x80
    D7: Reserved, set 1     : 0x01
    D6: Self Powered        : 0x00 (no)
    D5: Remote Wakeup       : 0x00 (no)
    D4..0: Reserved, set 0  : 0x00
    MaxPower                 : 0x32 (100 mA)
    
    Data (HexDump)           : 09 02 8D 00 03 01 00 80 32 09 04 00 00 00 01 01   ........2.......
                            00 00 09 24 01 00 01 28 00 01 01 0C 24 02 08 01   ...$...(....$...
                            02 00 04 03 00 00 00 0A 24 06 0B 08 01 03 00 00   ........$.......
                            00 09 24 03 0D 01 01 00 0B 00 09 04 01 00 00 01   ..$.............
                            02 00 05 09 04 01 01 01 01 02 00 00 07 24 01 0D   .............$..
                            00 01 00 11 24 02 01 02 03 18 03 80 BB 00 80 BB   ....$...........
                            00 80 BB 00 09 05 82 05 26 01 01 00 00 07 25 01   ........&.....%.
                            01 00 00 00 09 04 03 00 01 03 00 00 06 09 21 11   ..............!.
                            01 00 01 22 67 00 07 05 86 03 10 00 06            ..."g........
    
            ---------------- Interface Descriptor -----------------
    bLength                  : 0x09 (9 bytes)
    bDescriptorType          : 0x04 (Interface Descriptor)
    bInterfaceNumber         : 0x00 (Interface 0)
    bAlternateSetting        : 0x00
    bNumEndpoints            : 0x00 (Default Control Pipe only)
    bInterfaceClass          : 0x01 (Audio)
    bInterfaceSubClass       : 0x01 (Audio Control)
    bInterfaceProtocol       : 0x00
    iInterface               : 0x00 (No String Descriptor)
    Data (HexDump)           : 09 04 00 00 00 01 01 00 00                        .........
    
            ------ Audio Control Interface Header Descriptor ------
    bLength                  : 0x09 (9 bytes)
    bDescriptorType          : 0x24 (Audio Interface Descriptor)
    bDescriptorSubtype       : 0x01 (Header)
    bcdADC                   : 0x0100
    wTotalLength             : 0x0028 (40 bytes)
    bInCollection            : 0x01
    baInterfaceNr[1]         : 0x01
    Data (HexDump)           : 09 24 01 00 01 28 00 01 01                        .$...(...
    
            ------- Audio Control Input Terminal Descriptor -------
    bLength                  : 0x0C (12 bytes)
    bDescriptorType          : 0x24 (Audio Interface Descriptor)
    bDescriptorSubtype       : 0x02 (Input Terminal)
    bTerminalID              : 0x08
    wTerminalType            : 0x0201 (Microphone)
    bAssocTerminal           : 0x00
    bNrChannels              : 0x04 (4 channels)
    wChannelConfig           : 0x0003 (L, R)
    iChannelNames            : 0x00 (No String Descriptor)
    iTerminal                : 0x00 (No String Descriptor)
    Data (HexDump)           : 0C 24 02 08 01 02 00 04 03 00 00 00               .$..........
    
            -------- Audio Control Feature Unit Descriptor --------
    bLength                  : 0x0A (10 bytes)
    bDescriptorType          : 0x24 (Audio Interface Descriptor)
    bDescriptorSubtype       : 0x06 (Feature Unit)
    bUnitID                  : 0x0B (11)
    bSourceID                : 0x08 (8)
    bControlSize             : 0x01 (1 byte per control)
    bmaControls[0]           : 0x03
    D0: Mute                : 1
    D1: Volume              : 1
    D2: Bass                : 0
    D3: Mid                 : 0
    D4: Treble              : 0
    D5: Graphic Equalizer   : 0
    D6: Automatic Gain      : 0
    D7: Delay               : 0
    bmaControls[1]           : 0x00
    D0: Mute                : 0
    D1: Volume              : 0
    D2: Bass                : 0
    D3: Mid                 : 0
    D4: Treble              : 0
    D5: Graphic Equalizer   : 0
    D6: Automatic Gain      : 0
    D7: Delay               : 0
    bmaControls[2]           : 0x00
    D0: Mute                : 0
    D1: Volume              : 0
    D2: Bass                : 0
    D3: Mid                 : 0
    D4: Treble              : 0
    D5: Graphic Equalizer   : 0
    D6: Automatic Gain      : 0
    D7: Delay               : 0
    iFeature                 : 0x00 (No String Descriptor)
    Data (HexDump)           : 0A 24 06 0B 08 01 03 00 00 00                     .$........
    
            ------- Audio Control Output Terminal Descriptor ------
    bLength                  : 0x09 (9 bytes)
    bDescriptorType          : 0x24 (Audio Interface Descriptor)
    bDescriptorSubtype       : 0x03 (Output Terminal)
    bTerminalID              : 0x0D
    wTerminalType            : 0x0101 (USB Streaming)
    bAssocTerminal           : 0x00 (0)
    bSourceID                : 0x0B (11)
    iTerminal                : 0x00 (No String Descriptor)
    Data (HexDump)           : 09 24 03 0D 01 01 00 0B 00                        .$.......
    
            ---------------- Interface Descriptor -----------------
    bLength                  : 0x09 (9 bytes)
    bDescriptorType          : 0x04 (Interface Descriptor)
    bInterfaceNumber         : 0x01 (Interface 1)
    bAlternateSetting        : 0x00
    bNumEndpoints            : 0x00 (Default Control Pipe only)
    bInterfaceClass          : 0x01 (Audio)
    bInterfaceSubClass       : 0x02 (Audio Streaming)
    bInterfaceProtocol       : 0x00
    iInterface               : 0x05 (String Descriptor 5)
    Language 0x0409         : "Comica_VM30 TX"
    Data (HexDump)           : 09 04 01 00 00 01 02 00 05                        .........
    
            ---------------- Interface Descriptor -----------------
    bLength                  : 0x09 (9 bytes)
    bDescriptorType          : 0x04 (Interface Descriptor)
    bInterfaceNumber         : 0x01 (Interface 1)
    bAlternateSetting        : 0x01
    bNumEndpoints            : 0x01 (1 Endpoint)
    bInterfaceClass          : 0x01 (Audio)
    bInterfaceSubClass       : 0x02 (Audio Streaming)
    bInterfaceProtocol       : 0x00
    iInterface               : 0x00 (No String Descriptor)
    Data (HexDump)           : 09 04 01 01 01 01 02 00 00                        .........
    
            -------- Audio Streaming Interface Descriptor ---------
    bLength                  : 0x07 (7 bytes)
    bDescriptorType          : 0x24 (Audio Interface Descriptor)
    bDescriptorSubtype       : 0x01 (AS_GENERAL)
    bTerminalLink            : 0x0D (Terminal ID 13)
    bDelay                   : 0x00 (0 frames)
    wFormatTag               : 0x0001 (PCM)
    Data (HexDump)           : 07 24 01 0D 00 01 00                              .$.....
    
            ------- Audio Streaming Format Type Descriptor --------
    bLength                  : 0x11 (17 bytes)
    bDescriptorType          : 0x24 (Audio Interface Descriptor)
    bDescriptorSubtype       : 0x02 (Format Type)
    bFormatType              : 0x01 (FORMAT_TYPE_I)
    bNrChannels              : 0x02 (2 channels)
    bSubframeSize            : 0x03 (3 bytes per subframe)
    bBitResolution           : 0x18 (24 bits per sample)
    bSamFreqType             : 0x03 (supports 3 sample frequencies)
    tSamFreq[1]              : 0x0BB80 (48000 Hz)
    tSamFreq[2]              : 0x0BB80 (48000 Hz)
    tSamFreq[3]              : 0x0BB80 (48000 Hz)
    Data (HexDump)           : 11 24 02 01 02 03 18 03 80 BB 00 80 BB 00 80 BB   .$..............
                            00                                                .
    
            ----------------- Endpoint Descriptor -----------------
    bLength                  : 0x09 (9 bytes)
    bDescriptorType          : 0x05 (Endpoint Descriptor)
    bEndpointAddress         : 0x82 (Direction=IN EndpointID=2)
    bmAttributes             : 0x05 (TransferType=Isochronous  SyncType=Asynchronous  EndpointType=Data)
    wMaxPacketSize           : 0x0126 (294 bytes)
    bInterval                : 0x01 (1 ms)
    bRefresh                 : 0x00
    bSynchAddress            : 0x00
    Data (HexDump)           : 09 05 82 05 26 01 01 00 00                        ....&....
    
            ----------- Audio Data Endpoint Descriptor ------------
    bLength                  : 0x07 (7 bytes)
    bDescriptorType          : 0x25 (Audio Endpoint Descriptor)
    bDescriptorSubtype       : 0x01 (General)
    bmAttributes             : 0x01
    D0   : Sampling Freq    : 0x01 (supported)
    D1   : Pitch            : 0x00 (not supported)
    D6..2: Reserved         : 0x00
    D7   : MaxPacketsOnly   : 0x00 (no)
    bLockDelayUnits          : 0x00 (Undefined)
    wLockDelay               : 0x0000
    Data (HexDump)           : 07 25 01 01 00 00 00                              .%.....
    
            ---------------- Interface Descriptor -----------------
    bLength                  : 0x09 (9 bytes)
    bDescriptorType          : 0x04 (Interface Descriptor)
    bInterfaceNumber         : 0x03 (Interface 3)   *!*ERROR must be < bNumInterfaces (3)
    bAlternateSetting        : 0x00
    bNumEndpoints            : 0x01 (1 Endpoint)
    bInterfaceClass          : 0x03 (HID - Human Interface Device)
    bInterfaceSubClass       : 0x00 (None)
    bInterfaceProtocol       : 0x00 (None)
    iInterface               : 0x06 (String Descriptor 6)
    Language 0x0409         : "Comica_VM30 TX"
    Data (HexDump)           : 09 04 03 00 01 03 00 00 06                        .........
    
            ------------------- HID Descriptor --------------------
    bLength                  : 0x09 (9 bytes)
    bDescriptorType          : 0x21 (HID Descriptor)
    bcdHID                   : 0x0111 (HID Version 1.11)
    bCountryCode             : 0x00 (00 = not localized)
    bNumDescriptors          : 0x01
    Data (HexDump)           : 09 21 11 01 00 01 22 67 00                        .!...."g.
    Descriptor 1:
    bDescriptorType          : 0x22 (Class=Report)
    wDescriptorLength        : 0x0067 (103 bytes)
    Error reading descriptor : ERROR_GEN_FAILURE (due to a obscure limitation of the Win32 USB API, see F1 Help)
    
            ----------------- Endpoint Descriptor -----------------
    bLength                  : 0x07 (7 bytes)
    bDescriptorType          : 0x05 (Endpoint Descriptor)
    bEndpointAddress         : 0x86 (Direction=IN EndpointID=6)
    bmAttributes             : 0x03 (TransferType=Interrupt)
    wMaxPacketSize           : 0x0010 (16 bytes)
    bInterval                : 0x06 (6 ms)
    Data (HexDump)           : 07 05 86 03 10 00 06                              .......
    
        -------------------- String Descriptors -------------------
                ------ String Descriptor 0 ------
    bLength                  : 0x04 (4 bytes)
    bDescriptorType          : 0x03 (String Descriptor)
    Language ID[0]           : 0x0409 (English - United States)
    Data (HexDump)           : 04 03 09 04                                       ....
                ------ String Descriptor 1 ------
    bLength                  : 0x0E (14 bytes)
    bDescriptorType          : 0x03 (String Descriptor)
    Language 0x0409          : "COMICA"
    Data (HexDump)           : 0E 03 43 00 4F 00 4D 00 49 00 43 00 41 00         ..C.O.M.I.C.A.
                ------ String Descriptor 2 ------
    bLength                  : 0x1E (30 bytes)
    bDescriptorType          : 0x03 (String Descriptor)
    Language 0x0409          : "Comica_VM30 TX"
    Data (HexDump)           : 1E 03 43 00 6F 00 6D 00 69 00 63 00 61 00 5F 00   ..C.o.m.i.c.a._.
                            56 00 4D 00 33 00 30 00 20 00 54 00 58 00         V.M.3.0. .T.X.
                ------ String Descriptor 3 ------
    bLength                  : 0x18 (24 bytes)
    bDescriptorType          : 0x03 (String Descriptor)
    Language 0x0409          : "MA315614543"
    Data (HexDump)           : 18 03 4D 00 41 00 33 00 31 00 35 00 36 00 31 00   ..M.A.3.1.5.6.1.
                            34 00 35 00 34 00 33 00                           4.5.4.3.
                ------ String Descriptor 5 ------
    bLength                  : 0x1E (30 bytes)
    bDescriptorType          : 0x03 (String Descriptor)
    Language 0x0409          : "Comica_VM30 TX"
    Data (HexDump)           : 1E 03 43 00 6F 00 6D 00 69 00 63 00 61 00 5F 00   ..C.o.m.i.c.a._.
                            56 00 4D 00 33 00 30 00 20 00 54 00 58 00         V.M.3.0. .T.X.
                ------ String Descriptor 6 ------
    bLength                  : 0x1E (30 bytes)
    bDescriptorType          : 0x03 (String Descriptor)
    Language 0x0409          : "Comica_VM30 TX"
    Data (HexDump)           : 1E 03 43 00 6F 00 6D 00 69 00 63 00 61 00 5F 00   ..C.o.m.i.c.a._.
                            56 00 4D 00 33 00 30 00 20 00 54 00 58 00         V.M.3.0. .T.X.
    
@mcuee mcuee added windows isoc isochronous transfer, especially under Windows labels Apr 28, 2024
@mcuee
Copy link
Member

mcuee commented Apr 28, 2024

There are multiple issues of Windows ISOC transfer with libusb.
https://github.com/libusb/libusb/issues?q=is%3Aopen+is%3Aissue+label%3Aisoc

You can try PR #749 to see if tha helps or not.

If not, you may consider libusbK API instead (Windows only).
https://github.com/mcuee/libusbk

@kuzzh
Copy link
Author

kuzzh commented Apr 29, 2024

@mcuee Thanks for your reply. I just tested it, this PR didn't fix the issue, it couldn't even receive data properly. I`ll try libusbk later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
isoc isochronous transfer, especially under Windows windows
Projects
None yet
Development

No branches or pull requests

2 participants