Bug 433246

Summary: Pipewire is missing pulseaudio modules
Product: [Plasma] plasma-pa Reporter: Matthias Mueller <mat.mueller>
Component: generalAssignee: David Rosca <nowrep>
Status: RESOLVED FIXED    
Severity: normal CC: bugs.kde.org.facelift226, christophe, katyaberezyaka, lee295012, nate, nicolas.fella, plasma-bugs, rdieter
Priority: NOR    
Version: 5.20.90   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In: 5.22

Description Matthias Mueller 2021-02-19 12:31:41 UTC
After switching to pipewire to replace pulse i have one annoying issue: 
I can no longer set "Automatically switch all running streams when a new output becomes available" in the KDE sound settings - it’s greyed out with the message "needs the pulse-audio module "module-gsettings" "

According to https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/771 module-gsettings is not implemented in pipewire (yet).

I've not found any other reports of this issue, so i thought it wouldn't hurt to inform you, too, in case anybody else encounters this - or maybe it even is easy to remove the dependency to this module?



KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 1 Nate Graham 2021-02-19 16:55:25 UTC
Well, if there's no equivalent pipewire module, then this setting won't work, and it makes sense that it's grayed out, no?
Comment 2 Matthias Mueller 2021-02-19 18:57:03 UTC
Absolutely - i'm just not sure if/when the pipewire folks will implement that and as pipewire is destined to be the new standard some time i guess this should at least be documented :)
Comment 3 Nate Graham 2021-02-19 19:59:27 UTC
Any chance you could go ask them and find out their plans? That would be helpful. Otherwise I'm not sure what we would be able to document. :)
Comment 4 Matthias Mueller 2021-02-20 10:55:41 UTC
Yeah the question is still open at the linked gitlab, i'll report back here as soon as i've got info when/if gsettings will be implemented or if there is an alternative way!
Comment 5 Nicolas Fella 2021-02-20 11:02:32 UTC
module-gsettings is just our way of making sure module-combine-sink. The question is whether pipewire offers that or another way to achieve the same functionality
Comment 6 Nicolas Fella 2021-02-20 11:24:06 UTC
Sorry, I mixed up the "Switch streams automatically" and "Combine output" features.

Both are implemented using pulseaudio modules so both don't work with pipewire right now
Comment 7 Matthias Mueller 2021-02-20 12:04:05 UTC
Regarding the "automatically switch ..." function:
Quote from P V (Contributor): "There's a setting streams-follow-default in media-session.conf that moves streams when default changes, and it's usually on by default, so streams follow default unless they have been previously manually fixed to a specific device (see pw-dump | grep target.node).
The default session manager doesn't support toggling features at runtime, or have the combine sink. Pipewire itself can do all this since you can link nodes freely (eg. with Jack apps + pw-jack), but the session manager doesn't have the same link autoconfiguration features as pulseaudio right now."

It seems KDE is fixing the streams to devices, even if they are not manually changed in plasma-pa?
So i guess one solution (that would make the option "automatically switch ..." kind of obsolete, at least for my usecase) would be to only fix streams that have been manually set to another device and let the switching be handled by the pipewire session manager?
Comment 8 Matthias Mueller 2021-02-25 12:17:03 UTC
I've just updated to 5.21.1 and it seems now the behaviour is almost like "Automatically switch all running streams when a new output becomes available" was active (but it's still greyed out).
So all streams on the current default-sink are switched when changing the default, but any stream that was on another sink stays there.
So for me, this issue is kind of resolved, but for people who DON'T want that behaviour or need/want the combined output it might still be relevant.
Comment 9 Matthias Mueller 2021-03-03 10:31:44 UTC
Sadly, the first impression was wrong. While it sometimes works that way, it doesn't switch running streams over always, i haven't yet figured out when it happens or not.
Comment 10 Synthetic451 2021-03-04 01:04:17 UTC
Regarding streams not switching over with Pipewire, I have a pretty reproducible case.

1.) Connect a pair of Bluetooth headphones and set that as the default device if it isn't already.
2.) Play an audio stream and then pause it.
3.) Disconnect Bluetooth headphones. Default output auto switches to another device on the system.
4.) Play audio stream again. Stream plays back properly on that new default.
5.) Pause stream.
6.) Manually switch default output to ANOTHER audio device on the system. Play stream. The stream doesn't migrate over.

Seems like KDE (or Pipewire) is fixing the audio streams to a specific device whenever they're moved from another device that's been recently disconnected.

Should I file a separate bug for this?
Comment 11 Nate Graham 2021-04-30 17:41:27 UTC
*** Bug 436401 has been marked as a duplicate of this bug. ***
Comment 12 Bug Janitor Service 2021-05-01 15:27:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-pa/-/merge_requests/63
Comment 13 Nicolas Fella 2021-05-01 15:31:50 UTC
As I've said in https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/771#note_901957 I don't see what Plasma would be doing wrong with regards to fixing streams.

> Should I file a separate bug for this?

yes please.


For now the best thing I can do is not show the UI that does not work with PipeWire and in the future possibly replace the functionality using PipeWire-specific config (if equivalent functionality exists)
Comment 14 Nicolas Fella 2021-05-03 16:48:16 UTC
Git commit 8b3b582f86c1b8a4e21cd0afc97767c18227fe4b by Nicolas Fella.
Committed on 03/05/2021 at 16:48.
Pushed by nicolasfella into branch 'master'.

Hide advanced output configuration when using PipeWire

PipeWire does not have support for the relevant PulseAudio modules.

See https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/771

module-switch-on-connect is less relevant since PipeWire has this behavior by default.

M  +8    -0    src/modulemanager.cpp
M  +6    -0    src/server.cpp
M  +3    -0    src/server.h

https://invent.kde.org/plasma/plasma-pa/commit/8b3b582f86c1b8a4e21cd0afc97767c18227fe4b
Comment 15 Nicolas Fella 2021-08-20 13:26:24 UTC
*** Bug 439328 has been marked as a duplicate of this bug. ***