ALSA: usb-audio: Fix max bytes-per-interval calculation
authorDylan Robinson <dylan_robinson@motu.com>
Mon, 24 Nov 2025 21:05:18 +0000 (16:05 -0500)
committerTakashi Iwai <tiwai@suse.de>
Tue, 25 Nov 2025 06:58:42 +0000 (07:58 +0100)
commita748e1dbb2df11fb55ee32a56270341195260b15
treee4710a3ebe74e9229f05f57352e48d388a272534
parent9ef1203fc73570290e09be65b15df84815ca4089
ALSA: usb-audio: Fix max bytes-per-interval calculation

The maxpacksize field in struct audioformat represents the maximum number
of bytes per isochronous interval. The current implementation only
special-cases high-speed endpoints and does not account for the different
computations required for SuperSpeed, SuperSpeedPlus, or eUSB2. As a
result, USB audio class devices operating at these speeds may fail to
stream correctly. The issue was observed on a MOTU 16A (2025) interface,
which requires more than 1024 bytes per interval at SuperSpeed.

This patch replaces the existing logic with a helper that computes the
correct maximum bytes-per-interval for all USB speeds, borrowing the logic
used in drivers/usb/core/urb.c.

Signed-off-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://patch.msgid.link/20251124210518.90054-1-dylan_robinson@motu.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/stream.c