switch-on-connect mistakes startup for USB hotplug, so seemingly ignores the old default device on reboot

Bug #1877194 reported by Ma H
92
This bug affects 16 people
Affects Status Importance Assigned to Milestone
PulseAudio
New
Unknown
pulseaudio (Ubuntu)
Triaged
Low
Unassigned
Jammy
Confirmed
Undecided
Unassigned
Kinetic
Won't Fix
Low
Unassigned
ubuntu-settings (Ubuntu)
Invalid
Undecided
Unassigned
Jammy
Invalid
Undecided
Unassigned
Kinetic
Invalid
Undecided
Unassigned

Bug Description

Similar to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1847570

Only difference is that it does not reset to HDMI output, but to one of my USB-outputs. It does not respect the change I made after reboot.

In short:
1. Boot system
2. "Analogue Output - RODE NT-USB" is selected by default. I want to use "Line Out - Built-in Audio", which I choose.
3. Reboot.
4 Output device is now back to "Analogue Output - RODE NT-USB".

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: pulseaudio 1:13.99.1-1ubuntu3
ProcVersionSignature: Ubuntu 5.4.0-29.33-generic 5.4.30
Uname: Linux 5.4.0-29-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC2: marcus 1604 F.... pulseaudio
 /dev/snd/controlC0: marcus 1604 F.... pulseaudio
 /dev/snd/controlC1: marcus 1604 F.... pulseaudio
 /dev/snd/pcmC1D0c: marcus 1604 F...m pulseaudio
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Wed May 6 23:40:08 2020
InstallationDate: Installed on 2020-05-06 (0 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
SourcePackage: pulseaudio
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 12/27/2017
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 3703
dmi.board.asset.tag: Default string
dmi.board.name: MAXIMUS VIII HERO
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Default string
dmi.chassis.type: 3
dmi.chassis.vendor: Default string
dmi.chassis.version: Default string
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr3703:bd12/27/2017:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKCOMPUTERINC.:rnMAXIMUSVIIIHERO:rvrRev1.xx:cvnDefaultstring:ct3:cvrDefaultstring:
dmi.product.family: To be filled by O.E.M.
dmi.product.name: System Product Name
dmi.product.sku: SKU
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Ma H (mah-dvlpr) wrote :
description: updated
description: updated
Ma H (mah-dvlpr)
description: updated
Ma H (mah-dvlpr)
description: updated
Ma H (mah-dvlpr)
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

We configure PulseAudio by default to automatically choose hotplugged devices so it might be thinking booting with USB counts as hotplugging. To avoid this you should just be able to comment out:

  load-module module-switch-on-connect

from /etc/pulse/default.pa

Changed in pulseaudio (Ubuntu):
status: New → Incomplete
Revision history for this message
Ma H (mah-dvlpr) wrote :

Hi Daneil!

Commenting out "load-module module-switch-on-connect" in /etc/pulse/default.pa did indeed work.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, thanks. So it's kind of working as designed and kind of not...

If you would like to get this fixed then please open a new bug upstream:

  https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues

with a title like:

  switch-on-connect mistakes startup for USB hotplug

Changed in pulseaudio (Ubuntu):
importance: Undecided → Low
summary: - Selected audio output device not persistent between reboots (Resets to
- USB-device)
+ switch-on-connect mistakes startup for USB hotplug
Changed in pulseaudio (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Ma H (mah-dvlpr) wrote : Re: switch-on-connect mistakes startup for USB hotplug

Seems reasonable.

Created an issue: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/886

Thank you for the help.

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

Thanks

Revision history for this message
Adam Niedling (krychek) wrote :
Revision history for this message
Ma H (mah-dvlpr) wrote :

Yes, I thought so too. I even linked it in the description. Since the issue persists after the supposed fix however, it is still an issue.

Matthew M. Dean (fireculex), for example, also still has issues (see the other ticket, second to last comment).

As mentioned by Daniel van Vugt (vanvugt), on the last comment, if there still are issues -> create a new ticket, which I did.

I guess the major difference is that in my case it is a USB-device and not an HDMI.

tags: added: groovy
summary: - switch-on-connect mistakes startup for USB hotplug
+ switch-on-connect mistakes startup for USB hotplug, so seemingly ignores
+ the old default device on reboot
tags: removed: groovy
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1877194

tags: added: iso-testing
Revision history for this message
Steve Langasek (vorlon) wrote :

This behavior particularly affects Raspberry Pis, where USB is the only bus available for a lot of devices and treating this as "hotplug" gives wrong results.

That doesn't mean the default should change for pulseaudio on the desktop in general, but should somehow be treated in a hardware-specific manner.

I would suggest making /etc/pulse/default.pa key its loading of module-switch-on-connect on the absence of a flag file, which could then be provided by raspberry pi images.

I'm going to open a task on ubuntu-settings for the moment, since it provides ubuntu-raspi-settings that seems the most likely existing package to attach the raspi side of this to.

Changed in ubuntu-settings (Ubuntu):
assignee: nobody → Dave Jones (waveform)
tags: added: rls-jj-incoming
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm not sure we even need switch-on-connect anymore. It was introduced as a patch in 2017 (bug 1702794) at the request of Will Cooke but I suspect later upstream changes within the module logic like module-switch-on-port-available might suffice now.

Changed in pulseaudio:
status: Unknown → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

Kinetic is switching to pipewire, unsure if the issue is already there with it, could someone try?

Changed in pulseaudio (Ubuntu Kinetic):
assignee: nobody → Dave Jones (waveform)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

switch-on-connect is a feature of PulseAudio only so we should probably say "Won't Fix" in kinetic.

tags: removed: rls-jj-incoming
Revision history for this message
Dave Jones (waveform) wrote :

@seb128 tested with pipewire on kinetic with a Pi 4B and it correctly selects the HDMI out by default both on initial setup and after a few reboots. So, looks like this could be "invalid" on kinetic, at least for the Raspberry Pi case. Would be useful to double-check that on PC hardware too, obviously.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

We don't need to check. "switch-on-connect" is a feature of PulseAudio only. Even if a similar bug was ever seen in PipeWire, it would get a seperate bug report.

Changed in pulseaudio (Ubuntu Kinetic):
status: Triaged → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-settings (Ubuntu):
status: New → Confirmed
Revision history for this message
Dave Jones (waveform) wrote :

Still a problem on jammy, and removing switch-on-connect does fix things there.

The result of that change is that plugging in a new (never seen before) USB device does *not* automatically switch to it, but once the device has been selected as the output, it will subsequently be automatically selected when plugged in (or at least that's my experience on my PC).

And it also clears up the "always selects headphones output" issue on the Pi. I'll target this to jammy given we're still getting duplicate reports about it (LP: #1995459 is the latest)

Dave Jones (waveform)
Changed in ubuntu-settings (Ubuntu):
status: Confirmed → Invalid
Changed in ubuntu-settings (Ubuntu Jammy):
status: New → Invalid
Changed in ubuntu-settings (Ubuntu Kinetic):
status: Confirmed → Invalid
Changed in pulseaudio (Ubuntu Jammy):
status: New → Confirmed
Changed in pulseaudio (Ubuntu Kinetic):
assignee: Dave Jones (waveform) → nobody
Changed in ubuntu-settings (Ubuntu):
assignee: Dave Jones (waveform) → nobody
Changed in ubuntu-settings (Ubuntu Kinetic):
assignee: Dave Jones (waveform) → nobody
Dave Jones (waveform)
Changed in pulseaudio (Ubuntu):
assignee: Dave Jones (waveform) → nobody
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.