How to keep recording the stream when the network goes down?

Events happening in the community are now at Drupal community events on www.drupal.org.
joachim's picture

I think I've spotted a flaw in my test installation for streaming & recording.
I'm using MuSE to stream and station archive's ripper.php and streamripper to store MP3 of each hour, both on the same machine. There's no connection to Drupal for now; I just need to record the radio's output as hour-long MP3 files.

But what happens if the connection to the network and so to the icecast server is lost?
MuSE isn't giving me any error messages, but the MP3 file that's being recorded on my hard drive has stopped increasing in size.

Is there a way round this problem?
Our broadband connection can be flaky, and we have to keep an archive of our output for legal reasons, so the archiving has to be rock solid. I need the MP3 file to keep recording no matter what -- short of a power cut.

Comments

not sure

drewish's picture

i'm not sure i follow the setup of your archive. so the encoding/streaming and the ripping happen on the same machine? if so then there should be less possibility for error but if the stream server craps out there's not much you can do. streamripper will try to reconnect, there might be some options you could tweak there to make it retry for longer...

I've put the icecast source

joachim's picture

I've put the icecast source and streamripper on the same machine, as suggested in your guide (I think).

The icecast source, MuSE, picks up the audio line in and streams to the icecast server.
Streamripper connects to localhost:8000 and rips from that.
The icecast server is in a totally different location -- here in fact. So if our broadband dies, the icecast source doesn't have anything to stream to any more. If that were to happen, it could be down for hours. Or someone in the building might have messed with the phone or something. That could happen too.

I tried this on my test machine -- I unplugged the ethernet cable to simulate the connection to the icecast server being broken. MuSE (the source) didn't give any error message, but the MP3 file that streamripper was writing to stopped growing in size.

Is there a way to encode the audio line in to MP3 other than streamripper? That's the most important thing I need to get done -- we have to store 6 weeks of archive by law.

hehe

drewish's picture

i'm pretty sure the guide suggested putting the encoder, ripper and streaming server all on on box. because if you send it off to another server and then back it introduces a dependency on the network ;) you should setup a local icecast server that feeds streamripper and then relays to your external server.

Indeed -- dependency on the

joachim's picture

Indeed -- dependency on the network :)
I must have skipped that bit -- or I wasn't clued up on how icecast worked back then. (Not sure I am entirely now -- is the encoder the same as the icecast source?)

A pushing relay sounds like what I need, as I doubt that the icecast server we use would change their config to act as a slave relay -- it's a company that provides streaming to UK radio stations and they're not very responsive.

But the pushing relay stuff I've seen mentioned is icecast 1. The icecast 2 docs don't mention it. Looking at these docs it seems the same -- no push relay on icecast 2 :(

Oh well.... MuSE can stream to several things at once, so in the worst case I could stream to the remote server and a local icecast simultaneously.
I'll have a go later this week when the new PC arrives.

Thanks for the advice :)

that's it

drewish's picture

yeah, the encoder would be the icecast source... and that source would feed a local server that would in turn relay to your "official" server as a source: http://www.icecast.org/docs/icecast-trunk/icecast2_relay.html

or, as you suggest you could just have muse send out two copies.

If I read that page

joachim's picture

If I read that page correctly, in both kinds of relaying, the slave needs some special settings to tell it how to get the stream from the master (this is assuming I correctly understand which is master and which is slave).
I doubt our streaming providers will let us do that -- and more to the point, I'm told it's impossible to get hold of them.

I'll try setting up the local server as icecast1 with a push relay -- if I've got it correctly, that just behaves like another source and the remote server won't know the difference.
If not -- I'll get MuSe to double up :)

Off-air archiving

mattrock's picture

I have always intended to try to do this with darkice, but I ended up just setting up a second machine with AirCheck. This was my easy solution which also provided backup.

darkice

joachim's picture

I've actually got this working with darkice now!
It both streams and archives, so I'm really pleased with it -- though I haven't yet looked at integration with Drupal.

I can post a howto if anyone's interested.

Recording w/o streaming

twilley's picture

I've scanned you other posts but was unable to find your howto. Any other leads?

Radio

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: