Skip to content

Commit d463ac1

Browse files
committed
ALSA: usb-audio: Relax hw constraints for implicit fb sync
The fix commit the commit e4ea77f ("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: e4ea77f ("ALSA: usb-audio: Always apply the hw constraints for implicit fb sync") Reported-by: Ruud van Asseldonk <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 0599313 commit d463ac1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sound/usb/pcm.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,8 +937,13 @@ get_sync_ep_from_substream(struct snd_usb_substream *subs)
937937
continue;
938938
/* for the implicit fb, check the sync ep as well */
939939
ep = snd_usb_get_endpoint(chip, fp->sync_ep);
940-
if (ep && ep->cur_audiofmt)
941-
return ep;
940+
if (ep && ep->cur_audiofmt) {
941+
/* ditto, if the sync (data) ep is used by others,
942+
* this stream is restricted by the sync ep
943+
*/
944+
if (ep != subs->sync_endpoint || ep->opened > 1)
945+
return ep;
946+
}
942947
}
943948
return NULL;
944949
}

0 commit comments

Comments
 (0)