]> git.hungrycats.org Git - linux/commitdiff
ALSA: usb-audio: Don't attempt to get Lifecam HD-5000 sample rate
authorJoe Turner <joe@oampo.co.uk>
Mon, 16 Feb 2015 20:44:33 +0000 (20:44 +0000)
committerSasha Levin <sasha.levin@oracle.com>
Tue, 9 Jun 2015 18:31:47 +0000 (14:31 -0400)
[ Upstream commit b62b998010028c4dfd7db7c26990efb2a0985a1e ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
sound/usb/clock.c
sound/usb/quirks.c
sound/usb/quirks.h

index 03fed6611d9e83d489e2ab66d94320c84eed4c18..2ed260b10f6dc02cd129550ba1067c878034cb07 100644 (file)
@@ -303,6 +303,11 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface,
                return err;
        }
 
+       /* Don't check the sample rate for devices which we know don't
+        * support reading */
+       if (snd_usb_get_sample_rate_quirk(chip))
+               return 0;
+
        if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC_GET_CUR,
                                   USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN,
                                   UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep,
index bf5870c21e8eeff8859dc0affa04423f9c0c1209..5940bd50fca8808a5923ebfec4dd6e848eb08d40 100644 (file)
@@ -1102,6 +1102,11 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
        }
 }
 
+bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
+{
+       /* MS Lifecam HD-5000 doesn't support reading the sample rate. */
+       return chip->usb_id == USB_ID(0x045E, 0x076D);
+}
 
 /* Marantz/Denon USB DACs need a vendor cmd to switch
  * between PCM and native DSD mode
index 1b862386577d036d262a2d760f4f3551337ac8be..2cd71ed1201f93ea8e6b54e1d487a84751e09885 100644 (file)
@@ -21,6 +21,8 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
 void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
                              struct audioformat *fmt);
 
+bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip);
+
 int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
                                 struct audioformat *fp);