So to achieve true mono from a stereo output we need to tinker with pipewire config.
This is the part of the pipewire documentation that helped me to achieve the desired mono sink:
Pipewire - Module Combine Stream
So first we need to find out what are the name of our node.device
to use in our config file, as said in WirePlumber - ArchWiki from the terminal run:
$ wpctl status
PipeWire 'pipewire-0' [0.3.56, user@hostname, cookie:1163266174]
Audio
├─ Devices:
│ 42. HD Audio Controller [alsa]
│ 105. USB PnP Audio Device [alsa]
│
├─ Sinks:
│ * 48. HD Audio Controller Analog Stereo [vol: 0.50]
│
├─ ...
│
├─ Sources:
│ * 101. USB PnP Audio Device Mono [vol: 0.74]
│
└─ ...
The ones marked with an *
are the ones that your are current using, we are looking for the sinks, the number indicates the id, so we can use $ wpctl inspect [ID]
$ wpctl inspect 48
id 48, type PipeWire:Interface:Node
...
...
- factory.id = "18"
factory.mode = "merge"
factory.name = "api.alsa.pcm.sink"
...
- media.class = "Audio/Sink"
- node.description = "HD Audio Controller Analog Stereo"
- node.name = "alsa_output.pci-0000_08_00.4.analog-stereo"
- node.nick = "ALC1220 Analog"
...
- object.path = "alsa:pcm:1:front:1:playback"
- object.serial = "49"
...
We are looking to get the node.name
So now that we gather everything, we can combine the information from both wikis.
- In your distribution folder of pipewire(usually
/usr/share/pipewire
), find the pipewire.conf
file and add this configuration with the modifications that suits your needs.
- At the
context.modules
section:
context.modules = [
{ name = libpipewire-module-combine-stream
args = {
combine.mode = sink
node.name = "combine_stereo_to_mono_sink" # Can be any name of your choice
node.description = "Mono Speakers" # This is the name that will appear in the sound settings
combine.latency-compensate = false
combine.props = {
audio.position = [ MONO ]
}
stream.props = {
stream.dont-remix = true
}
stream.rules = [
{ matches = [
{ media.class = "Audio/Sink"
node.name = "alsa_output.pci-0000_08_00.4.analog-stereo" # Your node.name here
} ]
actions = { create-stream = {
audio.position = [ FL FR ]
combine.audio.position = [ MONO ] # These both are what combine both channels into one
} } }
]
}
}
]
You can either just copy the part inside context.modules=[]
or create a new file and add to the pipewire.conf.d
or pipewire-pulse.conf.d
directories.
After saving the file, either reboot your system or restart pipewire and wireplumber:
$ systemctl --user restart pipewire pipewire-pulse wireplumber
This is my sound settings:
Mono Speakers
Mono Speakers2