I had audio working on a headless system, then I connected a monitor via HDMI which had speakers on it. The audio started playing out of the monitor speakers automatically.
When I disconnect the monitor I can no longer get audio to play out of the original sound port that worked.
pacmd list-cards
now shows 9 cards available, it used to only have 1 before I added the monitor.
$ pacmd list-cards
Welcome to PulseAudio! Use "help" for usage information.
>>> 9 card(s) available.
index: 0
name: <alsa_card.pci-0000_06_00.1>
driver: <module-alsa-card.c>
owner module: 5
properties:
alsa.card = "1"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0xf9080000 irq 72"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:06:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:03.0/0000:03:00.0/0000:04:08.0/0000:06:00.1/sound/card1"
Many of the new cards listed in pacmd list-cards
seem to be webcams, which aren't even audio devices:
index: 5
name: <alsa_card.usb-046d_Logitech_Webcam_C930e_4C329CAE-02-C930e_3>
I've tried pacmd set-default-sink 0
counting up from 0 until I get an error to see if I can set the right audio device that way.
I've tried rebooting to no avail.
I've set the volume with pactl -- set-sink-volume 0 90%
and verified the speakers work.
$ sudo aplay -l
**** List of PLAYBACK Hardware Devices ****
Home directory not accessible: Permission denied
card 0: PCH [HDA Intel PCH], device 0: ALC1150 Analog [ALC1150 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC1150 Digital [ALC1150 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia_1 [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 2: NVidia_1 [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia_1 [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia_1 [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
Also, sometimes I get into this state where pacmd
fails.
$ pacmd
No PulseAudio daemon running, or not running as session daemon.
I can fix that by export $(dbus-launch)
and running pulseaudio &
. But I don't really understand why I did that, I just found a tidbit on some related question that suggested it.
Verified that the default audio device is correct:
$ pacmd list-sinks | grep -e 'name:' -e 'index'
index: 0
name: <alsa_output.pci-0000_06_00.1.hdmi-stereo>
index: 1
name: <alsa_output.pci-0000_05_00.1.hdmi-stereo>
* index: 2
name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
I haven't touched the system wide defaults in /etc/pulse/
as far as I know. I have tried deleting the local settings in ~/.config/pulse/