Headphone jack switch sense is inverted: plugging in headphones disables headphone output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Undecided
|
Hui Wang | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned | ||
Disco |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
On the LattePanda board, the headphone detection signal is not correct, it is
inverted: plugging in headphones disables headphone output
[Fix]
In the codec driver, there already is a fixup, just set the inv_jd1_1 to true.
[Test Case]
It is tested by the bug reporter, please refer to:
https:/
[Regression Risk]
Low. This fix is specific to a board which is defined by DMI strings.
My machine is a LattePanda board, which uses a "chtrt5645" device as a sound card. It has a single headphone output jack, which I think is a TRRS jack, with a mic input, such as is normally used on phones.
When I don't have headphones plugged in, the system thinks headphones *are* plugged in. Gnome Control Center shows my audio device as being headphones. If I insert a headphone connector partway into the jack, I can even get sound in the headphones.
But if I plug the headphones all the way in, the system decided that I have *un*plugged the headphones, and switches output over to "Speaker". The system doesn't actually have a speaker, only a headphone jack. And when the system switches over to "Speaker", I get no sound out of the headphones, even if I open "pavucontrol" and swap over to "Headphones (unplugged)" on the "Output Devices" tab.
This is what "pacmd"'s "list-cards" command says with my headphones *unplugged*:
2 card(s) available.
index: 0
name: <alsa_card.
driver: <module-
owner module: 7
properties:
alsa.card = "1"
alsa.card_name = "Intel HDMI/DP LPE Audio"
alsa.
alsa.driver_name = "snd_hdmi_
device.bus_path = "pci-0000:
sysfs.path = "/devices/
device.bus = "pci"
device.vendor.id = "8086"
device.
device.product.id = "22b0"
device.
device.string = "1"
device.
module-
device.icon_name = "audio-card-pci"
profiles:
output:
output:
output:
output:
output:
output:
output:
output:
output:
off: Off (priority 0, available: unknown)
active profile: <off>
ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
properties:
device.
hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
properties:
device.
hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
properties:
device.
index: 1
name: <alsa_card.
driver: <module-
owner module: 8
properties:
alsa.card = "0"
alsa.card_name = "chtrt5645"
alsa.
alsa.driver_name = "snd_soc_
device.bus_path = "platform-
sysfs.path = "/devices/
device.
device.string = "0"
device.
module-
device.icon_name = "audio-card"
profiles:
HiFi: Default (priority 8000, available: unknown)
off: Off (priority 0, available: unknown)
active profile: <HiFi>
sinks:
alsa_
sources:
alsa_
alsa_
ports:
[Out] Headphones: Headphones (priority 100, latency offset 0 usec, available: yes)
properties:
[Out] Speaker: Speaker (priority 100, latency offset 0 usec, available: no)
properties:
[In] HSMic: Headset Microphone (priority 100, latency offset 0 usec, available: yes)
properties:
[In] Mic: Internal Analog Microphone (priority 150, latency offset 0 usec, available: no)
properties:
When I plug in the headphones, the entry for card 1 changes to:
index: 1
name: <alsa_card.
driver: <module-
owner module: 8
properties:
alsa.card = "0"
alsa.card_name = "chtrt5645"
alsa.
alsa.driver_name = "snd_soc_
device.bus_path = "platform-
sysfs.path = "/devices/
device.
device.string = "0"
device.
module-
device.icon_name = "audio-card"
profiles:
HiFi: Default (priority 8000, available: unknown)
off: Off (priority 0, available: unknown)
active profile: <HiFi>
sinks:
alsa_
sources:
alsa_
alsa_
ports:
[Out] Headphones: Headphones (priority 100, latency offset 0 usec, available: no)
properties:
[Out] Speaker: Speaker (priority 100, latency offset 0 usec, available: unknown)
properties:
[In] HSMic: Headset Microphone (priority 100, latency offset 0 usec, available: no)
properties:
[In] Mic: Internal Analog Microphone (priority 150, latency offset 0 usec, available: unknown)
properties:
Note that the "Headphones" port is now "available: no".
PulseAudio is getting all these ports from Alsa's UCM (Use Case Manager) system, which has a bunch of config files that live in /usr/share/
This problem has affected me since at least Ubuntu 18.04. I've upgraded through 18.10 and to 19.04 today. All three releases have the same problem.
1. How is the PulseAudio/ALSA system determining whether headphones are plugged in or not?
2. How do I invert the sense of that test?
ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: libasound2 1.1.8-1
ProcVersionSign
Uname: Linux 5.0.0-8-generic x86_64
ApportVersion: 2.20.10-0ubuntu26
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Wed Apr 10 19:21:09 2019
InstallationDate: Installed on 2018-12-08 (123 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: alsa-lib
UpgradeStatus: Upgraded to disco on 2019-04-11 (0 days ago)
---
ProblemType: Bug
ApportVersion: 2.20.10-0ubuntu27
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
DistroRelease: Ubuntu 19.04
InstallationDate: Installed on 2018-12-08 (125 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
Lsusb:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0bda:8152 Realtek Semiconductor Corp. RTL8152 Fast Ethernet Adapter
Bus 001 Device 004: ID 2341:8036 Arduino SA Leonardo (CDC ACM, HID)
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: Default string Default string
Package: linux (not installed)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware 1.178
RfKill:
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
Tags: disco
Uname: Linux 5.0.0-8-generic x86_64
UnreportableReason: This report is about a package that is not installed.
UpgradeStatus: Upgraded to disco on 2019-04-11 (2 days ago)
UserGroups: adm cdrom dip docker libvirt lpadmin plugdev pulse-access sambashare sudo
_MarkForUpload: False
dmi.bios.date: 05/15/2018
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: DF-BI-7-
dmi.board.
dmi.board.name: Cherry Trail CR
dmi.board.vendor: AMI Corporation
dmi.board.version: Default string
dmi.chassis.
dmi.chassis.type: 9
dmi.chassis.vendor: Default string
dmi.chassis.
dmi.modalias: dmi:bvnAmerican
dmi.product.family: Tablet
dmi.product.name: Default string
dmi.product.sku: Default string
dmi.product.
dmi.sys.vendor: Default string
Changed in linux (Ubuntu): | |
assignee: | nobody → Hui Wang (hui.wang) |
description: | updated |
Changed in linux (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in linux (Ubuntu Cosmic): | |
status: | New → In Progress |
Changed in linux (Ubuntu Disco): | |
status: | New → In Progress |
Changed in linux (Ubuntu Bionic): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Disco): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Cosmic): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu): | |
status: | Confirmed → Fix Committed |
tags: |
added: verification-done-bionic removed: verification-needed-bionic |
tags: |
added: verification-done-disco removed: verification-needed-disco |
If I save the ALSA state with the headphones unplugged to a file:
sudo alsactl --file= settings- out.txt store
And then plug in the headphones and restore it:
sudo alsactl --file= settings- out.txt restore
I still get no sound. But then diffing the final state against the unplugged state did find this:
control.175 {
iface CARD
name 'Headphone Jack'
comment {
access read
type BOOLEAN
count 1
iface CARD
name 'Headset Mic Jack'
comment {
access read
type BOOLEAN
count 1
- value false
+ value true
}
}
control.176 {
- value false
+ value true
}
}
I need to convince ALSA to report/interpret those boolean jack states the other way around.