Are USB Interrupt Out transfers periodic?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Are USB Interrupt Out transfers periodic?

Post by nullplan »

Hi all,

the title question has been plaguing me for a while now because I failed to find a satisfactory answer anywhere. Or rather, the one I find sometimes (when the topic is addressed at all) makes no sense to me.

An Interrupt Out endpoint is one with which the host interrupts the device. So it is my understanding that such a transfer is asynchronous from the host perspective. I have here next to me a USB device that possesses such an endpoint: A game controller. The Interrupt Out endpoint is used to control the force feedback feature. That is something the game may want to turn on or off at its leisure, not periodically. But the thing I keep seeing in some places is that such transfers should be periodic.

I ask because all host controllers except xHCI make a big deal out of whether a transfer is periodic or asynchronous. And as far as I could tell, the Linux driver for EHCI at least will put all Interrupt transfers on the periodic schedule (function ehci_urb_enqueue() only cares about pipe type. not direction). But that makes no sense to me. What am I missing?

Of course, SeaBIOS does the same thing, but SeaBIOS has no support for USB devices that have Interrupt Out devices (they only support Boot Keyboard, Boot Mouse, and USB MSC in a few variations, and they don't support setting the LEDs on the keyboard). Is this a pervasive error or am I missing something obvious?
Carpe diem!
thewrongchristian
Member
Member
Posts: 426
Joined: Tue Apr 03, 2018 2:44 am

Re: Are USB Interrupt Out transfers periodic?

Post by thewrongchristian »

nullplan wrote: An Interrupt Out endpoint is one with which the host interrupts the device. So it is my understanding that such a transfer is asynchronous from the host perspective. I have here next to me a USB device that possesses such an endpoint: A game controller. The Interrupt Out endpoint is used to control the force feedback feature. That is something the game may want to turn on or off at its leisure, not periodically. But the thing I keep seeing in some places is that such transfers should be periodic.
...
Is this a pervasive error or am I missing something obvious?
I think it's more about scheduling than functionality. A normal bulk transfer is scheduled after isochronous and interrupt transfers.

So, in the case of your force feedback device, you want to do the force feedback in sync with the game play, and not be at the whims of bulk scheduling (you might be competing with large bulk block transfers, for example) giving you unpredictable latency.
Post Reply