linux-IllusionX/sound/usb
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
..
6fire sound: 6fire: move to use usb_control_msg_send() and usb_control_msg_recv() 2020-09-25 16:33:59 +02:00
bcd2000 ALSA: bcd2000: More constifications 2020-01-05 16:14:49 +01:00
caiaq ALSA: Replace with fallthrough pseudo keyword in the remaining places 2020-07-09 19:10:43 +02:00
hiface sound: hiface: move to use usb_control_msg_send() 2020-09-25 16:33:59 +02:00
line6 sound: line6: move to use usb_control_msg_send() and usb_control_msg_recv() 2020-09-25 16:33:59 +02:00
misc ALSA: ua101: Replace tasklet with work 2020-09-09 18:33:15 +02:00
usx2y sound: usx2y: move to use usb_control_msg_send() 2020-09-25 16:33:59 +02:00
card.c ALSA: usb-audio: Use ALC1220-VB-DT mapping for ASUS ROG Strix TRX40 mobo 2020-11-16 09:45:26 +01:00
card.h ALSA: usb-audio: Add hw constraint for implicit fb sync 2020-11-23 15:12:46 +01:00
clock.c ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3 2020-11-23 15:11:33 +01:00
clock.h ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3 2020-11-23 15:11:33 +01:00
debug.h
endpoint.c ALSA: usb-audio: Add hw constraint for implicit fb sync 2020-11-23 15:12:46 +01:00
endpoint.h ALSA: usb-audio: Add snd_usb_get_endpoint() helper 2020-11-23 15:11:56 +01:00
format.c ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3 2020-11-23 15:11:33 +01:00
format.h
helper.c USB: move snd_usb_pipe_sanity_check into the USB core 2020-09-16 11:02:23 +02:00
helper.h USB: move snd_usb_pipe_sanity_check into the USB core 2020-09-16 11:02:23 +02:00
Kconfig sound: Fix Kconfig indentation 2019-10-07 03:53:03 +02:00
Makefile ALSA: usb-audio: Add support for Presonus Studio 1810c 2020-02-15 09:46:16 +01:00
media.c
media.h
midi.c ALSA: usb-audio: Replace tasklet with work 2020-09-09 18:33:03 +02:00
midi.h
mixer.c ALSA: usb-audio: ignore broken processing/extension unit 2020-08-17 19:58:29 +02:00
mixer.h ALSA: usb-audio: Fix OOB access of mixer element list 2020-06-24 14:24:29 +02:00
mixer_maps.c ALSA: usb-audio: Use ALC1220-VB-DT mapping for ASUS ROG Strix TRX40 mobo 2020-11-16 09:45:26 +01:00
mixer_quirks.c ALSA: usb-audio: Add mixer support for Pioneer DJ DJM-250MK2 2020-09-23 14:40:52 +02:00
mixer_quirks.h
mixer_s1810c.c ALSA: usb-audio: Fix some typos 2020-06-30 19:48:18 +02:00
mixer_s1810c.h ALSA: usb-audio: Add support for Presonus Studio 1810c 2020-02-15 09:46:16 +01:00
mixer_scarlett.c ALSA: usb-audio: More constifications 2020-01-05 16:14:34 +01:00
mixer_scarlett.h
mixer_scarlett_gen2.c sound updates for 5.10 2020-10-15 11:07:44 -07:00
mixer_scarlett_gen2.h
mixer_us16x08.c ALSA: usb-audio: fix spelling mistake "Frequence" -> "Frequency" 2020-10-02 11:24:51 +02:00
mixer_us16x08.h ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
pcm.c ALSA: usb-audio: Add hw constraint for implicit fb sync 2020-11-23 15:12:46 +01:00
pcm.h ALSA: usb-audio: Track implicit fb sync endpoint in audioformat list 2020-11-23 15:12:26 +01:00
power.c
power.h
proc.c ALSA: usb-audio: Fix a limit check in proc_dump_substream_formats() 2020-04-22 11:29:15 +02:00
proc.h
quirks-table.h Merge branch 'for-linus' into for-next 2020-09-09 18:26:48 +02:00
quirks.c ALSA: usb-audio: Add delay quirk for all Logitech USB devices 2020-11-17 13:47:09 +01:00
quirks.h ALSA: usb-audio: Rewrite registration quirk handling 2020-03-26 10:47:00 +01:00
stream.c ALSA: usb-audio: Track implicit fb sync endpoint in audioformat list 2020-11-23 15:12:26 +01:00
stream.h
usbaudio.h Merge branch 'for-linus' into for-next 2020-08-23 13:20:34 +02:00
validate.c ALSA: usb-audio: Fix endianess in descriptor validation 2020-02-01 09:06:11 +01:00