How-to: Setup default audio output Ubuntu (Pulseaudio)

I’m currently using Ubuntu 17.04 on my PC, which runs Kodi. I have 2 screens attached to it: a 27″ 1080p PC monitor (via DVI), and a 50″ 4K TV (via HDMI).
At the moment I don’t have a dedicated graphics card, and both video outputs are driven by my motherboard (Gigabyte with Intel Z77 chipset).

I also have a JVC HiFi Stereo connected to the Digital (S/PDIF) output of my PC, which I would like to use as the default audio source for my PC.

Since I’ve been struggling to find a setting that works for my configuration, here’s how I finally managed, in 4 easy steps.

In my configuration, Ubuntu lists 2 audio output sources:

  • HDMI/DisplayPort
  • Digital Output (S/PDIF)

1) Let’s use aplay first to identify which card/device we want to use:

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: VT2020 Analog [VT2020 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: VT2020 Digital [VT2020 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: VT2020 Alt Analog [VT2020 Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0

In my case it’s card 0 (I only have the integrated sound card), device 1 (Digital output).

2) Now let’s modify the default setting by editing /etc/pulse/

In the modules section (towards the bottom of the file), let’s add:

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply
load-module module-alsa-sink device=hw:0,1

Notice how 0 and 1 are the values we retrieved previously: these depend entirely on your specific setup.

Now save the file and restart your PC.

3) Open a terminal and run the following command:

pacmd list-sinks | less
2 sink(s) available.
* index: 1
suspend cause: IDLE
priority: 9950
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 2
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
used by: 0
linked by: 0
configured latency: 0.00 ms; range is 0.50 .. 371.52 ms
module: 21
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix" = "VT2020 Digital" = "VT2020 Digital"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "1"
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0xf7d10000 irq 28"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1b.0"
sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
device.bus = "pci" = "8086" = "Intel Corporation" = "1e20" = "7 Series/C216 Chipset Family High Definition Audio Controller"
device.form_factor = "internal"
device.string = "hw:0,1"
device.buffering.buffer_size = "65536"
device.buffering.fragment_size = "32768"
device.access_mode = "mmap+timer"
device.description = "Built-in Audio"
device.icon_name = "audio-card-pci"
index: 2

4) Now we know our newly added sink is number 1. All we have to do is set it up as default by editing  /etc/pulse/ again. This time let’s add this line at the bottom:

### Make some devices default
#set-default-sink output
#set-default-source input
set-default-sink 1

That’s it 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: