-
chevron_right
Arun Raghavan: Accessibility Update: Enabling Mono Audio
news.movim.eu / PlanetGnome • 00:09 • 2 minutes
If you maintain a Linux audio settings component, we now have a way to globally enable/disable mono audio for users who do not want stereo separation of their audio (for example, due to hearing loss in one ear). Read on for the details on how to do this.
Background
Most systems support stereo audio via their default speaker output or 3.5mm analog connector. These devices are exposed as stereo devices to applications, and applications typically render stereo content to these devices.
Visual media use stereo for directional cues, and music is usually produced using stereo effects to separate instruments, or provide a specific experience.
It is not uncommon for modern systems to provide a “mono audio” option that allows users to have all stereo content mixed together and played to both output channels. The most common scenario is hearing loss in one ear.
PulseAudio and PipeWire have supported forcing mono audio on the system via configuration files for a while now. However, this is not easy to expose via user interfaces, and unfortunately remains a power-user feature.
Implementation
Recently, Julian Bouzas implemented a WirePlumber setting to force all hardware audio outputs (MR
721
and
769
). This lets the system run in stereo mode, but configures the
audioadapter
around the device node to mix down the final audio to mono.
This can be enabled using the WirePlumber settings via API, or using the command line with:
wpctl settings node.features.audio.mono true
The WirePlumber settings API allows you to query the current value as well as clear the setting and restoring to the default state.
I have also added (
MR1
,
MR2
) a mechanism to set this using the PulseAudio API (via the messaging system). Assuming you are using
pipewire-pulse
, PipeWire’s PulseAudio emulation daemon, you can use
pa_context_send_message_to_object()
or the command line:
pactl send-message /core pipewire-pulse:force-mono-output true
This API allows for a few things:
-
Query existence of the feature: when an empty message body is sent, if a
nullvalue is returned, feature is not supported -
Query current value: when an empty message body is sent, the current value (
trueorfalse) is returned if the feature is supported -
Setting a value: the requested setting (
trueorfalse) can be sent as the message body -
Clearing the current value: sending a message body of
nullclears the current setting and restores the default
Looking ahead
This feature will become available in the next release of PipeWire (both 1.4.10 and 1.6.0).
I will be adding a toggle in Pavucontrol to expose this, and I hope that GNOME, KDE and other desktop environments will be able to pick this up before long.
Hit me up if you have any questions!