-
Notifications
You must be signed in to change notification settings - Fork 0
Home
A simple LED bar-graph style meter, to show audio signal levels from a JACK server running on a Raspberry Pi. See it in action on YouTube
The program attaches as a client to a running JACK server, samples the audio level and displays it on LEDs connected to the Raspberry Pi's GPIO pins.
jackPiledmeter uses the WiringPi library to control the GPIO pins. jackPiledmeter must be run with super-user privileges, because that's required to control the GPIO pins.
The program has some options to control its behavior:
jackPiledmeter [ -1 first_led ] [ -5 ] [ -c decay_speed ] [ -d ] [ -f freqency ] [ -i ] [ -n number_of_leds ] [ -o ] [ -p ] [ -r ref_level ] [ -s ] [ , ... ]
-1 GPIO pin where the first LED (or shift register data pin) is connected, using wiringPi numbering scheme [0]
-5 use 74XX595 shift register(s) instead of discrete GPIO pins
-c decay speed (0 to disable) [4]
-d detach from the terminal and become a daemon
-f how often to update the meter per second [40]
-i read db values from standard input, not from a Jack server
-o send db values to standard output, not to the LEDs
-n number of connected LEDs [8]
-p peak hold
-r reference signal level for 0dB on the meter
-s single light, only one wandering light instead of a growing/shrinking bar of lights
<port> the JACK port(s) to monitor (multiple ports are mixed)`
Example command line (this is what I used for the meter in the video.):
sudo jackPiledmeter -5 -n 16 -d -p system:capture_1
The -i and -o options are useful together with e.g. netcat or socat, to have the meter LEDs on an RPi different than the one that's running the audio.
The LEDs can be connected directly to GPIO pins (with the appropriate resistor of course), one LED per GPIO pin, or you can use 74x595 shift registers to drive more LEDs than you have free GPIO pins. Connecting LEDs directly to GPIO pins is easy, but requires many GPIO pins. Shift registers, on the other hand, use only three GPIO pins for up to 32 LEDs, but is more complex to wire up.
The LEDs are connected to consecutively numbered GPIO pins, using the WiringPi numbering scheme. Thus, you only give the first (lowest numbered) GPIO pin you want to use. If using shift registers, the lowest numbered GPIO pin (data) is connected to DS, the next (clock) to SHCP and the third (latch) to STCP. The default first pin is WiringPi GPIO0 - BCM GPIO 17 - physical pin 11.
A couple of different ways to connect the LEDs.
One LED per GPIO pin.

Schematic for the above.

One LED per GPIO pin, with transistor. For more power hungry LEDs.

Schematic for the above.

16 LEDs using two shift registers.

Schematic for the above.

-- Finis