I have one speaker next to my computer which I use mostly as a headphone amplifier. On occasion I need to use it as a loudspeaker. Is it possible to quickly change the audio output from stereo to mono, either system-wide or as a plugin for a media player?
-
As a side note I can do this on my android phone using the Voodoo Control app which requires a custom kernel that tweaks the headphone amp found in the galaxy phones– daithib8Sep 17, 2011 at 8:56
-
If you're in Ubuntu 22.10 (which uses PipeWire instead of PulseAudio) you can install EasyEffects for this; check this answer.– geekleyNov 20, 2022 at 0:07
6 Answers
Find the name of your audio sink by running
pacmd list-sinks | grep name:
Then run this command (taking care to remove the angled brackets from the result of previous command):
pacmd load-module module-remap-sink sink_name=mono master=NAME_OF_AUDIO_SINK_GIVEN_BY_PREVIOUS_COMMAND channels=2 channel_map=mono,mono
or add
load-module module-remap-sink sink_name=mono master=NAME_OF_AUDIO_SINK_GIVEN_BY_PREVIOUS_COMMAND channels=2 channel_map=mono,mono
to /etc/pulse/default.pa
to have it run at startup.
Then in Sound Preferences choose "Mono" as the output, but remember to reduce volumes by half, since two channels are getting mixed into one, or else you'll have distortion. To test, run:
speaker-test -c 2 -t sine
Same thing in a single command:
pacmd load-module module-remap-sink sink_name=mono master=$(pacmd list-sinks | grep -m 1 -oP 'name:\s<\K.*(?=>)') channels=2 channel_map=mono,mono
To remove the mono channel, just use:
pacmd unload-module module-remap-sink
-
2Be sure to reduce the "Applications" volume (also found within the Sound Preferences) as well as the "Output" volume. If you play music from the terminal you can adjust that volume from there.– daithib8May 21, 2012 at 16:04
-
8Just a comment for anyone who gets a little confused (as I did): when @daithib8 writes "or add the argument to pacmd to /etc/pulse/default.pa", that means doing
sudo emacs /etc/pulse/default.pa
(orsudo nano
or whatever editor you prefer), scrolling down to the end, and then pasting everything from the command except thepacmd
part in to a new line at the bottom of the file. Then save and restart :-) May 3, 2013 at 21:40 -
8
-
2
-
1
I've cast answer 1 into a perl-script, so I don't need to remember these 2 commands:
#!/usr/bin/perl
use strict;
my @choices = ();
my $i = 0;
for (`pacmd list-sinks`) {
if( /name:.*<(.+)>/) {
$choices[$i++] = $1;
print "$i:\t$1\n";
}
}
my $choice = $choices[<>-1] or die "invalid choice";
exec (qw(pacmd load-module module-remap-sink sink_name=mono),
"master=$choice",
qw(channels=2 channel_map=mono,mono));
(I would've annotated that answer, but my karma is to low ;-) )
-
-
2Oh, you could replace the exec command by
exec "pacmd load-module module-remap-sink sink_name=hono master=$choice channels=1 channel_map=mono >/dev/null";
(This hides output, and uses slightly simpler mapping.)– jarnoSep 6, 2015 at 11:16
If you are using jack, then you can do so using patchage(which can be installed with apt-get install patchage
). It has a very intuitive interface.
-
1
-
@user800 : connect pulse_sink left/right and jack sink left/right to system playback_1 Oct 31, 2019 at 7:20
It seems there is no easy way to do this.
You can do it though, by proxying all PulseAudio output to a Jack sink. Too cumbersome to be used casually...
As an addendum, after you have created your mono sink with the above answers, you might map this script to a hotkey:
#!/bin/bash
if [ "* index: 0" == "$(pacmd list-sinks | grep "*" | sed 's/^ *//')" ];
then pacmd set-default-sink 1 && notify-send "Mono";
SINK=1;
else
pacmd set-default-sink 0 && notify-send "Stereo";
SINK=0;
fi;
pacmd list-sink-inputs | grep index | grep -o '[0-9]*' | while read -r line;
do pacmd move-sink-input $line $SINK;
done;
This will toggle between sinks and remap the current stream to the new sink(ma
You might be able to use the pulseaudio sound settings manager to change stereo to mono. Or perhaps you can try just panning everything to the left or right speaker.
-
Paning won't work. It will not mix both channels together, it will mute one of the speakers and take just the output from one of the channels. Apr 22, 2011 at 9:50
-
Panning is what David is asking for. Panning is the act of mixing two channels together in order to output them to one speaker, usually in order to give the impression that the sound is coming from a particular direction. Hence the name pan(orama)ing. A variant of this, called panning straight up, mixes the channels together but outputs an equal amount of the result to each speaker. Since he is only using one speaker this would also work for him. Pulseaudio volume control only adjusts the balance, where the volume at each speaker is adjusted though no mixing takes place.– daithib8Apr 22, 2011 at 13:05