You are not logged in.

#1 2020-03-22 21:13:23

rosseba
Member
Registered: 2019-09-13
Posts: 17

X1C7, Sound on both headphone and speaker

Hi all,
before sof, headphone and speaker were mutually exclusive.
Now when I plug headphone I can hear sound on both.
Any ideas? Thanks for any help.
-f

Some details about my scenario:
audio configured as suggested here: https://wiki.archlinux.org/index.php/Le … n_7)#Audio

# dmidecode -s system-version

ThinkPad X1 Carbon 7th

$ uname -a

Linux x1c7 5.5.10-arch1-1 #1 SMP PREEMPT Wed, 18 Mar 2020 08:40:35 +0000 x86_64 GNU/Linux

$ aplay -L

null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=sofhdadsp
    sof-hda-dsp, 
    Default Audio Device
sysdefault:CARD=sofhdadsp
    sof-hda-dsp, 
    Default Audio Device

$ amixer -c0

Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 60 [69%] [-20.25dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [on]
  Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [on]
  Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Bass Speaker',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Mic Mute-LED Mode',0
  Capabilities: enum
  Items: 'On' 'Off' 'Follow Capture' 'Follow Mute'
  Item0: 'Follow Mute'
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',2
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 39 [62%] [12.00dB] [on]
  Front Right: Capture 39 [62%] [12.00dB] [on]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Dmic0',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 70
  Front Left: Capture 50 [71%] [0.00dB] [on]
  Front Right: Capture 50 [71%] [0.00dB] [on]
Simple mixer control 'Dmic1',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 70
  Front Left: Capture 50 [71%] [0.00dB]
  Front Right: Capture 50 [71%] [0.00dB]
Simple mixer control 'PGA1.0 1 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA2.0 2 Master',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 80
  Front Left: Capture 50 [62%] [0.00dB]
  Front Right: Capture 50 [62%] [0.00dB]
Simple mixer control 'PGA3.0 3 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA4.0 4 Master',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 80
  Front Left: Capture 50 [62%] [0.00dB]
  Front Right: Capture 50 [62%] [0.00dB]
Simple mixer control 'PGA7.0 7 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA8.0 8 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA9.0 9 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]

$ pacmd list-cards

1 card(s) available.
    index: 0
	name: <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
	driver: <module-alsa-card.c>
	owner module: 6
	properties:
		alsa.card = "0"
		alsa.card_name = "sof-hda-dsp"
		alsa.long_card_name = "LENOVO-20QDCTO1WW-ThinkPadX1Carbon7th"
		alsa.driver_name = "snd_soc_skl_hda_dsp"
		device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "9dc8"
		device.product.name = "Cannon Point-LP High Definition Audio Controller"
		device.string = "0"
		device.description = "Cannon Point-LP High Definition Audio Controller"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		HiFi: Play HiFi quality Music (priority 8000, available: no)
		off: Off (priority 0, available: unknown)
	active profile: <off>
	ports:
		[Out] HDMI3: HDMI3/DP3 Output (priority 700, latency offset 0 usec, available: no)
			properties:
				
		[Out] HDMI2: HDMI2/DP2 Output (priority 600, latency offset 0 usec, available: no)
			properties:
				
		[Out] HDMI1: HDMI1/DP1 Output (priority 500, latency offset 0 usec, available: no)
			properties:
				
		[Out] Speaker: Speaker (priority 100, latency offset 0 usec, available: unknown)
			properties:
				
		[Out] Headphones1: Headphones (priority 200, latency offset 0 usec, available: no)
			properties:
				
		[In] Headphones2: Headphones Stereo Microphone (priority 200, latency offset 0 usec, available: no)
			properties:
				
		[In] Mic: Digital Microphone (priority 100, latency offset 0 usec, available: no)
			properties:		

$ pacmd list-sinks

1 sink(s) available.
  * index: 1
	name: <alsa_output.hw_0_0>
	driver: <module-alsa-sink.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9030
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 1
	sample spec: s16le 2ch 48000Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0.00 ms; range is 0.50 .. 341.00 ms
	module: 22
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = ""
		alsa.id = "HDA Analog (*)"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "sof-hda-dsp"
		alsa.long_card_name = "LENOVO-20QDCTO1WW-ThinkPadX1Carbon7th"
		alsa.driver_name = "snd_soc_skl_hda_dsp"
		device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "9dc8"
		device.product.name = "Cannon Point-LP High Definition Audio Controller"
		device.string = "hw:0,0"
		device.buffering.buffer_size = "65472"
		device.buffering.fragment_size = "16320"
		device.access_mode = "mmap+timer"
		device.description = "Cannon Point-LP High Definition Audio Controller"
		device.icon_name = "audio-card-pci"

Offline

#2 2020-03-22 22:15:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,431

Re: X1C7, Sound on both headphone and speaker

Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
amixer -c0 set 'Auto-Mute Mode',0 'Enabled'

Offline

#3 2020-03-24 11:07:36

rosseba
Member
Registered: 2019-09-13
Posts: 17

Re: X1C7, Sound on both headphone and speaker

Thanks @V1del, it works!
How to make it persistent? After a reboot is off again.
The strange thing is: /var/lib/alsa/asound.state file seems correct:

		name 'Auto-Mute Mode'
		value Enabled
		comment {
			access 'read write'
			type ENUMERATED
			count 1
			item.0 Disabled
			item.1 Enabled

but auto-mute doesn't works until I use the command you suggested.
amixer confirmed it:

$ amixer -c0 | grep -A 3 "Auto-Mute"
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'

Any other file is processed at boot?

Offline

#4 2020-04-02 16:34:34

semi225599
Member
Registered: 2012-06-17
Posts: 16

Re: X1C7, Sound on both headphone and speaker

I think the issue here is related to the current version of Pulseaudio not reading ucm2 profiles properly yet (see full explanation here).
I had the same issue where Auto-Mute wouldn't persist on reboot, but on closer inspection, I saw it was actually enabled for a few seconds after reboot until Pulseaudio disabled it. I'm assuming this is because it didn't read the info from the profile correctly.

One potential solution is to follow the instructions in the link above to use a profile from the legacy ucm repo.

I went with a slightly hacky yet less involved solution that I can remove once Pulseaudio updates: a systemd unit that waits for Auto-Mute to disable and then re-enables it.

~/.config/systemd/user/enable-auto-mute.service

[Unit]
Description=Enable Auto-Mute Mode
After=pulseaudio.service

[Service]
ExecStart=/path/to/script.sh
Type=oneshot

[Install]
WantedBy=default.target

/path/to/script.sh

#!/bin/bash

{ head -n1; kill "$!"; } < <(stdbuf -oL alsactl monitor hw:0)
amixer -c 0 sset 'Auto-Mute Mode' Enabled

Then run

> chmod +x /path/to/script.sh
> systemctl --user daemon-reload
> systemctl --user enable enable-auto-mute

Offline

#5 2020-04-17 11:44:36

rosseba
Member
Registered: 2019-09-13
Posts: 17

Re: X1C7, Sound on both headphone and speaker

Nice hack @semi225599, a little bit overkill for a simple auto-mute setting.
The topic seems pretty active also on wiki section: https://wiki.archlinux.org/index.php/Ta … _situation

Offline

Board footer

Powered by FluxBB