Skip to contentSkip to conversation

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

PATCH Superseded Macpaul Lin 3 participants 10 messages Nov 10, 2020 – Nov 18, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

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.

---
 sound/usb/format.c |    5 +++++
 1 file changed, 5 insertions(+)
sound/usb/format.c +5 -0
index 1b28d01..6f6e79b 100644
@@ -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)
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 17 lines · Macpaul Lin

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.

---
 sound/usb/format.c |    5 +++++
 1 file changed, 5 insertions(+)
sound/usb/format.c +0 -0
index 1b28d01..6f6e79b 100644

sound/usb/format.c static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof · line 223

Quoted 7 lines
sound/usb/format.c +4 -0
@@ -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

#2 lore raw
Quoted 14 lines · Takashi Iwai
Quoted 12 lines · Macpaul Lin

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.

---
 sound/usb/format.c |    5 +++++
 1 file changed, 5 insertions(+)
Quoted 15 lines

sound/usb/format.c static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof · line 223

Quoted 12 lines
sound/usb/format.c +4 -0
index 1b28d01..6f6e79b 100644
@@ -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.

Quoted 4 lines

thanks,

Takashi

Thanks
Macpaul Lin

#3 lore raw
Quoted 32 lines · Macpaul Lin
Quoted 14 lines · Takashi Iwai
Quoted 12 lines · Macpaul Lin

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.

---
 sound/usb/format.c |    5 +++++
 1 file changed, 5 insertions(+)
Quoted 15 lines

sound/usb/format.c static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof · line 223

Quoted 12 lines
sound/usb/format.c +4 -0
index 1b28d01..6f6e79b 100644
@@ -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?

Quoted 1 line

This means firmware version of the headset as far as I know..

OK, then it's useful.

Quoted 1 line

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

Quoted 9 lines
Quoted 5 lines

thanks,

Takashi

Thanks
Macpaul Lin

#4 lore raw

PATCH v3 1/1 ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET

In reply to Macpaul Lin

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.

---
Changes for v2:
- Fix build error.
- Add Cc: [email protected]
Changes for v3:
- Replace "udev" with "chip->dev" according to Takashi's suggestion. Thanks.

 sound/usb/format.c |    5 +++++
 1 file changed, 5 insertions(+)
sound/usb/format.c +5 -0
index 1b28d01..0aff774 100644
@@ -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(chip->dev->descriptor.bcdDevice) == 0x49)
+				continue;
 
 			fp->rate_table[fp->nr_rates] = rate;
 			if (!fp->rate_min || rate < fp->rate_min)
Signature · 5 lines
1.7.9.5
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#5 lore raw
Quoted 24 lines · Macpaul Lin

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.

---
Changes for v2:
- Fix build error.
- Add Cc: [email protected]
Changes for v3:
- Replace "udev" with "chip->dev" according to Takashi's suggestion. Thanks.

 sound/usb/format.c |    5 +++++
 1 file changed, 5 insertions(+)
sound/usb/format.c +0 -0
index 1b28d01..0aff774 100644
@@ -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) ||

sound/usb/format.c static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof · line 227

Quoted 10 lines
sound/usb/format.c +5 -0
 			     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(chip->dev->descriptor.bcdDevice) == 0x49)
+				continue;
 
 			fp->rate_table[fp->nr_rates] = rate;
 			if (!fp->rate_min || rate < fp->rate_min)

Sorry for bothering again, please hold-on this patch. I'm still trying to clarify if there is another approach for this interoperability issue.
I'll update this thread once the result has came out.

Thanks
Macpaul Lin

#6 lore raw
Quoted 34 lines · Macpaul Lin
Quoted 32 lines · Macpaul Lin

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.

---
Changes for v2:
- Fix build error.
- Add Cc: [email protected]
Changes for v3:
- Replace "udev" with "chip->dev" according to Takashi's suggestion. Thanks.

 sound/usb/format.c |    5 +++++
 1 file changed, 5 insertions(+)
sound/usb/format.c +5 -0
index 1b28d01..0aff774 100644
@@ -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(chip->dev->descriptor.bcdDevice) == 0x49)
+				continue;
 
Quoted 7 lines

sound/usb/format.c static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof · line 227

Quoted 2 lines
sound/usb/format.c +0 -0
 			fp->rate_table[fp->nr_rates] = rate;
 			if (!fp->rate_min || rate < fp->rate_min)

Sorry for bothering again, please hold-on this patch. I'm still trying to clarify if there is another approach for this interoperability issue.
I'll update this thread once the result has came out.

OK, thanks for information.

Takashi

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#7 lore raw

PATCH v2 1/1 ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET

In reply to Macpaul Lin

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.

---
Changes for v2:
- Fix build error.
- Add Cc: [email protected]

 sound/usb/format.c |    6 ++++++
 1 file changed, 6 insertions(+)
sound/usb/format.c +6 -0
index 1b28d01..7a4837b 100644
@@ -202,6 +202,7 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
 		fp->rate_min = fp->rate_max = 0;
 		for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) {
 			unsigned int rate = combine_triple(&fmt[idx]);
+			struct usb_device *udev = chip->dev;
 			if (!rate)
 				continue;
 			/* C-Media CM6501 mislabels its 96 kHz altsetting */
@@ -217,6 +218,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)
Signature · 1 line
1.7.9.5
#8 lore raw
Quoted 21 lines · Macpaul Lin

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.

---
Changes for v2:
- Fix build error.
- Add Cc: [email protected]

 sound/usb/format.c |    6 ++++++
 1 file changed, 6 insertions(+)
sound/usb/format.c +0 -0
index 1b28d01..7a4837b 100644

sound/usb/format.c static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof · line 208

Quoted 7 lines
sound/usb/format.c +1 -0
@@ -202,6 +202,7 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
 		fp->rate_min = fp->rate_max = 0;
 		for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) {
 			unsigned int rate = combine_triple(&fmt[idx]);
+			struct usb_device *udev = chip->dev;
 			if (!rate)
 				continue;
 			/* C-Media CM6501 mislabels its 96 kHz altsetting */

Did you run this patch through checkpatch.pl?

#9 lore raw
Quoted 17 lines · Greg KH
Quoted 16 lines · Macpaul Lin

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.

---
Changes for v2:
- Fix build error.
- Add Cc: [email protected]

 sound/usb/format.c |    6 ++++++
 1 file changed, 6 insertions(+)
Quoted 15 lines

sound/usb/format.c static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof · line 208

Quoted 12 lines
sound/usb/format.c +1 -0
index 1b28d01..7a4837b 100644
@@ -202,6 +202,7 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
 		fp->rate_min = fp->rate_max = 0;
 		for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) {
 			unsigned int rate = combine_triple(&fmt[idx]);
+			struct usb_device *udev = chip->dev;
 			if (!rate)
 				continue;
 			/* C-Media CM6501 mislabels its 96 kHz altsetting */

Did you run this patch through checkpatch.pl?

I've ran checkpatch for this patch v2, and it shown "total: 0 errors, 0 warnings". We're using 5.9-rc1 internal.

However, I'll send patch v3 according to Takashi's suggestion.

Thanks
Macpaul Lin