linux-IllusionX/sound
Takashi Iwai 5a6c3e11c9 ALSA: usb-audio: Add hw constraint for implicit fb sync
In the current code, there is no check at the stream open time whether
the endpoint is being already used by others.  In the normal
operations, this shouldn't happen, but in the case of the implicit
feedback mode, it's a common problem with the full duplex operation,
because the capture stream is always opened by the playback stream as
an implicit sync source.

Although we recently introduced the check of such a conflict of
parameters at the PCM hw_params time, it doesn't give any hint at the
hw_params itself and just gives the error.  This isn't quite
comfortable, and it caused problems on many applications.

This patch attempts to make the parameter handling easier by
introducing the strict hw constraint matching with the counterpart
stream that is being used.  That said, when an implicit feedback
playback stream is running before a capture stream is opened, the
capture stream carries the PCM hw-constraint to allow only the same
sample rate, format, periods and period frames as the running playback
stream.  If not opened or there is no conflict of endpoints, the
behavior remains as same as before.

Note that this kind of "weak link" should work for most cases, but
this is no concrete solution; e.g. if an application changes the hw
params multiple times while another stream is opened, this would lead
to inconsistencies.

Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-11-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-23 15:12:46 +01:00
..
ac97
aoa
arm
atmel
core ALSA: ctl: fix error path at adding user-defined element set 2020-11-13 11:33:55 +01:00
drivers
firewire ALSA: firewire: Clean up a locking issue in copy_resp_to_buf() 2020-11-13 18:37:22 +01:00
hda ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link() 2020-11-03 14:11:38 +01:00
i2c
isa
mips
oss
parisc
pci ALSA: mixart: Fix mutex deadlock 2020-11-19 18:26:30 +01:00
pcmcia
ppc
sh
soc ASoC: Fixes for v5.11 2020-11-19 19:56:29 +01:00
sparc ALSA: sparc: dbri: fix repeated word 'the' 2020-10-17 09:58:35 +02:00
spi
synth
usb ALSA: usb-audio: Add hw constraint for implicit fb sync 2020-11-23 15:12:46 +01:00
x86
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c