]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ALSA: usb-audio: Fix hw constraints dependencies
authorTakashi Iwai <tiwai@suse.de>
Wed, 20 Jan 2021 20:45:54 +0000 (21:45 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 20 Jan 2021 20:46:45 +0000 (21:46 +0100)
commit506c203cc3de6e26666b8476d287dee81595d6dc
tree455440a290379ead6592df22554d1e57780aab32
parent2b73649cee65b8e33c75c66348cb1bfe0ff9d766
ALSA: usb-audio: Fix hw constraints dependencies

Since the recent refactoring, it's been reported that some USB-audio
devices (typically webcams) are no longer detected properly by
PulseAudio.  The debug session revealed that it's failing at probing
by PA to try the sample rate 44.1kHz while the device has discrete
sample rates other than 44.1kHz.  But the puzzle was that arecord
works as is, and some other devices with the discrete rates work,
either.

After all, this turned out to be the lack of the dependencies in a few
hw constraint rules: snd_pcm_hw_rule_add() has the (variable)
arguments specifying the dependent parameters, and some functions
didn't set the target parameter itself as the dependencies.  This
resulted in an invalid parameter that could be generated only in a
certain call pattern.  This bug itself has been present in the code,
but it didn't trigger errors just because the rules were casually
avoiding such a corner case.  After the recent refactoring and
cleanup, however, the hw constraints work "as expected", and the
problem surfaced now.

For fixing the problem above, this patch adds the missing dependent
parameters to each snd_pcm_hw_rule() call.

Fixes: bc4e94aa8e72 ("ALSA: usb-audio: Handle discrete rates properly in hw constraints")
BugLink: http://bugzilla.opensuse.org/show_bug.cgi?id=1181014
Link: https://lore.kernel.org/r/20210120204554.30177-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/pcm.c