diff mbox series

ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET

Message ID 1604995443-30453-1-git-send-email-macpaul.lin@mediatek.com (mailing list archive)
State New, archived
Headers show
Series ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET | expand

Commit Message

Macpaul Lin Nov. 10, 2020, 8:04 a.m. UTC
The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports
96khz. However there will be some random issue under 96khz.
Not sure if there is any alternate setting could be applied.
Hence 48khz is suggested to be applied at this moment.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Signed-off-by: Eddie Hung <eddie.hung@mediatek.com>
---
 sound/usb/format.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Takashi Iwai Nov. 10, 2020, 8:12 a.m. UTC | #1
On Tue, 10 Nov 2020 09:04:03 +0100,
Macpaul Lin wrote:
> 
> The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports
> 96khz. However there will be some random issue under 96khz.
> Not sure if there is any alternate setting could be applied.
> Hence 48khz is suggested to be applied at this moment.
> 
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> Signed-off-by: Eddie Hung <eddie.hung@mediatek.com>
> ---
>  sound/usb/format.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/sound/usb/format.c b/sound/usb/format.c
> index 1b28d01..6f6e79b 100644
> --- a/sound/usb/format.c
> +++ b/sound/usb/format.c
> @@ -217,6 +217,11 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
>  			    (chip->usb_id == USB_ID(0x041e, 0x4064) ||
>  			     chip->usb_id == USB_ID(0x041e, 0x4068)))
>  				rate = 8000;
> +			/* Huawei headset can't support 96kHz fully */
> +			if (rate == 96000 &&
> +			    chip->usb_id == USB_ID(0x12d1, 0x3a07) &&
> +			    le16_to_cpu(udev->descriptor.bcdDevice) == 0x49)

This causes the compile error due to the unknown udev.
Is this bcdDevice check mandatory?


thanks,

Takashi
Macpaul Lin Nov. 10, 2020, 8:17 a.m. UTC | #2
On Tue, 2020-11-10 at 09:12 +0100, Takashi Iwai wrote:
> On Tue, 10 Nov 2020 09:04:03 +0100,
> Macpaul Lin wrote:
> > 
> > The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports
> > 96khz. However there will be some random issue under 96khz.
> > Not sure if there is any alternate setting could be applied.
> > Hence 48khz is suggested to be applied at this moment.
> > 
> > Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> > Signed-off-by: Eddie Hung <eddie.hung@mediatek.com>
> > ---
> >  sound/usb/format.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/sound/usb/format.c b/sound/usb/format.c
> > index 1b28d01..6f6e79b 100644
> > --- a/sound/usb/format.c
> > +++ b/sound/usb/format.c
> > @@ -217,6 +217,11 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
> >  			    (chip->usb_id == USB_ID(0x041e, 0x4064) ||
> >  			     chip->usb_id == USB_ID(0x041e, 0x4068)))
> >  				rate = 8000;
> > +			/* Huawei headset can't support 96kHz fully */
> > +			if (rate == 96000 &&
> > +			    chip->usb_id == USB_ID(0x12d1, 0x3a07) &&
> > +			    le16_to_cpu(udev->descriptor.bcdDevice) == 0x49)
> 
> This causes the compile error due to the unknown udev.
> Is this bcdDevice check mandatory?

This means firmware version of the headset as far as I know..
Sorry I'll check the compile error and resend later.

> 
> thanks,
> 
> Takashi

Thanks
Macpaul Lin
Takashi Iwai Nov. 10, 2020, 8:24 a.m. UTC | #3
On Tue, 10 Nov 2020 09:17:46 +0100,
Macpaul Lin wrote:
> 
> On Tue, 2020-11-10 at 09:12 +0100, Takashi Iwai wrote:
> > On Tue, 10 Nov 2020 09:04:03 +0100,
> > Macpaul Lin wrote:
> > > 
> > > The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports
> > > 96khz. However there will be some random issue under 96khz.
> > > Not sure if there is any alternate setting could be applied.
> > > Hence 48khz is suggested to be applied at this moment.
> > > 
> > > Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> > > Signed-off-by: Eddie Hung <eddie.hung@mediatek.com>
> > > ---
> > >  sound/usb/format.c |    5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/sound/usb/format.c b/sound/usb/format.c
> > > index 1b28d01..6f6e79b 100644
> > > --- a/sound/usb/format.c
> > > +++ b/sound/usb/format.c
> > > @@ -217,6 +217,11 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
> > >  			    (chip->usb_id == USB_ID(0x041e, 0x4064) ||
> > >  			     chip->usb_id == USB_ID(0x041e, 0x4068)))
> > >  				rate = 8000;
> > > +			/* Huawei headset can't support 96kHz fully */
> > > +			if (rate == 96000 &&
> > > +			    chip->usb_id == USB_ID(0x12d1, 0x3a07) &&
> > > +			    le16_to_cpu(udev->descriptor.bcdDevice) == 0x49)
> > 
> > This causes the compile error due to the unknown udev.
> > Is this bcdDevice check mandatory?
> 
> This means firmware version of the headset as far as I know..

OK, then it's useful.

> Sorry I'll check the compile error and resend later.

I guess the only needed change is to replace udev with chip->dev.


thanks,

Takashi

> 
> > 
> > thanks,
> > 
> > Takashi
> 
> Thanks
> Macpaul Lin
>
diff mbox series

Patch

diff --git a/sound/usb/format.c b/sound/usb/format.c
index 1b28d01..6f6e79b 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -217,6 +217,11 @@  static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
 			    (chip->usb_id == USB_ID(0x041e, 0x4064) ||
 			     chip->usb_id == USB_ID(0x041e, 0x4068)))
 				rate = 8000;
+			/* Huawei headset can't support 96kHz fully */
+			if (rate == 96000 &&
+			    chip->usb_id == USB_ID(0x12d1, 0x3a07) &&
+			    le16_to_cpu(udev->descriptor.bcdDevice) == 0x49)
+				continue;
 
 			fp->rate_table[fp->nr_rates] = rate;
 			if (!fp->rate_min || rate < fp->rate_min)