summaryrefslogtreecommitdiff
path: root/sound/usb/pcm.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-01-02 20:07:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 13:58:24 +0300
commit0d81b8e86e7562da9961537519920b4974de513c (patch)
tree91a676bd028032e9aeed59cbd19013bf92eafc4b /sound/usb/pcm.c
parent254328ba4cd3da2b4fb0afdc96e5033315e64441 (diff)
downloadlinux-0d81b8e86e7562da9961537519920b4974de513c.tar.xz
ALSA: usb-audio: Relax hw constraints for implicit fb sync
[ Upstream commit d463ac1acb454fafed58f695cb3067fbf489f3a0 ] The fix commit the commit e4ea77f8e53f ("ALSA: usb-audio: Always apply the hw constraints for implicit fb sync") tried to address the bug where an incorrect PCM parameter is chosen when two (implicit fb) streams are set up at the same time. This change had, however, some side effect: once when the sync endpoint is chosen and set up, this restriction is applied at the next hw params unless it's freed via hw free explicitly. This patch is a workaround for the problem by relaxing the hw constraints a bit for the implicit fb sync. We still keep applying the hw constraints for implicit fb sync, but only when the matching sync EP is being used by other streams. Fixes: e4ea77f8e53f ("ALSA: usb-audio: Always apply the hw constraints for implicit fb sync") Reported-by: Ruud van Asseldonk <ruud@veniogames.com> Link: https://lore.kernel.org/r/4e509aea-e563-e592-e652-ba44af6733fe@veniogames.com Link: https://lore.kernel.org/r/20230102170759.29610-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/usb/pcm.c')
-rw-r--r--sound/usb/pcm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 535eb95bc9ee..29838000eee0 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -939,8 +939,13 @@ get_sync_ep_from_substream(struct snd_usb_substream *subs)
continue;
/* for the implicit fb, check the sync ep as well */
ep = snd_usb_get_endpoint(chip, fp->sync_ep);
- if (ep && ep->cur_audiofmt)
- return ep;
+ if (ep && ep->cur_audiofmt) {
+ /* ditto, if the sync (data) ep is used by others,
+ * this stream is restricted by the sync ep
+ */
+ if (ep != subs->sync_endpoint || ep->opened > 1)
+ return ep;
+ }
}
return NULL;
}