pivumeter icon indicating copy to clipboard operation
pivumeter copied to clipboard

How to use pivumeter alongside the python phatbeat library?

Open pirateradiohack opened this issue 6 years ago • 2 comments

When I try to use the phatbeat python library by setting some pixels (as documented here http://docs.pimoroni.com/phatbeat/) while playing music with pivumeter installed on my phatbeat, I can only see some random pixels (even when I set only 1 pixel) briefly flashing. I can send the exact same command several times and witness how different random pixels flash briefly. Even when using the VLC project. The play / pause button has the clear function used (https://github.com/pimoroni/phat-beat/blob/master/projects/vlc-radio/phatbeatd/usr/bin/phatbeatd). When I play pause I can see how the vumeter disappear and also a random flash of some random colours appear, at pause, and play.

I have to stop the pulseaudio.service in order to shutdown pivumeter before I can use the phatbeat python library as expected.

I would really like to keep the vumeter going and also at the same time insert some other user interfaces through the use of the LEDs with the python library. Is that possible? Can I use pivumter only on 1 LED channel and free the other channel of the phatbeat to use with the python library?

Thanks!

pirateradiohack avatar Jun 23 '19 23:06 pirateradiohack

Poor PiVuMeter sort of got left by the wayside due to some unresolved issues that didn't make it quite ready to push hard. However I did have a devel branch with a PR that provides a "socket" output for Pi VU Meter - https://github.com/pimoroni/pivumeter/pull/15

This is relevant because you can use Pi VU Meter in "socket" mode and then write all the display code in Python like so: https://github.com/pimoroni/pivumeter/blob/f0e333230fc6e83b992eda0d4df432998cd65fdc/python_server/examples/phatbeat-server.py

That now means that you can mix your Python user code and Pi VU Meter code and switch between manual display/VU display, or mix/match as you see fit.

Gadgetoid avatar Mar 09 '20 21:03 Gadgetoid

that sounds quite promising indeed.

pirateradiohack avatar Mar 10 '20 06:03 pirateradiohack