Peppymeter (peppyalsa) VU Meters with Roon?

Ok, I know this is a complete shot in the dark, but thought it would be worth asking. I’m playing around with a RPi4 running RoonBridge (right now just plugged into a small speaker from the headphone jack but will eventually feed a DAC and headphone amp via USB), no HAT, and nothing else beyond RoonBridge. All is working well and as expected with Roon.

I’d like to run a software VU meter as well on the RPi4 and have had good success with PeppyMeter/peppyalsa which is working well when manually piping audio through the ‘peppyalsa’ software device, but I’m not having any luck getting Roon to pipe audio through peppyalsa so PeppyMeter can pick it up. I’m pretty sure this is by design as Roon writes directly to the hardware so no opp to pipe it through a software device, but in my case Peppy is also writing to “hw:0,0”, so I’m wondering if there’s any opp here to redirect Roon through peppyalsa.

I know, this is a bit ridiculous b/c I’m only messing around with this to get software VU meters to display on Roon data, no real value, but it’s a fun project, I’m a sucker for VU meters, and don’t have the skillset to pursue HW VU meters.

Anyone ever done anything like this?

I was able to use snd-aloop to loop bridge to a BT output. Maybe you can use it to loop through your vu meter? Wild guess… but, as you said, just testing.

Thanks for the pointer. How did you redirect Roon audio to a specific device? I’m not finding anything where I can set a config for Roon output…

This might not be my whole config. I actually had to hack my way into this SD card as I had forgotten my password… it’s been a while so going from memory on what I touched.

After your Pi is “working” with Roon you need to get the snd-aloop module loaded. This is an ALSA module. Make sure your distribution uses ALSA.

This will create loopback “hardware” devices like:
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]

“Loopback PCM” will show-up as a RAAT destination you need to enable in Roon. There might be more than one. Enable this in Roon

Then you need to run something like:
/usr/bin/alsaloop -d -C "hw:Loopback,0,0" -P "btaudio" -l 20000 -b 8000

-d runs alsaloop as a daemon
-C is the capture device, this is where Roon is sending the audio
-P is the “Playback” device. This is probably your VU meter.
*Note, I have a whole other set of things that runs and automatically tries to attach to a specific BT speaker address in the background. That speaker is built as “btaudio” in the alsa.conf
-l is latency
-b is non-block mode and I forget why I set this

I found the Pi was dropping a lot of frames trying to feed the outbound audio device until I set the latency properly. Just trial and error. There are lots of other options:
http://manpages.ubuntu.com/manpages/bionic/man1/alsaloop.1.html

I’ll leave the rest up to you. This, hopefully obviously, is not a complete guide. If you ask questions maybe I’ll remember what else I did to make this work. Good luck. I do remember it took me a while to get the snd-aloop module to load.

Oh… and I just had an idea… If you do get snd-aloop loaded and looped into the VU meter it may be possible to just group a zone with the VU. That would be slick. Then you could have a dedicated Pi doing nothing but VUs.

OK, I got bored. I got it working…
$ /usr/bin/alsaloop -d -C "hw:Loopback,0,0" -P "peppyalsa" -l 100 -b

$ ./peppyalsa-client 
Peppy ALSA Client. Goya Edition. 2018/09/08
No pipe name provided, defaulting to /home/pi/myfifo
L: ===============                                                             
R: ===========                                                                 

In Roon I had 2 loopback devices. I found the one which was attached to hw:Loopback,0,0 and grouped that with the zone I was listening to. Now I’ve got meters. Fun stuff.

EDIT: Play with the -l The lower the latency the better the meter will track to the music but too low and you’ll see errors.