I’ve just set up a Pirate Radio but can’t control the PhatBeat LEDs from Python.
If I set up using pHAT BEAT tutorial, the speaker-test works fine (audio plays, VU meter works) but test files and Python examples don’t control LEDs correctly – LEDs flash and flicker. I also tried VLC internet radio tutorial – works ok, including VU meter.
I’ve tried swapping PiZeros and also tested with Blinkt board to check for poor soldering. Blinkt works fine on clean install, but then stops working once phatbeat library installed.
Any suggestions for steps to debug further? I’ve run out of ideas…
No doubt the code for the VU meter is running in the background and clobbering any attempt you make to update the display.
Try- as a quick test- renaming the /etc/asound.conf
file to /etc/asound.conf.backup
, rebooting, and seeing if you can get some sense out of the LEDs.
Success! Yes – that got it going.
What is the better way of doing this? Is it the phatbeatd daemon?
It depends if you want the VU meter and your own customisation to co-exist. It’s possible to remove the Pi VU Meter stuff from asound.conf and use your own Python script to control the LEDs. What are you trying to accomplish overall?
In the short term, I was just testing that everything was working by running the test scripts!
But also thinking about converting an old speaker enclosure into media player – for which I might not want the meter at all. The pHAT BEAT would still be a neat solution as DAC and amp, even if I didn’t use buttons or LEDs.
Thanks for the steer. Maybe a note in tutorial would be useful in case others fall into same trap?
Cheers
Hi. I’ve just received my phatbeat - thanks for the quick delivery - but have also fallen foul of this issue too, i.e. being unable to control the LED’s until I rename the asound.conf file to disable the VU meter. It may be worth adding a note into this page about it: https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-phat-beat probably best in the " Controlling the VU meter LEDs separately" section.
However, I was wondering if there was a way to turn the VU meter functionality on/off without needing a re-boot?
By the way, I’m really impressed with the sound quality!
Any help would be greatly appreciated.
Additional note: It would appear the VU meter is also taking up to 30% CPU all the time, even when no audio is playing, so another reason for only wanting to enable it when playing audio.