linux/sound
chihhao.chen 2493757f88 BACKPORT: 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.

Bug: 196943902
Link: https://lore.kernel.org/patchwork/patch/1466711/
cherry picked from commit 4511781f95
Signed-off-by: chihhao.chen <chihhao.chen@mediatek.com>
Change-Id: I02731595572e3066fc1abda6009ca6c032b467e8
2021-08-18 11:44:28 +00:00
..
ac97
aoa
arm BACKPORT: UPSTREAM: amba: Make the remove callback return void 2021-03-01 12:52:06 -08:00
atmel
core ANDROID: ALSA: compress: add vendor hook to support pause in draining 2021-07-14 17:10:01 +00:00
drivers ALSA: aloop: Fix initialization of controls 2021-04-14 08:41:56 +02:00
firewire ALSA: firewire-lib: fix check for the size of isochronous packet payload 2021-05-26 12:06:51 +02:00
hda ALSA: hda: ignore invalid NHLT table 2021-03-30 14:31:48 +02:00
i2c
isa Revert "ALSA: gus: add a check of the status of snd_ctl_add" 2021-06-03 09:00:41 +02:00
mips
oss
parisc
pci ALSA: hda: update the power_state during the direct-complete 2021-06-10 13:39:25 +02:00
pcmcia
ppc
sh
soc Merge 5.10.42 into android12-5.10 2021-06-03 18:47:38 +02:00
sparc ALSA: sparc: dbri: fix repeated word 'the' 2020-10-17 09:58:35 +02:00
spi
synth
usb BACKPORT: ALSA: usb-audio: fix incorrect clock source setting 2021-08-18 11:44:28 +00:00
x86
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c