5

I'm attempting to switch at runtime between two ALSA devices on the same ALSA card:

>>> [blake@e530 ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CX20590 Analog [CX20590 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Device 0 is my laptop's onboard sound, Device 3 is its HDMI output.

After installing PulseAudio server (hopefull for more granular runtime management options) only Device 0 appears in my pacmd list-sinks:

flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
state: IDLE
suspend cause: 
priority: 9959
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: 20.40 ms
max request: 3 KiB
max rewind: 344 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
             Stereo
used by: 0
linked by: 1
configured latency: 20.00 ms; range is 0.50 .. 2000.00 ms
card: 0 <alsa_card.pci-0000_00_1b.0>
module: 6
properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "CX20590 Analog"
        alsa.id = "CX20590 Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "0"

Is there a way to achieve this output switching behavior at runtime using either PulseAudio or native ALSA?

2 Answers 2

3

My problem was similar, I have multiple devices listed in aplay -l but PulseAudio only listed my speakers pacmd list-sinks; it missed my headset.

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC898 Analog [ALC898 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC898 Digital [ALC898 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: A20 [Astro A20], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: A20 [Astro A20], device 1: USB Audio [USB Audio #1]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

For this output I ran the following to add my headset to PulseAudio. Then I used pasystray to select the headset as the default sink and I opened an application for music. Everything worked fine after that. pactl load-module module-alsa-sink device=hw:1,1 Then to make this persist across reboots I added load-module module-alsa-sink device=hw:1,1 to /etc/pulse/default.pa.

2

There can be different causes for this problem but for my situation this problem started showing up after an upgrade from Ubuntu 18.04 to 20.04. The problem turned out to be I needed to put myself in the pulse group in /etc/group rather than pulse-access.

1
  • Thank you, worked for me.
    – m0dular
    Commented Jun 27, 2020 at 22:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .