Summary

  • Utilize Raspberry Pi 4 with minimal OS compatibility issues for a DIY digital jukebox.
  • Select Fruitbox software and meet hardware requirements for an efficient setup.
  • Troubleshoot and ensure the project's sustainability amid potential future OS updates.

The jukebox has been an entertainment staple for as long as I can remember. You’ll still find the music-serving kiosks in bars, lounges, and even diners. You insert your money, choose the tunes you want to hear, and enjoy. I’ve thought more than a few times that it would be fun to have my own jukebox, so I’ve decided to build one. And so began another fun and entertaining Raspberry Pi project.

Elecrow Pi Terminal CM4
Brand
Elecrow
CPU
Quad-core 64-bit Arm Cortex-A72 processor
Memory
4GB
Display
1024x600 IPS Touchscreen
Wireless Connectivity
2.4GHz and 5GHz IEEE 802.11b/g/n/ac Wi-Fi and Bluetooth 5.0
Dimensions
182mm x 115mm x 29mm (7.17in x 4.53in x 1.14in)
Weight
1kg (2lbs)

If building your own digital jukebox sounds like a daunting task, it really isn’t. It’s much easier than many other Raspberry Pi projects, with a few caveats I’ll discuss later. Using a Raspberry Pi and some DIY know-how, the task is easy enough to complete, as long as you pay attention to compatibility issues (more on that later.) Let me walk you through the first step in my jukebox-building voyage: setting up the software side of things.

Finding suitable hardware and software to build your jukebox

Once I embarked on the voyage to build my digital jukebox, I had to decide what software to use as the interface and music player. Unsurprisingly, there are quite a few options to choose from. However, most of the options I found were either incredibly outdated or paid software. Several options state they are only compatible with the Raspberry Pi 4B running Bullseye, an outdated version of Raspberry Pi OS.

Ultimately, I went with Fruitbox, a free software that works even on the Raspberry Pi 3 and Zero models. I’m using a Raspberry Pi Compute Module 4 in an Elecrow Pi Terminal in my build. This setup offers a 7-inch touchscreen that I can easily mount in a cabinet. I also have ready access to the GPIO header and Phoenix-style electrical terminals that access many of the CM4’s GPIO capabilities.

So, what do you need to get Fruitbox up and running? Here are the basic requirements.

  • A Raspberry Pi. I’d recommend a Raspberry Pi 4B or Compute Module 4 with at least 4GB of memory. You can install it on a Raspberry Pi 5, but the most current version of Raspberry Pi OS Bookworm won’t work. You’ll need a version of Bookworm from March 15, 2024 or earlier.
  • A micro SD card for the Pi. Depending on how much music you want installed, I suggest 64 GB or greater. Of course, you could also store your music on USB-attached storage or an NVMe SSD.
  • An appropriate power supply for the Pi. In my case, the Elecrow Pi Terminal includes that.
  • A keyboard and mouse for the initial setup.
  • A computer capable of writing to the micro SD card with the official Raspberry Pi Imager or Balena Etcher.

Installing Raspberry Pi OS and the Fruitbox software

The first step is to set up your Raspberry Pi. Fruitbox will run on Bookworm, but you will need to use an older build of the OS. The build from March 15, 2024, works best; in later versions, Bookworm breaks access to several of the libraries Fruitbox depends on.

  1. Insert your micro SD card and reader into your computer and launch Raspberry Pi Imager.
  2. Choose the Raspberry Pi device, operating system version, and micro SD card.
  3. You can also save a few steps by configuring settings such as hostname, username, password, Wi-Fi network, and more in Raspberry Pi Imager.
  4. After writing the micro SD card, insert it into your Raspberry Pi and boot up the SBC.
  5. From a Terminal, update the Raspberry Pi software with these commands:
    sudo apt update && sudo apt upgrade
  6. Once the updates finish, reboot your Raspberry Pi.

If your Raspberry Pi runs Bullseye or earlier, increase the GPU memory to at least 256MB.

Modifying GPU memory is not possible in any Bookworm builds of Raspberry Pi OS.

  1. From a Terminal, issue the following command:
    sudo raspi-config
  2. In Performance Options -> GPU Memory, change the value to 256.
  3. Close raspi-config and reboot your Raspberry Pi

Next, we’ll install Fruitbox. Here’s how to do it:

  1. From Terminal, issue this command to download the installation script and set the proper permissions:
    wget https://github.com/chundermike/rpi-fruitbox-v2/raw/main/install_fruitbox_pi4 && chmod +x install_fruitbox_pi4
  2. If you’re running a 32-bit version of Raspberry Pi OS, use this command instead:
    wget https://github.com/chundermike/rpi-fruitbox-v2/raw/main/install_fruitbox_pi432 && chmod +x install_fruitbox_pi4_32
  3. Next, run the script to install Fruitbox:
    source ./install_fruitbox_pi4
  4. For the 32-bit version, run:
    source ./install_fruitbox_pi4_32
  5. Next, copy your music files to a USB memory stick or the SD card at /home/pi/Music (if your username is different, replace “pi” with it).
  6. Finally, launch Fruitbox from the Terminal:
    cd fruitbox && ./fruitbox

Troubleshooting the most critical issue

Unfortunately, your first Fruitbox launch may not work. The most common issue I encountered was the OS refusing to launch the software. At first, I got a “cannot execute” error. The installation script creates a symbolic link from “home/pi/fruit box” to the executable. Since it links to the 32-bit version of the software by default, you may have to change this.

Here’s how to check and fix, if necessary.

  1. From Terminal, issue this command and note which file the symbolic link points to:
    ls -l /home/pi/fruitbox/fruitbox
  2. Next, check what type of executable it is with the file command (replace the username and directory as required):
    file /home/pi/fruitbox/rpi/fruitbox
  3. As you can see in this screenshot, the Fruitbox executable is a 32-bit program that will not run on a 64-bit operating system.
  4. Relink to the proper executable using this command:
    ln -sf /home/pi/fruitbox/rpi4/fruitbox /home/pi/fruitbox/fruitbox
  5. Once done, try rerunning Fruitbox.

Warning about future OS updates

I recommend keeping your Raspberry Pi software as up-to-date as possible. Unfortunately, this could easily break a project like this one. While I was able to do an apt full-upgrade after the Fruitbox software was up and running, I simply can’t predict how future updates might break things.

We can only hope chundermike, the developer behind Fruitbox, can fix the problems caused by recent Bookworm builds. In the meantime, if you run “apt upgrade” or “apt full-upgrade,” ensure you back up your Pi first.

Setting up your jukebox

When you first launch Fruitbox, it will scan your music files and display the default skin. If it cannot find any files, ensure you’ve configured Fruitbox to look in the correct directory. You can do this by editing fruitbox.ini from the fruitbox directory. The first section includes a parameter called MusicPath.

Also, in the fruitbox.ini file, you’ll find options to customize your jukebox. You can change it from free play to coin-operated mode, select a different skin, configure the buttons, and more. There is ample documentation on these settings, but the most useful I’ve found is Jay Thompson’s Fruitbox for Dummies.

You may find it easier to configure the buttons from within Fruitbox. You can do this easily if you’re using any model other than the Raspberry Pi 5. Unfortunately, the way the GPIO header works on the Raspberry Pi 5 has changed, and configuring buttons using the on-screen menu will only give you a GPIO mmap error.

Press the Tab key on all other boards to bring up the on-screen menu. Then, you can navigate the options using displayed keyboard commands.

Next steps for the Pi jukebox

This is just the beginning

This is the beginning of my journey to build a digital jukebox. This project has many possibilities, but my next move will be designing and fabricating a cabinet to house the project. Rather than using a touchscreen, I’ll wire physical buttons using the GPIO header to control the jukebox.

Thanks to the thriving Raspberry Pi DIY community, 3D printing, and laser engraving, this is much more within my reach than it would have been years ago.