ALSA: usb-audio: Always apply the hw constraints for implicit fb sync
authorTakashi Iwai <tiwai@suse.de>
Mon, 11 Jan 2021 08:16:11 +0000 (09:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 13 Jan 2021 21:25:27 +0000 (22:25 +0100)
commite4ea77f8e53f9accb9371fba34c189d0447ecce0
tree180c59e7d0a47354b2d23b72b219002333d5bbf3
parent5e941fc033e411118fb3a7d9e0b97f8cf702cd39
ALSA: usb-audio: Always apply the hw constraints for implicit fb sync

Since the commit 5a6c3e11c9c9 ("ALSA: usb-audio: Add hw constraint for
implicit fb sync"), we apply the hw constraints for the implicit
feedback sync to make the secondary open aligned with the already
opened stream setup.  This change assumed that the secondary open is
performed after the first stream has been already set up, and adds the
hw constraints to sync with the first stream's parameters only when
the EP setup for the first stream was confirmed at the open time.
However, most of applications handling the full-duplex operations do
open both playback and capture streams at first, then set up both
streams.  This results in skipping the additional hw constraints since
the counter-part stream hasn't been set up yet at the open of the
second stream, and it eventually leads to "incompatible EP" error in
the end.

This patch corrects the behavior by always applying the hw constraints
for the implicit fb sync.  The hw constraint rules are defined so that
they check the sync EP dynamically at each invocation, instead.  This
covers the concurrent stream setups better and lets the hw refine
calls resolving to the right configuration.

Also this patch corrects a minor error that has existed in the debug
print that isn't built as default.

Fixes: 5a6c3e11c9c9 ("ALSA: usb-audio: Add hw constraint for implicit fb sync")
Link: https://lore.kernel.org/r/20210111081611.12790-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/pcm.c