rafael2k / darkice

DarkIce is a live audio streamer. It records audio from an audio interface (e.g. sound card), encodes it and sends it to a streaming server. This is the official development repository of Darkice.
http://www.darkice.org
198 stars 46 forks source link

darkice stream doesn't reconnect if Internet connection breaks #134

Closed cibersheep closed 5 years ago

cibersheep commented 6 years ago

Hi! I have setup a little Odroid (similar to a Raspbery Pi) for streaming: 2 mp3 and 1 ogg to a remote ocecast2 server. All is working good (nice work) but if Internet connection hiccups (if connections stop for about 10 seconds) darkice doesn't reconnect. -I first tried with a compile version I did. Then with the darkice from the repositories with same result. -I have tried with a buffer of 1 up to 120 in cfg Would it be better to have several instances of darkice, 1 for each stream?

I'm using Ubuntu Mate 16.04.

DanielEckl commented 6 years ago

I know this issue myself. Sadly I only have a workaround for you that might or might not be feasable for your setup.

I don't stream to a remote icecast, but instead to one running on the same host, that is reachable from the internet. Then the remote icecast is configured to use my local icecast as relay. This survives any connection issues you may face. Additionally, if you set "relays-on-demand" on the remote icecast it will only stream data if there is at least one listener connected to the remote icecast server. This saves unneeded traffic.

About having one instance per stream: It will not help against the connection loss problems. But if you can do this, this will be better anyway. The multithreading capabilities of darkice are okay normally, but not the best. It can crash in some edge cases. If you run multiple processes instead, then the operating system is managing the parallel processing, which is way more robust.

cibersheep commented 6 years ago

Interesting, very interesting. I'll try this next week as I think I will be able to set it up this way. thank you

cibersheep commented 5 years ago

Looks like the «last week» was longer that I thought :D Anyway, this workaround works great. I have been using it for months and made my life better. Thanks