You are not logged in.
Hi,
I just reinstalled my Arch, I have a problem with ALSA I guess :
- By default, I have sound with my PC' speakers
- When I plug my headphones, the sound is correctly redirected
- When I unplug my headphones, the sound doesn't switch back to speakers
With pavucontrol I can see that the headphone is correctly detected as "unplugged" and if I change manually the output source to speaker, I have sound again with speaker.
Has someone an idea how to ask alsa to switch back sound to speaker after unplugging headphones ?
Sound card : Realtek ALC299
Environment : KDE Plasma
Thanks
Last edited by damien200 (2021-01-18 22:17:18)
Offline
From a pulseaudio POV that usually happens via the switch-on-port-available module that should be loaded in a default configuration.
FWIW maybe post a
amixer -c0 #... or the correct card index from aplay -l if not 0
pacmd list-cards
pacmd list-sinks
Offline
Thanks for your quick reply, here are the commands' results :
$ amixer -c0
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 59 [68%] [-21.00dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 0 [0%] [-65.25dB] [off]
Front Right: Playback 0 [0%] [-65.25dB] [off]
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 'PCM',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 253 [99%] [-0.40dB]
Front Right: Playback 253 [99%] [-0.40dB]
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 '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: 'Enabled'
Simple mixer control 'Internal 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]
$ pacmd list-cards
2 card(s) available.
index: 0
name: <alsa_card.pci-0000_01_00.1>
driver: <module-alsa-card.c>
owner module: 6
properties:
alsa.card = "1"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0x63000000 irq 17"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:01:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"
device.bus = "pci"
device.vendor.id = "10de"
device.vendor.name = "NVIDIA Corporation"
device.product.id = "10f0"
device.product.name = "GP104 High Definition Audio Controller"
device.string = "1"
device.description = "GP104 High Definition Audio Controller"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
output:hdmi-stereo: Sortie Digital Stereo (HDMI) (priority 5900, available: no)
output:hdmi-surround: Sortie Digital Surround 5.1 (HDMI) (priority 800, available: no)
output:hdmi-surround71: Sortie Digital Surround 7.1 (HDMI) (priority 800, available: no)
output:hdmi-stereo-extra1: Sortie Digital Stereo (HDMI 2) (priority 5700, available: no)
output:hdmi-surround-extra1: Sortie Digital Surround 5.1 (HDMI 2) (priority 600, available: no)
output:hdmi-surround71-extra1: Sortie Digital Surround 7.1 (HDMI 2) (priority 600, available: no)
output:hdmi-stereo-extra2: Sortie Digital Stereo (HDMI 3) (priority 5700, available: no)
output:hdmi-surround-extra2: Sortie Digital Surround 5.1 (HDMI 3) (priority 600, available: no)
output:hdmi-surround71-extra2: Sortie Digital Surround 7.1 (HDMI 3) (priority 600, available: no)
output:hdmi-stereo-extra3: Sortie Digital Stereo (HDMI 4) (priority 5700, available: no)
output:hdmi-surround-extra3: Sortie Digital Surround 5.1 (HDMI 4) (priority 600, available: no)
output:hdmi-surround71-extra3: Sortie Digital Surround 7.1 (HDMI 4) (priority 600, available: no)
output:hdmi-stereo-extra4: Sortie Digital Stereo (HDMI 5) (priority 5700, available: no)
output:hdmi-surround-extra4: Sortie Digital Surround 5.1 (HDMI 5) (priority 600, available: no)
output:hdmi-surround71-extra4: Sortie Digital Surround 7.1 (HDMI 5) (priority 600, available: no)
output:hdmi-stereo-extra5: Sortie Digital Stereo (HDMI 6) (priority 5700, available: no)
output:hdmi-surround-extra5: Sortie Digital Surround 5.1 (HDMI 6) (priority 600, available: no)
output:hdmi-surround71-extra5: Sortie Digital Surround 7.1 (HDMI 6) (priority 600, available: no)
off: Éteint (priority 0, available: unknown)
active profile: <off>
ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-5: HDMI / DisplayPort 6 (priority 5400, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
index: 1
name: <alsa_card.pci-0000_00_1f.3>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0x404a100000 irq 147"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1f.3"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "a348"
device.product.name = "Cannon Lake PCH cAVS"
device.form_factor = "internal"
device.string = "0"
device.description = "Audio interne"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
input:analog-stereo: Entrée Stéréo analogique (priority 65, available: unknown)
output:analog-stereo: Sortie Stéréo analogique (priority 6500, available: unknown)
output:analog-stereo+input:analog-stereo: Duplex stéréo analogique (priority 6565, available: unknown)
off: Éteint (priority 0, available: unknown)
active profile: <output:analog-stereo+input:analog-stereo>
sinks:
alsa_output.pci-0000_00_1f.3.analog-stereo/#0: Audio interne Stéréo analogique
sources:
alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#0: Monitor of Audio interne Stéréo analogique
alsa_input.pci-0000_00_1f.3.analog-stereo/#1: Audio interne Stéréo analogique
ports:
analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-input-microphone"
analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-input-microphone"
analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-speakers"
analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-headphones"
$ pacmd list-sinks
1 sink(s) available.
* index: 0
name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9039
volume: front-left: 28901 / 44% / -21,33 dB, front-right: 28901 / 44% / -21,33 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: 0
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Stéréo
used by: 0
linked by: 2
configured latency: 0,00 ms; range is 0,50 .. 1837,50 ms
card: 1 <alsa_card.pci-0000_00_1f.3>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC299 Analog"
alsa.id = "ALC299 Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0x404a100000 irq 147"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1f.3"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "a348"
device.product.name = "Cannon Lake PCH cAVS"
device.form_factor = "internal"
device.string = "front:0"
device.buffering.buffer_size = "352800"
device.buffering.fragment_size = "176400"
device.access_mode = "mmap+timer"
device.profile.name = "analog-stereo"
device.profile.description = "Stéréo analogique"
device.description = "Audio interne Stéréo analogique"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-speakers"
analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-headphones"
active port: <analog-output-speaker>
Offline
I tested something else also :
I connected a bluetooth headset and it switchs correctly between the BT headset and the speaker.
Offline
not a useful test, a bluetooth card is a completely separate device that none of the jack logistics that are at play here will have a relevance on.
Were these outputs after headphone plug out (... and non existant speaker playback) ? All seems to look correctly from a general stand point.
Offline
My mistake, those are the one after headphone unplugged and no sound on speakers :
$ amixer -c0
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 77 [89%] [-7.50dB] [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 0 [0%] [-65.25dB] [off]
Front Right: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'PCM',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 253 [99%] [-0.40dB]
Front Right: Playback 253 [99%] [-0.40dB]
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 '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: 'Enabled'
Simple mixer control 'Internal 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]
$ pacmd list-cards
2 card(s) available.
index: 0
name: <alsa_card.pci-0000_01_00.1>
driver: <module-alsa-card.c>
owner module: 6
properties:
alsa.card = "1"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0x63000000 irq 17"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:01:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"
device.bus = "pci"
device.vendor.id = "10de"
device.vendor.name = "NVIDIA Corporation"
device.product.id = "10f0"
device.product.name = "GP104 High Definition Audio Controller"
device.string = "1"
device.description = "GP104 High Definition Audio Controller"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
output:hdmi-stereo: Sortie Digital Stereo (HDMI) (priority 5900, available: no)
output:hdmi-surround: Sortie Digital Surround 5.1 (HDMI) (priority 800, available: no)
output:hdmi-surround71: Sortie Digital Surround 7.1 (HDMI) (priority 800, available: no)
output:hdmi-stereo-extra1: Sortie Digital Stereo (HDMI 2) (priority 5700, available: no)
output:hdmi-surround-extra1: Sortie Digital Surround 5.1 (HDMI 2) (priority 600, available: no)
output:hdmi-surround71-extra1: Sortie Digital Surround 7.1 (HDMI 2) (priority 600, available: no)
output:hdmi-stereo-extra2: Sortie Digital Stereo (HDMI 3) (priority 5700, available: no)
output:hdmi-surround-extra2: Sortie Digital Surround 5.1 (HDMI 3) (priority 600, available: no)
output:hdmi-surround71-extra2: Sortie Digital Surround 7.1 (HDMI 3) (priority 600, available: no)
output:hdmi-stereo-extra3: Sortie Digital Stereo (HDMI 4) (priority 5700, available: no)
output:hdmi-surround-extra3: Sortie Digital Surround 5.1 (HDMI 4) (priority 600, available: no)
output:hdmi-surround71-extra3: Sortie Digital Surround 7.1 (HDMI 4) (priority 600, available: no)
output:hdmi-stereo-extra4: Sortie Digital Stereo (HDMI 5) (priority 5700, available: no)
output:hdmi-surround-extra4: Sortie Digital Surround 5.1 (HDMI 5) (priority 600, available: no)
output:hdmi-surround71-extra4: Sortie Digital Surround 7.1 (HDMI 5) (priority 600, available: no)
output:hdmi-stereo-extra5: Sortie Digital Stereo (HDMI 6) (priority 5700, available: no)
output:hdmi-surround-extra5: Sortie Digital Surround 5.1 (HDMI 6) (priority 600, available: no)
output:hdmi-surround71-extra5: Sortie Digital Surround 7.1 (HDMI 6) (priority 600, available: no)
off: Éteint (priority 0, available: unknown)
active profile: <off>
ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
hdmi-output-5: HDMI / DisplayPort 6 (priority 5400, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
index: 1
name: <alsa_card.pci-0000_00_1f.3>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0x404a100000 irq 147"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1f.3"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "a348"
device.product.name = "Cannon Lake PCH cAVS"
device.form_factor = "internal"
device.string = "0"
device.description = "Audio interne"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
input:analog-stereo: Entrée Stéréo analogique (priority 65, available: unknown)
output:analog-stereo: Sortie Stéréo analogique (priority 6500, available: unknown)
output:analog-stereo+input:analog-stereo: Duplex stéréo analogique (priority 6565, available: unknown)
off: Éteint (priority 0, available: unknown)
active profile: <output:analog-stereo+input:analog-stereo>
sinks:
alsa_output.pci-0000_00_1f.3.analog-stereo/#0: Audio interne Stéréo analogique
sources:
alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#0: Monitor of Audio interne Stéréo analogique
alsa_input.pci-0000_00_1f.3.analog-stereo/#1: Audio interne Stéréo analogique
ports:
analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-input-microphone"
analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-input-microphone"
analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-speakers"
analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-headphones"
pacmd list-sinks
1 sink(s) available.
* index: 0
name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9039
volume: front-left: 48563 / 74% / -7,81 dB, front-right: 48563 / 74% / -7,81 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: 0
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Stéréo
used by: 0
linked by: 1
configured latency: 0,00 ms; range is 0,50 .. 1837,50 ms
card: 1 <alsa_card.pci-0000_00_1f.3>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC299 Analog"
alsa.id = "ALC299 Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0x404a100000 irq 147"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1f.3"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "a348"
device.product.name = "Cannon Lake PCH cAVS"
device.form_factor = "internal"
device.string = "front:0"
device.buffering.buffer_size = "352800"
device.buffering.fragment_size = "176400"
device.access_mode = "mmap+timer"
device.profile.name = "analog-stereo"
device.profile.description = "Stéréo analogique"
device.description = "Audio interne Stéréo analogique"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-speakers"
analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-headphones"
active port: <analog-output-headphones>
Offline
Ye this is weird, module switch-on-port-available is loaded ?
pactl list modules | grep switch
or did you unload that because of the HDMI device switch that otherwise might happen on wakeup?
Alternatively listen to acpi events yourself and do the relevant switch over see this post for some pointers on how that could look like
Offline
Yes, the module is loaded
$ pactl list modules | grep switch
Nom : module-switch-on-port-available
I will check your link, thanks
Offline
Hi,
I just reinstalled my Arch, I have a problem with ALSA I guess :
- By default, I have sound with my PC' speakers
- When I plug my headphones, the sound is correctly redirected
- When I unplug my headphones, the sound doesn't switch back to speakersWith pavucontrol I can see that the headphone is correctly detected as "unplugged" and if I change manually the output source to speaker, I have sound again with speaker.
Has someone an idea how to ask alsa to switch back sound to speaker after unplugging headphones ?Sound card : Realtek ALC299
Environment : KDE PlasmaThanks
Its an issue with pulseaudio, I have managed to find a workaround though a bug report is necessary later to help resolve this issue.
I reverted to the 14.0-1 version for these packages from the archive and it correctly switches when unplugging headphones:
libpulse
pulseaudio
pulseaudio-bluetooth
Offline
Should be fixed with the just released 14.2 if I'm reading the release notes right, don't have a setup were I could readily test this myself right now.
Offline
Should be fixed with the just released 14.2 if I'm reading the release notes right, don't have a setup were I could readily test this myself right now.
I have just checked it out: the old correct behaviour is restored in pulseaudio 14.2
Hurray!
Offline
Should be fixed with the just released 14.2 if I'm reading the release notes right, don't have a setup were I could readily test this myself right now.
I confirm, no more problem on my computer
Offline