Skip to content

Commit 3784d44

Browse files
committed
ALSA: usb-audio: Set sample rate for all sharing EPs on UAC1
The UAC2/3 sample rate setup is based on the clock node, which is usually shared in the interface, and can't be re-setup without deselecting the interface once, and that's how the current code behaves. OTOH, the sample rate setup of UAC1 is per endpoint, hence we basically need to call for each endpoint usage even if those share the same interface. This patch fixes the behavior of UAC1 to call always snd_usb_init_sample_rate() in snd_usb_endpoint_configure(). Fixes: bf6313a ("ALSA: usb-audio: Refactor endpoint management") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 87cb9af commit 3784d44

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sound/usb/endpoint.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,15 @@ int snd_usb_endpoint_configure(struct snd_usb_audio *chip,
12521252

12531253
/* If the interface has been already set up, just set EP parameters */
12541254
if (!ep->iface_ref->need_setup) {
1255+
/* sample rate setup of UAC1 is per endpoint, and we need
1256+
* to update at each EP configuration
1257+
*/
1258+
if (ep->cur_audiofmt->protocol == UAC_VERSION_1) {
1259+
err = snd_usb_init_sample_rate(chip, ep->cur_audiofmt,
1260+
ep->cur_rate);
1261+
if (err < 0)
1262+
goto unlock;
1263+
}
12551264
err = snd_usb_endpoint_set_params(chip, ep);
12561265
if (err < 0)
12571266
goto unlock;

0 commit comments

Comments
 (0)