Problem with liquidsoap (Airtime 2.0.2)
  • Hi there!

    I've got a very frustrating problem with Airtime 2.0.2 running on Debian Squeeze.

    If I install it from package it throws an error in the post-installation script, though everything is working except liquidsoap. That is indicated in the service status.

    The thing is though, that I can run liquidsoap in the shell, e.g.

    xxx@xxx:/root$ liquidsoap 'output.icecast(%vorbis, host="localhost", port=8000, password="xxx", mount="test_128", sine())'
    2012/03/12 20:06:36 >>> LOG START
    2012/03/12 20:06:36 [protocols.external:3] Didn't find "ufetch".
    2012/03/12 20:06:36 [protocols.external:3] Found "/usr/bin/wget".
    2012/03/12 20:06:36 [main:3] Liquidsoap 1.0.0
    2012/03/12 20:06:36 [main:3] Using: graphics=[distributed with Ocaml] pcre=6.0.1 dtools=0.2.2 duppy=0.4.2 duppy.syntax=0.4.2 cry=0.2.2 mm=0.2.0 ogg=0.4.3 vorbis=0.6.1 mad=0.4.4 flac=0.1.0 flac.ogg=0.1.0 dynlink=[distributed with Ocaml] lame=0.3.1 alsa=0.2.1 ao=0.2.0 taglib=0.2.0 camomile=0.7.1 portaudio=0.2.0 pulseaudio=0.1.2
    2012/03/12 20:06:36 [dynamic.loader:2] Could not load plugins in directory /usr/local/lib/liquidsoap/1.0.0/plugins.
    2012/03/12 20:06:36 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
    2012/03/12 20:06:36 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
    2012/03/12 20:06:36 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
    2012/03/12 20:06:36 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
    2012/03/12 20:06:36 [threads:3] Created thread "generic queue #1".
    2012/03/12 20:06:36 [threads:3] Created thread "generic queue #2".
    2012/03/12 20:06:36 [test_128:3] Connecting mount test_128 for source@localhost...
    2012/03/12 20:06:36 [test_128:3] Connection setup was successful.
    2012/03/12 20:06:36 [threads:3] Created thread "wallclock_main" (1 total).
    2012/03/12 20:06:36 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.

    2012/03/12 20:09:20 [main:3] Shutdown started!
    2012/03/12 20:09:20 [main:3] Waiting for threads to terminate...
    2012/03/12 20:09:20 [test_128:3] Closing connection...
    2012/03/12 20:09:20 [clock.wallclock_main:3] Streaming loop stopped.
    2012/03/12 20:09:20 [threads:3] Thread "wallclock_main" terminated (0 remaining).
    2012/03/12 20:09:20 [main:3] Cleaning downloaded files...
    2012/03/12 20:09:20 >>> LOG END


    Everything fine. I can listen to the sine-stream from the Icecast server. But when I try to start it as a daemon, NOTHING happens!

    root@xxx:~# /etc/init.d/liquidsoap start
    Starting channels: OK
    root@xxx:~# ls -la /var/run/liquidsoap/
    total 4
    drwxr-xr-x  2 liquidsoap liquidsoap    6 Mar  7 00:19 .
    drwxr-xr-x 10 root       root       4096 Mar 12 20:27 ..


    Also the logs are empty.

    Anyone else has/had this problem?

    Best, Christian

  • 18 Comments sorted by
  • So Liquidsoap randomly shuts down 3 minutes after connecting to the icecast mount everytime?
    Airtime Pro Hosting: http://airtime.pro
  • No, I can run liquidsoap as long as I want in the foreground, but I cannot run it in the background with the init script /etc/init.d/liquidsoap

    That's why (I guess) Airtime states the service as not working.

    But I just realised that liquidsoap requires a configuration file (.liq) in /etc/liquidsoap to run it in background.
    In my /etc/liquidsoap there was only a radio.liq.example file, though. So I added a test configuration (sine output) et voila:

    root@xxx:~# /etc/init.d/liquidsoap start
    Starting channels: airtime.liq FATAL ERROR: Log directory "/usr/local/var/log/liquidsoap" does not exist.
    To change it, add the following to your script:
      set("log.file.path", "<path>")
    OK


    Still have no clue why this is not working. A misconfiguration?

    Best, Christian
  • Ah ok, I misunderstood your original post. Try this command:

    sudo -u pypo /usr/lib/airtime/pypo/bin/airtime-liquidsoap

    Its similar to the command the init.d script runs. This should fail as well, but with some reason why at least.
    Airtime Pro Hosting: http://airtime.pro
  • root@dubbase:~# sudo -u pypo /usr/lib/airtime/pypo/bin/airtime-liquidsoap
    sudo: unable to resolve host dubbase
    2012/03/12 21:23:47 >>> LOG START
    2012/03/12 21:23:46 [protocols.external:3] Didn't find "ufetch".
    2012/03/12 21:23:46 [protocols.external:3] Found "/usr/bin/wget".
    2012/03/12 21:23:47 [main:3] Liquidsoap 1.0.0
    2012/03/12 21:23:47 [main:3] Using: graphics=[distributed with Ocaml] pcre=6.0.1 dtools=0.2.2 duppy=0.4.2 duppy.syntax=0.4.2 cry=0.2.2 mm=0.2.0 ogg=0.4.3 vorbis=0.6.1 mad=0.4.4 flac=0.1.0 flac.ogg=0.1.0 dynlink=[distributed with Ocaml] lame=0.3.1 alsa=0.2.1 ao=0.2.0 taglib=0.2.0 camomile=0.7.1 portaudio=0.2.0 pulseaudio=0.1.2
    2012/03/12 21:23:47 [dynamic.loader:2] Could not load plugins in directory /usr/local/lib/liquidsoap/1.0.0/plugins.
    2012/03/12 21:23:47 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
    2012/03/12 21:23:47 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
    2012/03/12 21:23:47 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
    2012/03/12 21:23:47 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
    2012/03/12 21:23:47 [threads:3] Created thread "generic queue #1".
    2012/03/12 21:23:47 [threads:3] Created thread "generic queue #2".
    2012/03/12 21:23:47 [threads:3] Created thread "non-blocking queue #1".
    2012/03/12 21:23:47 [airtime_128:3] Connecting mount airtime_128 for source@127.0.0.1...
    2012/03/12 21:23:47 [airtime_128:3] Connection setup was successful.

    #########################################
    #           *** pypo  ***               #
    #     pypo notification gateway         #
    #########################################
    2012/03/12 21:23:47 [lang:3] /usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --connect --stream-id=1 --time=1331583827.08
    2012/03/12 21:23:47 [threads:3] Created thread "wallclock_main" (1 total).
    2012/03/12 21:23:47 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
    2012/03/12 21:23:47 [fallback_5163:3] Switch to src_5161.
    2012/03/12 21:23:47 [src_5161:3] Inserting missing metadata.
    2012/03/12 21:23:47 [lang:3] /usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --data='0' --media-id=

    #########################################
    #           *** pypo  ***               #
    #     pypo notification gateway         #
    #########################################
    NOTICE: 'media_id' command-line argument not given.
    2012/03/12 21:23:47 [lang:3] Using stream_format 0



  • I realized that as soon as I ran this script (in foreground) I could connect to the streaming server in the web admin, the status indication of airtime-liquidsoap is still red.
  • What happens if you kill the foreground process and do

    sudo service airtime-playout restart

    ?
    Airtime Pro Hosting: http://airtime.pro
  • root@xxx:~# service airtime-playout restart
    Restarting Airtime Playout: start-stop-daemon: unable to alter nice level by -15 (Operation not permitted)
    Done.



  • I'm running Debian Squeeze myself and never had this problem. What is your effective user id?

    echo $EUID

    should return 0. 
    Airtime Pro Hosting: http://airtime.pro
  • Yes, it's 0.
  • Someone else had the same problem with Airtime it's our french forum: http://forum.sourcefabric.org/discussion/13582/config-liquidsoap-vers-un-serveur-shoutcast-/p1

    Not sure what the solution was, maybe Albert FR can comment here :)
    Airtime Pro Hosting: http://airtime.pro
  • It looks like their problem is related to not having root permissions, which is what I thought your problem might be when I asked for the EUID. It's strange that you don't have permission to alter the "nice" level, when you are the superuser.

    Any differences between your system and a standard Squeeze install?
    Airtime Pro Hosting: http://airtime.pro
  • Hey, thanks for your help so far! Really helped me forward.

    Not to my knowledge. It's a virtual root server with squeeze pre-installed.

    Indeed it is very strange. I also could not find anything on the internet, only a bug in the nice command from back in 2001 :D

    For now I altered the /etc/init.d/airtime-playout script and set the nicelevel to 0. This solved the problem. But could this cause other problems?

  • I was going to suggest removing that parameter as a temporary workaround. It isn't really necessary, it's just to make Liquidsoap play nice if the system is under very heavy load (give other processes higher CPU priority).
    Airtime Pro Hosting: http://airtime.pro
  • Opened a new thread
    Post edited by Aris Synodinos at 2012-03-14 09:37:56
  • @Martin

    Everything works fine now. Thanks a lot for your help!

    The server load is quite high now - constantly around 2.0 - where liquidsoap is using most of the cpu time. Is that normal?
  • After spending a day on this issue I could resolve it :)

    The problem was that the airtime-liquidsoap failed to restart, but there were no errors in the logs nor any other indication (not even in the system status in the web interface).

    In /etc/init.d/airtime-liquidsoap I removed --nicelevel -15 from the parameters and restarted the service with $ sudo invoke-rc.d airtime-liquidsoap restart

    The service restarted, the settings updated and liquidsoap could connect to Shoutcast!

  • Glad to hear :) If you ever figure out why re-nicing your Liquidsoap process didn't work let us know.
    Airtime Pro Hosting: http://airtime.pro
  • I had to make following change as well to get up and running::
    For now I altered the /etc/init.d/airtime-liquidsoap script and set the nicelevel to 0. This solved the problem. But could this cause other problems? 
    However airtime-system-check still shows
    LIQUIDSOAP_PROCESS_ID          = FAILED
    MEDIA_MONITOR_PROCESS_ID       = FAILED
    and 
    PLAYOUT_ENGINE_PROCESS_ID      = FAILED

    any help with this one?



    Post edited by michel jacobs at 2012-12-17 06:37:50