Skip to content

Instantly share code, notes, and snippets.

@Jiab77
Last active August 13, 2022 06:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Jiab77/c84cedd53f8471d7dce15671aad8a624 to your computer and use it in GitHub Desktop.
Save Jiab77/c84cedd53f8471d7dce15671aad8a624 to your computer and use it in GitHub Desktop.
Enable 2.1 audio output in PulseAudio

Enable 2.1 audio output in PulseAudio

I'm using a 2.1 speakers kit from Logitec but most of the time it is always detected as 2.0... 😒

So I decided to make some research and found a solution that works everytimes (on Ubuntu based distribs).

It seems to work also on Arch Linux, see comment from @ilikenwf.

Before patching

As you can see, my audio output is not patched.

Audio Ouput

actual-audio-output

Audio Test

actual-audio-test

The patch

To fix the problem easily, I wrote a small script to run as root or using sudo.

sudo bash pulse-audio-2.1-patch.sh

You will need to reboot to apply the changes.

After patching

Now you can see the result of the patch, for the best result, set your principal audio output volume close to the max then select the new audio output entry as shown below and set the volume you want. 😁

Patched Audio Ouput

patched-audio-output

Patched Audio Test

patched-audio-test

Enjoy!

Now you can enjoy a much better and cleaner audio output. 😉 🤘

TODO

Add search references.

#!/bin/bash
# Patch config
sudo sed -i 's/; enable-lfe-remixing = no/enable-lfe-remixing = yes/g' /etc/pulse/daemon.conf
echo 'default-sample-channels = 3' | sudo tee -a /etc/pulse/daemon.conf
echo 'default-channel-map = front-left,front-right,lfe' | sudo tee -a /etc/pulse/daemon.conf
# Patch modules
echo -e '### Test subwoofer\nload-module module-combine channels=3 channel_map=front-left,front-right,lfe\n' | sudo tee -a /etc/pulse/default.pa
@ilikenwf
Copy link

ilikenwf commented Dec 4, 2020

This worked for me on Arch also. Thanks!

@Jiab77
Copy link
Author

Jiab77 commented Dec 5, 2020

@ilikenwf, woow really? I'm so proud to have also helped an Arch user! 🤘 🥳

@ilikenwf
Copy link

ilikenwf commented Dec 5, 2020 via email

@ilikenwf
Copy link

ilikenwf commented Dec 6, 2020

Oh, also, using loopback has been handy too for plugging stuff in and upmixing it from the input:

https://unix.stackexchange.com/questions/263274/pipe-mix-line-in-to-output-in-pulseaudio

@Jiab77
Copy link
Author

Jiab77 commented Dec 6, 2020

woow @ilikenwf, many thanks for those additional details! Much appreciated 👍

@Silver812
Copy link

Silver812 commented Dec 26, 2020

My only problem is that I executed the bash script twice by mistake and now I have two "Simultaneous output to..." options in my settings. Do you know how to delete one of them?

Edit: I solved it myself. What I did was just delete the new devices from the "default.pa" file that is referenced in the script.

@robodraif
Copy link

Thank's!!!!
Good script. It really works!

@Jiab77
Copy link
Author

Jiab77 commented Jan 9, 2021

@Silver812, sorry I thought I had replied you already 🤦‍♂️

In case you've ran the script twice or more by accident, simply delete duplicated lines from:

  1. /etc/pulse/daemon.conf
  2. /etc/pulse/default.pa

You can do it from the terminal by editing the files with nano or vi as root or with sudo.

As it was just to patch something I haven't added checking code but if you want it, just let me know 😉

@Jiab77
Copy link
Author

Jiab77 commented Jan 9, 2021

@robodraif, You're very welcome, glad it solved your issue 🤘

@ShashiWerdun
Copy link

On Ubuntu20.04 testing the subwoofer only sends a short pulse of static to the front speakers. if anyone tested their subwoofer, what kind of sound you got on subwoofer? and what could be possible reasons for not working?
My speakers are quite old, from Creative(MMS112).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment