Skip to content

Commit 4511781

Browse files
chihhao.chentiwai
authored andcommitted
ALSA: usb-audio: fix incorrect clock source setting
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: d2e8f64 ("ALSA: usb-audio: Explicitly set up the clock selector") Signed-off-by: chihhao.chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 2b8b12b commit 4511781

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sound/usb/clock.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip,
324324
sources[ret - 1],
325325
visited, validate);
326326
if (ret > 0) {
327+
/*
328+
* For Samsung USBC Headset (AKG), setting clock selector again
329+
* will result in incorrect default clock setting problems
330+
*/
331+
if (chip->usb_id == USB_ID(0x04e8, 0xa051))
332+
return ret;
327333
err = uac_clock_selector_set_val(chip, entity_id, cur);
328334
if (err < 0)
329335
return err;

0 commit comments

Comments
 (0)