KDE/Kubuntu: Module "module-switch-on-connect" should be loaded once at most. Refusing to load.

Bug #1720519 reported by ben van 't ende
218
This bug affects 44 people
Affects Status Importance Assigned to Milestone
PulseAudio
Fix Released
Unknown
pulseaudio (Ubuntu)
Won't Fix
High
Unassigned

Bug Description

Pulseaudio daemon does not start after the update to Kubuntu 17.10 beta2, because the module fails to load although it is there.

From 'pulseaudio -vv'

E: [pulseaudio] module.c: Module "module-switch-on-connect" should be loaded once at most. Refusing to load.
E: [pulseaudio] main.c: Module load failed.
E: [pulseaudio] main.c: Failed to initialize daemon.

PS sorry I am not a seasoned bug reporter. Let me know if I can provide more info.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: pulseaudio 1:10.0-2ubuntu3
ProcVersionSignature: Ubuntu 4.13.0-12.13-generic 4.13.3
Uname: Linux 4.13.0-12-generic x86_64
ApportVersion: 2.20.7-0ubuntu1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/pcmC0D0p: ben 2809 F...m chrome
 /dev/snd/controlC0: ben 2809 F.... chrome
 /dev/snd/timer: ben 2809 f.... chrome
CurrentDesktop: KDE
Date: Sat Sep 30 11:20:55 2017
InstallationDate: Installed on 2017-04-07 (175 days ago)
InstallationMedia: Kubuntu 17.04 "Zesty Zapus" - Beta amd64 (20170321)
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
SourcePackage: pulseaudio
UpgradeStatus: Upgraded to artful on 2017-09-30 (0 days ago)
dmi.bios.date: 10/29/2015
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P1.10
dmi.board.name: B150M-ITX
dmi.board.vendor: ASRock
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP1.10:bd10/29/2015:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rnB150M-ITX:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.family: To Be Filled By O.E.M.
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.

Revision history for this message
ben van 't ende (benvantende) wrote :
Revision history for this message
ben van 't ende (benvantende) wrote :

Heyla,

After reading up some more I removed alsa and pulseaudio and reinstalled like this:

sudo apt-get remove --purge alsa-base pulseaudio

Now install again Alsa and Pulse Audio:

sudo apt-get install alsa-base pulseaudio

Then, reload Alsa:

sudo alsa force-reload

That made audio up and running again!

Revision history for this message
ben van 't ende (benvantende) wrote :

fixed myself by reinstalling pulseaudio

Changed in pulseaudio (Ubuntu):
assignee: nobody → ben van 't ende (benvantende)
Revision history for this message
David Eichelsdörfer (themysi) wrote :

had the same problem and could only fix it by removing the line
load-module module-switch-on-connect
from
/etc/pulse/default.pa

Revision history for this message
ben van 't ende (benvantende) wrote : Re: [Bug 1720519] Re: Module "module-switch-on-connect" should be loaded once at most. Refusing to load.

Good to know. Honestly for some weird reason the same bug re-appeared. I
had to do the same again to solve that, but also removed Discord
<https://discordapp.com/>. I vaguely remembered reading somewhere that
could cause problems. For now all is fine.

On Mon, 2 Oct 2017 at 21:41 David Eichelsdörfer <email address hidden>
wrote:

> had the same problem and could only fix it by removing the line
> load-module module-switch-on-connect
> from
> /etc/pulse/default.pa
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1720519
>
> Title:
> Module "module-switch-on-connect" should be loaded once at most.
> Refusing to load.
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1720519/+subscriptions
>
--
ben van 't ende
Web:* ben.vanten.de <http://ben.vanten.de/>*
Tel: +31 (0)6 47074151
Email: <email address hidden>
Social: benvantende

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Module "module-switch-on-connect" should be loaded once at most. Refusing to load.

pulseaudio 1:10.0-2ubuntu3 does only load that module once. So it sounds like some other config file is getting loaded with it in your case. Perhaps Kubuntu-specific? Can anyone with this bug search their /etc and ~/ and find out all the locations where switch-on-connect is loaded?

grep -r 'load-module module-switch-on-connect' /etc

Changed in pulseaudio (Ubuntu):
assignee: ben van 't ende (benvantende) → nobody
status: New → Incomplete
assignee: nobody → Daniel van Vugt (vanvugt)
assignee: Daniel van Vugt (vanvugt) → nobody
Revision history for this message
Joni Hyttinen (jonihyt) wrote :

This would seem to happen because start-pulseaudio-x11 tries to load module-device-manager that unfortunately conflicts with module-switch-on-connect.

https://bugs.freedesktop.org/show_bug.cgi?id=95104

summary: - Module "module-switch-on-connect" should be loaded once at most.
- Refusing to load.
+ KDE/Kubuntu: Module "module-switch-on-connect" should be loaded once at
+ most. Refusing to load.
Changed in pulseaudio (Ubuntu):
status: Incomplete → Confirmed
importance: Undecided → High
tags: added: pulse11
Revision history for this message
Harald Albrecht (harald-albrecht) wrote :

Same bug over here; commands given in #2 helped me to get audio up and running again.

Revision history for this message
Invincible (ventsislav-mladenov) wrote :

Fixed like in #4 by commenting load-module module-switch-on-connect, but this may brake functionality with hot connecting devices.

Revision history for this message
Rik Mills (rikmills) wrote :

Possibly introduced by:

https://launchpad.net/ubuntu/+source/pulseaudio/1:10.0-2ubuntu1

* Enable modules that needn't be disabled:
  - module-role-cork: Now enabled per upstream defaults (LP: #1701688)
  - module-switch-on-connect: Enabled for seamless hotplugging (LP: #1702794)

Revision history for this message
Horst Schirmeier (horst) wrote :

I'm seeing this as well on a machine with a clean 17.04 installation that was upgraded to 17.10, using KDE (sound: Intel HDA). Steps in comment #2 fixed this problem, at least temporarily.

Revision history for this message
Horst Schirmeier (horst) wrote :

Update: After reinstalling pulseaudio, alsa-base, pulseaudio-module-bluetooth and plasma-pa (for KDE's volume control applet), the problem reappeared. Commenting out "load-module module-switch-on-connect" in /etc/pulse/default.pa (see comment #4) seems to fix the issue permanently; the module still seems to be loaded due to some other means of triggering the load (see output of: pactl list modules).

Changed in pulseaudio:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Juancho (juan-baptiste-0) wrote :

I had the same issue and workaround from #2 worked, thanks !

Revision history for this message
Imre Széll (konzerwe) wrote :

After upgrading from 17.04 I had this issue. Neither could I connect to an external audio device via Bluetooth.

I started pulseaudio in verbose mode (-vvv) and found that the module "module-switch-on-connect" is already loaded when it is tried to load again. I commented out the following lines in /etc/pulse/default.pa:

.ifexists module-switch-on-connect.so
load-module module-switch-on-connect
.endif

This workaround solves the problem permanently. I was able to use my USB Bluetooth adapter to connect external playback device.

The module "module-switch-on-connect" could be loaded by default or some dependency...

Changed in pulseaudio (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in pulseaudio (Ubuntu):
status: Confirmed → In Progress
Changed in pulseaudio (Ubuntu):
status: In Progress → Triaged
assignee: Daniel van Vugt (vanvugt) → nobody
Revision history for this message
Oded Arbel (oded-geek) wrote :

The problem is in an incorrect interaction between KDE's KCM audio configuration module and PulseAudio's default configuration in Ubuntu:

* As per bug #1702794, the default PA configuration on Ubuntu enables the "switch-on-connect" module by default (in /etc/pulse/default.pa)
* "switch-on-connect" can only be loaded once, and if it gets loaded a second time, PulseAudio terminates.
* The KCM module for audio configuration has an option under "Advanced" to "Automatically switch all running streams when a new output becomes available". This checkbox updates the PulseAudio gconf configuration /system/pulseaudio/modules/switch-on-connect/enabled and sets it to "true". What that is set, when the PA gconf module gets loaded, it tries to load the switch-on-connect module again - cause PA to crash.

The fix should be - IMHO:
 - in PulseAudio don't crash when switch-on-connect gets loaded a second time, just ignore it as it is 99.99999% a configuration mistake and should not be fatal.
 - in PulseAudio gconf module, when deciding if to load modules specified in the gconf configuration, don't try to load modules already loaded.
 - in the Audio Volume KCM module, check the status of switch-on-connect in PA's default configuration and if it is enabled, show the "Automatically switch all running streams..." checkbox as checked and disabled. Only have the checkbox editable if the default PA configuration does not have switch-on-connect enabled.

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

I agree we need a proper fix like that.

Further discussion about this issue probably should go upstream where the fix would ideally be applied first. If not here:
  https://bugs.freedesktop.org/show_bug.cgi?id=95104
then in another upstream bug.

Revision history for this message
Woden Cafe (wodencafe) wrote :

I have this bug now too, seems to happen every time I restart.

Everything was fine until upgrading to 17.10, which caused this and several other unrelated bugs.

This kind of stuff makes me very wary to doing release upgrades anymore.

E: [pulseaudio] module.c: Module "module-switch-on-connect" should be loaded once at most. Refusing to load.
E: [pulseaudio] main.c: Module load failed.
E: [pulseaudio] main.c: Failed to initialize daemon.

Revision history for this message
michael (reeves-87) wrote :

Attached is a patch from upstream made against Pulse Audio 12. The patch makes attempted to load an already loaded load once module non-fatal. This will enables the PulseAudio deamon to start normally under to conditions described in this bug. There will still be a warning message in the system logs however.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Upstream patch from Pulse Audio 12" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Shaheed Haque (srhaque-i) wrote :

The workaround in #4 works-for-me.

Revision history for this message
William Ivanski (william-ivanski) wrote :

Workaround in #4 works for me, but only for the computer-integrated speaker. Integrated microphone and also headsets don't work any more.

Revision history for this message
José Manuel (manuelvsqz) wrote :

I experienced this bug too. #2 fixes the problem but also removes plasma-pa. When plasma-pa is reinstalled it breaks pulseaudio again.

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

I actually tried removing the module with the upgrade to PA 11.1 in Ubuntu 18.04. The release notes for PA 11.0 suggested that switch-on-connect would not be required, but my testing shows it still is needed for both Bluetooth and USB audio devices. Sorry about that.

Revision history for this message
ALU (c-launchpadmail) wrote :

After upgrading from 17.04 to 17.10 I also had this issue with error:

> pulseaudio[6267]: Module "module-switch-on-connect" should be loaded once at most. Refusing to load.

Fixed like in #4 by commenting load-module module-switch-on-connect out of /etc/pulse/default.pa

Have not tried any plug-in-devices to see if this fix affects their usage.

Revision history for this message
Joshua Salazar (joshua-m-salazar) wrote :

By commenting the lines from /etc/pulse/default.pa

#.ifexists module-switch-on-connect.so
#load-module module-switch-on-connect
#.endif

And reinstalling pulse audio and alsa-base as here:

apt-get remove --purge pulseaudio
rm -rf /etc/pulse
apt-get install pulseaudio
reboot

I managed to get the audio again, but I cannot control it with the volume controls of my keyboard, neither with thw sound tray icon(that completely dissapeared)

Revision history for this message
DimanNe (dimanne) wrote :

Thank you, benvantende! Reinstalling pulseaudio has helped me too

Revision history for this message
ben van 't ende (benvantende) wrote : Re: [Bug 1720519] Re: KDE/Kubuntu: Module "module-switch-on-connect" should be loaded once at most. Refusing to load.

ahhh cool that helped. I have updated to 18.04 last week and did not come
across any problems any more.

gRTZ ben

On Tue, 27 Mar 2018 at 11:20 DimanNe <email address hidden> wrote:

> Thank you, benvantende! Reinstalling pulseaudio has helped me too
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1720519
>
> Title:
> KDE/Kubuntu: Module "module-switch-on-connect" should be loaded once
> at most. Refusing to load.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/pulseaudio/+bug/1720519/+subscriptions
>
--
ben van 't ende
Web:* ben.vanten.de <http://ben.vanten.de/>*
Tel: +31 (0)6 47074151
Email: <email address hidden>
Social: benvantende

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

Are you saying this bug was fixed somewhere in 18.04?

Changed in pulseaudio (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Nate Graham (pointedstick) wrote :

I think so, yes.

Revision history for this message
Kai Stian Olstad (kai-stian-olstad) wrote :

I also had this problem after upgrading to 17.10 and solved it with commenting out load-module module-switch-on-connect in /etc/pulse/default.pa.

When upgrading to 18.04 I opt for replacing the /etc/pulse/default.pa so the setting is back, but I don't have this issue, so it's fixed for me in 18.04.

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

The error message still exists in the latest (12.2) PulseAudio:

  pa_log("Module \"%s\" should be loaded once at most. Refusing to load.", name);
  errcode = -PA_ERR_EXIST;
  goto fail;

So if it seems fixed then that probably means the KDE/Kubuntu side got fixed.

Changed in pulseaudio (Ubuntu):
status: Incomplete → Won't Fix
Revision history for this message
accnetdev (accnetdev) wrote :

It is not fixed in 18.04.
My Kubuntu 18.04 worked with no sound issue up to mid may 2019.
One morning, no longer sound !
I have tested all the solution proposed with no success...
I think It Would be useful to create another bug linked to 18.04 LTS.

Revision history for this message
accnetdev (accnetdev) wrote :

I know that if I reinstall from scratch my Kubuntu 18.04, it would fix the issue but it is not acceptable for the reliability of Linux comparing to MacOS or Windows to have to do this.

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

Ubuntu 18.04 is actually the only current release that ships an old version of PulseAudio.

Does anyone see this bug in Ubuntu 18.10, 19.04 or 19.10 ?

Changed in pulseaudio:
importance: Medium → Unknown
status: Confirmed → Unknown
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also, progress on this issue is now being made upstream:

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

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

Hi,

I use Linux from about 1996 and Windows from the very first version 2.x
Both OS have become more reliable and powerfull.

For Ubuntu the worst weaknesses are related to multimedia and conflicts between devs : Graphics cards, sound issues and many other boring things are really where Canonical and the linux community have to work a lot.

In too much cases, we have to reinstall the whole system (backing up and reinstalling all our specific configurations and apps) to fix these kind of issues, to retrieve a clean Ubuntu OS.

This is what I am going to do one more time now, and it is a time consuming activity, that I would appreciate not to have to do...

I rarely experience this on Windows or MacOS PCs, in these OS uninstalling drivers or apps, cleaning and reinstalling fixes most often these kind of multimedia issues.

On most of my PCs, I use Kubuntu 18.04 as KDE is my favourite Desktop Environment.

Thanks for reading.

Changed in pulseaudio:
status: New → Fix Released
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.