[alsa-devel] Problem and Patch for B&W PX Bluetooth Headphones

Nicolas Herochao nicolas at herochao.de
Fri Sep 28 20:03:25 CEST 2018


Hello,

I'm writing this mail because of a Crash when connecting the B&W PX 
headphones via usb. Half a year ago this used to work with Linux after 
setting the default sample rate of pulseaudio to 48000k.

A Launchpad Bug seems to describe this exact issue (detailed description 
below): https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1773697.
It pointed me to the right direction, and today I have successfully 
compiled and tested a small patch that fixes the errors while also 
setting the sample rate to 48000k, making these headphones plug&play on 
any newer firmware. They sound awesome via USB!

I would like to submit this patch, but it would be my first contribution 
and it could potentially break the B&W PX on older firmware. I can't 
test it since I see no obvious ways to downgrade the firmware. The 
automatic detection of these headphones always worked except for the 
sample-rate and perhaps the worst result is that old firmware will show 
a non-functional microphone, like on Windows.

So I decided to first present the patch on this mailing list and ask for 
feedback and help. If anyone wants to pick the patch up, I'd appreciate 
that as well.

My questions:

* Can a quirk somehow handle multiple firmware versions of a usb device?

* If not: Will this quirk allow old firmware to work out of the box but 
show a non-functional microphone? (And is that okay?)

Thanks for your time and any feedback you can provide!
Sincerely,

Nicolas

PS: more detail on the cause of the issue:
------

A quirk in snd-usb-audio was added to automate setting sample rate to 
4800k and remove the previously exposed nonfunctional microphone:
commit 240a8af929c7c57dcde28682725b29cf8474e8e5
https://lore.kernel.org/patchwork/patch/919689/

However the headphones where updated shortly after that to remove the 
unintentional microphone functionality. I guess because of this the 
headphones now crash when connecting them via USB while the quirk is 
active with the following dmesg errors:

snd-usb-audio: probe of 2-3:1.0 failed with error -22
usb 2-3: 2:1: cannot get min/max values for control 2 (id 2)

---------------
Finally, here is the patch (based on the current mainline kernel and 
generated according to all Guidelines I could find) which fixes the 
quirk by removing the microphone part:
----------------

 From 748587283db85e219902abf4ac012864005943c8 Mon Sep 17 00:00:00 2001
From: Nicolas Huaman <nicolas at herochao.de>
Date: Fri, 28 Sep 2018 18:05:15 +0200
Subject: [PATCH 1/1] SOUND: update quirk for B&W PX to remove microphone

Signed-off-by: Nicolas Huaman <nicolas at herochao.de>
---
  sound/usb/quirks-table.h | 9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 08aa78007020..849953e5775c 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -3346,19 +3346,14 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", 
"HVR-950Q"),
                  .ifnum = 0,
                  .type = QUIRK_AUDIO_STANDARD_MIXER,
              },
-            /* Capture */
-            {
-                .ifnum = 1,
-                .type = QUIRK_IGNORE_INTERFACE,
-            },
              /* Playback */
              {
-                .ifnum = 2,
+                .ifnum = 1,
                  .type = QUIRK_AUDIO_FIXED_ENDPOINT,
                  .data = &(const struct audioformat) {
                      .formats = SNDRV_PCM_FMTBIT_S16_LE,
                      .channels = 2,
-                    .iface = 2,
+                    .iface = 1,
                      .altsetting = 1,
                      .altset_idx = 1,
                      .attributes = UAC_EP_CS_ATTR_FILL_MAX |
-- 
2.19.0








More information about the Alsa-devel mailing list