Simple Raspberry Pi Internet Radio Station

by jacobalze in Circuits > Raspberry Pi

38 Views, 2 Favorites, 0 Comments

Simple Raspberry Pi Internet Radio Station

Screenshot 2025-04-27 193344.png

This project i stated when I just wanted to stream audio locally with Icecast. I developed it a little more and made it into a public radio station. It took some working, but I managed to do it. It uses Caster.fm, a free streaming service that uses a modified form of Icecast, an audio streaming software. We will also use Mixxx, a mixer software used to record and stream to Icecast. We will configure Mixxx to capture system audio, then broadcast that audio to Caster.fm for public streaming. Let's get Started!

Supplies

This project is fairly simple and requires only a few basic Raspberry Pi tools:

  1. Raspberry Pi 5 (the 5 is best but any model will work)
  2. Display Screen
  3. Keyboard/Mouse
  4. Bluetooth Headphones
  5. Cooling system (your Pi will be on for long periods of time, so it may be best for the Pi to have this)
  6. USB Microphone (Optional)

Set Up Your Caster.fm Station

  1. Navigate to Caster.fm.
  2. Create a free account.
  3. Configure the station following the prompts.
  4. Come back here when you are on the Dashboard and Streaming Server screen.

Set Up and Configure Your Audio Source

Screenshot 2025-04-27 164142.png
Screenshot 2025-04-27 171042.png
  1. First, ensure your software is up to date.
  2. Connect your headphones to your Pi and set the audio output device to your headphones (right click the volume icon on the taskbar and select your headphones, see image 1 above)
  3. Next, open a terminal and run this command:
pactl list sources
  1. Look for something like bluez_output.<MAC-ADDRESS>.<profile>.monitor
  2. Ensure it is your device by looking for this under the name: Description: Monitor of <DEVICE NAME>
  3. Once you have found your device, copy or make note of the name (bluez_output.<MAC-ADDRESS>.<profile>.monitor). You will need this for later. (See image 2 for an example)
  4. What you just found was the monitor for this Bluetooth device. It controls the audio being output or input from that device. We can capture this audio and stream it to our station.
  5. Now we need to set the monitor as the default source. Run this command:
pactl set-default-source <source-name>
  1. Replace <source-name> with the name you copied in the previous step (bluez_output.<MAC-ADDRESS>.<profile>.monitor)
  2. Use this command to confirm the change:
pactl info
  1. Now your audio source is set up! Now lets set up Mixxx!

Set Up Mixxx

Screenshot 2025-04-27 184540.png
Screenshot 2025-04-27 185104.png
Screenshot 2025-04-27 185643.png
Screenshot 2025-04-27 185849.png
Screenshot 2025-04-27 190645.png

Part 1: Install Mixxx:


  1. First, Install Mixxx:
sudo apt-get install mixxx


Part 2: Install the Lame mp3 library:


  1. Before opening Mixxx, we need to add a configuration file that will stream in the mp3 format.
  2. I linked the file for you here. Click it and download the file. Make sure it is in the download folder on your Raspberry Pi.
  3. Use the following command to move it into the Mixxx files:
sudo mv ~/Downloads/libmp3lame.dll /usr/share/mixxx/
  1. Next, use this command to set the necessary permissions:
sudo chmod 755 /usr/share/mixxx/libmp3lame.dll
  1. Confirm you did it right with this command:
ls /usr/share/mixxx/
  1. The libmp3lame.dll file should be listed.


Part 3: Configure Mixxx Settings:


  1. Now we can start working with Mixxx.
  2. Open it by navigating to the Start Menu > Sound & Video > Mixxx (See image 1)
  3. After opening Mixxx, navigate to Options > Preferences (See image 2)
  4. Opening the preferences menu, you should already be on the Sound Hardware tab.
  5. Scroll down until you see the big chart.
  6. DO NOT SELECT OUTPUT DEVICES! Doing so will create a loopback and the sound on your station will have a lot of static.
  7. Instead, go to the Input tab. (See Image 3)
  8. Scroll down to Auxiliary 1, select default as the source (See Image 4).
  9. If you have one, add your USB microphone under Microphone 1.
  10. Click Apply to save.
  11. Now on the Left Panel, go to the Live Broadcasting tab.
  12. Select Create new connection
  13. See image 5 for the settings to configure. Replace the red scratched out parts with the ones shown on your Caster.fm dashboard.
  14. Scroll down to Stream Info and fill that in with what you want.
  15. Ensure at the top that your stream you just set up is enabled and delete other unused streams (renaming the stream would be helpful to keep track).
  16. Click Apply to save.
  17. You can close out the preferences window now.

Go Live!

Screenshot 2025-04-27 191444.png
  1. At the top, toggle the Mic/Aux button to show the controls for the sources (See image 1).
  2. To ensure it is working, play some music, and you should see the Aux 1 Mixer Bar move to the beat of the music!
  3. Now that we have everything working, time to Go Live!
  4. Go to your Caster.fm dashboard and under streaming server, click Start Server.
  5. This will start the Icecast Server.
  6. Now go back to Mixxx and Click the On Air button in the top right corner.
  7. This button will turn orange for a few seconds, showing it is trying to connect to the server.
  8. Once in connects, it will turn green, and now you are Live!
  9. Select Play under Aux 1.
  10. Navigate to a music streaming service website. (Not all streaming services work. I recommend either Spotify or Apple Music, as they work the best)
  11. Play some music, and it should be broadcast to your station!

Conclusion

Congratulations! You now have a fully functional radio station on your Raspberry Pi for free! This is a neat little project and I find it fun to stream, even if nobody is listening. Caster.fm has features where you cand create a station schedule with shows, specials, etc. With Mixxx, you can use the DJ mixer and control audio, record, and play audio locally on your Raspberry Pi. If you have any questions or issues with this project, let me know in the comments below. Thanks for reading and enjoy your new radio station!