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.

My Loopback PCM in roon is showing as “Fixed volume” - even after I selected use device volume.

I found the one which was attached to hw:Loopback,0,0 and grouped that with the zone I was listening to

How did you found out which loopback roonbridge is using ?

1 Like

That’s really cool and bent my brain a bit. I’m completely the opposite, where HW VU meters would be trivial to setup, but I’d struggle mightily to do the ALSA loopback.

Sorry I missed this. It’s literally trial / error. Enable in Roon and play something. Then run the above alsaloop command against loopback the different Loopback devices until you get something.

1 Like

Hello! Would you be able to detail the process step by step to make this work, please? Thanks!

I’ve managed to build a Pi+ 7" touchscreen running Roon Bridge, peppyalsa and peppymeter and the alsaloop trick.
It works, but it’s not ideal, as you need to group zones and it doesn’t like straying from 16/44.1 PCM, forget DSD…

So, I’ll be working on some ALSA-fu to get to the green box and get something totally transparent to Roon that will support whatever audio thrown at it. I’m pretty sure that ALSA has all the bits required and that it’s a matter of plumbing the correct configuration.
Basically, the green box is the magic trick.

Once all sorted, I’ll push a full documentation to @spockfish with the hope that it can make it into Ropieee

4 Likes

Part.
I also have a roon core on nuc i7, plus raspi from volumio and roon bridge. I would like to capture somehow the roon bridge signal for the display under the covers or vu indicators (without roon bridge after airplay, there is a reduction to 16/44, but the display works).
have any of you already done it and could help? thank you

Any chance that someone would be willing to help me get this up and running? I have a feeling I’m really close, but just making a dumb mistake.

Well then, give us details as to what you’ve achieved so far and where you think you’re stumbling…

Thank you. The two loopback options show up in roon, and there are 3 output options that show up in volumio (headphones, dummy, and loopback). The only combination that results in communication with volumio from roon is when the headphone device is selected in Roon and the output device in volumio is set to headphones. If any other combination is selected then volumio stops communicating with Roon.

Not being a Volumio user here, I think it’s probably better to check their fora.
While working on my Roon-dynamic-range-metering-bridge I think I’ve seen links to threads regarding setting up and using the peppy meter plugin…

Edit:
Do you have peppy meter work as Volumio plug in yet?
If so, then just grouping with whatever zone you want it to display should do the trick, no?

Thanks but I’ll keep working this thread as this is the only thread I’ve found where people have had success doing this. Unless you’re using roon, there’s no reason to setup the loopback.

I finally had a chance to revisit this and want to say thanks to @ipeverywhere (and everyone else) for continuing to tinker around with this. With snd-aloop and alsaloop everything is working in my Pi streamer when I group the loopback device with the standard endpoint in Roon. Very cool.

I’ll post my full walkthrough later where I’ve distilled all of the above (plus a few other tweaks to PeppyMeter configs) to get everything working as a complete streamer + VU meters, but first I’m going to test building a basic Volumio streamer running RoonBridge and nothing but the VU meters which may be easier in the long run.

One problem I can’t figure out with the manual approach, though: My Pi streamers are all configured to run at 1024x768 but there are no Peppy Meter skins that fit that resolution, and I can’t figure out how to tell python3 peppymeter.py to run at full screen. Anyone have any suggestions on running Peppy Meter at full screen with standard Pi resolutions?

1 Like

Two updates:

  • I gave Volumio a try and I have to say I’m liking their distro more and more as a Roon endpoint. There’s a newer tool called ‘volroon’ which is available as a plugin w/in Volumio that uses a web extension to display Now Playing and basic playback functions. No Now Playing support was a huge blocker for me and Volumio, glad to see it. BUT, no luck getting PeppyMeter to work with a Roon stream. I tried hacking around with asound.conf but couldn’t get it to work, which is a shame b/c it’s slick as a Volumio screensaver. I’m going to request Roon support b/c it’s a much more elegant solution than the manual implementation below.

  • I was able to fix the full screen issue and cobble together a super quick runbook for getting this up and running on a 3.5 TFT. It’s not 100% yet – autostart with peppymeter and alsaloop isn’t working, and there are still a few bumps that aren’t fully solid (see below), but it’s a great first PoC.

Quick walkthrough on getting this running on a standard Pi w/ screen:

  • Get the endpoint up and running with RoonBridge and your screen however you’d like. Once that’s working…
    • You’ll need to force your screen resolution to match one of the pre-scaled resolutions like 800x480 to use “large” meters
  • Install peppyalsa:
    • git clone GitHub - project-owner/peppyalsa
    • cd peppyalsa/
    • sudo apt-get install build-essential autoconf automake libtool libasound2-dev libfftw3-dev
    • aclocal && libtoolize
    • autoconf && automake --add-missing
    • ./configure && make
    • sudo make install
  • Make fifo
    • mkfifo ~/myfifo
  • Load snd-module
    • sudo modprobe snd-aloop (to load it now)
    • sudo echo ‘snd-aloop’ >> /etc/modules (to persist it after a reboot)
  • Run alsaloop
    • alsaloop -d -C “hw:Loopback,0,0” -P “peppyalsa” -l 1500 -b &
  • Grab PeppyMeter (you’ll need python3 if you don’t have it installed)
    • git clone GitHub - project-owner/PeppyMeter: PeppyMeter Repository
    • cd PeppyMeter
    • edit config.txt to choose “large” (assuming you set that resolution from above) and to choose your meters (or just leave it random for now to get started)
    • export DISPLAY=:0 && cd /home/pi/PeppyMeter/ && python3 /home/pi/PeppyMeter/peppymeter.py > /dev/null 2>&1 & (remove the background and redirects to /dev/null to test and see full output if you have issues)
  • In Roon, enable the Loopback PCM device now available for your Pi RoonBridge endpoint
  • Group the standard Alsa RoonBridge endpoint with the new Loopback PCM and you should be in business.

I’ve been running with this setup all day, rotating between a few different meters, and generally all is good, but I have had two issues with the above:

  • I had to set the latency (-l in alsaloop) really high to avoid buffer underrun issues. No idea why; everything in my env is connected over ethernet so it’s not a network issue. It does make the Peppy needles a bit less responsive.
  • After listening in this setup for a while, maybe ~30 minutes, the audio will become distorted, starting gradually and sounding mechanically until it becomes really robot-y and distorted. Ungrouping and regrouping in Roon fixes it. It may be something that I can correct in the loopback Roon settings, haven’t played around yet. Or maybe increasing the buffer?
1 Like

@rcrawley umfortunately I can’t be of any help on the resolution thing, but as a photographer I’m pretty handy in photoshop and might be able to adjust a couple of the backgrounds to fit the needed resolution for you.

If you need any help testing your instructions please feel free to DM me.

Thanks @312Elements! I think we were posting at the same time. :slight_smile: Forcing my Pi screen to a resolution that matched the “large” resolution for Peppy has worked for now, but thanks for the offer! My next step is to work out why launching Peppy via autostart isn’t working, but once that’s done and I have bootable VU Meters I may take you up on on that offer.

Also found this archive of different sized meters:

…and a few different options and resolutions embedded in this long thread:

1 Like