usb: gadget: uac2: support explicit channel counts
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest posting 2/22 patches 5 repliesIn review
- v2 posting 1/22 patches 0 repliesSuperseded
- v1 posting 2/22 patches 0 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 posting 1/2 | 2 patches | 0 replies | Superseded |
Changes in v2 from the cover letter
- Edit commit messages for clarity and brevity.
- Add Assisted-by: LLM attribution.
- No code changes.
Patches in v2 posting 2/2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | usb: gadget: u_audio: pass channel counts explicitlydrivers/ drivers/ drivers/ +1 more | +20 | 2 replies | |
| 2/2 | usb: gadget: f_uac2: allow explicit channel count independent of channel maskDocumentation/ Documentation/ drivers/ +1 more | +87 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/2 RESEND] usb: gadget: uac2: support explicit channel counts
USB Audio Class 2.0 permits up to 255 channels in an audio channel cluster via bNrChannels. Independently, a channel-location bitmap is specified via bmChannelConfig for up to 27 predefined spatial locations. Setting bmChannelConfig to zero indicates that the channels have no predefined spatial positions.
The current UAC2 gadget driver derives bNrChannels from the number of set bits in bmChannelConfig. Since bmChannelConfig provides 27 predefined spatial locations this limits playback and capture streams to 27 channels.
This series allows channel counts up to the UAC2 limit of 255 without requiring predefined spatial channel locations in bmChannelConfig. Existing ConfigFS channel-mask configuration continues to work unchanged. New optional playback and capture count attributes allow the number of channels to be specified separately from the channel-location bitmap.
The series is split so that the shared u_audio infrastructure is updated first without changing behavior, followed by the UAC2 functional change.
Patch 1:
Pass resolved playback and capture channel counts explicitly into the UAC1/UAC2 shared u_audio implementation instead of deriving them from channel masks.
Patch 2:
Add ConfigFS playback/capture channel-count attributes to the UAC2 function driver and use them when generating descriptors and stream configuration, allowing counts beyond the 27 predefined channel locations.
Testing
Testing was performed using a Raspberry Pi Zero 2 W configured as a USB UAC2 gadget. Streaming and descriptor validation were performed against both Linux and macOS hosts. Windows hosts were not tested.
UAC1
- Verified playback/capture operation via alsaloop.
- No descriptor or behavioral changes observed.
UAC2
- Verified legacy channel-mask configuration (1-27 channels).
- Verified explicit channel-count mode with 2, 28, 61, 62, 96 channels.
- Verified invalid channel-count/channel-mask combinations are rejected.
- Verified Feature Unit descriptor size limits at 61/62 channel boundary.
- Verified descriptors including:
* bNrChannels
* bmChannelConfig
* Feature Unit presence and bLength
* AudioControl wTotalLength
* endpoint wMaxPacketSize
- Verified ALSA-reported playback and capture channel counts.
- Verified streaming using alsaloop.
Changes in v2:
- Edit commit messages for clarity and brevity.
- Add Assisted-by: LLM attribution.
- No code changes.
v1: https://lore.kernel.org/linux-usb/[email protected]/
Kyle Farrell (2):
usb: gadget: u_audio: pass channel counts explicitly
usb: gadget: f_uac2: allow explicit channel count independent of
channel mask
.../ABI/testing/configfs-usb-gadget-uac2 | 18 ++++- Documentation/usb/gadget-testing.rst | 18 ++++- drivers/usb/gadget/function/f_uac1.c | 2 + drivers/usb/gadget/function/f_uac2.c | 69 ++++++++++++++----- drivers/usb/gadget/function/u_audio.c | 32 ++++----- drivers/usb/gadget/function/u_audio.h | 2 + drivers/usb/gadget/function/u_uac2.h | 4 ++ 7 files changed, 105 insertions(+), 40 deletions(-)
base-commit: d58dffe9ee2c8883193959ff4ef995ec07932874
Signature · 1 line
2.34.1