51

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?

1
  • 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 – daithib8 Sep 17 '11 at 8:56
78
  1. Find the name of your audio sink by running

    pacmd list-sinks | grep name:
    
  2. Then run this command (taking care to remove the angled brackets):

    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.

  3. 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
  1. To remove the mono channel, just use:

    pacmd unload-module module-remap-sink
    
15
  • 2
    Be 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. – daithib8 May 21 '12 at 16:04
  • 6
    Just 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 (or sudo nano or whatever editor you prefer), scrolling down to the end, and then pasting everything from the command except the pacmd part in to a new line at the bottom of the file. Then save and restart :-) – machineghost May 3 '13 at 21:40
  • 6
    You're a lifesaver for people with single-sided hearing loss. – Omri Barel Mar 8 '14 at 22:04
  • 2
    And I am doing fine by channels=1 channel_map=mono. – jarno Sep 6 '15 at 10:56
  • 1
    Just want to follow up my own comment, reduced volume is because the remap takes the volume of the source. So if my original "Headphones - built-in Audio" is set to 20%, then I select "Remapped Built-in Audio..." and set my volume to 100%, it is in fact only 20%, the original 20%. Stop your sound, select the original source and turn it up to 50-100%, then select the Remapped and you will get a "normal" volume range – Chad Feb 6 '20 at 16:17
16

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 ;-) )

2
  • How can you hide the output of pacmd command? – jarno Sep 6 '15 at 11:04
  • 2
    Oh, 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.) – jarno Sep 6 '15 at 11:16
3

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.

2
  • 1
    So what do you do after installing patchage? There is no help in the "Help" menu and I can't find a manual or intro on the website. – Tsundoku Oct 31 '18 at 11:43
  • @user800 : connect pulse_sink left/right and jack sink left/right to system playback_1 – Laurent Debricon Oct 31 '19 at 7:20
1

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...

0

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.

2
  • 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. – Rafał Cieślak Apr 22 '11 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. – daithib8 Apr 22 '11 at 13:05
0

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