This is LED Jukebox, an audio-reactive system with five LED panels and four speakers.

- Raspberry Pi 4B, 64GB microSD, Raspberry pi os lite(64-bit)
- P2.5 64x64 RGB LED Matrix Panel x 5
- 5V 40A Power Supply x1
- 8Ω 10W Speaker x4
- 10W+10W Stereo USB DAC Amplifier x1
- Neodymium magnets(φ6mm x 3mm) for attaching LED panels and top plate to the main body. x48
- Ceiling outlet connector for power supply. x1
- 3D printed parts. Print the models in the
3d_modelsdirectory.- main_carrige.stl x1
- The main body of the jukebox.
- top_plate.stl x1
- The top plate of the jukebox. Holds ceiling outlet connecter.
- speaker_carriage.stl x1
- The speaker carriage. Holds four speakers.
- panel_adapter.stl x5
- The LED panel carriage. Holds five LED panels. Attaches to the main body using magnets.
- main_carrige.stl x1
- Raspotify: Streams Spotify music using an open-source client for Spotify Connect on Raspberry Pi.
- rpi-rgb-led-matrix: Used for controlling the LED panels.
- MQTT: Used for communication between some components.
- PyOpenGL: Used for rendering the visualizer.
- LED-Jukebox-Visualizer: The rendering library for LED-Jukebox.
-
Clone this repository.
cd /usr/local/bingit clone --recursive https://github.com/ubiquitous-o/LED-Jukebox.git- Set your
.envfile in/usr/local/bin/LED-Jukebox/.env.- Get your Spotify API credentials from Spotify Developer Dashboard.
SPOTIFY_CLIENT_ID=<your client id> SPOTIFY_SECRET_KEY=<your secret key>
- Get your Spotify API credentials from Spotify Developer Dashboard.
-
Install Raspotify as a User Service for using Audio Reactive Scripts.
- Install Raspotify.
sudo apt-get -y install curl && curl -sL https://dtcooper.github.io/raspotify/install.sh | sh- Install some audio libraries.
sudo apt-get install pipewire libasound2-plugins libportaudio2 portaudio19-dev
- Stop and Disable Raspotify Service.
sudo systemctl stop raspotify.servicesudo systemctl disable raspotify.service
- Create User Service.
mkdir -p ~/.config/systemd/user/mkdir -p ~/.cache/raspotifycp service/raspotify.service ~/.config/systemd/user/raspotify.servicesystemctl --user daemon-reloadsystemctl --user enable raspotify.servicesystemctl --user start raspotify.service
- Set Your Speaker.
wpctl status- Remember your Sinks ID
DEFAULT_SINK_ID=<your id>NODE_NAME=$(pw-cli info $DEFAULT_SINK_ID | grep 'node.name = ' | head -n 1 | cut -d '"' -f 2)MONITOR_SOURCE_NAME="${NODE_NAME}.monitor"- Check your monitor source name
echo $MONITOR_SOURCE_NAME- example:
alsa_output.usb-Apple_Computer__Inc._Speakers_p4000-00.analog-stereo.monitor
- Check for Playing and Recording at the Same Time for Testing.
- Play spotify music on raspi using Spotify Connect
- Record playing music
PULSE_SOURCE=$MONITOR_SOURCE_NAME arecord -D pulse -r 48000 -f S16_LE -c 2 output.wav
- Install Raspotify.
-
Install rpi-rgb-led-matrix
- Refer to this guide to install the Python bindings: python bindings
- Build the python bindings:
git clone https://github.com/hzeller/rpi-rgb-led-matrix.gitcd rpi-rgb-led-matrix/bindings/python/sudo apt-get update && sudo apt-get install python3-dev cython3 -ymake build-python
- Install
rpi-rgb-led-matrixinto your venv:cd /usr/local/bin/LED-Jukeboxpython -m venv venvsource venv/bin/activatecd rpi-rgb-led-matrix/bindings/python/pip install .
- Set
dtparam=audio=offin/boot/firmware/config.txtfile. - Add snd_bcm2835 to blacklist
cat <<EOF | sudo tee /etc/modprobe.d/blacklist-rgb-matrix.conf blacklist snd_bcm2835 EOF sudo update-initramfs -u
- Set
isolcpus=3in the end of/boot/firmware/cmdline.txtfile.sudo vim /boot/firmware/cmdline.txt- example:
console=serial0,115200 console=tty1 root=PARTUUID=2b5c324a-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=JP isolcpus=3
- example:
- Reboot your pi.
sudo reboot
-
Setup LED-Jukebox
- Setup System Services
- Setup MQTT as a system service.
sudo apt-get install mosquitto mosquitto-clientssudo systemctl enable mosquitto.servicesudo systemctl start mosquitto.service- Set MQTT broker service
sudo cp service/led-jukebox-mqtt.service /etc/systemd/system/led-jukebox-mqtt.servicesudo systemctl daemon-reloadsudo systemctl enable led-jukebox-mqtt.servicesudo systemctl start led-jukebox-mqtt.service
- Set LED matrix subscriber
sudo cp service/led-jukebox-led-matrix.service /etc/systemd/system/led-jukebox-led-matrix.servicesudo systemctl daemon-reloadsudo systemctl enable led-jukebox-led-matrix.servicesudo systemctl start led-jukebox-led-matrix.service
- Set Beats publisher as a user service.
cp service/led-jukebox-beats.service ~/.config/systemd/user/led-jukebox-beats.servicesystemctl --user daemon-reloadsystemctl --user enable led-jukebox-beats.servicesystemctl --user start led-jukebox-beats.service
- Auto login setting
sudo vim /etc/systemd/system/getty.target.wants/getty@tty1.service#ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear - $TERM ExecStart=-/sbin/agetty --autologin <your user name> --noclear %I $TERMsudo systemctl daemon-reloadsudo reboot
- Setup System Services
-
Renderer Settings
- LED-Jukebox is rendered using OpenGL.
sudo apt-get install -y build-essential python3-dev libgles2-mesa-dev mesa-utils libgbm-dev libdrm-dev xvfb
- Set gpu_memory in
/boot/firmware/config.txtfile.sudo vim /boot/firmware/config.txtgpu_mem=128
- Install
pyopenglandpyopengl-accelerate.- Clone the repository.
git clone https://github.com/mcfletch/pyopengl.gitcd /usr/local/bin/LED-Jukeboxsource venv/bin/activatecd pyopenglpip install -e .cd acceleratepip install -e .
- Clone the repository.
- Install python dependencies.
pip install -r requirements.txt
- LED-Jukebox is rendered using OpenGL.