Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

LED Jukebox

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

sample video is here

Hardware Specifications

Dependencies

  • 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.

Setup

  1. Clone this repository.

    • cd /usr/local/bin
    • git clone --recursive https://github.com/ubiquitous-o/LED-Jukebox.git
    • Set your .env file 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>
        
  2. 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.service
      • sudo systemctl disable raspotify.service
    • Create User Service.
      • mkdir -p ~/.config/systemd/user/
      • mkdir -p ~/.cache/raspotify
      • cp service/raspotify.service ~/.config/systemd/user/raspotify.service
      • systemctl --user daemon-reload
      • systemctl --user enable raspotify.service
      • systemctl --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
  3. 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.git
      • cd rpi-rgb-led-matrix/bindings/python/
      • sudo apt-get update && sudo apt-get install python3-dev cython3 -y
      • make build-python
    • Install rpi-rgb-led-matrix into your venv:
      • cd /usr/local/bin/LED-Jukebox
      • python -m venv venv
      • source venv/bin/activate
      • cd rpi-rgb-led-matrix/bindings/python/
      • pip install .
    • Set dtparam=audio=off in /boot/firmware/config.txt file.
    • 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=3 in the end of /boot/firmware/cmdline.txt file.
      • 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
    • Reboot your pi.
      • sudo reboot
  4. Setup LED-Jukebox

    • Setup System Services
      • Setup MQTT as a system service.
      • sudo apt-get install mosquitto mosquitto-clients
      • sudo systemctl enable mosquitto.service
      • sudo systemctl start mosquitto.service
      • Set MQTT broker service
        • sudo cp service/led-jukebox-mqtt.service /etc/systemd/system/led-jukebox-mqtt.service
        • sudo systemctl daemon-reload
        • sudo systemctl enable led-jukebox-mqtt.service
        • sudo 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.service
        • sudo systemctl daemon-reload
        • sudo systemctl enable led-jukebox-led-matrix.service
        • sudo 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.service
        • systemctl --user daemon-reload
        • systemctl --user enable led-jukebox-beats.service
        • systemctl --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 $TERM
          
        • sudo systemctl daemon-reload
        • sudo reboot
  5. 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.txt file.
      • sudo vim /boot/firmware/config.txt
        gpu_mem=128
        
    • Install pyopengl and pyopengl-accelerate.
      • Clone the repository.
        • git clone https://github.com/mcfletch/pyopengl.git
        • cd /usr/local/bin/LED-Jukebox
        • source venv/bin/activate
        • cd pyopengl
        • pip install -e .
        • cd accelerate
        • pip install -e .
    • Install python dependencies.
      • pip install -r requirements.txt

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages