2

I've been experimenting with isochronous USB transfers using WinUsb, and it turns out that WinUsb always sends data as fast as possible:

WinUsb_WriteIsochPipe packetizes the transfer buffer so that in each interval, the host can send the maximum bytes allowed per interval.

However for the kernel drivers you can apparently send shorter packets:

The MaximumPacketSize value indicates the maximum permitted size of the isochronous packet. The client driver can set the size of each isochronous packet to any value less than the MaximumPacketSize value.

I wondered how USB audio handles this. As far as I can see in the spec they just two alternative configurations for the interface - a zero bandwidth one, and a non-zero bandwidth one. There is a flag that says whether the endpoint requires full-size packets or not.

So my questions are:

a) What is the best way to handle sending less than full-speed data. Should I have a whole array of alternate configurations with different max packet sizes?

b) Should I expect to be able to send shorter-than-maximum packets? If so why doesn't WinUsb allow this?

Timmmm
  • 88,195
  • 71
  • 364
  • 509

1 Answers1

0

Maybe you have to call WinUsb_WriteIsochPipe once for each packet you want to send. Make sure to use asynchronous I/O so you can queue up dozens or hundreds of requests ahead of time.

David Grayson
  • 84,103
  • 24
  • 152
  • 189
  • No, that function starts a transfer which must be a whole number of frames using the maximum packet size. – Timmmm Apr 21 '17 at 08:19
  • I have encountered a similar (possibly identical) problem: https://stackoverflow.com/questions/59644460/use-microframes-with-winusb – Paamand Jan 08 '20 at 11:06