liquidsoap version 1.1.1
Under stressing circumstances (esp. hard network interrupts) input.http crashes. You can check this using the telnet interface: If http_1234.buffer_length returns 0.00 but http_1234.status returns connected. All telnet commands such as http_1234.start|stop|skip return done but liquidsoap does not react. The only way to get a proper state is to kill ans restart liquidsoap himself. That sucks.
My attempt to kill the corresponding network connection via tcpkill had no effect. I solved the problem wit a workaround.
Instead of using input.http i switched to input.mplayer. It works fine, but a mayor disadvantage is, that this input function is not connected to the telnet interface. The second is, that it plays mp3 streams only. That’s because mplayer returns sometimes not 16bit LE but other formats. I fixed this by adding -format s16le to the input.mplayer wrapper function. I did it by adding an mplayer2 function to my liquidsoap config file.
def input.mplayer2(~id="input.mplayer",
~restart=true,~restart_on_error=true,
~buffer=0.2,~max=10.,s) =
input.external(id=id,restart=restart,
restart_on_error=restart_on_error,
buffer=buffer,max=max,
"mplayer -really-quiet \
-format s16le \
-ao pcm:file=/dev/stdout \
-vc null -vo null #{quote(s)} \
2>/dev/null")
end
The other way is to tune the externals.liq file containing the standard input.mplayer wrapping function.
You can test the mplayer behaviour at the console:
mplayer -ao pcm:file=/dev/stdout -really-quiet -vc null -vo null -format s16le http://streams.ir-media-tec.com/bbradio.opus > /tmp/test.wav
If you can play the test.wav file you have won.
Thanks! This was just what I was looking for. The mplayer options mentioned here are also useful if one wants to pipe mplayer to ices2 stdinpcm module.
Huge thanks for the info!