none
WinUSB_WritePipe failing on some Win10 machines RRS feed

  • Question

  • Hello,

    I am fighting an issue with WinUSB.  I have a composite device in which 2 of the 7 interfaces are WinUSB interfaces.  I can successfully talk to the device on some Win10 machines but not others.  I have multiple working host and multiple non-working hosts so I think I have ruled out bad hardware.  Each of the hosts report the same versions of Win10, and USB drivers as far as I can tell.  On all hosts, the device enumerates properly and shows up in Device Manager as I would expect. 

    The problem occurs when trying to write to a bulk endpoint on the device.  The WinUSB_WritePipe() call fails with a timeout (error 121) and reports no data has been sent.  The endpoint packet size is 500 bytes.  The buffer I am trying to send is 512000 bytes (not 512K).  On a USB analyzer I always see 23 packets being transmitted and ack'd and then transmission stops so 11500 bytes in, the host stops sending data for whatever reason.  Then, 10 seconds later (my timeout duration), the writepipe call returns with a timeout.  Without re-enumerating, I can try and resend another buffer and I will see another 23 packets show up on the analyzer so I believe the device is behaving as it should.  The host just stops sending.  Yet, I can plug the exact same device into another Win10 machine and it works flawlessly.

    Any insight would be greatly appreciated. Are there any WinUSB logs, registry entries, or other debug facilities I can enable or look at?  I can provide analyzer dumps an any source code you might think required to help.

    Thanks in advance.

    Wednesday, May 16, 2018 4:08 PM

Answers

  • > The endpoint packet size is 500 bytes.

    If that's not a typo, your device violates the USB specification.  A high-speed bulk endpoint MUST have a max packet size of 512 bytes.  There is no other option.

    It's quite possible that some host controllers make assumptions about compliance that you are violating.


    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    • Marked as answer by ttahut Thursday, May 17, 2018 7:12 PM
    Wednesday, May 16, 2018 9:42 PM

All replies

  • > The endpoint packet size is 500 bytes.

    If that's not a typo, your device violates the USB specification.  A high-speed bulk endpoint MUST have a max packet size of 512 bytes.  There is no other option.

    It's quite possible that some host controllers make assumptions about compliance that you are violating.


    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    • Marked as answer by ttahut Thursday, May 17, 2018 7:12 PM
    Wednesday, May 16, 2018 9:42 PM
  • With respect to logs, https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/how-to-capture-a-usb-event-trace 

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

    Thursday, May 17, 2018 5:13 PM
  • Thanks for the reply.  That did the trick although I have to admit I was surprised.  I had always interpreted that number to be device dependent.   I'm sure I've seen values other than 512 on some other devices- but they probably won't work either.  It would have been helpful if one of the myriad of descriptor tools, or my expensive analyzer would flag that as a violation..... Thanks again.
    Thursday, May 17, 2018 7:12 PM
  • I've gone through that page (and a few other similar ones).  I can get the etl file, but all I get out of traceview when I look at it is "No format information found".  I've tried figuring out how to download the necessary symbols but can not seem to find the right place.  Any pointers to a web page that has these symbols for download or instructions would be highly appreciated.
    Thursday, May 17, 2018 7:17 PM