Selected output device in Sound settings is not persisted across restarts

Bug #1924852 reported by Filippo Ghibellini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-control-center (Ubuntu)
Invalid
Low
Unassigned
pulseaudio (Ubuntu)
Incomplete
Low
Unassigned

Bug Description

# Introduction

My computer has multiple audio devices, so I had to select the correct one in the "Sound" section of "Settings". This worked fine, except that whenever I restart the computer this setting resets to the original one. Effectively I have to visit the sound settings on each system startup in order to hear anything.

# How to reproduce

1. have system with multiple audio outputs
2. open sound settings
3. select non-default output device
4. restart computer
5. open sound settings

# Expected result

Selected audio device is the same as the one selected right before restart.

# Actual result

The active output device is the original default one (i.e. not the one that we selected).

# System information

$ lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04

$ apt-cache policy gnome-control-center
gnome-control-center:
  Installed: 1:3.36.5-0ubuntu1
  Candidate: 1:3.36.5-0ubuntu1
  Version table:
 *** 1:3.36.5-0ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1:3.36.1-1ubuntu5 500
        500 http://de.archive.ubuntu.com/ubuntu focal/main amd64 Packages

Tags: focal
Revision history for this message
Filippo Ghibellini (f-ghibellini) wrote :

It seems that whenever you connect a new device it is set as the currently active one.
I suspect the device selected as active after the restart is simply the last one to load.

I just tried this with 3 devices:

1. at first have device A and B connected to the computer and have B selected as active
2. connect new device C
3. I can see C becoming automatically the active device
4. disconnect device C from computer
5. A automatically becomes the active device

all of the above was monitored by having the "Sound" panel of gnome-control-center opened and watching the "Output" > "Output Device" Combo-box changing.

Revision history for this message
Filippo Ghibellini (f-ghibellini) wrote :
Download full text (4.7 KiB)

# Temporary Workaround for others who face this

Get the list of available sinks:

```
$ pactl list sinks

Sink #1
 State: IDLE
 Name: alsa_output.usb-Audio_Technica_Corp_ATR2100x-USB_Microphone-00.analog-stereo
 Description: ATR2100x-USB Microphone Analog Stereo
 Driver: module-alsa-card.c
 Sample Specification: s16le 2ch 44100Hz
 Channel Map: front-left,front-right
 Owner Module: 26
 Mute: no
 Volume: front-left: 5282 / 8% / -65.62 dB, front-right: 49145 / 75% / -7.50 dB
         balance 0.89
 Base Volume: 65536 / 100% / 0.00 dB
 Monitor Source: alsa_output.usb-Audio_Technica_Corp_ATR2100x-USB_Microphone-00.analog-stereo.monitor
 Latency: 34631 usec, configured 40000 usec
 Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
 Properties:
  alsa.resolution_bits = "16"
  device.api = "alsa"
  device.class = "sound"
  alsa.class = "generic"
  alsa.subclass = "generic-mix"
  alsa.name = "USB Audio"
  alsa.id = "USB Audio"
  alsa.subdevice = "0"
  alsa.subdevice_name = "subdevice #0"
  alsa.device = "0"
  alsa.card = "3"
  alsa.card_name = "ATR2100x-USB Microphone"
  alsa.long_card_name = "Audio Technica Corp ATR2100x-USB Microphone at usb-0000:08:00.3-3.3, full speed"
  alsa.driver_name = "snd_usb_audio"
  device.bus_path = "pci-0000:08:00.3-usb-0:3.3:1.0"
  sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:08:00.3/usb3/3-3/3-3.3/3-3.3:1.0/sound/card3"
  udev.id = "usb-Audio_Technica_Corp_ATR2100x-USB_Microphone-00"
  device.bus = "usb"
  device.vendor.id = "0909"
  device.vendor.name = "Audio-Technica Corp."
  device.product.id = "004d"
  device.product.name = "ATR2100x-USB Microphone"
  device.serial = "Audio_Technica_Corp_ATR2100x-USB_Microphone"
  device.form_factor = "microphone"
  device.string = "front:3"
  device.buffering.buffer_size = "352800"
  device.buffering.fragment_size = "176400"
  device.access_mode = "mmap+timer"
  device.profile.name = "analog-stereo"
  device.profile.description = "Analog Stereo"
  device.description = "ATR2100x-USB Microphone Analog Stereo"
  module-udev-detect.discovered = "1"
  device.icon_name = "audio-input-microphone-usb"
 Ports:
  analog-output-headphones: Headphones (priority: 9900)
 Active Port: analog-output-headphones
 Formats:
  pcm

Sink #2
 State: SUSPENDED
 Name: alsa_output.pci-0000_08_00.4.analog-stereo
 Description: Starship/Matisse HD Audio Controller Analog Stereo
 Driver: module-alsa-card.c
 Sample Specification: s16le 2ch 44100Hz
 Channel Map: front-left,front-right
 Owner Module: 27
 Mute: no
 Volume: front-left: 19660 / 30% / -31.37 dB, front-right: 19660 / 30% / -31.37 dB
         balance 0.00
 Base Volume: 65536 / 100% / 0.00 dB
 Monitor Source: alsa_output.pci-0000_08_00.4.analog-stereo.monitor
 Latency: 0 usec, configured 0 usec
 Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
 Properties:
  alsa.resolution_bits = "16"
  device.api = "alsa"
  device.class = "sound"
  alsa.class = "generic"
  alsa.subclass = "generic-mix"
  alsa.name = "ALC1220 Analog"
  alsa.id = "ALC1220 Analog"
  alsa.subdevice = "0"
  alsa.subdevice_name = "subdevice #0"
  alsa.device = "0"
  alsa.card = "2"
  alsa.card_name = "HD-Audio Generic"
  alsa.long_card_n...

Read more...

tags: added: focal
Revision history for this message
Sebastien Bacher (seb128) wrote :

The settings only apply the changes, they have no backend side aiming at enforcing the changes again after a restart, it's a pulseaudio problem rather

Changed in gnome-control-center (Ubuntu):
importance: Undecided → Low
status: New → Invalid
Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you give some details on what output you select and which one is on after restart? There a known problems around HDMI handling, unsure if that's what you are seeing though

Changed in pulseaudio (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Filippo Ghibellini (f-ghibellini) wrote :

In my specific case I have two output devices:

1. an audio card integrated in the motherboard
2. and an external microphone that has a monitoring output jack

Each of them results in two selectable options (there's always a second "Digital Output (S/PDIF)" prefixed one) in the Ubuntu settings for a total of 4.

After startup the usb microphone is selected as the output device so I have to switch it to the integrated sound card analog output.

(you can see details about each device in the `pactl list sinks` output in my "workaround" comment)

Also whenever I connect my guitar amp (also acts as sound output) it is automatically selected as the active device and disconnecting it results in the microphone being selected again no matter what I had selected before connecting the amp.

There is no HDMI involved anywhere.

Revision history for this message
Sebastien Bacher (seb128) wrote :

it sounds similar to bug #1877194

could you try if commenting out switch-on-connect in /etc/pulse/default.pa fixes the issue for you?

Revision history for this message
Filippo Ghibellini (f-ghibellini) wrote :

Yes, it did fix the issue.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.