A simple Jukebox App for my Raspberry Pi. This is meant to act as a self-contained jukebox, not a full-featured media player. As such, it is essentially a 'now playing' queue. A user can browse by artist or genre and select a song to be added to the queue. By default, music is read either from disk or USB stick (if you want, you can mount a shared network drive in /var/media/music, but there is currently no GUI configuration mechanism to accomplish this). Also, while you can control the jukebox from your phone's browser, you explicitly cannot stream content from your phone or mobile device. As the perceived use case is for in a party/business environment, you would want more control over the music played to avoid inappropriate content. If, however, you are using this for a more personal use, then why wouldn't you just use a standard full-featured music player?
The application consists of two parts:
- The Controller:
- Controls the playing of music and catalog, etc.
- Controlled by ReST API (currently Flask)
- The Web Interface:
- Basic web interface using AngularJS and Flask templates
- Web interface will default to assume controller is local and connect to localhost:5000
While the application was meant to be installed on a raspberry pi, it's really just a webserver, so it can run anywhere. Keep in mind, though, that the audio will be played from the device on which it is installed; streaming to a brownser is not supported.
To install on your local machine:
-
use the python installer:
sudo python3 setup.py install
This will install the python libraries and installs:
/usr/local/bin/start_jukeberry
/usr/local/bin/juke-loadcatalog
/etc/jukeberry.ini
-
Toss some mp3 files into
/var/media/music
-
Start application
start_jukeberry
-
Load your library
juke-loadcatalog
-
Enjoy your music: http://localhost:5000/
If some of your mp3s aren't recognized as mp3, you can copy the included install/magic.mime
file
to /etc/magic.mime
If you want to run Jukeberry as a service whenever the device boots:
sudo cp install/deb/jukeberry.service /lib/systemd/system/jukeberry.service
sudo systemctl enable jukeberry.service
sudo service jukeberry start
juke-loadcatalog
The default media player is omxplayer
which is comes with raspbian. You can, however, change this to use
whichever player you want (e.g. mpg321
).
I have included an Ansible role for installation to make things super easy.
See install/ansible/README.md
for details
See example config file for detailed explanation of options
The config file follows a standard .ini file format.
DEBUG Default: False
AUTOLOAD Default: False
THREADED Default: True
SSL Default: False
PLAYER Default: omxplayer
LIB Default: /var/media/music/
SSL_CRT /path/to/crt.crt (only valid when SSL is true)
SSL_KEY /path/to/key.key (only valid when SSL is true)
HOST Default: 0.0.0.0
PORT Default: 5000
See Adafruit 2.8" PiTFT Assembly for instructions on assembling the touchscreen.
Run adafruit-pitft.sh
touchscreen setup script
cd ~
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/adafruit-pitft.sh
chmod +x adafruit-pitft.sh
sudo ./adafruit-pitft.sh
See Adafruit 2.8" PiTFT Easy Install for details on setup script.
You probably want to choose the "PiTFT as HDMI Mirror" option.
You will also want to configure the system to launch the Chromium browser fullscreen on startup.
- Open
/home/pi/.config/lxsession/LXDE-pi/autostart
to edit - Add the following line to the end:
@chromium-browser --kiosk http://localhost:5000/
Note: This is part of the Ansible setup, should you choose that option.
This is what I am currently using:
- $35 - Raspberry Pi B (Discontinued)
- $35 - PiTFT Mini Kit - 320x240 2.8" TFT+Touchscreen for Raspberry Pi (req solder assembly)
- $10 - Adafruit PiTFT Enclosure for Raspberry Pi Model B
- $ 6 - Adafruit Tactile Switch Buttons (6mm slim)
I think these will work together, but I haven't actually tried to assemble them.
- $50 - Raspberry Pi 3 B+ (incl power, heat sinks)
- $45 - Adafruit (PID 2423) PiTFT Plus 320x240 2.8" TFT + Capacitive Touchscreen (pre-assembled)
- $ 9 - Pi Model B+ / Pi 2 / Pi 3 - Case Base and Faceplate Pack - Clear - for 2.8" PiTFT
I also want to try some larger screens and cases. Like the SmartiPi Touch case for The Official Raspberry Pi 7" Touchscreen Display - Adjustable Angle.
- Add wifi and other setup options to "Settings" view.
- Add volume up/down control
- These commands only work with
mpg321
, not withomxplayer
:- inc 5%:
amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]*%|sed 's/%//')+5]%
- dec 5%:
amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]*%|sed 's/%//')-5]%
- inc 5%:
- These commands only work with
- Update "Settings" view.
- Add support for newer touchscreens
- Add Functionality for the 4 buttons on PiTFT displays
- e.g. volume control, play random, re-load music catalog, &c
- Change navigation to be more Jukebox-ish
- Show only 2 or 4 artists or songs in a view.
- Include large next/prev buttons.
- Optimize separately for two views:
- Raspberry Pi touchscreen/mobile (320x240).
- Remote web browser (800x500?).
- Web-ify setup on Raspberry Pi (wifi, etc).
- Web admin interface list Jukeboxes and allow user to specify which to control.
- Will function similar to multi-DVR or media-center GUI. Select from list and act as remote.
- Allows server to run anywhere (even on localhost)
- Music Lib can be remote.
- Needs web admin interface to add remote lib
- Not sure how to implement the admin perms. nfs might be bad. want to avoid smb.
- Sync to playlists on local mobile devices.
- Requires client app on phone.
- Allows for consolidated playlists if named the same.
- Note: I'm not sure how I file about this as it wouldn't really be a "Jukebox".