Phat Beat increase VU meter sesitivity

Is there a way to increase the VU meter sensitivity so it peaks at lower volume levels? The sound is way to loud if I turn it up enough to get a good indication on the VU meter. Most of the time only the bottom two LED’s flicker. I didn’t see anything relevant in the alsa config file for the pHat Beat.

It’s in my TODO list- actually I’m completely re-working how the VU works so that the front-end (the bit which actually displays the VU data on your HAT/pHAT etc) is entirely Python, making it easier for people to tweak to their needs.


Or, in your case,

The trouble is, however, that the front-end, and even ALSA itself (where the plugin to grab the VU data is inserted) have, as far as I’m aware, absolutely no knowledge of what the current volume level is. I plan to rectify that by doing a rather clunky call out to amixer like so:

    def get_volume(self):
        actual_volume = subprocess.check_output("amixer get 'PCM' | awk '$0~/%/{print $4}' | tr -d '[]%'", shell=True)
        if version_info[0] >= 3:
            return actual_volume.strip().decode('utf-8')
            return actual_volume.strip()

I was hoping for a reply along those lines. I saw the older threads on the same subject, with the its being looked at comments. It’s a nice bit of kit and IMHO, could be a lot better with some tweaking. I just don’t have the skills to tweak it myself. Thanks for the reply and the links, will definitely have a look see.

As long as you’ve got the skills to join the crowd of people nagging me to get it done, that should move it along nicely ;)

Still! I wholeheartedly encourage you trying to get the linked dev branch of PiVUMeter up and running on your own ;) it may end in failure, but it will certainly result in learning.

I have next to no Linux skills. Some Python skills, but that was mostly from learn by example. I will research it some and maybe give it a try. I have a spare Micro SD card to play around with and not mess up what’s working now.

Has there been any progress on this?
I have just put together a phat beat and all is well except for the issue of the VU meter not really displaying anything unless the volume is cranked way up.

As it is it’s a nice sound card for the Pi Zero but the VU meter doesn’t really work.

I put it on the back burner and then forgot all about it. ops.

Just about to ask the same Q - Phatbeat and Led’s working but i am using it al low volume so looking to change the sensitivity.

Is this possible at all?


I’ll see if I can spend some time on this latter on today. After my wife gets out of bed… ;)
To be honest though, I think its above my skill level. That hasn’t stopped me in the past though.
@gadgetoid , Phil my pHat Beat is one of the early ones, I think there was a hardware mode / revision done to help with the pop sound issue. Will that factor into this?

Ok, so the LEDS are APA102’s, addressable RGB. And its a Pimoroni plugin that handles those?
Is all that magic done on the Pi? Via BCM 23 Data and BCM 24 Clock? Just trying to wrap my head around how it al works? The product page says, " and install our VU meter plugin to display the volume levels in real time (although you can disable this and code the LEDs yourself).".
I’m thinking thats this bit,

It may be a while before I have a go at this. Some pressing family matters came up yesterday that I have to attend to.

You can increase the sensitivity on the Phat Beat VU Meter by doing the following:

cd Pimoroni/pivumeter
nano src/devices/phat-beat.c

Change line 88 to:

int bar = (meter_level * (meter_level / 8) / 512000.0f) * (brightness * (NUM_PIXELS/2));

Recompile the library:

sudo make install

Now your VU meter is more sensitive! Tweak the values to your liking.

1 Like

Wow, thankyou very much for that. =)
Its looking like it going to be a rainy stuck in the house weekend here so its a good time to have a go at that. Thanks again for taking the time to figure it out. :)

I’m going to give this a try latter on today. Do I need to stop my stream first or stop my Pirate radio from starting up automatically when I boot up that Pi? Or can I just go ahead and do the above while its running?

That worked, its actually a bit to sensitive now. I get full at low to moderate volume levels. Not a complaint just an observation. What would I change in that line of code to lower it down a bit? By 1/3 or 1/2 of what it is now?
Definitely a step in the right direction. =)

EDIT: I assume I’d change the “131071.0f”, do I increase it or decrease it?

EDIT: 2. You raise that number to lower the sensitivity. I’d try 600000 or 700000, with the volume at the level you usually listen to it at.

Yes, I originally did it early one morning when the rest of the family was still asleep. I agree it’s a bit too sensitive and I’ve tweaked mine since doing it, think I’ve got a good compromise now. My line currently looks like this:

    int bar = (meter_level * (meter_level / 8) / 512000.0f) * (brightness * (NUM_PIXELS/2));

Mines at 1200000.0f. I have my volume a bit on the loud side though. Thanks again for sorting this out. Its nice to have a full scale VU meter that you can tweak to your preference. =)