Skip to content

Instantly share code, notes, and snippets.

@Jiab77
Last active June 27, 2024 21:08
Show Gist options
  • Save Jiab77/c84cedd53f8471d7dce15671aad8a624 to your computer and use it in GitHub Desktop.
Save Jiab77/c84cedd53f8471d7dce15671aad8a624 to your computer and use it in GitHub Desktop.
So I decided to make some research and found a solution that works everytimes (on Ubuntu based distribs).

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