Debian Jessie 8 + MATE Desktop - Default audio output keeps resetting

Note: This is not completely necessary for Debian Stretch 9, it follows /etc/pulse/default.pa as it should, see note about pulseaudio-equalizer how to set the sinks there.

Using the default audio output is no problem on Debian Jessie 8. It works as expected.

The problem comes when you have more than one audio output and want to use one that is not the default one, because everytime you restart the system (on a laptop for example) you are back to the default one. Very annoying.

Messing with the configs in /etc/pulse/ has not worked for me.

What did however was to put a line in the startup programs that selects the desired card on boot.

These instructions apply to Debian Jessie 8 with MATE Desktop, you may have to change it for other distros and desktops.

1. Select the sound card you want to use, go to System->Settings->Audio->Output tab and then tick the one you like.

2. Open a terminal and list the outputs, running a terminal as regular user, _not_ running as root:

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

You should now get a list that looks like this:

  * index: 0
	name: <alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00-CODEC.analog-stereo>
    index: 1
	name: <alsa_output.pci-0000_00_1b.0.analog-stereo>

The name between < and > is what you want. The star (*) shows which one that is currently used.

3. Create a file somewhere in the system, for example in /var/scripts and maybe name it set_default_audio.sh

4. Fill the file with this:

sleep 10
pacmd set-default-sink The-Name-Of-The-Output

Replace The-Name-Of-The-Output with the name in the list in previous steps without < and >.
For example:

pacmd set-default-sink alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00-CODEC.analog-stereo

3. Go to System->Settings->Startup programs

4. Create a new item with the following values:

Name: Pulseaudio - USB Default output sink

Command: /bin/bash /var/scripts/set_default_audio.sh &
(Replace file location with where you put the file created above)

Comment: Set default output sink

Done! What now will happen on boot is that the script will be forked into background and not halt boot (because of &), wait some seconds, then select the sound card.



Set default input

You may experience the same problem when it comes to inputs, like you want to use an external webcam and have it's microphone as the default source.

The procedure is almost the same, but this time you want to list and set source.

Get the sources:

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

(You may need to run pacmd list-sources to figure out which source you want.)

Then you set it like this:

pacmd set-default-source The-Name-Of-The-Source

Replace  The-Name-Of-The-Source with the name of the source, example:

pacmd set-default-source alsa_input.usb-003024-05-0304304.analog-mono

Put it in the same bash file as you made for the output above.

This is a personal note. Last updated: 2017-08-17 09:21:34.



GitHub

My

GitLab

My

LinkedIn

My

Klebe.se

Don't forget to pay my friend a visit too. Joakim