# ALSA equalizer not working

**URL:** <https://dietpi.com/forum/t/alsa-equalizer-not-working/5291>\
**Category:** Troubleshooting\
**Created:** [9 May 2021 07:54 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291 "2021-05-09T07:54:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zackdvd](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/b38774/32.png) [@zackdvd](https://dietpi.com/forum/u/zackdvd)\
**Post date:** [9 May 2021 07:54 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/1 "2021-05-09T07:54:07Z")

</div>

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.

```nohighlight
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?  
  
  
  
Thank you!

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [9 May 2021 09:06 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/2 "2021-05-09T09:06:12Z")

</div>

MichaIng  
can you have a look pls. usually you are the sound expert 😉

---

<div class="post-metadata">

**Author:** ![zackdvd](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/b38774/32.png) [@zackdvd](https://dietpi.com/forum/u/zackdvd)\
**Post date:** [9 May 2021 12:08 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/3 "2021-05-09T12:08:15Z")

</div>

Thanks, hope he can help me 🙂

Forgot to post some details about the system itself:

```nohighlight
 ─────────────────────────────────────────────────────
 DietPi v7.1.2 : 4 APT updates available
 ─────────────────────────────────────────────────────
 - Device model : RPi A+ (armv6l)

```

Status: No equalizer, sound is working:

```nohighlight
dietpi@DietPi:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
dmix:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample snooping device
hw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Hardware device with all software conversions

```

There is only one difference when eq is on: Added a third line with “default”

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [9 May 2021 13:46 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/4 "2021-05-09T13:46:57Z")

</div>

To be sure, you use the onboard 3.5mm jack, right?

Can enable the equalizer and try the following:

```nohighlight
> /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

```

---

<div class="post-metadata">

**Author:** ![zackdvd](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/b38774/32.png) [@zackdvd](https://dietpi.com/forum/u/zackdvd)\
**Post date:** [9 May 2021 18:11 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/5 "2021-05-09T18:11:37Z")

</div>

Yes, 3,5mm on-board jack.  
  
  
you mean echo ?

```nohighlight
 [b]echo [/b]> /var/lib/dietpi/dietpi-config/.alsaequal.bin # Clear equalizer settings

```

Tried echo, but mixer doesnt’t like it. rm did it.

So yes, file is getting created. Settings are persistent between two starts of alsamixer.  
BUT: Any changes I make does not affect the sound…

---

<div class="post-metadata">

**Author:** ![zackdvd](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/b38774/32.png) [@zackdvd](https://dietpi.com/forum/u/zackdvd)\
**Post date:** [9 May 2021 18:19 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/6 "2021-05-09T18:19:06Z")

</div>

I mean, I activate EQ, aplay fails. I deactivate it, aplay plays just fine.  
Very strange…

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [9 May 2021 19:27 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/7 "2021-05-09T19:27:18Z")

</div>

> file is an empty redirect, echo is not required for this but doesn’t hurt either 😉.

Okay, please try the following:

```plaintext
cat << _EOF_ > /etc/asound.conf
ctl.eq {
	type equal
	controls "/var/lib/dietpi/dietpi-config/.alsaequal.bin"
}
pcm.plugequal {
	type equal
	slave.pcm {
		type plug
		slave.pcm {
			type hw
			card 0
			device 0
		}
	}
	controls "/var/lib/dietpi/dietpi-config/.alsaequal.bin"
}
pcm.!default {
	type plug
	slave.pcm plugequal
	slave.channels 2
}
ctl.!default {
	type hw
	card 0
}
_EOF_

```

---

<div class="post-metadata">

**Author:** ![zackdvd](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/b38774/32.png) [@zackdvd](https://dietpi.com/forum/u/zackdvd)\
**Post date:** [10 May 2021 18:08 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/8 "2021-05-10T18:08:11Z")

</div>

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.

```nohighlight
    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 🙂

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [10 May 2021 19:20 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/9 "2021-05-10T19:20:32Z")

</div>

Nice, I see the need for an equalizer then.

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:

```plaintext
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: [GitHub - bassdr/alsaequal: Alsaequal is a real-time adjustable equalizer plugin for ALSA](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.

Solved with: [DietPi-JustBoom | Fix equalizer by MichaIng · Pull Request #4366 · MichaIng/DietPi · GitHub](https://github.com/MichaIng/DietPi/pull/4366)  
This also removes the fixed two channels which should now be based on audio source instead.

---

<div class="post-metadata">

**Author:** ![zackdvd](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/b38774/32.png) [@zackdvd](https://dietpi.com/forum/u/zackdvd)\
**Post date:** [12 May 2021 18:34 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/10 "2021-05-12T18:34:12Z")

</div>

So I’m not sure if that should work out of the box, but if I try it does not work.

I stick now with your first solution which is now working for me 🙂

Thanks again!

---

<div class="post-metadata">

**Author:** ![zackdvd](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/b38774/32.png) [@zackdvd](https://dietpi.com/forum/u/zackdvd)\
**Post date:** [12 May 2021 19:18 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/11 "2021-05-12T19:18:23Z")

</div>

Sorry to bother you again, but shairport-sync won’t play. From verbose logging:

```nohighlight
0.008741000 "audio_alsa.c:442" *warning: alsa: error -16 ("Device or resource busy") opening alsa device "default".

```

So I tried a bit:

```nohighlight
# sudo -u shairport-sync aplay piano2.wav
aplay: main:828: audio open error: Operation not permitted

```

```nohighlight
# sudo -u shairport-sync alsamixer

```

→ Works

```nohighlight
# sudo -u shairport-sync amixer -D eq
amixer: Mixer attach eq error: Operation not permitted

```

→ not working

```nohighlight
# 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…  
  
  
Thanks.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [14 May 2021 19:51 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/12 "2021-05-14T19:51:11Z")

</div>

You mean the above config starting with

```nohighlight
pcm.!default {
	type equal

```

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?

```nohighlight
sudo -u shairport-sync cat /var/lib/dietpi/dietpi-config/.alsaequal.bin
ls -al /var/lib/dietpi/dietpi-config

```

---

<div class="post-metadata">

**Author:** ![shao](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/aeb1de/32.png) [@shao](https://dietpi.com/forum/u/shao)\
**Post date:** [23 May 2021 07:34 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/13 "2021-05-23T07:34:11Z")

</div>

Hi,

Same trouble with non working Alsa equalizer.

Quite a difference anyway i use an usb FDA and play sound with raspotify and it works like a charm without eq

Already tried the code posted above, (switching from hw 0 to hw 1 in my case) into asound.conf.

and added OPTIONS= --device eq into the raspotify conf file.

No sound at all.

Have to disable eq with justboom to have it back.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [23 May 2021 18:13 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/14 "2021-05-23T18:13:51Z")

</div>

Which config did you try exactly? That one worked: [https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/7](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/7)

---

<div class="post-metadata">

**Author:** ![shao](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/aeb1de/32.png) [@shao](https://dietpi.com/forum/u/shao)\
**Post date:** [23 May 2021 18:50 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/15 "2021-05-23T18:50:38Z")

</div>

Hi,  
I tested the one you quoted.

raspotify status is sending this :

```nohighlight
mai 23 20:46:51 DietPi librespot[9529]: 17: 0x57b304 - <librespot_playback::
player::PlayerInternal as futures::future::Future>::poll::he6e04a5bccf94e34
mai 23 20:46:51 DietPi librespot[9529]: 18: 0x4df300 - futures::task_impl::s
td::set::hab1c1811473e3998
mai 23 20:46:51 DietPi librespot[9529]: 19: 0x4d5838 - std::sys_common::back
trace::__rust_begin_short_backtrace::h8286c5a0fd04a387
mai 23 20:46:51 DietPi librespot[9529]: 20: 0x4f04f4 - core::ops::function::
FnOnce::call_once{{vtable.shim}}::h76e6c7604d7daced
mai 23 20:46:51 DietPi librespot[9529]: 21: 0x91c940 - <alloc::boxed::Box<F>
 as core::ops::function::FnOnce<A>>::call_once::h6b7ad05f87ff90ae
mai 23 20:46:51 DietPi librespot[9529]: at /rustc/7eac88a
bb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/boxed.rs:1042
mai 23 20:46:51 DietPi librespot[9529]: 22: 0x91c940 - <alloc::boxed::Box<F>
 as core::ops::function::FnOnce<A>>::call_once::he9130e675b8d97ee
mai 23 20:46:51 DietPi librespot[9529]: at /rustc/7eac88a
bb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/boxed.rs:1042
mai 23 20:46:51 DietPi librespot[9529]: 23: 0x91c940 - std::sys::unix::threa
d::Thread::new::thread_start::h7a3f6590d8e03e95
mai 23 20:46:51 DietPi librespot[9529]: at /rustc/7eac88a
bb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys/unix/thread.rs:87

```

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [23 May 2021 19:04 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/16 "2021-05-23T19:04:32Z")

</div>

Hmm, does playing a local file via aplay (wav) or mpg123 (mp3) so work?

---

<div class="post-metadata">

**Author:** ![shao](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/aeb1de/32.png) [@shao](https://dietpi.com/forum/u/shao)\
**Post date:** [24 May 2021 08:19 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/17 "2021-05-24T08:19:08Z")

</div>

Yes it does work, eq too.

Seems to be raspotify librespot issue.

Maybe OPTIONS=–device eq is not the good thing to place into raspotify conf but leaving default settings doesn’t work either

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [24 May 2021 23:45 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/18 "2021-05-24T23:45:59Z")

</div>

The device is still called “default”. “eq” is only used by mixers to control the equalizer settings.

---

<div class="post-metadata">

**Author:** ![shao](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/aeb1de/32.png) [@shao](https://dietpi.com/forum/u/shao)\
**Post date:** [25 May 2021 04:29 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/19 "2021-05-25T04:29:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [25 May 2021 12:21 UTC](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291/20 "2021-05-25T12:21:56Z")

</div>

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.

[Next page](https://dietpi.com/forum/t/alsa-equalizer-not-working/5291.md?page=2)
