Kyle Edwards

RadioPi

RadioPi is a headless Raspberry Pi running an IceCast server on my home network to play music I bought off of Bandcamp (I’m trying to stop using a criminally underpaying streaming service that shall not be named). For a while, I was switching between computers a lot and I liked the idea of being able to tune in no matter which machine I was on.

Whenever I get new music, I’ll use ffmpeg to format the files, then scp them into the /home/pi/rpnfs/music/ogg directory, and I can create playlists in the /home/pi/rpnfs/music/playlists directory. The service start with ices ice.xml & after booting.

At some point I’d like to add triggers to iterate through playlists and restart the service.

Listening

To listen to the radio, you can access the station via the IceCast web client or ffplay. For ease of use I added these aliases to my .zshrc.

# Start listening
alias rpp="ffplay http://{HOSTNAME}:8000/rpnfs.ogg -nodisp -hide_banner -loglevel panic -i -infbuf &"

# Stop listening
alias rps="pgrep ffplay | xargs kill -9"

# Get current song title and artist name
alias rpq="curl http://{HOSTNAME}:8000/status-json.xsl | jq '.icestats.source.artist + \" - \" + .icestats.source.title'"

Todos