Okay, I’ve done a bit of sleuthing into this and found that the issue lies with “dmix” rather than Pi VU Meter
Removing dmix from the equation gets audio output- including Pi VU Meter- up and running stably again.
Dmix was included in an attempt to allow multiple audio streams to output to the same device, which is not really an issue with Pirate Radio and probably something better solved with Pulse Audio (since it also solves the popping issue).
I’m not 100% sure what’s happening, but since the plugins in ALSA seem to share access to the same PCM channel buffer my hypothesis is that dmix is silently corrupting or trashing it somehow and that, in turn, causes Pi VU Meter to segfault when it tries to access it.
I am still testing this configuration on my own Pirate Radio setup, but so far it’s run for longer than 2 minutes and most fails have been at the 1-2 minute mark, so it looks pretty promising.
Now, an actionable fix for Stretch users? Just replce your /etc/asound.conf
with the following:
pcm.!default {
type plug
slave.pcm "softvol_and_pivumeter"
}
ctl.!default {
type hw
card 0
}
pcm.pivumeter {
type meter
slave.pcm "hw:0,0"
scopes.0 pivumeter
}
pcm.softvol_and_pivumeter {
type softvol
slave.pcm "pivumeter"
control {
name "PCM"
card 0
}
}
pcm_scope.pivumeter {
type pivumeter
decay_ms 500
peak_ms 400
brightness 128
output_device phat-beat
}
pcm_scope_type.pivumeter {
lib /usr/local/lib/libpivumeter.so
}
pcm.dsp0 pivumeter