Hi, On Fri, Oct 6, 2017 at 2:22 AM, Takashi Iwai <tiwai@xxxxxxx> wrote: > On Thu, 05 Oct 2017 20:04:06 +0200, > Kai-Heng Feng wrote: >> >> Like other Plantronics devices, P610 does not support sample >> rate reading. Apply sample rate quirk to it. >> >> BugLink: https://bugs.launchpad.net/bugs/1719853 >> >> Signed-off-by: Kai-Heng Feng <kai.heng.feng@xxxxxxxxxxxxx> > > Hrm, maybe we should ignore all Plantronics devices? > Also MS Lifecam and Phoenix devices are such candidates. > > So something like below. > > Takashi > > -- 8< -- > From: Takashi Iwai <tiwai@xxxxxxx> > Subject: [PATCH] ALSA: usb-audio: Apply vendor ID matching for sample rate > quirk > > So far, lots of Plantronics, MS and Phoenix Audio devices need the > quirk not to read sample rate back, and the list just grows. > In this patch, instead of adding each device, apply the quirk by > matching with these vendors. > > Signed-off-by: Takashi Iwai <tiwai@xxxxxxx> > --- > sound/usb/quirks.c | 23 +++++++++-------------- > 1 file changed, 9 insertions(+), 14 deletions(-) > > diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c > index b8cb57aeec77..9aeb05f61f78 100644 > --- a/sound/usb/quirks.c > +++ b/sound/usb/quirks.c > @@ -1128,29 +1128,24 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) > /* devices which do not support reading the sample rate. */ > switch (chip->usb_id) { > case USB_ID(0x041E, 0x4080): /* Creative Live Cam VF0610 */ > - case USB_ID(0x045E, 0x075D): /* MS Lifecam Cinema */ > - case USB_ID(0x045E, 0x076D): /* MS Lifecam HD-5000 */ > - case USB_ID(0x045E, 0x076E): /* MS Lifecam HD-5001 */ > - case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */ > - case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */ > - case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */ > - case USB_ID(0x047F, 0x02F7): /* Plantronics BT-600 */ > - case USB_ID(0x047F, 0x0415): /* Plantronics BT-300 */ > - case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */ > - case USB_ID(0x047F, 0xC022): /* Plantronics C310 */ > - case USB_ID(0x047F, 0xC036): /* Plantronics C520-M */ > case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */ > case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */ > case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */ > case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ > case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */ > case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */ > - case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */ > - case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ > - case USB_ID(0x1de7, 0x0114): /* Phoenix Audio MT202pcs */ > case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */ > return true; > } > + > + /* devices of these vendors don't support reading rate, either */ > + switch (USB_ID_VENDOR(chip->usb_id)) { > + case 0x045E: /* MS Lifecam */ > + case 0x047F: /* Plantronics */ > + case 0x1de7: /* Phoenix Audio */ > + return true; > + } > + > return false; > } > This is definitely a better approach. Thanks! Acked-by: Kai-Heng Feng <kai.heng.feng@xxxxxxxxxxxxx> > -- > 2.14.2 > _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxx http://mailman.alsa-project.org/mailman/listinfo/alsa-devel