为什么我需要一个没有端点的 USB 备用接口?

Why would I want a USB alternate interface with no endpoints?

Atmel 为 USB 设备提供的示例代码有一个带有两个备用设置的接口。第一个没有端点,第二个有 6 个端点。这有什么原因吗 - 为什么不只对所有端点进行一个备用设置?

我在互联网上的某个地方发现了一个模糊的 post 暗示它可能与省电有关。有人知道吗?

啊,这似乎是因为具有同步端点的接口在 USB 总线上保留了带宽。但是有一个没有同步端点的默认替代可以避免这个问题。

来源:

http://www.makelinux.net/ldd3/chp-13-sect-1

The initial state of a interface is in the first setting, numbered 0. Alternate settings can be used to control individual endpoints in different ways, such as to reserve different amounts of USB bandwidth for the device. Each device with an isochronous endpoint uses alternate settings for the same interface.

https://msdn.microsoft.com/en-us/library/windows/hardware/jj124028(v=vs.85).aspx

This test verifies that when any device has an interface that consumes isochronous bandwidth, that device supports multiple alternate settings for that interface, and that alternate setting 0 (zero) does not consume isochronous bandwidth.

对于音频,您必须始终在设备未使用时提供零带宽备用设置:

Whenever an AudioStreaming interface requires an isochronous data endpoint, it shall at least provide the default Alternate Setting (Alternate Setting 0) with zero bandwidth requirements (no isochronous data endpoint defined) and an additional Alternate Setting that contains the actual isochronous data endpoint.

来自UAC 3.0

视频相同:

All devices that transfer isochronous video data must incorporate a zero-bandwidth alternate setting for each VideoStreaming interface that has an isochronous video endpoint, and it must be the default alternate setting (alternate setting zero). A device offers to the Host software the option to temporarily relinquish USB bandwidth by switching to this alternate setting. The zero-bandwidth alternate setting does not contain a VideoStreaming isochronous data endpoint descriptor.

来自UVC 1.5