Skip to content

Commit b62b998

Browse files
oampotiwai
authored andcommitted
ALSA: usb-audio: Don't attempt to get Lifecam HD-5000 sample rate
Adds a quirk to disable the check that the sample rate has been set correctly, as the Lifecam does not support getting the sample rate. This means that we don't need to wait for the USB timeout when attempting to get the sample rate. Waiting for the timeout causes problems in some applications, which give up on the device acquisition process before it has had time to complete, resulting in no sound. [minor tidy up by tiwai] Signed-off-by: Joe Turner <joe@oampo.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 93ceaa3 commit b62b998

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

sound/usb/clock.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface,
303303
return err;
304304
}
305305

306+
/* Don't check the sample rate for devices which we know don't
307+
* support reading */
308+
if (snd_usb_get_sample_rate_quirk(chip))
309+
return 0;
310+
306311
if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC_GET_CUR,
307312
USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN,
308313
UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep,

sound/usb/quirks.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,11 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
11111111
}
11121112
}
11131113

1114+
bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
1115+
{
1116+
/* MS Lifecam HD-5000 doesn't support reading the sample rate. */
1117+
return chip->usb_id == USB_ID(0x045E, 0x076D);
1118+
}
11141119

11151120
/* Marantz/Denon USB DACs need a vendor cmd to switch
11161121
* between PCM and native DSD mode

sound/usb/quirks.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
2121
void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
2222
struct audioformat *fmt);
2323

24+
bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip);
25+
2426
int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
2527
struct audioformat *fp);
2628

0 commit comments

Comments
 (0)