[feature] ALSA & PulseAudio Equaliser
XxAcielxX opened this issue ยท 11 comments
Hello,
As the title suggests, if it is possible to add Equaliser.
Edit 1:
For ALSA with your container I tried this method ALSA-EQ-Plugin and it works perfectly.
Steps to Install
apt update && apt install libasound2-plugin-equal
- Create
/root/.asoundrc
...
pcm.!default {
type plug
slave.pcm plugequal;
}
ctl.!default {
type hw card 0
}
ctl.equal {
type equal;
}
pcm.plugequal {
type equal;
slave.pcm "plughw:0,0"; # NOTE this line MUST be your hardware device.
}
pcm.equal {
type plug;
slave.pcm plugequal;
}
In my case, audio is outputting from HDMI.
Hello, this is an interesting feature. I will be working on it as soon as I can.
About your asoundrc file, do you use "pcm.plugequal" as the alsa device in the mpd output?
In any case, I will probably start by adding the necessary packages, so by just mounting the asoundrc file and using the 'additional-outputs.txt' file, you will probably not need to do any package operation when the container is recreated. Then I will try to understand how to make this work using environment variable.
At first I did create additional-outputs.txt
like this:
audio_output {
type "alsa"
name "Alsa EQ"
device "plug:plugequal"
mixer_type "software"
}
Then I noticed that the EQ was automatically applied to the default output as well.
I have created /user/config/eq
and mounted this volume with my EQ Preset scripts in there. For example:
00-default.sh
...
#!/bin/bash
/usr/bin/amixer -D equal -q set '00. 31 Hz' 66
/usr/bin/amixer -D equal -q set '01. 63 Hz' 66
/usr/bin/amixer -D equal -q set '02. 125 Hz' 66
/usr/bin/amixer -D equal -q set '03. 250 Hz' 66
/usr/bin/amixer -D equal -q set '04. 500 Hz' 66
/usr/bin/amixer -D equal -q set '05. 1 kHz' 66
/usr/bin/amixer -D equal -q set '06. 2 kHz' 66
/usr/bin/amixer -D equal -q set '07. 4 kHz' 66
/usr/bin/amixer -D equal -q set '08. 8 kHz' 66
/usr/bin/amixer -D equal -q set '09. 16 kHz' 66
echo "EQ: reset"
Then I can run docker exec -it mpd /user/config/eq/./<preset>.sh
to apply it.
That's interesting :-)
There is already an image available, which includes the necessary packages. Can you please try it and see if this works for you? I expect that the manual steps required for adding the package should not be necessary now.
Tested and it is working smooth. ๐๐ป
Good to hear that.
I will experiment with equalizer myself and probably come out with a release. I can't predict how long this will take though.
Hello, I just added support for a new file in /user/config
, named asoundrc.txt
. I had to also support user mode because the .asoundrc file mounted in /root did not work when using user mode. Can you please verify with the new image? It is building right now.
I am considering creating a asoundrc file from the container, letting the user configure it via env variables, but it seems too complicated to be really useful. Do you agree?
If so, can we close the issue?
Hi,
Tested your new image,
...
volumes:
- ${APP_CONF}/mpd/asoundrc.txt:/user/config/asoundrc.txt
And it is working. Creating asoundrc file from the container environments is indeed complicated. I think leaving it the same way as the additional-outputs.txt
is best. User can create and mount it as required.
Do leave some kind of documentation guide about it so others can implement the EQ.
Thank you very much for working on my feature request.
Regards,
XxAcielxX
Hello, thank you for your feedback. I will add the documentation from this ticket in an additional file in the doc folder and link it in the main README.md
.
I will probably do that this saturday. Should you want to send a merge request with part of the documentation, it would be welcome of course. Just feel free to do that if you have some spare time.
Thank you for the contribution!
No problem at all. We can now close this issue.