none
WinUsb, reading from an 'Isochronous Audio Endpoint' RRS feed

  • Question

  • Environment

    • Windows 8.1 (x64) Desktop
    • WinUSB Console Application
    • Isochronous Audio Endpoint

    Use-case

    • Read streaming audio from a USB Isochronous Audio Endpoint
    • I have no control of the device implementing the Audio source

    Implementation

    1.        Initialization
      1.        Get the USB Interface Endpoint & Pipe Id
      2.       WinUsb_AbortPipe
      3.        WinUsb_ResetPipe
      4.       WinUsb_RegisterIsochBuffer having all buffers/packets aligned in accordance with the pipe “MaximumBytesPerInterval”, and, have OVERLAPPED::hEvent initialized
      5.       For each IO RegisterWaitForSingleObject(OVERLAPPED::hEvent)
      6.         Setup Packets & Descriptors
    2.        Reading
      1.        Initialize current frame using GetCurrentFrameNumber
      2.       For each read IO
        1. i.      Set the frame number
        2. ii.      Call WinUsb_ReadIsochPipe and Update the next Frame Number
    3.        Read Completion, Upon ‘OVERLAPPED::hEvent’ signaling
      1.        Call WinUsb_GetOverlappedResult w/o blocking ( since ‘OVERLAPPED::hEvent’ was already set )
      2.       For each packet whose USBD_ISO_PACKET_DESCRIPTOR::Length > 0, copy the bytes to an Aux buffer
      3.        If total bytes > 0 dispatch buffer

    Problem at hand

    Each and every WinUsb_GetOverlappedResult call fail w/  “A device attached to the system is not functioning. ( 0x8007001f )”, I keep on issuing read requests but nothing, they all keep on failing.

    Using a USB sniffer I can see that while all read requests succeed (URB_FUNCTION_ISOCH_TRANSFER), Completion of the first URB fail with USBD_STATUS_ISOCH_REQUEST_FAILED/ USBD_STATUS_XACT_ERROR.

    Completion of corresponding URBs SUCCEED though still WinUsb_GetOverlappedResult keep on failing for all.

    What am I doing wrong? Why can’t I read from the “Isochronous Audio Endpoint”?


    Nadav Rubinstein, See my Blog @ http://nadavrub.wordpress.com


    • Edited by Nadav Rub Friday, July 17, 2015 3:24 PM
    Thursday, March 26, 2015 11:36 AM

All replies

  • Your blog link does not respond (hacked?)

    -- pa


    • Edited by Pavel A Thursday, March 26, 2015 5:18 PM
    Thursday, March 26, 2015 5:18 PM
  • did you install winusb on the device, replacing the default audio class driver that is installed?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 26, 2015 5:21 PM
  • Yeah, Well, it's not hacked, it's simply offline, I have to find time, make it a face-lift and turn it back on

    Nadav Rubinstein, See my Blog @ http://nadavrub.wordpress.com


    • Edited by Nadav Rub Friday, July 17, 2015 3:24 PM
    Sunday, March 29, 2015 1:23 PM
  • Yeah, WinUsb is on the stack for this USB device, Surprisingly, Audio have been recovered when I have booted both the device and my Windows PC, booting only the device didn't help... MayB something is not cleaned up properly during the Console App shutdown sequence, still, upon app termination, I would expect the OS to cleanup all Handles used by the App ...

    What would be the best approach to electrically reset a specific USB port ( same as disconnecting and then re-connecting the USB device )? something I can use to reset the port upon app startup ?


    Nadav Rubinstein, See my Blog @ http://nadavrub.wordpress.com





    • Edited by Nadav Rub Friday, July 17, 2015 3:24 PM
    Sunday, March 29, 2015 1:29 PM
  • I have implemented Isochronous Audio capture using WinUsb as described in the original post, Audio didn't capture, after spending more than a while with the code, I have rebooted both my Desktop machine and the device, after the reboot audio capture have successfuly started w/o errors.

    It is important to note that when I have rebooted the device ( only the device ) the problem persisted.


    Nadav Rubinstein, See my Blog @ http://nadavrub.wordpress.com




    • Edited by Nadav Rub Friday, July 17, 2015 3:25 PM
    Sunday, March 29, 2015 8:31 PM