Hi all,
just recently discovered dietpi and in general I’m very very happy with it! So many tweaks and config options, I’m blazed!
This includes having the option to activate the alsa equalizer. I did id some time ago with rasperry pi os and there it’s a lot of work by hand.
So I configured and activated die Equalizer with dietpi-config. It did change something (volume went up) and I’m able to start alsamixer with equalizeroptions, but any change has no effekt.
Addionally, after a reboot, I cannot play anything.
E.g.
dietpi@DietPi:~ $ aplay piano2.wav
Playing WAVE 'piano2.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
ALSA lib pcm_params.c:2226:(snd1_pcm_hw_refine_slave) Slave PCM not usable
aplay: set_params:1310: Broken configuration for this PCM: no configurations available
After disabling EQ, rebooting, sound is available again.
Summary: Activating is fine, sound still there, but changing EQ has no effect. After reboot, sound not available at all.
Any hints on that? Do you suggest any tests I should do ? Any idea where the problem may have it’s source?
To be sure, you use the onboard 3.5mm jack, right?
Can enable the equalizer and try the following:
> /var/lib/dietpi/dietpi-config/.alsaequal.bin # Clear equalizer settings
alsamixer -D eq # Adjust settings
ls -l /var/lib/dietpi/dietpi-config/.alsaequal.bin # Check whether this file is now not empty, hence settings have been stored
OK, let’s just forget about my comment on the “missing” echo… :facepalm:
And for you asound.conf:
Yes, that absolutely did the trick! Everything is working.
What was the reason?
I see an added nesting of slave.pcm.
slave.pcm {
type plug
slave.pcm {
Anyway, thank you!
If you are curious what I’m doing: I built a webradio, streaming with mplayer. You can also connect via airplay, radio stops as long as airplay is running. And for the mixer: I’ve a bass and treble box inside and doing a SW-frequency control for the loudspeakers
The type plug ALSA plugin does software conversion of channels, rate and format, when required for the sound card/driver. That is already used in the first place, as pcm.!default is type plug as well but in some cases it seems to be required (again) after the equalizer. I wonder if it would be possible like that as well to avoid having the conversion plugin two times in the pipe:
pcm.!default {
type equal
slave.pcm {
type plug
slave.pcm {
type hw
card 0
device 0
}
}
controls "/var/lib/dietpi/dietpi-config/.alsaequal.bin"
}
But the way you have it now matches the official instructions, and I’ll adjust our implementation accordingly: https://github.com/bassdr/alsaequal
EDIT:
Further reading in the repo:
sound card to output to, will probably have to be a plug since alsaequal only supports floating point numbers, a “plug” will convert the data type, outputig directly to hw won’t;
…
You will also probably need to pump the data through a plug to change the format to float, which is all alsaequal supports.
I lack insights about how the audio stream looks like but it seems like the equalizer supports only a specific format (floating point numbers) while the audio source might be in a different format and the sound card/driver requires a different format as well. So there needs to be a “plug” first to convert the audio source into floating point numbers and one afterwards to convert it into a format supported by the sound device. Sounds like a nasty overhead, but since it is the intended setup, it doesn’t seem to have a significant negative impact.
# groups shairport-sync
shairport-sync : shairport-sync audio
I may can let shairport-sync run as dietpi, but I think others will have the failure and I’m curious what it is.
My first guess was shairport-sync not in audio group, but that was fine from the beginning…
does not work? That confirms my guess that incoming and outgoing streams must both be piped through a “type plug” plugin, which is also the solution I added to our code.
Hmm, has shairport-sync read access to the equalizer config?
sudo -u shairport-sync cat /var/lib/dietpi/dietpi-config/.alsaequal.bin
ls -al /var/lib/dietpi/dietpi-config
Ok, so there is nothing to change into raspotify conf ?
Already tried to leave it as it was.
Still no sound with it ans with the error posted previously.
It should work OOTB. The foreground audio interface is the same, only the middle- and back-end changed. You can try to use OPTIONS=–device=default explicitly, but that indeed should be default when nothing is set.
Can you try to remove slave.channels 2 from /etc/asound.conf? Not sure why we forced stereo in the past, I removed that part to have it based on the actual audio source. Probably that is already the issue Raspotify has, when source channels are not two.
Another thing, when you copy&paste the config. Is card 0 and device 0 actually the correct sound card?
Check the IDs via aplay -l.