A Jukebox With Raspberry Pi

Introduction: A Jukebox With Raspberry Pi

This tutorial that will allow you to build this Jukebox (or a your custom model :) ).

This project,requires a minimum of DIY attitude, confidence with audio cables and computer science in general.

Note:The software provided on this tutorial by the author itself, is under license GNU GPLv2.

Supplies:

Hardware Shoplist

- Raspberry Pi

- Monitor

- Related cables (hdmi, audio etc)

- Buttons + USB controller and LED lights

- Speakers

Optional:

- Car hifi

- 12 volts power supply (even an old one or PC can go well)

- RCA switch

- RCA audio input

Software Shoplist

- Raspbian GNU Linux (I used version 9.6)

- Fruitbox (I used version v1.12.1)

- Custom scripts and configurations (to be downloaded later on this guide)

Step 1: Hardware

In this section, I put only a few of details, because it is similar to a procedure to build an arcade cabinet, and the network is full of guides (ask uncle Google).

I will only say that this includes:

- The monitor

- the controls

- the Raspberry Pi 3B+ (but it works with Raspberry 2 as well).

- Various cables

- Lights and various

I put only some pictures about the construction phase as inspiration for your project.

Optionally, you can add the car hi-fi, to listen to CDs as well. According to someone, this distorts the project a bit, but in my opinion it turns it into a mobile hi-fi rather than a giant MP3 player :)


To connect a power supply to a car radio, there is another tutorial list . To switch between the CD, the jukebox and any other audio source, you can use an rca switch , available in the main online stores.

Step 2: Software

In my opinion this section is the most interesting one, as it contains the customization I made to make the jukebox part work, which is the core of the project.

The advice I give, which I myself put into practice, is to buy the minimum hardware to be able to prototype. By doing so, if we realize that the project is too ambitious, we would reduce costs in case of abandonment.

We proceed by steps:


Download and install Raspbian on the Raspberry

Official Guide


Download and install Fruitbox for Retropie

Download and guide


First configurations and tests

NOTE: All commands assume a default Raspbian and fruitbox installation.Customization of these may not guarantee correct operation, which is not guaranteed regardless

At this point, Fruitbox should be in the /home/pi/rpi-fruitbox-master directory.

Let's copy our MP3s to the folder /home/pi/rpi-fruitbox-master/Music/ (create it if it doesn't exist) using our favorite SFTP client (for example Filezilla ).

I recommend no more than fifty files as test (later you will add all the MP3s).

We launch a first execution of the program as described in the guide:

cd /home/pi/rpi-fruitbox-master

./fruitbox –cfg skins/[YOUR_THEME] /fruitbox.cfg

Where [YOUR_THEME] is one of the following default skins:

-Granite

-MikeTV

-Modern

- NumberOne

-Splat

-TouchOne

-WallJukeF

-WallSmall

-Wurly

Try various skins, using the keyboard as temporary input, but consider that the required buttons are different for skins, and this will impact the final choice of physical buttons.

Button configuration

Any of the guides for building an aracade cabinet, mentioned above, should explain how to connect a USB controller to the corresponding buttons.

To check how the buttons are recognized by the system, run the following commands:

cd /home/pi/rpi-fruitbox-master

sudo ./fruitbox –test-buttons –cfg ./skins/[YOUR_THEME]/fruitbox.cfg

Click on each button and take note of the code generated on the screen. Modify on your PC the fruitbox.btn configuration file, replacing for each key you want to map the corresponding code we took noted of, in the previous step.

Copy the fruitbox.btn configuration file via SFTP on this path:

/home/pi/rpi-fruitbox-master/rpi-fruitbox-master/

Relaunch the fruitbox application as shown above:

cd/home/pi/rpi-fruitbox-master

./fruitbox –cfg skins/[YOUR_THEME] /fruitbox.cfg

Check if the keys works.

Set up automatic start of fruitbox at boot and shutdown at exit

First we need to set the automatic login to the user pi.

Commands:

sudo raspi-config

At the ncurses menu (the gray one with a blue background, for example) select:

3 Boot Options Configure options for start-up

Then:

B1 Desktop/CLI Choose whether to boot into the desktop environment or the command line

And finally:

B2 Console Autologin Text console, automatically logged in as 'pi' user

Exit by selecting

<Finish>

And to the question:

Would you like to reboot now?

Reply

<Yes>

At this point we verify that when Raspbian restarts, the password is not required to log in as user pi.

Now we have to automate the start and stop. First we download the jukebox.conf file.

Let us modify this file by uncommenting (ie: deleting the hash mark #) our favorite skin.

Download the runjb.sh script. Then copy the runjb.sh and jukebox.conf files via SFTP to the /home/pi directory of our Raspberry.

Finally, on the Raspbian terminal (the text-based startup screen) let's execute:

chmod 770 /home/pi/runjb.sh

chmod 770 /home/pi/jukebox.conf

echo "/home/pi/runjb.sh" >> /home/pi/.bashrc

At this point we only need to restart the system and verify correct operation.

Step 3: Conclusion and Extra

If all the previous steps have been correctly executed, have fun assembling and decorating your jukebox.

Update the MP3 list

  1. Add the files in /home/pi/rpi-fruitbox-master/Music/ directory.
  2. Delete the file /home/pi/fruitbox.db
  3. Restart fruitbox


Advanced configurations

The file rpi-fruitbox-master/skins/[YOUR_THEME]/fruitbox.cfg contains interesting configurations including:

  • The possibility of performing random songs after a certain period of inactivity
  • The possibility of managing the coin mechanism
  • Much else…

Official documentation


Framebuffer

If you don't like "start-up logs" which are the standard output of the Raspbian start, you can customize it with the image you prefer ( guide ). But the procedure is not for newbies. I personally left them because if something goes wrong I want to understand what it is.


WallBradz skin

For my project I modified the skin based on the original WallJuke. If you really want to have my face on the spinning vinyl you can download it here

Note:This tutorial is available in Italian as well

Be the First to Share

    Recommendations

    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020

    11 Discussions

    0
    davidhooker
    davidhooker

    26 days ago

    Hi,

    Thanks for sharing this great project. I'm in the process of rebuilding a Seeburg wall jukebox but I have a question for you, if you don't mind. Where did you get the labels for the LED buttons? I'm struggling to locate or make anything that looks half as good as what you have in the pictures. Any guidance appreciated as ever. Best, Dave.

    0
    blair.campbell
    blair.campbell

    2 months ago

    Thanks for the instructable. I'm looking to change the music path and location of the database file to a usb drive. With the hopes that I could use multiple usb's. Ie. one with my music and one with my wife's music. I think the path would be "../media/usb1" but I'm getting and error "Can't find any MP3 songs (are the 'MusicPath" settings in your config correct?" can you help?

    0
    starmap1969
    starmap1969

    3 months ago

    Love this project. I have followed it and made a wall jukebox. I used an old laptop screen and I'm just waiting for the buttons to arrive. I'm still trying to figure out how to play sound via Bluetooth

    IMG_20200410_110012.jpg15870325792456141756687484579918.jpg
    0
    starmap1969
    starmap1969

    Question 3 months ago on Step 2

    Hi, could you please tell me if its possible to stop it from autoloading as I would like to open a terminal to change the sound output to Bluetooth

    0
    Chuffy2
    Chuffy2

    Question 6 months ago

    Hi! Great build. I'm going to have a go at this one with some tweaks. Rather than adding all the MP3s to the folder though, do you think it would be possible to point the player to another folder somewhere else on the local network (e.g. local NAS drive)? Thanks

    1
    Kreiny
    Kreiny

    11 months ago on Step 3

    Hi. Great build. Where did you get the buttons from??

    0
    Bradsorph
    Bradsorph

    Reply 8 months ago

    You can get it on line on the most popular web stores. Search for "Rectangular arcade buttons". You also need the controller to plug them to raspberry via USB.

    0
    JanG127
    JanG127

    10 months ago

    Hello, first of all what a great build but what I was wondering how do you get to run the car stereo over the same speakers as the raspberry pi, normally you have to hook up speakers strait to the car stereo?

    0
    Bradsorph
    Bradsorph

    Reply 8 months ago

    Thanks! Sorry for late answer... The car hi-fi has the RCA output. I simply got from the web an RCA switch with 4 input and one output.

    0
    cesoi
    cesoi

    11 months ago

    Tanks for your time
    It is a nice great project but not sure to have the knowledge to complete it
    I am going to follow your tuto first
    Thanks for this sharing

    0
    Bradsorph
    Bradsorph

    Reply 11 months ago

    Thanks, if you have doubts ask here ;)