Help: alsa Plugin.equal with docker

Hi,

I’m trying to use alsa plugin equal to get more feminine voice (less bass).

  • Installing on last Buster up to date -> ok
  • Setting equal -> ok, got /home/pi/.alasaequal.bin
  • Testing with speaker-test -c1 --test=wav -w /usr/share/sounds/alsa/Front_Center.wav -> ok
  • Having rhasspy use it -> NOK

I’m really not an expert of linux and audio (dmix, snoops and so on). With Snips, we had to copy the bin file to /var/empty/.alsaequal.bin so snips audioserver could use it. I guess there is something like that to do for Docker, but dunno where to put it, what to do.

In rhasspy settings I’m tried all aplay settings (direct, with all conversion, default, etc) without luck.

Here is my asound.conf that works in ssh on the pi:
With respeaker 2 pi hat, default pi soundcard disabled, respeaker jack used.

defaults.pcm.rate_converter "samplerate"
pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "plugequal"
    }
    capture.pcm {
        type plug
        slave.pcm "hw:seeed2micvoicec"
    }
}
#equalizer:
ctl.equal {
 type equal
}
pcm.plugequal {
 type equal
 slave.pcm "plughw:seeed2micvoicec"
}
pcm.equal {
 type plug
 slave.pcm plugequal
}

If any asound / docker guru could help ? It really make a big difference for voice quality.

Here is how to set it up with Snips: https://github.com/KiboOst/SNIPS-Tips/tree/master/snips_equal

I have tried, like here : Hass.io addon: make Rhasspy use custom asound.conf, to add:

-v "$HOME/rhasspy/asound.conf:/etc/asound.conf" \

Doesn’t work either :cold_sweat:

Strange:

Starting docker with:

docker run -d -p 12101:12101 \
	--name rhasspy \
	--restart unless-stopped \
	-v "$HOME/.config/rhasspy/profiles:/profiles" \
	-v "/etc/localtime:/etc/localtime:ro" \
	-v "/etc/asound.conf:/etc/asound.conf" \
	--device /dev/snd:/dev/snd \
	--ipc="host" \
	rhasspy/rhasspy \
	--user-profiles /profiles \
	--profile fr

I now see:

But for both, got audioserver error return -1 …

Are you using PulseAudio? I never got Rhasspy working with PulseAudio in Docker until this excellent documentation by @daywalker1180:

1 Like

Don’t think so, never installed it and even don’t know what it is lol !
No pulse in my asound.conf anyway so maybe rhasspy container get it’s own sound config, even linking asound inside ?

Rhasspy going well in production, voice is the only thing not waf. Was the same with snips before I put pluginequal on it :wink:

Tried like this

docker run -d -p 12101:12101 \
	--name rhasspy \
	--restart unless-stopped \
	-v "$HOME/.config/rhasspy/profiles:/profiles" \
	-v "/etc/localtime:/etc/localtime:ro" \
	-v "/etc/asound.conf:/etc/asound.conf" \
	-v "/home/pi/.alsaequal.bin:/profiles/.alsaequal.bin" \
	--device /dev/snd:/dev/snd \
	rhasspy/rhasspy \
	--user-profiles /profiles \
	--profile fr

With volumes for asound.conf and alsaequal setting file, but no luck.
Once more, it does work on the host, not in rhasspy. And dunno why rhasspy see pulse equal/plugequal devices :face_with_raised_eyebrow:

Also try to create docker volumes for /usr/lib/ladspa/caps.so seen here:

Still doesn’t work :sob:

Strange that no one use it really …

OOOOOOOOOOOOK !!!

Finally got it working !!!

After starting the rhasspy container, I did:

docker exec -t -i rhasspy /bin/bash
This put me inside the container.

Then:
speaker-test -c1 --test=wav -w /usr/share/sounds/alsa/Front_Center.wav

Here, I add some messages with missing libraries and such.

So finnally, starting the container like this:

docker run -d -p 12101:12101 \
	--name rhasspy \
	--restart unless-stopped \
	-v "$HOME/.config/rhasspy/profiles:/profiles" \
	-v "/etc/localtime:/etc/localtime:ro" \
	-v "/etc/asound.conf:/etc/asound.conf" \
	-v "$HOME/.alsaequal.bin:/profiles/alsaequal.bin" \
	-v "/usr/lib/ladspa:/usr/lib/ladspa" \
	-v "/usr/lib/arm-linux-gnueabihf/alsa-lib:/usr/lib/arm-linux-gnueabihf/alsa-lib" \
	--device /dev/snd:/dev/snd \
	rhasspy/rhasspy \
	--user-profiles /profiles \
	--profile fr

It does work !! With Audio playing set as aplay / Default Device

Will have to clean asound.conf, check if I can simplify this, and finally write a memo on how to make it work.

BUT: There is something really strange !

  • In rhasspy UI when I navigate between pages (settings, home etc) at each page change I hear a scrrrrtttcccchhhhhh in the speaker.
  • At start and end of TTS I have same, let’s say 0.5s, scrrrrtttcccchhhhhh
    It is lower than the voice, but present.
1 Like

Ok, got it explained here for those who want to use it:

No need to copy settings file or such inside the container, you can run the plugin-equal as usual, and even change settings without having to restart Rhasspy !

WAF just increased a lot :rofl:

:beers:

3 Likes