liquidsoap | input.http problems

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",
~buffer=0.2,~max=10.,s) =
"mplayer -really-quiet \
-format s16le \
-ao pcm:file=/dev/stdout \
-vc null -vo null #{quote(s)} \

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 > /tmp/test.wav

If you can play the test.wav file you have won.


2 thoughts on “liquidsoap | input.http problems

  1. 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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s