Add accessibility option for mono audio

I’m deaf in one ear and everytime i’m using a device to listen to something i need to set it up to mono in case it sends different sounds to different sides like in binaural sounds. Over the years using linux i found ways to manually set this up that are mostly hit or miss depending on whether you’re using pulse audio or pipewire.

What i’m asking here is that an option to turn sound output into mono be added to the accessibility panel on the settings, it would make my life really easier as i would not have the need to set it manually or with scripts everytime i change my earbuds or headsets, thank you.

I know this may seem like a distro specific issue but from my years using linux i realized not a single desktop has this accessibility option for me, i can do this on android and windows, but on linux it always comes back to “set up a script or use wirepubler”, i just want to make it easier for other people that may not be as knowledged when it comes to solving these issues.

The need for mono audio for a11y reasons is surprisingly common.

This seems like a good job for easyeffects, what do you think OP?

Hi - just for folks’ reference, there is an existing feature request in the KDE Bugtracking System for this option: 462527 – Feature request/Accessibility: Allow downmixing audio to mono

I’m not sure where in the stack that would need to be implemented, but it does sound extremely helpful for accessibility. It’s even helpful for working around device issues - for example, the right speaker on the headphones I use with my phone doesn’t work, so I turn on mono audio in the iOS settings to still be able to hear everything.

2 Likes

I used easy effects for this before, it does the job if you thinker enough, but i wish to see an option for this in the settings because it would make it easier for people who just want to use the desktop without having to set this up.

Hello, i’m not very knowledge when in comes to what would be needed to make this work, but i know its a needed feature for a lot of people and i’ve seen it requested across many linux projects, i do use it on android as well so good to know iOS has this too!
The only desktop i know that plans to implement this feature soon is cosmic, i’ve seen it on their tracker, but besides them the request for mono in other projects has been either ignored or denied for some reason or another.

I do hope some plasma dev sees this and implements it as its my favorite DE by far.

I see what you did there :grin:

For something simple like a mono mixdown output over both channels, wireplumber and pipewire have all the tools built-in, so it’s basically a simple matter of dropping a config file. The new audio device renaming feature has that kind of capability, so I feel like plasma could do this job pretty easily.

A couple of links in case the “how” is interesting:

https://pipewire.pages.freedesktop.org/wireplumber/policies/smart_filters.html

I haven’t tested this beyond about 10 seconds, but I’m pretty sure it works: you make a smart filter, with no target set, mono capture and unset channels on the playback stream, and allow it to upmix.

It’ll inject itself transparently before the selected output device, which will cause apps targeting that device to use mono playback, then upmix it and play that through however many channels the device really has.

~/.config/pipewire/pipewire.conf.d/99-mono-downmix.conf

context.modules = [
    {   name = libpipewire-module-loopback
        args = {
            node.name = mono-filter
            node.description = "Mono Mixdown Filter"
            capture.props = {
                audio.position = [ MONO ]
                media.class = Audio/Sink
                filter.smart = true
                filter.smart.name = mono-filter
            }
            playback.props = {
                node.passive = true
                node.dont-remix = false
                channelmix.upmix = true
                channelmix.upmix-method = simple
            }
        }
    }
]

Tada, instant global mono downmix. It effectively makes all your sound cards’ outputs look mono to your apps.

Off the top of my head I can think of like 6 different ways to do this, so if that doesn’t work, don’t be put off, that’s just me ‘doodling’. I’m sure it can work and be something very simple like a single config file, which would be easy for a skilled individual to put in place with a button click or a toggle switch or whatever.

Do I seem to be vaguely on the right track, @kuroki100 ? If I could come up with something that worked for you, do you think it would work for others if it was behind a toggle switch or something? Would it need options or something? Are there guidelines that should be followed for how this sort of thing should work? I appreciate any advice :slight_smile:

2 Likes

I have something like you did there setup here, the issues i’ve ran into is that the output it creates sometimes doesn’t actually work as an volume slider. So what happens, for example, is that if i have a browser tab playing something using a headset and i try to change the volume slider on the mono output it doesn’t do anything, i have to either change it on the output of the headset or the browser tab, which can be confusing if you have several sound sources having to figure out which one is the one you need to reduce the volume for it to work.

I think having it so when you enable the toggle it just changes the actual device to mono instead of creating a new one would be a good way to prevent this, if its a recurring issue with other methods of mono downmixing.

Unfortunately, not all sound cards have a mono profile to select. But smart filters are specially made for purposes like this (or for example, to put special treatment in front of mac speakers) so generally should be fairly reliable. I use them literally all day every day here and have not seen that volume failure - and I’ve fixed two volume bugs today. (which is to say, I’ve been trying to break volume control)

That’s how I tested this, it seemed to work? It sounds like you are using a loopback device, as I showed, but you are not using it with smart filters, but as a normal filter chain creating a virtual sink. The code may look similar, but they act kinda different.

If you use smart filters as I showed above, the filter is ‘invisible’ to the system, and you don’t get a separate volume control, or see a new device in your apps - there is no “device it creates” as far as the visible part of the system is concerned. Your apps have no idea the filter exists, they see only your real sound cards. Unless you want them to see it, so use filter.smart.targetable=true

You can see it in apps like qpwgraph, but it is marked virtual, so it will be hidden in for example your browser or media player or plasma volume controls. You just use the normal volume controls and select the normal soundcard as your output like it’s all totally normal and there is no mono downmix.

It’s also much nicer because now you can select the physical device you are actually listening to from the Plasma GUI, not a new device that is created and makes routing difficult. Everything starts to work as it is intended for a normal device.

There was a bug regarding volume changes and loopbacks recently, too, so maybe you saw that. But perhaps you might try to temporarily rename your pipewire config dir and a copy paste of the above configuration, restart pipewire and see how it works. I can happily test it all day but I am not deaf in one ear so what would I know if the result is acceptable or not? :laughing: Anyway I am sure you will prefer smart filters when you try them. It’s very elegant.

2 Likes