summaryrefslogtreecommitdiff
path: root/sound/usb
diff options
context:
space:
mode:
authorchihhao.chen <chihhao.chen@mediatek.com>2021-07-24 07:23:41 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-12 14:22:03 +0300
commit71f39badc898616ca4ff765d1dd755ffd8c68554 (patch)
tree8e0d80b789c9f6c1969b1469a304e76fa19a42f8 /sound/usb
parentc4fcda128780531178bfe9beac966b4de87f6840 (diff)
downloadlinux-71f39badc898616ca4ff765d1dd755ffd8c68554.tar.xz
ALSA: usb-audio: fix incorrect clock source setting
[ Upstream commit 4511781f95da0a3b2bad34f3f5e3967e80cd2d18 ] The following scenario describes an echo test for Samsung USBC Headset (AKG) with VID/PID (0x04e8/0xa051). We first start a capture stream(USB IN transfer) in 96Khz/24bit/1ch mode. In clock find source function, we get value 0x2 for clock selector and 0x1 for clock source. Kernel-4.14 behavior Since clock source is valid so clock selector was not set again. We pass through this function and start a playback stream(USB OUT transfer) in 48Khz/32bit/2ch mode. This time we get value 0x1 for clock selector and 0x1 for clock source. Finally clock id with this setting is 0x9. Kernel-5.10 behavior Clock selector was always set one more time even it is valid. When we start a playback stream, we will get 0x2 for clock selector and 0x1 for clock source. In this case clock id becomes 0xA. This is an incorrect clock source setting and results in severe noises. We see wrong data rate in USB IN transfer. (From 288 bytes/ms becomes 144 bytes/ms) It should keep in 288 bytes/ms. This earphone works fine on older kernel version load because this is a newly-added behavior. Fixes: d2e8f641257d ("ALSA: usb-audio: Explicitly set up the clock selector") Signed-off-by: chihhao.chen <chihhao.chen@mediatek.com> Link: https://lore.kernel.org/r/1627100621-19225-1-git-send-email-chihhao.chen@mediatek.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/clock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index e3d97e5112fd..514d18a3e07a 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -319,6 +319,12 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip,
selector->baCSourceID[ret - 1],
visited, validate);
if (ret > 0) {
+ /*
+ * For Samsung USBC Headset (AKG), setting clock selector again
+ * will result in incorrect default clock setting problems
+ */
+ if (chip->usb_id == USB_ID(0x04e8, 0xa051))
+ return ret;
err = uac_clock_selector_set_val(chip, entity_id, cur);
if (err < 0)
return err;