post: Current state of audio routing #38
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Phosh/phosh-site!38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agx/phosh-site:media-role"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
1d4f8dc88fto44e3a9e45344e3a9e453b3612babacb3612babac48366e006848366e00686067a288796067a28879f2e6916235v1.1
f2e6916235addd754895v1.2
addd7548957a41e8ad93v1.3
Thanks! Actually TIL of such feature in LInux, hopefully everyone starts to make use of such features.
Just minor typos and inclusion of commas and full-stops, so it is easier to read. Rest all looks good to me.
@ -0,0 +12,4 @@What if you want to have your phone's alarm clock volume different from your music playback volumeand have the later go to speakers while alarms should continue to go to the phone's speaker?While this could be handled via manually set up, per application volume and sink setups this doesn't@ -0,0 +18,4 @@incoming call while music is playing).THe modern Linux audio stack uses [pipewire][] and [wireplumber][] and the wireplumber maintainersimplemented a solution for this called *role* *based* routing. In the following we'll explore how@ -0,0 +19,4 @@THe modern Linux audio stack uses [pipewire][] and [wireplumber][] and the wireplumber maintainersimplemented a solution for this called *role* *based* routing. In the following we'll explore howthis works, what is already implemented and what we needs to do before we can enable it by default@ -0,0 +33,4 @@While ducking and corking is being leveraged with pulseaudio to e.g. silence music during phonecalls on e.g. the Librem 5[already](https://source.puri.sm/Librem5/librem5-base/-/blob/pureos/latest/default/audio/pulse/librem5.pa#L26-L31)@ -0,0 +39,4 @@## Media RolesIn order to leverage this applications tag their audio streams with a certain role so wireplumber@ -0,0 +45,4 @@for alarm clocks, cellbroadcasts incoming calls, etc. is usually emitted by feedbackd theseapplications don't need to anything as feedbackd will set an appropriate role.The roles are currently not standardized on Linux so we researched a bit what is in use and@ -0,0 +68,4 @@If you want to test this you can build [feedbackd](https://gitlab.freedesktop.org/agx/feedbackd)with `-Dmedia-roles`. `meson install` will then put a `media-role-nodes.conf` into`/usr/share/wireplumber/wireplumber.conf.d/` enabling media role based@ -0,0 +70,4 @@with `-Dmedia-roles`. `meson install` will then put a `media-role-nodes.conf` into`/usr/share/wireplumber/wireplumber.conf.d/` enabling media role basedin Wireplumber and feedbackd will then add `media.role` properties to the emitted events ensuringthat e.g. incoming calls or emergency alerts will silence any playing music or game output.@ -0,0 +72,4 @@in Wireplumber and feedbackd will then add `media.role` properties to the emitted events ensuringthat e.g. incoming calls or emergency alerts will silence any playing music or game output.### How do check if role based routing is active@ -0,0 +74,4 @@### How do check if role based routing is activeIf role based routing is active the `wpctl status` output should list the known media roles as@ -0,0 +137,4 @@{ "subject": 0, "key": "current.role-based.volume.control", "type": "Spa:String:JSON", "value": { "name": "input.loopback.sink.role.alarm" } }```We can then use that in Phosh to make the default volume slider operation on this volume control. A@ -0,0 +139,4 @@We can then use that in Phosh to make the default volume slider operation on this volume control. Aprototype for this can be found[here](https://gitlab.gnome.org/World/Phosh/phosh/-/merge_requests/1714))@ -0,0 +143,4 @@## Routing TargetWith volume controls sorted out there's still the question where to output to. Mobile phones usually@ -0,0 +144,4 @@## Routing TargetWith volume controls sorted out there's still the question where to output to. Mobile phones usuallyhave a speaker and an earpiece and also often Bluetooth headphones are connected to. While the later@ -0,0 +145,4 @@With volume controls sorted out there's still the question where to output to. Mobile phones usuallyhave a speaker and an earpiece and also often Bluetooth headphones are connected to. While the latermight be the right target for music one usually wants emergency alerts and alarms routed to the@ -0,0 +159,4 @@# Trying it outSo how can you try that out. Until more things made it into releases we have to build some@ -0,0 +162,4 @@So how can you try that out. Until more things made it into releases we have to build somecomponents from source:* [feedbackd][]: The needed changes are merge so you can clone it an run from the working copy@ -0,0 +173,4 @@_build/run```* [wireplumber][] git has the needed changes merged so you can build and run from the working copy@ -0,0 +186,4 @@./wp-uninstalled.sh wireplumber```* [phosh-mobile-settings][] has support built in since 0.47, no need to build anything@ -0,0 +204,4 @@With this you should be able to check if the role based policies are active and e.g. see the volumeslider in mobile settings.If you can do without an GUI bits and want to avoid building lots of stuff manually but still want@ -0,0 +205,4 @@slider in mobile settings.If you can do without an GUI bits and want to avoid building lots of stuff manually but still wantto try things out it sufficient to only build wireplumber and add the policy. You can then use7a41e8ad9395c1b32390Thanks a lot @arun-mani-j , I've applied all of it and made some more tweaks for (hopefully) clarity.
95c1b32390b106a3727bb106a3727b2c8d1114732c8d111473cfcc6f4c13cfcc6f4c134e5e18304e