Bug 150601 - broadwell-rt286: combojack on Dell Venue 11 Pro 7140 not properly detected
Summary: broadwell-rt286: combojack on Dell Venue 11 Pro 7140 not properly detected
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-28 12:13 UTC by RussianNeuroMancer
Modified: 2020-04-06 08:31 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.4.15
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Venue 7140 combojack patch (390 bytes, patch)
2016-07-28 12:13 UTC, RussianNeuroMancer
Details | Diff
Patch which solves all current issues with combojack by dell venue 11 Pro 7140 (314 bytes, patch)
2020-02-15 15:38 UTC, szmaszmo
Details | Diff
Minimum changes to HiFi.conf profile to make sound and mic working again. (1.31 KB, patch)
2020-04-05 19:27 UTC, szmaszmo
Details | Diff
Suggested changes to HiFi.conf profile to make sound and mic working a bit better. (1.40 KB, patch)
2020-04-05 19:28 UTC, szmaszmo
Details | Diff

Description RussianNeuroMancer 2016-07-28 12:13:40 UTC
Created attachment 226731 [details]
Venue 7140 combojack patch

Same issue as with bug #93841 and probably same solution: https://bugzilla.kernel.org/show_bug.cgi?id=93841#c17

Patch attached. Unfortunately I wasn't able to test it, but most likely it should works.
Comment 1 RussianNeuroMancer 2016-08-14 04:05:08 UTC
Tested this patch.
Combojack now is detected, but playback is mono-only and no audio from microphone. Probably some other changes required.
Comment 2 RussianNeuroMancer 2016-09-28 17:12:36 UTC
I tried to add Venue 7140 to struct dmi_system_id dmi_dell_dino[] but result still the same, playback is mono-only (both headphones playback both stereo channels) and no audio from microphone. Linux 4.8.
Comment 3 RussianNeuroMancer 2017-05-06 01:04:53 UTC
Issue is still reproducible with Linux 4.10.
Comment 4 RussianNeuroMancer 2017-07-06 18:43:53 UTC
I also notices that while playback movies with 5.1 track, audio from front center (voices) doesn't playback to headphones at all (so no voices in movies).
Comment 5 szmaszmo 2019-07-28 18:18:14 UTC
This kind of bug is still there in kernel 4.19 (tested on Debian and Manjaro). I have to turn off one channel (left or right) to get reasonable sound (feels like pins are mismatched - this jack has 3 pins left/right/mic!). Mic is broken anyway (does not detect as plugged in). Since kernel 5.x (tested 5.2 on Manjaro) the card does not work at all (even speaker). Only some weird sounds come from the jack output.

Linux version 4.19.59-1-MANJARO (dmesg):
...
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> System Pin mapping ok
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload0 Pin mapping ok
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload1 Pin mapping ok
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Loopback Pin mapping ok
...
input: broadwell-rt286 Headset as /devices/pci0000:00/INT3438:00/broadwell-audio/sound/card1/input12
...
haswell-pcm-audio haswell-pcm-audio: Direct firmware load for intel/IntcPP01.bin failed with error -2
...


Linux version 5.2.1-1-MANJARO (dmesg):
...
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> System Pin mapping ok
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload0 Pin mapping ok
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload1 Pin mapping ok
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Loopback Pin mapping ok
broadwell-audio broadwell-audio: rt286-aif1 <-> snd-soc-dummy-dai mapping ok
input: broadwell-rt286 Headset as /devices/pci0000:00/INT3438:00/broadwell-audio/sound/card1/input12
...
haswell-pcm-audio haswell-pcm-audio: Direct firmware load for intel/IntcPP01.bin failed with error -2
haswell-pcm-audio haswell-pcm-audio: error: message type 7 header 0x87000000
haswell-pcm-audio haswell-pcm-audio: error: reset stream 2 still running
haswell-pcm-audio haswell-pcm-audio: error: reset stream 0 still running
haswell-pcm-audio haswell-pcm-audio: ipc: error set dx state 3 failed
haswell-pcm-audio haswell-pcm-audio: ipc: error set dx state 3 failed
haswell-pcm-audio haswell-pcm-audio: ipc: error set dx state 3 failed
...
Comment 6 David Ward 2020-02-01 15:53:28 UTC
(In reply to szmaszmo from comment #5)
> Since kernel 5.x (tested 5.2 on Manjaro) the card does not work at all (even
> speaker). Only some weird sounds come from the jack output.

That is a separate bug 204237. It is fixed in kernel 5.5.



(In reply to RussianNeuroMancer from comment #2)

> I tried to add Venue 7140 to struct dmi_system_id dmi_dell_dino[] but result
> still the same, playback is mono-only (both headphones playback both stereo
> channels) and no audio from microphone. Linux 4.8.

What about jack detection specifically? Can you please run these commands before the headset is plugged in, and then again after it is plugged in:

$ amixer --card broadwellrt286 cget iface=CARD,name='Headphone Jack'
$ amixer --card broadwellrt286 cget iface=CARD,name='Mic Jack'

and post the output here?
Comment 7 szmaszmo 2020-02-08 18:33:03 UTC
(In reply to David Ward from comment #6)
> (In reply to szmaszmo from comment #5)
> > Since kernel 5.x (tested 5.2 on Manjaro) the card does not work at all
> (even
> > speaker). Only some weird sounds come from the jack output.
> 
> That is a separate bug 204237. It is fixed in kernel 5.5.
> 
> 
> 
> (In reply to RussianNeuroMancer from comment #2)
> 
> > I tried to add Venue 7140 to struct dmi_system_id dmi_dell_dino[] but
> result
> > still the same, playback is mono-only (both headphones playback both stereo
> > channels) and no audio from microphone. Linux 4.8.
> 
> What about jack detection specifically? Can you please run these commands
> before the headset is plugged in, and then again after it is plugged in:
> 
> $ amixer --card broadwellrt286 cget iface=CARD,name='Headphone Jack'
> $ amixer --card broadwellrt286 cget iface=CARD,name='Mic Jack'
> 
> and post the output here?

Thank you for your interest in fixing this issue and sorry for delay.
Now speakers work even with kernel 5.4 (both channels are fine left and right).
Thank you also for a hint in https://bugzilla.kernel.org/show_bug.cgi?id=150591

The headset problem is still not solved. Mic is not detected at all, channels are kind of mixed.
If I test left and right channel in plasma audio settings, only right channel answers.
Weird enough, I hear it in both ears (like RussianNeuroMancer stated - mono).

My tests are without his patch, as I do not know how to apply it.
If you give me any information how to do it, I can try.

Please find output from requested commands below (performed on generic kernels delivered with Manjaro):

Linux version 5.4.17-1-MANJARO
Jack on:
$ amixer --card broadwellrt286 cget iface=CARD,name='Headphone Jack'
numid=13,iface=CARD,name='Headphone Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
$ amixer --card broadwellrt286 cget iface=CARD,name='Mic Jack'
numid=12,iface=CARD,name='Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off

Jack off:
$ amixer --card broadwellrt286 cget iface=CARD,name='Headphone Jack'
numid=13,iface=CARD,name='Headphone Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
$ amixer --card broadwellrt286 cget iface=CARD,name='Mic Jack'
numid=12,iface=CARD,name='Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off  


Linux version 5.5.2-1-MANJARO
Jack on:
$ amixer --card broadwellrt286 cget iface=CARD,name='Headphone Jack'
numid=13,iface=CARD,name='Headphone Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
$ amixer --card broadwellrt286 cget iface=CARD,name='Mic Jack'
numid=12,iface=CARD,name='Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off

Jack off:
$ amixer --card broadwellrt286 cget iface=CARD,name='Headphone Jack'
numid=13,iface=CARD,name='Headphone Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
$ amixer --card broadwellrt286 cget iface=CARD,name='Mic Jack'
numid=12,iface=CARD,name='Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
Comment 8 szmaszmo 2020-02-08 19:25:54 UTC
Just one more thing I have just noticed, the output of amixer shows mono with left channel playback 0% but.. on!
Double check with alsamixer - turning off right channel now disables entire sound, so it is clearly right channel only - mono.

Linux version 5.5.2-1-MANJARO
$ amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 0 [0%] [on]
  Front Right: Playback 28180 [43%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 30147 [46%] [on]
  Front Right: Capture 30147 [46%] [on]
Comment 9 szmaszmo 2020-02-08 19:34:48 UTC
And without headset, suddenly 80%.. however mono? I clearly hear stereo in plasma mixer front left/right test.

Linux version 5.5.2-1-MANJARO
$ amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 52428 [80%] [on]
  Front Right: Playback 52428 [80%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 30147 [46%] [on]
  Front Right: Capture 30147 [46%] [on]

Sorry for so many posts, just hope it will help.
Comment 10 szmaszmo 2020-02-08 20:15:02 UTC
With the help of PulseAudio Volume Control, I have now managed to get both channels also for headset at 43% - the problem however is, that then they get mixed together and I loose sound quality (e.g. bass effect is dropped). So still like in kernel 4.19, the channels in headset/combojack are squezzed. Both headset-pins get both channels at the same time somehow - this is my experience. It is actually stereo, but.. every pin should get only one channel. No improvement here with new kernels by now.
Comment 11 RussianNeuroMancer 2020-02-09 16:30:58 UTC
> What about jack detection specifically? 

My Dell 7140 is currently malfunction (looks like hardware issue with motherboard) so hopefully szmaszmo will able to provide all necessary information.
Comment 12 szmaszmo 2020-02-15 15:38:26 UTC
Created attachment 287409 [details]
Patch which solves all current issues with combojack by dell venue 11 Pro 7140

David's idea seems to work, take a look at attached patch.
Microphone is detected, only volume gain is a bit low (needed to adjust it to 150% in PulseAudio Volume Control), but it works. I tested it also with Skype-preview internal self-test.
Left and right channels are also working fine now. Magic!

First I was confused, as David asked to modify dmi_dell_dino structure only, whereas the patch from RussianNeuroMancer modified force_combo_jack_table.
  Anyhow since forcing is typically bad idea, I modified only dmi_dell_dino structure by copying XPS 13 9343 entries, with the content from RussianNeuroMancer patch.
  The difference is DMI_PRODUCT_NAME instead DMI_PRODUCT_VERSION - in RussianNeuroMancer patch.

Output of requested commands now:
Linux varan 5.4.19-1-MANJARO (actually -CUSTOM)
Build based on current master from https://gitlab.manjaro.org/packages/core/linux54
Annoyingly there are no tags or other branches like stable there.
Jack off:
$ amixer --card broadwellrt286 cget iface=CARD,name='Headphone Jack'
numid=13,iface=CARD,name='Headphone Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
$ amixer --card broadwellrt286 cget iface=CARD,name='Mic Jack'
numid=12,iface=CARD,name='Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off

Jack on:
$ amixer --card broadwellrt286 cget iface=CARD,name='Headphone Jack'
numid=13,iface=CARD,name='Headphone Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
$ amixer --card broadwellrt286 cget iface=CARD,name='Mic Jack'
numid=12,iface=CARD,name='Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on

$ amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 28180 [43%] [on]
  Front Right: Playback 28180 [43%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 30147 [46%] [on]
  Front Right: Capture 30147 [46%] [on]
Comment 13 szmaszmo 2020-02-15 15:50:14 UTC
Just for completeness patch is also based on what master branch in https://gitlab.manjaro.org/packages/core/linux54 fetches by PKGBUILD.
Respective last commit (state with which test kernel was built):
commit d2e66b4eb7ff3d68b7ed154e8e37f065642db382 (HEAD -> master, origin/master, origin/HEAD)
Author: Bernhard Landauer <bernhard@manjaro.org>
Date:   Tue Feb 11 18:17:27 2020 +0100

    5.4.19
Comment 14 David Ward 2020-02-24 01:56:00 UTC
(In reply to szmaszmo from comment #12)
> Microphone is detected, only volume gain is a bit low (needed to adjust it
> to 150% in PulseAudio Volume Control), but it works. I tested it also with
> Skype-preview internal self-test.

Can you please upgrade to alsa-ucm-conf 1.2.2 and see if this helps? The "AMIC Volume" mixer control is now set to its maximum value (3 instead of 1) when a headset is connected.
Comment 15 szmaszmo 2020-03-01 18:13:51 UTC
After the update of alsa-ucm-conf (1.2.1.2-1 to 1.2.2-1) from official Manjaro packages now, the card is no longer detected at all. Verified by downgrade. It looks like a new bug. Any ideas?
Comment 16 Jaroslav Kysela 2020-03-01 19:19:07 UTC
Could you show the error message from 'alsaucm -c broadwell-rt286 set _verb HiFi set _enadev Speaker' ?
Comment 17 szmaszmo 2020-03-01 20:11:06 UTC
(In reply to Jaroslav Kysela from comment #16)
> Could you show the error message from 'alsaucm -c broadwell-rt286 set _verb
> HiFi set _enadev Speaker' ?

The command does not deliver any output (neither stdout nor stderr) in any case - with alsa-ucm-conf (1.2.1.2-1 or 1.2.2-1).

In dmesg I see something weird, but it also happens with both versions:
haswell-pcm-audio haswell-pcm-audio: Direct firmware load for intel/IntcPP01.bin failed with error -2
haswell-pcm-audio haswell-pcm-audio: fw image intel/IntcPP01.bin not available(-2)
Looks like yet another issue to me. Other ideas?
Comment 18 szmaszmo 2020-03-01 20:17:52 UTC
Another weird thing is the follwing output (everything is set to 100% after update):
$ amixer 
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 65536 [100%] [on]
  Front Right: Playback 65536 [100%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65536 [100%] [on]
  Front Right: Capture 65536 [100%] [on]
After downgrading, I see again sth. like 43% as in posts above.
Hope it helps somehow.
Comment 19 szmaszmo 2020-03-01 20:46:41 UTC
(In reply to szmaszmo from comment #15)
> After the update of alsa-ucm-conf (1.2.1.2-1 to 1.2.2-1) from official
> Manjaro packages now, the card is no longer detected at all. Verified by
> downgrade. It looks like a new bug. Any ideas?

Just small clarification - at all I mean in Plasma e.g. in PulseAudio etc., so I can not even play mpv or use microphone. In dmesg it looks like working (in theory):

haswell-pcm-audio haswell-pcm-audio: FW loaded, mailbox readback FW info: type 01, - version: 00.00, build 77, source commit id: 876ac6906f31a43b6772b23c7c983ce9dcb18a19
rt286 i2c-INT343A:00: ASoC: sink widget DMIC1 overwritten
rt286 i2c-INT343A:00: ASoC: source widget DMIC1 overwritten
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> System Pin mapping ok
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload0 Pin mapping ok
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload1 Pin mapping ok
broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Loopback Pin mapping ok
broadwell-audio broadwell-audio: rt286-aif1 <-> snd-soc-dummy-dai mapping ok
Comment 20 Jaroslav Kysela 2020-03-01 21:16:29 UTC
Use 'amixer -c 0' to get the real mixer settings. Also, I guess that some volume controls should be increased, because the hard-coded settings was removed for the newer pulseaudio. Try to set the values via 'amixer -c 0' or 'alsamixer -c 0' (see the UCM configuration diffs for the affected volume controls).
Comment 21 szmaszmo 2020-04-05 19:27:43 UTC
Created attachment 288215 [details]
Minimum changes to HiFi.conf profile to make sound and mic working again.
Comment 22 szmaszmo 2020-04-05 19:28:30 UTC
Created attachment 288217 [details]
Suggested changes to HiFi.conf profile to make sound and mic working a bit better.
Comment 23 szmaszmo 2020-04-05 19:30:35 UTC
(In reply to Jaroslav Kysela from comment #20)
> Use 'amixer -c 0' to get the real mixer settings. Also, I guess that some
> volume controls should be increased, because the hard-coded settings was
> removed for the newer pulseaudio. Try to set the values via 'amixer -c 0' or
> 'alsamixer -c 0' (see the UCM configuration diffs for the affected volume
> controls).

It took me some time to play with this great multioption configuration HiFi.conf profile:
1. SectionDevice."Mic" causes dummy output device in plasma/pulseaudio etc.
   Changing it to SectionDevice."Mainmic" (with all references) solves the issue.
   This is what I meant - card is not correctly detected i.e. current version of this file (in alsa-ucm-conf  1.2.2 package) is useless for this hardware.
2. Without cset "name='Master Playback Volume' 30", after every boot I need to manually set it e.g. in alsamixer. It is also annoying, because it does not correspond 1:1 to main volume in plasma. Setting it to 30 show 100% in alsamixer, but thanks to this in plasma I can adjust volume reasonably well then.
3. Microphone section is really annoying, see patch files for minimum and a bit better changes from my side.
   Actually I am still not 100% happy with microphone (but it got a bit better) as I have to increase it over 100% to get a nice sound input. Without minimum changes the card is ueseless.
4. There is also yet another kind of cosmetic issue, that I noticed during reboots.
   If a headset is plugged during a boot time, it is not correctly activated
   i.e. I need to unplug it and plug it again to make it work.
   With headset plugged in at boot time, the speaker also does not work, so it is kind of weird.

I have also 2 questions:
1. Why have you decided to remove these defaults from HiFi.conf for newer pulseaudio? At least few of them are really necessary.
   Maybe you can consider to deliver few presets for different hardware scenarios. Without them this card is useless and average user will have difficulties to figure out what is going on.
2. When will this kernel patch come to official kernel release?
Comment 24 szmaszmo 2020-04-05 19:45:33 UTC
(In reply to David Ward from comment #14)
> (In reply to szmaszmo from comment #12)
> > Microphone is detected, only volume gain is a bit low (needed to adjust it
> > to 150% in PulseAudio Volume Control), but it works. I tested it also with
> > Skype-preview internal self-test.
> 
> Can you please upgrade to alsa-ucm-conf 1.2.2 and see if this helps? The
> "AMIC Volume" mixer control is now set to its maximum value (3 instead of 1)
> when a headset is connected.

Just to answer your question directly - AMIC Volume set to 3 helps a bit, but still I need to adjust microphone in pulseaudio to more than 100% to obtain say middle volume range of input headset sound level.
Comment 25 Jaroslav Kysela 2020-04-06 08:31:32 UTC
UCM configuration issues should be discussed here (not a kernel issue):

https://github.com/alsa-project/alsa-ucm-conf/issues

The "Mic" is correct UCM device name. You hit probably a bug somewhere.

The "Master" volume should be handled via pulseaudio (PlaybackMasterElem configuration).

Make sure that you are using the latest pulseaudio 13.99 (beta). Previous versions didn't have the volume control. Basically, UCM should not set the fixed volume when the UCM applications are allowed to change it.

Note You need to log in before you can comment on or make changes to this bug.