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?
Just set the soundcard's profile to "off", for example:
pavucontrol
can do this is well in its "Configuration" tab: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.
in 18.10 i was able to fix it
file /etc/modprobe.d/blacklist.conf
add
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).
3. The Elegant Way
Another more elegant way to get audio working is to enable "Simultaneous Output" from paprefs as depicted here:
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.
I found this suggestion on Launchpad
which states you should edit the pulseaudio settings
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 sectionsname
field.I checked and the approach should still be valid in 10.10
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:
use
lsusb
to identify the vendor/product id of the device you want to ignorethe
ID
part gives us the magic numberscreate 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:
I chose the
80-
prefix for the filename arbitrarily. If you any pulseaudio related rules, make sure your new file starts with a lower numberreboot 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
andmodule-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.find the name of the card you don't want; hopefully the name should be enough to tell which one:
For me, it was the "LAPDOCK" that kept stealing my audio.
create the systemd unit, to call
pactl
and disable the card:Add these contents, changing the
ExecStart
line to refer to the card you want to drop: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 ofsystemctl --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 usemodule-switch-on-connect blacklist="REGEX_MATCHING_THE_CARD_NAME"
, but that didn't work for me; there's no way to customizemodule-switch-on-port-available
, and I think that's what was selecting it for me.As a workaround please disable that feature by editing
/etc/pulse/default.pa
and comment out (with#
) or remove:and reboot the system.