[kinda solved] amp2 + simple equalizer, troubles with mpd

i have struggled bringing the simple equalizer to work with volumio 2.729 together with hifiberry amp2.

the out-of-the-box installation of the plugin happened without errors, but i had no sound anymore when activating the plugin.

i installed the latest alsa-equal-thingies, followed some hints posted here https://forum.volumio.org/equalizer-t45.html and got it working, but with issues, and not really stable.

always the mpd.conf switched back to some kind of fallback after i implemented some necessary changes regarding piping the output through the equalizer first, and the “asound.conf” miracly showed up with “plugequal1” instead of working “plugequal”, without the “1” at the end.

:exclamation: the reason for the troubles seems to be, that mpd nowadays expects only letters in that speciffic part of configuration.

:exclamation: by changing the output device or activate/deactivate i2s dac by doing some try and error, the equalizer-plugin pushes a template-config (/data/plugins/audio_interface/volsimpleequal/asound.tmpl), where the “plugequal1” is coded, and mpd in consequence won’t play anymore.

because of this the mpd-daemon seems not to start after the next reboot, therefore volumio states that there is no audio device available, activating a fallback-config, so again the plugin-template is copied.

so i changed that file, and if i edit things via ssh again and reboot, everything is working fine again, even though the settings show there is no i2s dac active, and there seems no hardware-mixer available.

but as soon as i change the output device or activate i2s dac, things are screwed up again.

after all, i can live with it, volumio is awesome work, guys :wink:

From a working version of Volumio, install the plugin from plugin manager. Enable it. Do not change anything in Volumio playback settings. Do not change mpd.conf or any other file!. Reboot if no sound. Let me know

thanks for your quick reply, i will do so and post a report when done.

regards,
phil

ok, took me some time to track this down, my card-reader is terrible slow.

first, everything works fine as long as i don’t change any equalizer settings, then things start to get messy.

i tried to install the plugin, this fails every now and then, couldn’t figure out the exact cause, but it seems that the network layer is crashing during the last steps of downloading stuff. the installation stops at 70%, the very last entry of the details view shows “lgn archive…yadayada…/ui-Translation-en
at this point the ssh-connection freezes too and can’t be reestablished.
(the freeze of the installation process also happens if no ssh is enasbled via the dev page)
waited 20 min, but this seems to be another issue,

so fresh image, next try, this time the installation succeded after a minute or two.
enabled the plugin, reboot, all fine, sound is there,

in “general playback options” the output device has changed to “Hifiberry DAC Plus through equalizer plugin”, but i2s dac is “Off”, additionally under “Volume Options” the Mixer Type is “None”.

as said, sound is there, so i started to change bass frequencies inside the plugin, effect take place, all good, reboot.

volumio starts without any error message, states “Player configuration change” but when i click play there is no sound, but player pretends playing, time is counting, progress slider moving, but silence, reboot.

this time volumio states “The selected output device is not available” but general playback options show the same settings as described above. no sound by clicking a file, player is not playing, time does not count, slider isn’t moving, no error message.

at this time i noticed a new directory in “/home/volumio/.config/pulse” which made me curious, priviliges set to owner only.
for testing i set the whole tree of “/home/volumio” to “read/write/exec” with chmod 777, including the new “pulse” directory with it contents.
i changed bass frequencies again, reboot -> sound

then i checked the pulse-directory: permissions reset to owner only, along with it contents.
changed frequency again, change took effect, all fine, reboot, got sound.
changed frequency again, effect took place, reboot, volumio states again “The selected output device is not available”, no sound.

conclusions:

  1. some mechanism is recreating or changing the permissions of the pulse-directory everytime i change equalizer settings.

  2. it takes 2 reboots after changing equalizer settings to get the sound off.

  3. i managed to get back sound by changing the permissions to “read/write for all” of the pulse directory including contents before i change equalizer settings and reboot.

  4. even after resetting permissions to read/write for all to get the sound back on in “general playback options” i2s dac if still “off”, although it must be on, since there wouldn’t be the pulse-thingie make it work, i guess.

lastly, i have never touched any config- or other file, except for changing permissions, and never canged anyything in the volumio settings except for the equalizer values.

hope this helps.
regards,
phil

update, kinda solved the problem, well, mostly.

directory “pulse” was already in “/home/volumio/.config” before the plugin install process, also a user and group “pulse” already existed.

so i took a fresh image, enabled ssh, changed user “pulse” as the new owner of the pulse-folder (“volumio” was set before).

sudo chown pulse:pulse /home/volumio/.config/pulse/

then i added users “volumio” and “mpd” to the group “pulse”.

sudo usermod -aG pulse volumio
sudo usermod -aG pulse mpd

then i installed the plugin.

as a result sound is functioning right afterwards, without a reboot.
after enabling the plugin changes to equalizer take also effect immediately without a reboot.

aditionally, sound is stable now, rebooted/powered off about 20 times by now, with or without changes to the eq, also the i2s dac-option remains active in the “global playback options”.

one thing is still kinda problem, there is no longer a hardware mixer in the settings to find, only “none” or “Software” available, so after the plugin installation process the volume was silently set to 100% without adjusting the display, there it still showed 25%. i guess my neighbours jumped - like me.

not 100% sure, but without a configured mixer setting the startup volume-level (i previously adjusted in the fresh image) can’t be set after reboot, it simply remains at the value just before the reboot, but volumio shows na/0. however, the volume is adjustable from beginning on without a problem.

regards,
phil

Thanks a lot for your investigation.
When the plugin has been written, there no pulse used…
For the mixer and i2s don’t worry. If a hw mixer and i2s Dac were set before the plugin was installed, they are still used even if it doesn’t appear in Volumio playback settings… This a known problem related to the way the output is handled in Volumio. We are working on it :wink:

nothing to thank for, i’m happy beeing able to help a little in this very nice project.

regards,
phil

checked again, sadly, it’s definetly the software mixer active.
the sound has only half the bass presure and midtone dynamics it used to have.

any ideas where to look what’s happening?
what could i look for in /var/log/volumio log, or mpd.log?

regards,
phil

ok, here’s now my final recipe to get the simple equalizer to stable work with i2s dac and the hardware mixer:

took a fresh and working image, with hifiberry dac plus as output device, i2s dac model also hifiberry dac plus.

before installing the plugin, i’ve set the following priviliges via ssh:

sudo chown pulse:pulse /home/volumio/.config/pulse/ sudo usermod -aG pulse volumio sudo usermod -aG pulse mpd sudo chmod -R 777 /home/volumio

then i installed the pugin, but did not enable it.

i replaced the content of “/data/plugins/audio_interface/volsimpleequal/asound.tmpl” with this:

ctl.equal { type equal } pcm.plugequal { type equal slave.pcm "plughw:${hwout},0"; } pcm.equal { type plug; slave.pcm plugequal; }

the only changes to the original file are:
line 4 changed from “pcm.plugequal1 {” to “pcm.plugequal {”
line 10 changed from “slave.pcm plugequal1;” to “slave.pcm plugequal;”

so only the 1-digit had to go.

then i enabled the plugin and waited for the “configuration changed” message volumio pops up
then i set the volume to about 20%, because after the plugin was enabled it was set to 100% and stays there, regardless what volumio displays.

reboot.
done.

in the global playback settings i2s is shown as not active, also the mixer type is set to “none”, but the i2s and hardware mixer are definetly active.

this might be due to the fact, that the mpd-output device is now configured as loopback, which can have by definition no mixer. i guess it would be more a volumio thing, rather than a mpd topic. this could also explain that the volume bar does not refresh to the actual volume after reboot and displays the “NaN/100” thingie.

regards,
phil

update, just recieved my new hifiberry dac plus adc pro card.

same recipe as above applies to this hardware setup, since i faced the same problem.
the only difference is that i configured “hifiberry dac plus adc pro” as output device and i2s dac for the fresh image i used.

regards,
phil

Hi! I just retested on two hardware. Rpi4 + usb Dac and rpi3 + i2s Dac. Just installed from plugin manager. Reboot and everything is fine. Volume is restored. The only known thing is than mixer and i2s is not displayed correctly in UI. But to be not touched!

interesting.

i’m testing on a raspberry pi 3 model b v1.2 with

  1. hifiberry amp2 v1.0
  2. hifiberry dac plus adc pro v1.01 with an aamp60 hat v1.0 atttached.

the image i use is
volumio-2.729-2020-03-18-pi.img

i also have a raspberry pi 4 model b, will test it tomorrow.

regards,
phil

i’m using quality passive speakers with a passive subwoofer attached to a separate frequency divider.
i can hear a remarkable difference between software and hardware mixer when playing above 50% volume - and the subwoofer says hello.
could not test it this loud last saturday evening, so missed that only the software mixer was active.

tried with a raspberry pi4 with the “hifiberry dac plus adc pro”, same problems

additionally, after following my workaround recipe from above to get sound, volumio states at first reboot that device “hifiberry dac plus adc pro is not available”, but plays flawlessly using the hw-mixer, eq functional, but volume is set to 100 percent, but showin 0/100. put the volume down to 25%, by the next reboot no error occurs, but volume is again maxed by showing 0/100.

this i found in the log:

sudo cat /var/log/volumio.log | grep error 2020-04-28T13:15:12.624Z - error: Cannot set ALSA Volume: Error: Alsa Mixer Error: Failed to create secure directory (/home/volumio/.config/pulse): Operation not permitted 2020-04-28T13:15:41.125Z - error: Cannot set ALSA Volume: Error: Alsa Mixer Error: Failed to create secure directory (/home/volumio/.config/pulse): Operation not permitted

very strange, because the complete path is read/write for all.

regards,
phil

very weird!
have you installed other plugins, or software?

try this : disable the plugin and set an initial volume, save reboot. activate the plugin
what returns :

sudo apt-get -y install libasound2-plugin-equal ?

no, i did not install any other software or plugins, no “apt-get update/upgrade”, and i did not touch any other file except asound.tmpl

after the reboot and after enabling the plugin the volume was again at 100%, although volumio states NaN/100.

volumio@volumio:~$ sudo apt-get -y install libasound2-plugin-equal Reading package lists... Done Building dependency tree Reading state information... Done libasound2-plugin-equal is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.

volumio@volumio:~$ sudo cat /var/log/volumio.log | grep error 2020-04-30T15:29:42.627Z - error: Cannot set ALSA Volume: Error: Alsa Mixer Error: Failed to create secure directory (/home/volumio/.config/pulse): Operation not permitted 2020-04-30T15:29:42.704Z - error: Upnp client error: Error: This socket has been ended by the other party 2020-04-30T15:30:43.040Z - error: Cannot set ALSA Volume: Error: Alsa Mixer Error: Failed to create secure directory (/home/volumio/.config/pulse): Operation not permitted volumio@volumio:~$

balbuze, i’m sorry, i think we’re on kinda wrong track here.

i noticed clicksounds immediatly after starting a file, every 5 to 15 seconds, with “hifiberry dac plus adc pro” or “hifiberry dac plus” configured while using a hifiberry dac plus adc pro card in a fresh volumio-image on a rpi 3 or rpi 4, regardless if your plugin is installed or not. additionally, when sliding the progress-bar to the very beginning of a song, volumio always plays garbage for half a blink.

i do not have clicksounds/garbage running an actual raspbian image using vlc-player, which is preinstalled on the raspbian image.
haven’t tested with mpd so far.
btw, is there a way to install volumio as a package on raspbian?

i did not noticed the clicksound/garbage behaviour running hifiberry amp2 hw in volumio on a rpi3/4, will test tomorrow.

regards,
phil

tested now with hifiberry amp2, output setting “hifiberry dac plus”: no clicksound.
then i tested again with the adc pro hardware, but selected the “hifiberry dac plus” setting: no click sound.

so it’s related to the “hifiberry dac plus adc pro” setting in volumio.
sometimes the clicksound occurs immediately after setting, sometimes it needs a reboot to have it.

the garbage sound when seeking in a song is related to the mp3-file format (24 bit, don’t have any other for testing further at the moment), i do not have it on flac or wave files.

however, the click sound i get on all file formats.

regards,
phil