Skip to content
browser-controlled web radio player/recorder
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
index.php
jquery-1.9.1.min.js
raspdio.ico
raspdio.xcf
stations.php

README.md

What it does

Use raspdio to listen to web radio stations, while recording/dumping the same1 stream for later use. Control it via http interface. It runs on my Raspberry Pi/raspbian (hence the name), but should run on any *nix that can satisfy the dependencies (porting wouldn't be hard either).

1 only one connection is made. It saves your and the station's bandwith. This was the one of the original motivations for this project.

Where it's at

As I do this in my freest of time, it works, but barely works at the moment. This is my first github project, too. While I normally would not release a project at a stage that ugly, I'm using it to get into git and -hub. It's really super ugly.

Deps

  • Good old mplayer does the streaming and playback.
  • Interface written in pretty basic (< 5) PHP.
  • It needs *nixy PHP stuff, like posix_mkfifo (and support for FIFOs, of course).
  • *nixy (or POSIXy?) stuff like kill, ps, tee.
  • ts
  • ALSA for volume control (amixer shell call)
  • bash to wrap up the piping.
  • I run it on lighttpd with PHP-CGI.

Installation

  1. Set up a site in your httpd.
  2. There's basically two files:
    • index.php is the app,
    • stations.php has your stations; edit it.
  3. Two directories, make them writable for the httpd's user
    • dump for the dumps, (I symlinked this to another parition)
    • fifos where the app creates some fifos needed for piping business.

Usage

Playback

  1. Point your browser to wherever you installed raspdio.
  2. In the stations overview, click on start. As soon the cache is full enough, you should hear something.
  3. You can stop playback there, too. Starting a different station will stop the current station, too.
  4. At the top, there's a volume control bar (measured in dBs, really superugly ATM).
  5. Debug info is all over the place.
  6. There's a playlist at the bottom (provided your station sends info), with links to search the song on Google or YouTube.

Dumping

  • All playback is dumped automatically (like some DVRs do) into your dump folder, filenames are formatted

    Y-m-d_H-i-s.station.extension, e.g. 2013-03-20_07-42-05.wfmu.mp3 There's the mp3, obviously, and a .txt file with the timestamped playlist.

  • The latest.* symlinks point to the latest dump's files.
  • All dumps older than 24h are garbage-collected/removed upon (any) station start.
  • When I want to save a song, I open the latest.mp3 from the cifs-mounted1 dumps directory in mp3splt-gtk2, set the split-points3, set the file name4 and save it!

1 Via fstab/cifs-utils. smb:// in KDE copies the whole file to /tmp, .gvfs has serious problems in Ubuntu 12. SSHFS is ok, too, but the Raspi seems to struggle with the encryption overhead.
2 No re-encoding!
3 Manually, which can be a drag, but mp3splt handles it quite well. Automatic splitpoints from playlist roadmapped.
4 Automatic file name roadmapped as well.

$medium is killing music

I'm not sure how legal dumping is. In your country. I buy music; I use the dumps solely for future reference, to remember for future purchase (or concert visit) and usually for obscure stuff that is impossible to find.

Internals

  • Simultaneous playback/dumping is done by mplayer -streamdumping into a named pipe which is then teed into a file and another mplayer process
  • Raspdio scans your processes for the mplayer process and matches its args to find the pid
  • which is used for stopping by killing the streamdumping mplayer process. Playback continues for a while until the cache of the playback process is empty.
  • Don't worry about the two playback processes, one handles the caching.

Roadmap

A whole lot.

  • Comment the source :)
  • Nicer interface. Way nicer.
  • Better volume control
  • Playlist interface
    • Possibility to bookmark songs
  • Handle pls/m3u instead of direct links, which may change.
  • Better “splitability”
    • Automatic cue/split files
    • with automatic artist/title info
  • DVR/cron functionality

License

Don't be stupid, support artists and radio stations. Otherwise free. Attribution and feedback welcome, though.

Please

  • donate to WFMU. They're so good.
  • become a “friend” (=donate monthly to) of Byte.FM so you can stream their archive, so no need for dumping anymore :)
You can’t perform that action at this time.