Skip to content

Commit eaa1b01

Browse files
puleglottiwai
authored andcommitted
ALSA: usb-audio: Ignore clock selector errors for single connection
For devices with multiple clock sources connected to a selector, we need to check what a clock selector control request has returned. This is needed to ensure that a requested clock source is indeed selected and for autoclock feature to work. For devices with single clock source connected, if we get an error there is nothing else we can do about it. We can't skip clock selector setup as it is required by some devices. So lets just ignore error in this case. This should fix various buggy Mackie devices: [ 649.109785] usb 1-1.3: parse_audio_format_rates_v2v3(): unable to find clock source (clock -32) [ 649.111946] usb 1-1.3: parse_audio_format_rates_v2v3(): unable to find clock source (clock -32) [ 649.113822] usb 1-1.3: parse_audio_format_rates_v2v3(): unable to find clock source (clock -32) There is also interesting info from the Windows documentation [1] (this is probably why manufacturers dont't even test this feature): "The USB Audio 2.0 driver doesn't support clock selection. The driver uses the Clock Source Entity, which is selected by default and never issues a Clock Selector Control SET CUR request." Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/audio/usb-2-0-audio-drivers [1] Link: https://bugzilla.kernel.org/show_bug.cgi?id=217314 Link: https://bugzilla.kernel.org/show_bug.cgi?id=218175 Link: https://bugzilla.kernel.org/show_bug.cgi?id=218342 Signed-off-by: Alexander Tsoy <alexander@tsoy.me> Link: https://lore.kernel.org/r/20240201115308.17838-1-alexander@tsoy.me Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent c7de2d9 commit eaa1b01

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sound/usb/clock.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,16 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip,
347347
!writeable)
348348
return ret;
349349
err = uac_clock_selector_set_val(chip, entity_id, cur);
350-
if (err < 0)
350+
if (err < 0) {
351+
if (pins == 1) {
352+
usb_audio_dbg(chip,
353+
"%s(): selector returned an error, "
354+
"assuming a firmware bug, id %d, ret %d\n",
355+
__func__, clock_id, err);
356+
return ret;
357+
}
351358
return err;
359+
}
352360
}
353361

354362
if (!validate || ret > 0 || !chip->autoclock)

0 commit comments

Comments
 (0)