With some #wireplumber changes landing we're a big step closer to enabling separate volume controls for things like media, alerts, alarms, etc. in #Phosh. Here's a short overview on the current state: https://phosh.mobi/posts/role-based-routing/

#LinuxMobile

Audio Roles, Volumes and Routes

What if you want to have your phone鈥檚 alarm clock volume different from your music playback volume and have the later go to speakers while alarms should continue to go to the phone鈥檚 speaker? While this could be handled manually via per application volume and sink setups, this doesn鈥檛 scale well on phones that also have emergency alerts, incoming calls, voice assistants, etc. It also doesn鈥檛 specify how to handle simultaneous playback - for instance, if an incoming call rings while music is playing.

Phosh

@phosh

Great idea considering emergency alerts as volume adjustable 馃憤

@panda @phosh There might be regulatory requirements forcing vendors to prevent this in shipped products (so e.g. UI elements might need to be hidden) but from the configuration side it is a role like any other.
@phosh Nice! Glad to see people are starting building above of Wireplumber. Am impatient to implement something similar for Sxmo. Also, this could fix my dangling setup that route my microphone input to headpones in a generic way.
@stacyharper @phosh I hope we can get all DEs on board for a common set of roles and wireplumber config for that. Otherwise it'll get croweded in wireplumber.conf.d and we need to add a way to select config by `XDG_CURRENT_DESKTOP`.
@agx @phosh Did you tried integrating sources as much? I am thinking about using the echo-cancel module, and linking the playback as some "Communication" role.
Also, apparently the smart-filtering system seems to not behave correctly when used with role based linking. At least, here it sometime fails to links everything correctly.
My ultimate goal would be to link back the cleaned up mic input, to a dedicated role loopback "Private" that are strictly connected to Headphone sinks, to prevent any feedback.
This area is yet poorly documented. Hopefully at some point we would at least have good examples to build complex pipelines.
@stacyharper @phosh no, mostly looking getting the sink side into shape so far and adding the necessary bits to wp so we can get that rolling by default. There's still issues like https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4949 I need to look into.
loopback node volumes not restored until they start running (#4949) 路 Issues 路 PipeWire / pipewire 路 GitLab

While looking into

GitLab
@phosh @agx on iOS when you get a call or an alarm goes off, both your speaker and the connected bluetooth device will ring. Is that something that can also be implemented here ?
@vixalientoots @phosh you can combine sinks so that should be doable too (by creating a combined sink and then setting it as `preferred-target` in our policy).

@phosh #wireplumber 0.5.13 containing the necessary changes was released a couple of days ago 馃檹 and is already in #Debian 馃檹 so I built #feedbackd with `DEB_BUILD_PROFILES=pkg.feedbackd.media-roles`, installed the result and from a quick test is seems to be working nicely.

The next #pipewire release will fix a bug regarding volume restore with media roles and hopfully we can then looking into turning this on by default in #phosh afterwards.

@agx @phosh Can you link me to the volume restore bugfix please? I can't find it in the wireplumber repo

@katzenmann @phosh It's part of 1.5.84 , the commit is linked from https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4949#note_3205830

(but note that wireplumber 1.5.84 needs gvc fixes (https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/merge_requests/31) as otherwise e.g. phosh crashes on device selection.

loopback node volumes not restored until they start running (#4949) 路 Issues 路 PipeWire / pipewire 路 GitLab

While looking into

GitLab