How to remove Nvidia HDMI audio output in PulseAudio?

At each reboot, PulseAudio sets a sink (in my case, “HDMI Audio Output”) as the default.

So, at each reboot, I don’t hear any sound, and need to reconfigure the default sink each time to “Analog Output”.

How do I remove/disable a specific sink such as HDMI, or set a default sink that overrides the existing sink?

Asked By: manatlan

||

I found this suggestion on Launchpad

which states you should edit the pulseaudio settings

sudo nano /etc/pulse/default.pa

and replace #set-default-sink output with: set-default-sink {name of your device}

Name of the device can be found by looking at pactl list output in the Card sections name field.

I checked and the approach should still be valid in 10.10

Answered By: HagenaarsDotNu

1. Delete User Settings

Another approach prior to editing the default.pa would be to rename the hidden directory ~/.pulseaudio to something like ~/.pulseaudio.000 in your /home directory. This is where your user defined setup is stored. If deleted or renamed it will immediately be recreated from the /etc/pulse/default.pa settings.

2. Edit Defaults

Only if this has no effect for your system then maybe udev loads the HDMI interface as default sink. Then one approach could be as already mentioned by HagenaarsDotNu to edit the default.pa. Mind to make a backup of the current default.pa. Look for this section which is pretty self-explaining (mind that hal-detect will not work in Ubuntu >10.04).

### Load audio drivers statically (it's probably better to not load
### these drivers manually, but instead use module-hal-detect --
### see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
#
### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Alternatively use the static hardware detection module (for systems that
### lack udev support)
load-module module-detect
.endif

3. The Elegant Way

Another more elegant way to get audio working is to enable “Simultaneous Output” from paprefs as depicted here:

paprefs

This enables audio output on both, the internal audio, and the HDMI-Interface. Make this virtual output device your default and you have all options at your hands.

Answered By: Takkat

in 18.10 i was able to fix it

file /etc/modprobe.d/blacklist.conf
add

blacklist snd_hda_codec_hdmi
Answered By: Selmi

Just set the soundcard’s profile to "off", for example:

pactl set-card-profile alsa_card.usb-Generic_ThinkPad_Dock_USB_Audio-00 off

pavucontrol can do this is well in its "Configuration" tab:

enter image description here

An alternative is to completely disable any auto connect functionality in pulseaudio, however I like this functionality in the case of my bluetooth headset.
With the above solution you can disable soundcards in a fine-grained manner.

Answered By: hbogert

As a workaround please disable that feature by editing /etc/pulse/default.pa and comment out (with #) or remove:

load-module module-switch-on-port-available

and reboot the system.

Answered By: Dmitry Obelov

found a better option

using systemd as described below worked on startup but not when plugging devices in to an already running system.

To ignore audio when hot-plugging and on boot, udev rules are the better option.

Adapted from Tell PulseAudio to ignore a USB device using udev:

  1. use lsusb to identify the vendor/product id of the device you want to ignore

    $ lsusb
    Bus 006 Device 003: ID 17e9:4307 DisplayLink LAPDOCK
    # <other devices I don't care about>
    

    the ID part gives us the magic numbers

  2. create a udev rules file, e.g. /etc/udev/rules.d/80-ignore-audio-cards.rules that sets an environment variable for pulse audio.

    For me this looked like:

    ATTRS{idVendor}=="17e9", ATTRS{idProduct}=="4307", ENV{PULSE_IGNORE}="1"
    

    I chose the 80- prefix for the filename arbitrarily. If you any pulseaudio related rules, make sure your new file starts with a lower number

  3. reboot to ensure it takes effect

With the udev rule in place, pulseaudio ignores the device completely.


previous answer:

Ran into the same problem, and the given answers didn’t work for me across restarts. I think my issue was delayed detection of cards; when pulseaudio started up it didn’t see all the cards, and some combination of module-switch-on-connect and module-switch-on-port-available was always resetting my choices.

I solved this by making a systemd user unit to run pactl set_card_profile "$MY_CARD_NAME" off when I logged in.

  1. find the name of the card you don’t want; hopefully the name should be enough to tell which one:

    $ pactl list cards | grep -E '(Card|Name:)'
    Card #0
        Name: alsa_card.usb-DisplayLink_LAPDOCK_U3D2338486250-02
    Card #1
        Name: alsa_card.pci-0000_01_00.1
    Card #2
        Name: alsa_card.usb-Plantronics_Plantronics_Blackwire_5220_Series_2961D11C621649939CED8BF57E910BA5-00
    Card #3
        Name: alsa_card.usb-HD_Web_Camera_HD_Web_Camera_Ucamera001-02
    Card #4
        Name: alsa_card.pci-0000_00_1f.3
    

    For me, it was the "LAPDOCK" that kept stealing my audio.

  2. create the systemd unit, to call pactl and disable the card:

    $ mkdir -p ~/.config/systemd/user
    $ nano ~/.config/systemd/user/disable-cards.service
    

    Add these contents, changing the ExecStart line to refer to the card you want to drop:

    [Unit]
    Description=Disable card
    
    [Service]
    Type=simple
    Restart=on-failure
    ExecStart=pactl set-card-profile "alsa_card.usb-DisplayLink_LAPDOCK_U3D2338486250-02" off
    
    [Install]
    WantedBy=default.target
    
  3. enable the service: systemctl --user enable disable-cards

Now when you restart systemd will keep trying to disconnect that card until it succeeds. There’s probably better systemd config to get this running after the monitor is plugged in; each device shows up as a "unit" (e.g. in the output of systemctl --user) so this could be improved to work as you plug/unplug things.

The other alternative is to change your /etc/pulse/default.pa to use module-switch-on-connect blacklist="REGEX_MATCHING_THE_CARD_NAME", but that didn’t work for me; there’s no way to customize module-switch-on-port-available, and I think that’s what was selecting it for me.

Answered By: Ryan Davis
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.