diff options
author | Takashi Iwai <tiwai@suse.de> | 2022-04-07 23:16:57 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2022-04-08 14:30:01 +0200 |
commit | 98c27add5d96485db731a92dac31567b0486cae8 (patch) | |
tree | ade5f799bb87f3a8c7020191b24404b29b331c7f /sound/ppc/powermac.c | |
parent | d52eee988597ac2a2c5d17d842946616d7d41070 (diff) | |
download | linux-98c27add5d96485db731a92dac31567b0486cae8.tar.gz linux-98c27add5d96485db731a92dac31567b0486cae8.tar.bz2 linux-98c27add5d96485db731a92dac31567b0486cae8.zip |
ALSA: usb-audio: Cap upper limits of buffer/period bytes for implicit fb
In the implicit feedback mode, some parameters are tied between both
playback and capture streams. One of the tied parameters is the
period size, and this can be a problem if the device has different
number of channels to both streams. Assume that an application opens
a playback stream that has an implicit feedback from a capture stream,
and it allocates up to the max period and buffer size as much as
possible. When the capture device supports only more channels than
the playback, the minimum period and buffer sizes become larger than
the sizes the playback stream took. That is, the minimum size will be
over the max size the driver limits, and PCM core sees as if no
available configuration is found, returning -EINVAL mercilessly.
For avoiding this problem, we have to look through the counter part of
audioformat list for each sync ep, and checks the channels. If more
channels are found there, we reduce the max period and buffer sizes
accordingly.
You may wonder that the patch adds only the evaluation of channels
between streams, and what about other parameters? Both the format and
the rate are tied in the implicit fb mode, hence they are always
identical.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215792
Fixes: 5a6c3e11c9c9 ("ALSA: usb-audio: Add hw constraint for implicit fb sync")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220407211657.15087-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/ppc/powermac.c')
0 files changed, 0 insertions, 0 deletions