Nvidia default audio profile on boot

I came across an issue where by default my GPU will output audio to my 2nd monitor with no speakers, resulting in no sound. My primary is a larger TV with speakers.

Doing some searching, the problem seems common, and I found a lot of information regarding pulseaudio configuration. The easiest answer to find was to use pavucontrol to manually set the output device to the correct monitor, and yes it worked, but after a reboot or two it would return to the same no-sound default and I'd have to change it again.

So this is what I was able to find, and have done. My question is- Did I do it effectively? Is there a better and/or best practice way to accomplish this? Looking for advice.

pacmd list-cards

3 card(s) available.
index: 0
name: <alsa_card.pci-0000_01_00.1>
driver: <module-alsa-card.c>
owner module: 6
properties:
alsa.card = "2"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0xdf080000 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/card2"
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 = "2"
device.description = "GP104 High Definition Audio Controller"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 38668, available: unknown)
output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 38468, available: unknown)
output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 33368, available: unknown)
output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 33368, available: unknown)
output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5700, available: no)
output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 600, available: no)
output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)
output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5700, available: no)
output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 600, available: no)
output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no)
output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 5700, available: no)
output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 600, available: no)
output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: no)
output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (priority 5700, available: no)
output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (priority 600, available: no)
output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (priority 600, available: no)
output:hdmi-stereo-extra6: Digital Stereo (HDMI 7) Output (priority 5700, available: no)
output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7) Output (priority 600, available: no)
output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7) Output (priority 600, available: no)
off: Off (priority 0, available: unknown)
active profile: <output:hdmi-stereo-extra1>
sinks:
alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1/#11: GP104 High Definition Audio Controller Digital Stereo (HDMI 2)
sources:
alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1.monitor/#12: Monitor of GP104 High Definition Audio Controller Digital Stereo (HDMI 2)
ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: yes)
properties:
device.icon_name = "video-display"
device.product.name = "Acer P186H
"
hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: yes)
properties:
device.icon_name = "video-display"
device.product.name = "SAMSUNG
"
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"
hdmi-output-6: HDMI / DisplayPort 7 (priority 5300, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"

After using pavucontrol to switch GP104's profile from HDMI to HDMI2:
pacmd list | grep active\ profile

active profile: <output:hdmi-stereo-extra1>
active profile: <output:analog-stereo+input:analog-stereo>
active profile: <output:iec958-stereo>

Edit to /etc/pulse/default.pa

### Config to default HDMI2 (TV) for output.
set-card-profile 0 	output:hdmi-stereo-extra1

Edit:
This change was not effective, the default is still the other monitor on boot.
Referencing PulseAudio/Examples - ArchWiki, I tried this next:

pacmd list-sinks | grep -e 'name:' -e 'index:'

index: 1
name: <alsa_output.usb-Kingston_HyperX_Virtual_Surround_Sound_00000000-00.analog-stereo>
* index: 6
name: <alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1>
index: 7
name: <combined>

Edit to /etc/pulse/default.pa

### Make some devices default
set-default-sink alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1
#set-default-source input

### Allow including a default.pa.d directory, which if present, can be used
### for additional configuration snippets.
.nofail
.include /etc/pulse/default.pa.d

### Config to default HDMI2 (TV) for output.
#set-card-profile 0 	output:hdmi-stereo-extra1

I half suspect there’s a regression in Pipewire 0.3.33; my system has started switching from the USB DAC I set as default back to the internal audio every reboot, probably because the USB DAC is disconnected. It didn’t do that before, so I’m going to wait for 0.3.34 (which is due shortly).

2 Likes

This is a little over my head, pipewire sounds rather complicated when I look it up. What I was able to gather, however, is that I don't have pipewire-pulse installed, just pipewire. If I understand, pipewire on its own is basically audio/video screen recording, maybe for people who do streams? And there's packages that expand pipewire to eventually replace pulseaudio as the sound server?

In any case, setting the default sink in default.pa caused system instability. I believe my video driver crashed, screen went blank and would not respond to dropping into console. On restart, latte crashed, and every app I would try to open would crash, including konsole. Commenting out set-default-sink seems to have fixed this.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.