aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Turner <joe@oampo.co.uk>2015-02-16 15:44:33 -0500
committerTakashi Iwai <tiwai@suse.de>2015-02-17 01:20:04 -0500
commitb62b998010028c4dfd7db7c26990efb2a0985a1e (patch)
treea318c5ce9088577e59289479c65cf48cee05218c
parent93ceaa303b2946453b925c55dc28a4273520dd18 (diff)
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>
-rw-r--r--sound/usb/clock.c5
-rw-r--r--sound/usb/quirks.c5
-rw-r--r--sound/usb/quirks.h2
3 files changed, 12 insertions, 0 deletions
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index 03fed6611d9e..2ed260b10f6d 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -303,6 +303,11 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface,
303 return err; 303 return err;
304 } 304 }
305 305
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
306 if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC_GET_CUR, 311 if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC_GET_CUR,
307 USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN, 312 USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN,
308 UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, 313 UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep,
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index a7398412310b..5c0c05314df0 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1111,6 +1111,11 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
1111 } 1111 }
1112} 1112}
1113 1113
1114bool 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}
1114 1119
1115/* Marantz/Denon USB DACs need a vendor cmd to switch 1120/* Marantz/Denon USB DACs need a vendor cmd to switch
1116 * between PCM and native DSD mode 1121 * between PCM and native DSD mode
diff --git a/sound/usb/quirks.h b/sound/usb/quirks.h
index 1b862386577d..2cd71ed1201f 100644
--- a/sound/usb/quirks.h
+++ b/sound/usb/quirks.h
@@ -21,6 +21,8 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
21void snd_usb_set_format_quirk(struct snd_usb_substream *subs, 21void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
22 struct audioformat *fmt); 22 struct audioformat *fmt);
23 23
24bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip);
25
24int snd_usb_is_big_endian_format(struct snd_usb_audio *chip, 26int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
25 struct audioformat *fp); 27 struct audioformat *fp);
26 28