What is an Alternate Setting in a USB interface?
Asked Answered
L

2

10

What is an Alternate Setting? Example of device that needs them?

The USB spec has a lot of talk about them, but never tells what one is and - most importantly - why I would use one. I never saw a USB device that uses alternate settings.

Louis answered 2/2, 2015 at 9:29 Comment(2)
By the way: If you are reading the USB spec, you will probably not understand much, because this document is of bad writing quality and lacking examples. If you are learning USB I recommend this excellent tutorial: usbmadesimple.co.ukGrotesque
"I never saw a USB device that uses alternate settings." Pretty much every USB audio device uses them for different bandwidth settings (16-bit 44.1 kHz, vs 24-bit 96 kHz, for instance.) Probably same for video, etc.Chalcidice
T
8

Alternate setting is used to provide the advantage of having two configurations on the fly even though the device has only one configuration.

The alternate setting of a USB interface is define by the bAlternateSetting attribute in the Standard Interface Descriptor. A USB interface with an alternate settings can be used in two mode. For example a USB interface endpoints may act as INTERRUPT pipes in normal settings, but might act as BULK pipe in alternate settings providing you the facility of two different mode on the same interface. You just have to send a SetInterface request to activate a settings. I myself didn't have to use it much though. And I think normally device drivers don't tend to use it as I couldn't find out any example driver.

You can look at this link for more details.

Turkey answered 18/2, 2015 at 17:22 Comment(3)
You have a typo in your answer. It is defined in the Interface descriptor, not in the device descriptor.Grotesque
I suppose you found your answer here: beyondlogic.org/usbnutshell/usb5.shtml They use exactly the same example as you do. But you did not add the image that they have there.Grotesque
So an Alternate setting is just another interface which is mutually exclusive with the default interface?Rebak
C
0

As far as I understood the specs, a given USB host expects to install ONLY ONE specific driver for a given VID/PID identifier. Now, some devices provide different interfaces, which would require a completely different driver. For example a USB modem that also implements a usb storage to provide installation software. One mechanism that allows the host to select either the MSC interface (storage) or the SSP interface (modem) is the alternate setting configuration.

Chloric answered 20/12, 2023 at 22:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.