Skip to content

A Raspberry Pi project that listens to audio from a USB turntable, identifies the currently playing song using ShazamIO, generates a 64×64 album art display with artist/title text, and sends it to a Divoom Pixoo-64.

License

Notifications You must be signed in to change notification settings

simontrost/VinylPi64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VinylPi64

VinylPi is a Raspberry Pi project that listens to audio from a turntable, identifies the currently playing song using ShazamIO, fetches album metadata and artwork, generates a 64×64 pixel frame, and displays it on a Divoom Pixoo. It also features a webapp with a dashboard and settings.

VinylPi Logo

Important: Hardware-specific implementation

I built this project specifically for my own hardware setup:

If you use different hardware, you will most likely have to modify parts of the code, like:

  • turntable without USB: you will need a soundcard or USB microphone on your pi
  • other pixel display: you need to modify the Divoom API calls

Features

  • Auto-detects USB audio device
  • USB audio capture from turntable
  • Automatic music recognition using ShazamIO
  • Album cover retrieval
  • Custom 64×64 pixel renderer
    • centered album cover
    • custom pixel font
    • dynamic/manual background and text font
    • marquee text for long titles/bands
    • fallback image
  • Send results to pixel diplay
  • local WebApp:
    • dashboard with current song, lyrics and switch (on/off)
    • settings: configure vinylpi
    • pixoo: configure your divoom pixoo
    • statistics: keeps track of your listened minutes, songs, artists and albums
    • about: support me :)

Example Output

Preview

Preview results

Setup

Preview results

WebApp Mobile

| | |

WebApp Desktop

| | |

Installation

0. Install OS on the Raspberry Pi

  • I recommend using Raspberry Pi OS Lite (64-bit) for best performance (again I am using the Raspberry PI zero 2 w).
  • Flash it using the official Raspberry Pi Imager.
  • Enable SSH during flashing.
  • Boot the Pi and connect via SSH:
ssh user@hostname

1. Clone the repository

git clone https://github.com/simontrost/VinylPi64.git
cd VinylPi64

hint: you might need to sudo apt install git first

2. Create and activate a virtual environment

python3 -m venv venv
source venv/bin/activate

hint: you might need to sudo apt install -y python3-venv python3-devfirst

3. Install dependencies

pip install -r requirements.txt

hint: you might need to pip install --upgrade pip first

4. Check for your audio device:

arecord -l

eg: 0 USB AUDIO CODEC: Audio (hw:0,0), ALSA (2 in, 2 out) hint: you might also want to get ffmpeg sudo apt install ffmpeg

5. Configuration:

If you don't want to use the web interface, you will have toi edit the config manually

nano config.json

6. Execute

with active env:

python vinylpi/dashboard.py

hint: you can start the actual music detection from the webapp: http://vinylpi.local:8080/or via python vinylpi/main.py

Autostart on boot

1. Create service file:

create a file:

sudo nano /etc/systemd/system/vinylpi.service

with the following content and adjust the username and paths

[Unit]
Description=VinylPi Dashboard
After=network-online.target
Wants=network-online.target

[Service]
User=pi
WorkingDirectory=/home/pi/VinylPi64
#ExecStart=/home/pi/VinylPi64/venv/bin/gunicorn --bind 0.0.0.0:5000 vinylpi.dashboard:app
ExecStart=/home/simon/VinylPi64/venv/bin/python3 -m vinylpi.web.dashboard
Restart=on-failure

[Install]
WantedBy=multi-user.target

Save and exit. You can decide if you really nead a gunicorn server, for my purpose it's not really needed.
If you do want to use gunicorn, make sure you install it via pip install gunicorn

2. Activate

sudo systemctl daemon-reload
sudo systemctl enable vinylpi.service
sudo systemctl start vinylpi.service

hint: check with sudo systemctl status vinylpi.service (should be "active (running)")

3. Logs

if something is not working check

journalctl -u vinylpi.service -f

License

Creative Commons Attribution–NonCommercial 4.0

Full license text: https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt

About

A Raspberry Pi project that listens to audio from a USB turntable, identifies the currently playing song using ShazamIO, generates a 64×64 album art display with artist/title text, and sends it to a Divoom Pixoo-64.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published