Skip to content

Commit

Permalink
ALSA: usb-audio: Set sample rate for all sharing EPs on UAC1
Browse files Browse the repository at this point in the history
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/20210118075816.25068-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jan 18, 2021
1 parent 87cb9af commit 3784d44
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sound/usb/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,15 @@ int snd_usb_endpoint_configure(struct snd_usb_audio *chip,

/* If the interface has been already set up, just set EP parameters */
if (!ep->iface_ref->need_setup) {
/* sample rate setup of UAC1 is per endpoint, and we need
* to update at each EP configuration
*/
if (ep->cur_audiofmt->protocol == UAC_VERSION_1) {
err = snd_usb_init_sample_rate(chip, ep->cur_audiofmt,
ep->cur_rate);
if (err < 0)
goto unlock;
}
err = snd_usb_endpoint_set_params(chip, ep);
if (err < 0)
goto unlock;
Expand Down

0 comments on commit 3784d44

Please sign in to comment.