9

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.

2
  • 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.uk
    – Elmue
    Sep 12, 2016 at 22:37
  • 2
    "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.
    – endolith
    Sep 6, 2017 at 19:58

1 Answer 1

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.

3
  • 1
    You have a typo in your answer. It is defined in the Interface descriptor, not in the device descriptor.
    – Elmue
    Sep 12, 2016 at 22:31
  • 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.
    – Elmue
    Sep 12, 2016 at 22:41
  • So an Alternate setting is just another interface which is mutually exclusive with the default interface? Mar 24, 2020 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.