How to stream music on a Raspberry Pi with MusicBox

How to stream music on a Raspberry Pi with MusicBox

Let’s crank up the tunes!

Need a little ambience in the room? Why not spruce up the place with a Raspberry Pi music box?

Just go ahead and put the cassette tapes away. You don't need them anymore. We'll be creating a custom music box that plays songs, streams playlists, and can even be controlled with a mobile device.

1

Install the Pi MusicBox image

We'll be using Pi MusicBox software on our Raspberry Pi to complete our project. The developers provide an image to be installed on the Raspberry Pi's SD card. Download the MusicBox image here and write it to the SD card.

2

Connect the Raspberry Pi to the network

For Pi MusicBox to function, it needs to be online with your network. There are two ways to go about connecting your Pi.

Ethernet

Plug a live ethernet cable into your Raspberry Pi. Insert the SD card into the Raspberry Pi.

Wifi

If you’re using Wifi, you’ll need to manually add your wifi information to the written image on the SD card. Open the /config/settings.ini file in a text editor. There are two lines near the top in which you can enter your wireless network name and password. Save this file and insert the SD card into the Raspberry Pi.

3

Access Pi MusicBox via browser

Once you’ve inserted the SD card, it’s time to access Pi MusicBox. In a browser, enter the IP address of your Raspberry Pi or go to http://musicbox.local.

4

Access Pi MusicBox using mobile devices

Accessing Pi MusicBox via mobile is easy! Open a browser on the mobile device and navigate to either the IP address of the Pi or go to http://musicbox.local.

5

Audio output device setup

MusicBox is designed to automatically detect USB devices to use as speaker output. If no devices are found, it moves to HDMI output and finally analog.

If your preferred audio output method isn’t working, you can manually set the output device by accessing Pi MusicBox in a browser. Audio output devices are set under Settings > Audio > Audio Output.

6

Add music streaming accounts (Spotify, SoundCloud, Google Music, etc)

The coolest part about Pi MusicBox is its streaming service compatibility. You can add so many accounts to many different leading music streaming services.

To add your accounts, access your Pi MusicBox in the browser. Choose Settings in the sidebar menu. Scroll down and add any relevant account information to your favorite streaming services.

Saving your changes will prompt the Raspberry Pi to restart.

7

Configure your music library

Now it’s time to jam! This is your opportunity to go crazy customizing your music box with all of your favorite songs, playlists, and more. The menu is rather self explanatory, but here are the basics you need to get started:

  • Add individual songs by going to Queue in the sidebar menu.
  • Switch to a specific streaming service by selecting Streams in the sidebar menu.
  • Access currently playing media by choosing Now Playing in the sidebar menu.
8

Troubleshooting

It’s not a Raspberry Pi project without at least one or two hiccups. Here are some of the most common issues you’ll run into while setting up this project.

No network connection

Without the internet, our Pi MusicBox is rather silent. Make sure your device is configured with appropriate wifi credentials or otherwise connected with an ethernet cable. If you log into your router, you should be able to see your Raspberry Pi on the list of available devices.

Login issues

You may need to log into your Music Box terminal, the default userID and password are very useful in this situation.

Default Authentication Information

Username: root
Password: musicbox

No audio

This is the worst problem to run into! What's a music box without any sound? The audio output device is set to Auto by default. It looks for any USB devices that are connected first. I had to unplug my keyboard before the audio would push to HDMI output. You can manually adjust output settings under Settings > Audio > Audio Output