Hi, PulseAudio 8.0 introduced a vastly improved "module-switch-on-connect" which i like to use in KDE/Plasma 5. However, switching input to other devies as they get connected doesn't seem to work under Plasma 5. It works just fine under GNOME. So i investigated this issue a bit. It turns out that "start-pulseaudio-x11" detects a full KDE session and does some specific module loading: if [ x"$KDE_FULL_SESSION" = x"true" ]; then /usr/bin/pactl load-module module-device-manager "do_routing=1" > /dev/null fi In my case that very line was breaking module-switch-on-connect. Removing it made it work just as advertised in the PulseAudio 8.0 release notes. I would like to ask to remove that line in the next release of PulseAudio. Perhaps it had it's reasons to be there in the past, but i can't seem to find any reason for that to still be needed. These days Plasma 5 also has a default volume applet that is meant for PulseAudio management. In fact, kmix isn't even part of the default install anymore (on ArchLinux at least). Cheers, Mark
Is there someone from KDE upstream who might be able to tell us what their preference in this case is?
module-device-manager is used to set device priority per-role and can be configured from System Settings -> Multimedia -> Audio and Video. It has nothing to do with kmix nor plasma-pa. I would prefer to keep this module loaded from start-pulseaudio-x11 when KDE_FULL_SESSION is true, otherwise that settings page (and routing with the configured priority) will not work at all. I am maintainer of plasma-pa.
(In reply to David Rosca from comment #2) > module-device-manager is used to set device priority per-role and can be > configured from System Settings -> Multimedia -> Audio and Video. It has > nothing to do with kmix nor plasma-pa. > > I would prefer to keep this module loaded from start-pulseaudio-x11 when > KDE_FULL_SESSION is true, otherwise that settings page (and routing with the > configured priority) will not work at all. > > I am maintainer of plasma-pa. If that is how it should be done, then why doesn't input switching workout of the box with PLasma 5? That should just work, right?
(In reply to David Rosca from comment #2) > module-device-manager is used to set device priority per-role and can be > configured from System Settings -> Multimedia -> Audio and Video. It has > nothing to do with kmix nor plasma-pa. > > I would prefer to keep this module loaded from start-pulseaudio-x11 when > KDE_FULL_SESSION is true, otherwise that settings page (and routing with the > configured priority) will not work at all. > > I am maintainer of plasma-pa. So what's the alternative? At the moment this behaviour apparently breaks automatic input switching as users plug/unplug audio devices. This is horrendous for the majority of users. If the settings page doesn't work that it needs designing to, in the meantime it should be disabled by default (for the majority) and an option to enable it on for those users who need it.
@Störm Poorun Even if this weird module is pulled out from the pulseaudio startup, it still won't give input switching to usb devices. Unity (Ubuntu) loads the module-switch-on-connect and gives in my opinion the best user experience. That's for jack and usb headsets. Plasma 5 has more than one issue to fix when it comes to usb input audio devices. What does work with PLasma 5 at this moment is plugging in a jack headset. Then audio is redirected to that. The fixes it needs to do to get USB working as well is: 1.Get rid of the module-device-manager in pulseaudio startup. -- now it still doesn't load module-switch-on-connect since it's not loaded by default -- 2. Load module-switch-on-connect. Then it's on par with Unity in terms of loaded modules and gives a wonderful user experience when plugging in a usb headset. I'd also like to know why David Rosca is persistent in keeping this module. Even if the module would remain as is then your audio should still go to the usb headset when plugged in, so at the very least there would be a bug in the plasma-pa handling usb audio. Lastly, i just looked for the module-device-manager code. It's not made by plasma (my bad there). It's a module of pulseaudio. So it might be the case that module-switch-on-connect and module-device-manager conflict with each other somehow. In that case it's "exposed" by plasma, but not a bug in plasma. It might as well be exposed by any other platform that happened to load both modules. So, ehh, pulseaudio devs, could someone please load those modules at the same time, plugin a usb headset and debug if the issue is within those modules? I'd be happy to do that, but i have no clue where to start. Could it be a wrong priority order when "do_routing=1" is defined?
(In reply to markg85 from comment #5) > So, ehh, pulseaudio devs, could someone please load those > modules at the same time, plugin a usb headset and debug if the issue is > within those modules? I'd be happy to do that, but i have no clue where to > start. Could it be a wrong priority order when "do_routing=1" is defined? Unfortunately, there's no way to quickly test module-device-manager outside a KDE environment, because we lack command line tools to configure the device priorities. I can only say that I'm not surprised at all if module-device-manager doesn't play nicely with module-switch-on-connect, because both modules try to control the stream routing using different logic. The two modules aren't designed to be used together.
It would seem that module-device-manager would need to swallow module-switch-on-connect (and the KDE GUI updated to support policy setting for on-connect devices).
This bug now made it to Ubuntu 17.10: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1720519
Created attachment 135391 [details] [review] Patch Trivial patch attached. We should remove this workaround since it's breaking PulseAudio in Kubuntu. There are no known regressions with these lines removed.
I have now encountered this too after upgrading to Kubuntu 17.10: 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.
So KDE has started to use GConf for loading module-switch-on-connect. That's not good. The GConf interface will be removed as soon as someone ports paprefs away from it. The "should be loaded once at most" error will be gone in PulseAudio 12.0, but that doesn't change the fact that KDE is using an unsupported interface that may go away at any moment. This is the patch that removes the "should be loaded once at most" error, in case e.g. Kubuntu wants to apply it before the 12.0 release: https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=f0dfddead3cf1ff7af4c9c09a8027fde26065003 It's a bit unclear to me whether KDE plans to continue using module-device-manager. I hope David Rosca can comment on that. As long as KDE depends on that module, it can't be removed from start-pulseaudio-x11.
module-device-manager is used in KDE Phonon Audio and Video settings, which was already discussed about removing it in past and there are also some other issues with it. I maintain only plasma-pa, not the Phonon settings. If there really is some issue with it, I think it can be removed from start-pulseaudio-x11 and it will either be loaded by KDE or it will be the last push to phase out this settings from KDE. I personally am not against it. The current situation in plasma-pa (which I do maintain) is that we use GConf to permanently enable/disable modules (eg. to be remembered after pulseaudio restart). There have been voices against this too, so I would also like to ask here what should we use instead?
plasma-pa starts in the beginning of a login session, right? Maybe it could use libpulse to load module-switch-on-connect every time it starts? What to do with module-device-manager is up to KDE to decide. Who's maintaining the Phonon audio and video settings app?
Adding to my previous comment: it would be nice to have an API for managing the persistent module configuration, but no such API exists at the moment (apart from GConf). I hope we'll have such API some day (it's probably required for getting rid of GConf anyway).
(In reply to Tanu Kaskinen from comment #13) > plasma-pa starts in the beginning of a login session, right? Maybe it could > use libpulse to load module-switch-on-connect every time it starts? This should work, I was hoping for more elegant solution though :) > What to do with module-device-manager is up to KDE to decide. Who's > maintaining the Phonon audio and video settings app? Harald Sitter, though I'm not sure if he still is.
(In reply to David Rosca from comment #15) > (In reply to Tanu Kaskinen from comment #13) > > plasma-pa starts in the beginning of a login session, right? Maybe it could > > use libpulse to load module-switch-on-connect every time it starts? > This should work, I was hoping for more elegant solution though :) David, so we have a downstream KDE Bugzilla ticket tracking this?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/509.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.