Bug 216798
Summary: | JBL Quantum 810/610 dongle not working | ||
---|---|---|---|
Product: | Drivers | Reporter: | dev |
Component: | Sound(ALSA) | Assignee: | Jaroslav Kysela (perex) |
Status: | NEW --- | ||
Severity: | normal | CC: | adelmojr07, kernelorg, sz.zoard, tiwai, venzislav |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 6.0.5-200 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
Test patch #1 for 6.0.12
New quirk for the 6.2 kernel New quirk implementation for the 6.0.12 kernel New quirk implementation for the 6.2 kernel (version 2) New quirk implementation for the 6.0.12 kernel (version 2) |
Description
dev
2022-12-11 12:11:31 UTC
I also have a problem with jbl quantum 810 and I found many people has the same problem like mine and also 610 users. At best I managed to make only mic working with no sound output. I can upload more info later but the dongle is standart usb sound device because when I put it in any Window$ machine it works without any divers installed - it just works. I tryed few diffrent quirks also but the same result :( You can test various quirks in the linux driver: $ modinfo snd-usb-audio | grep quirk parm: quirk_alias:Quirk aliases, e.g. 0123abcd:5678beef. (array of charp) parm: quirk_flags:Driver quirk bit flags. (array of uint) usbaudio.h:#define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0) usbaudio.h:#define QUIRK_FLAG_SHARE_MEDIA_DEVICE (1U << 1) usbaudio.h:#define QUIRK_FLAG_ALIGN_TRANSFER (1U << 2) usbaudio.h:#define QUIRK_FLAG_TX_LENGTH (1U << 3) usbaudio.h:#define QUIRK_FLAG_PLAYBACK_FIRST (1U << 4) usbaudio.h:#define QUIRK_FLAG_SKIP_CLOCK_SELECTOR (1U << 5) usbaudio.h:#define QUIRK_FLAG_IGNORE_CLOCK_SOURCE (1U << 6) usbaudio.h:#define QUIRK_FLAG_ITF_USB_DSD_DAC (1U << 7) usbaudio.h:#define QUIRK_FLAG_CTL_MSG_DELAY (1U << 8) usbaudio.h:#define QUIRK_FLAG_CTL_MSG_DELAY_1M (1U << 9) usbaudio.h:#define QUIRK_FLAG_CTL_MSG_DELAY_5M (1U << 10) usbaudio.h:#define QUIRK_FLAG_IFACE_DELAY (1U << 11) usbaudio.h:#define QUIRK_FLAG_VALIDATE_RATES (1U << 12) usbaudio.h:#define QUIRK_FLAG_DISABLE_AUTOSUSPEND (1U << 13) usbaudio.h:#define QUIRK_FLAG_IGNORE_CTL_ERROR (1U << 14) usbaudio.h:#define QUIRK_FLAG_DSD_RAW (1U << 15) usbaudio.h:#define QUIRK_FLAG_SET_IFACE_FIRST (1U << 16) usbaudio.h:#define QUIRK_FLAG_GENERIC_IMPLICIT_FB (1U << 17) usbaudio.h:#define QUIRK_FLAG_SKIP_IMPLICIT_FB (1U << 18) usbaudio.h:#define QUIRK_FLAG_IFACE_SKIP_CLOSE (1U << 19) usbaudio.h:#define QUIRK_FLAG_FORCE_IFACE_RESET (1U << 20) From alsa-info output (from the github bug): [ 511.513138] usb 1-5: 3:1: cannot set freq 48000 to ep 0x2 [ 511.521058] usbcore: registered new interface driver snd-usb-audio [ 511.581632] usb 1-5: 1:1: cannot set freq 48000 to ep 0x1 The related quirks: QUIRK_FLAG_SKIP_CLOCK_SELECTOR, QUIRK_FLAG_IGNORE_CLOCK_SOURCE . Maybe: QUIRK_FLAG_SET_IFACE_FIRST, QUIRK_FLAG_IFACE_DELAY The quirk value may be computed using a command like: python -c 'print (1 << 5)' Put snd-usb-audio module configuration to /etc/modprobe.d/usb-audio.conf (for example): echo "options snd-usb-audio quirk_flags=32" > /etc/modprobe.d/usb-audio.conf Reboot is required. I assume that only ONE USB CARD is present in the system. If you have multiple USB cards, the quirk flags may be set for another card. Also note that two playback devices are detected for this card (aplay -l): card 1: Wireless [JBL Quantum810 Wireless], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Wireless [JBL Quantum810 Wireless], device 1: USB Audio [USB Audio #1] Subdevices: 1/1 Subdevice #0: subdevice #0 So you should try also the second device (first device is zero): speaker-test -D plughw:Wireless,1 There being 2 playback devices seems to be at least part of the problem actually. The headset has audio mixing functionality, originally meant to mix between game and voice chat audio. This is done via a hardware wheel. Seems to register a device for both of these channels. The old Quantum 800, which worked completely fine on Linux, also has this functionality, but through some sort of driver shenanigans it only registered 1 device (disabling the mixing feature). On the new one, it does not matter which of the devices audio is played on, nothing is coming out. So I'm assuming that the "only register 1 device" patch needs to be applied here as well. Also, please note that in pavucontrol, the headset can only be configured as "Pro Audio" and "Mono Input". There should be way more options there, including Analog Stereo Duplex. No idea why this is, but definitely seems to be related to the problem. Regarding the quirk stuff: I have tried adding your example line to usb-audio.conf and rebooting, does not change anything as far as I can see. No idea what all the other flags do (again, not a kernel dev), tried some of them (at least I know how bitfields work), still nothing. Also, it seems like quirks are not what I originally thought they were... What I was talking about was the specific driver implementation for JBL headsets. Meaning that, with the 810 being pretty new, my suspicion is that its device ID is seen and treated like any other generic device, without the driver stuff by puleglot being applied. The same thing happened when the 800 model was still new, and when its device ID changed at some point, leading to this: https://lore.kernel.org/alsa-devel/s5h4kb4m3ht.wl-tiwai@suse.de/T/ If you look to the USB descriptors, the input is just mono (see bNrChannels):
AudioStreaming Interface Descriptor:
bLength 14
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 1
bSubframeSize 2
bBitResolution 16
bSamFreqType 2 Discrete
tSamFreq[ 0] 16000
tSamFreq[ 1] 48000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
So the mic is probably fine. This device does not advertise stereo input PCM stream.
> Regarding the quirk stuff: I have tried adding your example line to
> usb-audio.conf and rebooting, does not change anything as far as I can see.
> No idea what all the other flags do (again, not a kernel dev), tried some of
> them (at least I know how bitfields work), still nothing.
You should try at least all my suggested flags (multiple changes + reboots). I gave you hints, how to compute them from the driver bit definitions.
> leading to this:
> https://lore.kernel.org/alsa-devel/s5h4kb4m3ht.wl-tiwai@suse.de/T/
It's obsolete code. The current USB audio driver does not use such quirks (they are not required).
> So the mic is probably fine. This device does not advertise stereo input PCM > stream. The mic does in fact work, yes. It's only the headphones that don't. > You should try at least all my suggested flags I have now added all the flags as separate commented out lines in usb-audio.conf and will proceed to cycle through uncommenting them one by one and rebooting. The computed numbers are 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576 > It's obsolete code Well that at least explains why my search for that code wasn't fruitful... I have also found that running speaker-test on any of the 2 devices results in it complaining about a broken pipe: ➜ ~ speaker-test -D plughw:Wireless,0 speaker-test 1.2.8 Playback device is plughw:Wireless,0 Stream parameters are 48000Hz, S16_LE, 1 channels Using 16 octaves of pink noise Rate set to 48000Hz (requested 48000Hz) Buffer size range from 96 to 96000 Period size range from 48 to 48000 Using max buffer size 96000 Periods = 4 Unable to set hw params for playback: Broken pipe Setting of hwparams failed: Broken pipe > I have now added all the flags Try QUIRK_FLAG_IGNORE_CLOCK_SOURCE as first (if you tried QUIRK_FLAG_SKIP_CLOCK_SELECTOR already). So values: 32,64 (or maybe combination 96 /32 + 64/). > Unable to set hw params for playback: Broken pipe It's probably because this error in ksyslog (dmesg): cannot set freq 48000 to ep 0x1 (or 0x02 I did now go through all of the flags separately. Meaning all of the following lines, one by one: options snd-usb-audio quirk_flags=1 options snd-usb-audio quirk_flags=2 options snd-usb-audio quirk_flags=4 options snd-usb-audio quirk_flags=8 options snd-usb-audio quirk_flags=16 options snd-usb-audio quirk_flags=32 options snd-usb-audio quirk_flags=64 options snd-usb-audio quirk_flags=128 options snd-usb-audio quirk_flags=256 options snd-usb-audio quirk_flags=512 options snd-usb-audio quirk_flags=1024 options snd-usb-audio quirk_flags=2048 options snd-usb-audio quirk_flags=4096 options snd-usb-audio quirk_flags=8192 options snd-usb-audio quirk_flags=16384 options snd-usb-audio quirk_flags=32768 options snd-usb-audio quirk_flags=65536 options snd-usb-audio quirk_flags=131072 options snd-usb-audio quirk_flags=262144 options snd-usb-audio quirk_flags=524288 options snd-usb-audio quirk_flags=1048576 None of them have restored audio output, I did notice some changes however: --- QUIRK_FLAG_SHARE_MEDIA_DEVICE (2) speaker-test (both devices tested, 0 used as example): Playback device is plughw:Wireless,0 Stream parameters are 48000Hz, S16_LE, 1 channels Using 16 octaves of pink noise Playback open error: -22,Invalid argument No output devices in pavucontrol, however "aplay -l" lists them correctly --- QUIRK_FLAG_ITF_USB_DSD_DAC (128) Mono Input profile missing in pavucontrol. Pro Audio still there. --- Everything else produced no changes from original behavior, including the suggested combination of 32 and 64 (96) Ok, if you can compile a kernel with a patch, you may try the following change: diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 4aaf0784940b..e10b92755a3b 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -1412,6 +1412,8 @@ static int init_sample_rate(struct snd_usb_audio *chip, return rate; if (clock && !clock->need_setup) return 0; + if ((ep->ep_num & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) + goto __end; err = snd_usb_init_sample_rate(chip, ep->cur_audiofmt, rate); if (err < 0) { @@ -1420,6 +1422,7 @@ static int init_sample_rate(struct snd_usb_audio *chip, return err; } +__end: if (clock) clock->need_setup = false; return 0; This change skips the rate settings for the playback streams. The hardware advertise only one format and rate, so it may work. I have no idea what to do with that to be honest... Is there maybe, like, a "kernel patches for dummies" guide or something I can use? Or would it be possible to get a precompiled RPM for Fedora? In my case it give the same hw error when driver try to set frequency to 48000. I know how to compile a kernel but I am on vacantion now. I will try it later when I come back home. Many many thanks ! I need badly to make it work! It's not so difficult. Install the kernel-devel package, get the linux sources (minor version should match to your installed kernel e.g. 6.0) - https://www.kernel.org/ - unpack sources, go to the directory, do suggested changes in sound/usb/endpoint.c (text editor) and: make -C /lib/modules/$(uname -r)/build M=$(pwd)/sound/usb modules Find snd-usb-audio.ko (sound/usb/snd-usb-audio.ko) and replace /lib/modules/$(uname -r)/kernel/sound/usb/snd-usb-audio.ko (maybe with .xz suffix). Reboot. I suggest to move the original kernel module to a different place (outside /lib/modules tree) so you can restore it after tests. As I don't know what exactly to edit (not used to reading straight git diffs), I have tried to apply the patch automatically. Doing this against sources for 6.0.12 . However: ➜ linux-6.0.12 patch -p1 < ~/Downloads/usb-audio.patch patching file sound/usb/endpoint.c Hunk #1 FAILED at 1412. patch unexpectedly ends in middle of line Hunk #2 FAILED at 1420. 2 out of 2 hunks FAILED -- saving rejects to file sound/usb/endpoint.c.rej As an example for what I'm seeing, this is lines 1410-1424 from the original file: /* If the interface has been already set up, just set EP parameters */ if (!ep->iface_ref->need_setup) { /* sample rate setup of UAC1 is per endpoint, and we need * to update at each EP configuration */ if (ep->cur_audiofmt->protocol == UAC_VERSION_1) { err = init_sample_rate(chip, ep); if (err < 0) goto unlock; } err = snd_usb_endpoint_set_params(chip, ep); if (err < 0) goto unlock; goto done; } Created attachment 303404 [details]
Test patch #1 for 6.0.12
Try the above patch. Seems like I have successfully applied the new patch and am now running it. The frequency errors are in fact gone now, but so is the entire audio device. Missing in pavucontrol, even missing in aplay -l dmesg when plugging the dongle in: [ 94.446810] usb 1-5: new high-speed USB device number 8 using xhci_hcd [ 94.576314] usb 1-5: New USB device found, idVendor=0ecb, idProduct=2069, bcdDevice= 1.00 [ 94.576330] usb 1-5: New USB device strings: Mfr=4, Product=5, SerialNumber=0 [ 94.576337] usb 1-5: Product: JBL Quantum810 Wireless [ 94.576343] usb 1-5: Manufacturer: Harman International Inc [ 94.619634] hid-generic 0003:0ECB:2069.0004: hiddev96,hidraw1: USB HID v1.10 Device [Harman International Inc JBL Quantum810 Wireless] on usb-0000:00:14.0-5/input5 It is listed in lsusb, couldn't find it anywhere else. Do you have loaded snd-usb-audio module ? lsmod ? Perhaps, you should run 'depmod -a' to update the filename if you moved from .ko.xz to .ko. Yup, module was in fact not loaded, depmod fixed that (did move from .ko.xz to .ko) And, I am very happy to announce that you are a saint my good sir! I have audio output! And input also still works! And I'm getting proper profiles in pavucontrol now (am currently on "Analog Stereo Output + Mono Input")! The frequency errors are also gone! I have also realized that by going back to Pro Audio, which also produces output now, I'm even able to use the mixing functionality as intended! Other profiles only register 1 audio device. This patch can be sent straight to torvalds now for all I care :) Heyo, I also have these problems with a JBL Quantum810 on Fedora 37, running kernel 6.0.12-300.fc37.x86_64 I successfully patched the kernel module, did a `depmod -a`, etc. reloaded the kernel module and am now listening to high quality audio on one of the devices (JBL Quantum810 Wireless Pro 1) and having headset communication on the other device (JBL Quantum810 Wireless Pro). I now also have these "Digital Stereo..." and "Analog Stereo..." profiles in pavucontrol. For now it seems to work really fine. Big thanks for that! Tobi Please, don't use this patch for the regular use (if you have more / different USB audio devices). It's a test patch to skip the problematic rate setup for this particular device, but it will break other audio devices. I will prepare a better code (new quirk). It seems that the firmware in this device is problematic. Created attachment 303407 [details]
New quirk for the 6.2 kernel
This patch is for the latest upstream.
Created attachment 303408 [details]
New quirk implementation for the 6.0.12 kernel
Could you test, please ?
With the new patch for 6.0.12, I'm back to the original non-working behavior. Did the exact same thing as with the other patch. Applied to source, compiled, moved .ko to modules directory, depmod -a, reboot. Also, looking at what's being changed, it looks like this is for the 810 only. There are users reporting the exact same issue on the 610 as well. I don't know the device ID for that, but just saying to have that in the back of your mind. Also I'd like to clarify that i did in fact apply the patch to a fresh unmodified copy of the source Do you removed any quirk settings from /etc/modprobe.d ? Anyway, this patch has a little problem - it may break the capture stream. I'll post update version soon. Yes, I have removed any overrides before doing anything with the first patch Whoops, sorry, my bad, just realized I still had this line in /etc/modprobe.d/alsa-base.conf from testing stuff weeks ago: options snd-usb-audio index=-2 quirk_alias=0ecb2069:095116d8 After removing this, the new patch does work now For me the new patch works as well. Created attachment 303410 [details]
New quirk implementation for the 6.2 kernel (version 2)
Created attachment 303411 [details]
New quirk implementation for the 6.0.12 kernel (version 2)
Please, test this one, too.
(In reply to Jaroslav Kysela from comment #31) > Created attachment 303411 [details] > New quirk implementation for the 6.0.12 kernel (version 2) > > Please, test this one, too. This one works for me, too. Yup, can confirm, it's working A doubt, this patch will work with the JBL Quantum 610 (In reply to Adelmo Junior from comment #35) > A doubt, this patch will work with the JBL Quantum 610 Maybe it should be added DEVICE_FLG for 610 as it is added for 810 ? I am not a programmer but just follow the logic ? Maybe must be added one more line here : a/sound/usb/quirks.c b/sound/usb/quirks.c index 58b37bfc885c..3d13fdf7590c 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -2152,6 +2152,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x0525, 0xa4ad, /* Hamedal C20 usb camero */ QUIRK_FLAG_IFACE_SKIP_CLOSE), + DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */ + QUIRK_FLAG_FIXED_RATE), I download kernel 6.0.12 and apply second patch - compile the whole thing and install the kernel. AND MIRACLE - I had sound !!! Thanks Jaroslav Kysela ! You are the best :). But I don't have the two channels for output (not so important) but I did not have working mic :(. After this I start removing all extra files and configs that I made before this and restart the system and now no sound and no mic. I get this : Dec 16 00:05:13 venzi-Z170X-Gaming-3 pulseaudio[1594]: Failed to find a working profile. Dec 16 00:05:13 venzi-Z170X-Gaming-3 pulseaudio[1594]: Failed to load module "module-alsa-card" (argument: "device_id="1" name="usb-Harman_International_Inc_JBL_Quantum810_Wireless-00" card_name="alsa_card.usb-Harman_International_Inc_JBL_Quantum810_Wireless-00" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed. Do I need to do some profile somewhere to make it work ? Otherwise I see the card with aplay -l : card 1: Wireless [JBL Quantum810 Wireless], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Wireless [JBL Quantum810 Wireless], device 1: USB Audio [USB Audio #1] Subdevices: 1/1 Subdevice #0: subdevice #0 and recording with arecord -L : hw:CARD=Wireless,DEV=0 JBL Quantum810 Wireless, USB Audio Direct hardware device without any conversions Thanks ! :) I just fix it ! I was left some extra config in : /etc/udev/rules.d/91-pulseaudio.rules After removing it all is ok now ! I have two working audio channels and now working mic ! For first time I see in real time how strong and fast is open source community - great stuff ... wish more of human technology do it in this way ! Thanks ! PS fix : have only one audio out ... I was too exited ;) But 1 working audio out is enough for me ! > have only one audio out
Which audio profile are you using? (pavucontrol -> configuration tab)
With Pro Audio, I'm getting both output channels and the mixing wheel works fine. With any profile other than Pro Audio, it's only 1 channel. Probably because these profiles just didn't have 2 channels in mind, as it's a pretty niche feature. From what I understand, Pro Audio is doing way less abstraction, leading to a more "bare metal" approach.
I don't have such profile to select ? Here screenshot : https://ibb.co/1RdGn04 Huh. Are you on Pulseaudio or PipeWire? May be PipeWire exclusive or something, no idea. All I can say is that I'm on Fedora 36 and have it. Pulseaudio and I am on ubuntu mate - I look around how to install this Pro Audio but it is not clear what is exacly and no clue how to install it :) Thanks anyway ! Do you know when this fix will be merged with kernel and patching will be not necessary (from witch version) ? Guess it's a PipeWire thing then. Meaning to install it, you'll have to switch to PipeWire. As for when this will be included in mainline, no idea. All i know on that topic is that everything has to go through torvalds first. I guess Jaroslav would be the guy to ask. Can someone add this change in kernel patch, I have no idea how to do it. I tested it with my headset (JBL Quantum610) and I was successful. --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -2188,6 +2188,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */ QUIRK_FLAG_FIXED_RATE), + DEVICE_FLG(0x0ecb, 0x205c, /* JBL Quantum610 Wireless */ + QUIRK_FLAG_FIXED_RATE), /* Vendor matches */ VENDOR_FLG(0x045e, /* MS Lifecam */ QUIRK_FLAG_GET_SAMPLE_RATE), (In reply to Adelmo Junior from comment #45) > Can someone add this change in kernel patch, I have no idea how to do it. > I tested it with my headset (JBL Quantum610) and I was successful. OK, now I submitted the patch and merged to sound git tree. https://lore.kernel.org/r/20230118165947.22317-1-tiwai@suse.de Hi Guys! Let me bring this thread up. I have a Quantum 810 and I'm using Linux Mint 21.1 Vera. Kernel: 5.15.0-72 First of all I'd like to know, is the solution above suitable for kernel versions lower than the mentioned one (6.0.12)? If yes, can someone put together a step by step instruction to follow, so I can make my headphones work? If not, does anyone have any advice how to get the headphones work with the kernel I have? Also a step by step would be highly appreciated. Unfortunately on Mint board the only solution is to use the headphones via Bluetooth, but I'd like to keep the BT connection to my phone, and the main connection to the computer should be the dongle. |