In the comments reader “Christian” asked me about how to use Alsaequal with squeezelite. I had never heard about “Alsaequal” but once I looked into it, I found out it was an equalizer plugin for Alsa. It looked quite promising.
After a bit of tinkering with it, Christian and I got it working. And it’s really nice! It lets you change the different low and high tones of the music output. It looks like this:
I now use it to boost the base a bit for the kitchen raspberry. The kitchen raspberry is connected to two small ceiling speakers, which are low on base. Adjusting the equalizer to give it a little more base improved the sound quality quite a bit.
Tutorial
This is a tutorial on how to install en setup Alsaequal on a Raspberry Pi running Raspbian and squeezelite.
Install alsaequal package
First we have to install the alsaequal package, run this command:
sudo apt-get install -y libasound2-plugin-equal |
Find the right soundcard number
We have to tell the alsaequal plugin which soundcard to use. This is done by a device number. To find the right device number, execute this command:
aplay -l |
**** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio] Subdevices: 0/1 Subdevice #0: subdevice #0
I want to use the USB soundcard, which is the “C-Media USB Headphone Set”. And that is “card 1″, we will have to remember the “1” because we will need it in the next step.
Create asound.conf settings file mit USB-Soundkarte!
We will have to tell Alsa that there is a Alsaequal plugin, and what the settings are for this plugin. This is done in the asound.conf file. You can create one with this command:
sudo nano -c /etc/asound.conf |
ctl.equal { type equal; controls "/home/pi/.alsaequal.bin" } pcm.plugequal { type equal; slave.pcm "plughw:1,0"; controls "/home/pi/.alsaequal.bin" } pcm.equal { type plug; slave.pcm plugequal;}
slave.pcm "plughw:1,0"; |
Save and exit the file.
Create asound.conf settings file mit Analogen-Ausgang!
We will have to tell Alsa that there is a Alsaequal plugin, and what the settings are for this plugin. This is done in the asound.conf file. You can create one with this command:
sudo nano -c /etc/asound.conf |
ctl.equal { type equal; } pcm.plugequal { type equal; # Modify the line below if you don't # want to use sound card 0. slave.pcm "plughw:0,0"; # or if you want to use with multiple applications output to dmix # slave.pcm "plug:dmix" } # pcm.equal { # Or if you want the equalizer to be your # default soundcard uncomment the following # line and comment the above line. pcm.!default { type plug; slave.pcm plugequal;}
This file is set to use card “0”, but if your souncard has a different number, change this line:
slave.pcm "plughw:0,0"; |
Save and exit the file.
Setup Squeezelite to use the equalizer
Now we have to tell squeezelite to use the equalizer instead of a soundcard. Open the script:
sudo nano -c /etc/init.d/squeezelite |
SL_SOUNDCARD="sysdefault:CARD=ALSA" |
SL_SOUNDCARD="equal" |
sudo reboot; |
Using the equalizer
When it’s restarted, login again and type:
sudo alsamixer -D equal |
With the “tab” key you can switch between the different frequencies, and with the up and down keys the settings can be changed.
Changes made should be directly audible when playing something with squeezelite.
Have fun!