My Liquidsoap (1.1.1) has gotten dead air between songs since I changed its
config recently to include a new switch/harbor setting to have DJs pause
the request queue and talk.
The goal of the config: What I need is to pause my dynamic request from
queuing the next song based on an interactive server variable. (set through
a web interface for DJs) When the dynamic request is not going forward, I
need blank/dead air to play so that the DJ can connect to my harbor and
talk. When the DJ is about to finish talking he can hit a button on the
web interface and Liq should start playing music from the dynamic queue
again.
Here is what I came up with:
======================
#!/usr/bin/liquidsoap
set("log.level", 3)
r4_offline_file = "/home/icecast/~misc/cover-offline.mp3"
r4_sid = "3"
r4_dest_mount = "covers"
r4_dest_desc = "Rainwave Covers"
r4_dest_url = "http://covers.rainwave.cc"
r4_harbor_port = 8023
set("server.socket", true)
set("server.socket.path","/var/run/liquidsoap/<script>.sock")
set("server.socket.permissions",432)
set("server.timeout",-1.)
r4_paused = interactive.bool("paused", false)
r4_harbor_pw = interactive.string("harbor_pw", "no_password_at_all")
def r4_backend() =
result = get_process_output("/opt/rainwave/rw_get_next.py --sid
"^r4_sid)
request.create(result)
end
def r4_live_auth(user, password) =
if password == r4_harbor_pw() then
true
else
false
end
end
def r4_is_paused() =
r4_paused
end
r4_offline = audio_to_stereo(single(r4_offline_file))
r4_silence = rewrite_metadata([("title", r4_dest_desc)],
audio_to_stereo(single("/home/icecast/silence_5min.mp3")))
r4_auto = request.dynamic(r4_backend, length=12.0, conservative=false,
timeout=20.0)
r4_auto = rewrite_metadata([("title", '$(if $(use_suffix),"$(title)
$(suffix)","$(title)")'), ("url", r4_dest_url)], r4_auto)
r4_auto = amplify(0.8, override="replay_gain", audio_to_stereo(r4_auto))
r4_auto = fallback([r4_auto, r4_offline], track_sensitive=false)
r4_auto = switch([ (r4_is_paused(), r4_silence), ({ true }, r4_auto) ],
track_sensitive=true)
r4_auto = smart_crossfade(r4_auto)
r4_live = input.harbor("/", port=r4_harbor_port, auth=r4_live_auth,
icy=true);
r4_livemix = smooth_add(delay=0.5, p=0.2, normal=r4_auto, special=r4_live)
# outputs removed
=======================
The interface will use output.skip() to force the 'pause' status to end.
My log looks like:
=======================
2015/02/20 01:41:13 [request.dynamic_4835:4] Remaining: 11.2s, queued:
0.0s, adding: 30.0s (RID 5)
2015/02/20 01:41:25 [decoder:4] Decoding "[[ song 1 ]]" ended:
Mad.End_of_stream.
2015/02/20 01:41:25 [request.dynamic_4835:3] Finished with "[[ song 1 ]]".
2015/02/20 01:41:25 [amplify_4840:3] End of the current overriding.
2015/02/20 01:41:25 [request.dynamic_4835:4] Remaining: 0.0s, queued:
30.0s, taking: 30.0s
2015/02/20 01:41:25 [request.dynamic_4835:3] Prepared "[[ song 2 ]]" (RID
5).
2015/02/20 01:41:25 [amplify_4840:3] Overriding amplification: 0.364754.
2015/02/20 01:41:25 [ogg.muxer:4] covers(dot)ogg: Setting end of track
9922787.
2015/02/20 01:41:25 [ogg.muxer:4] covers(dot)ogg: Every ogg logical tracks
have ended: setting end of stream.
2015/02/20 01:41:25 [ogg.muxer:4] covers(dot)ogg: Starting new
sequentialized ogg stream.
2015/02/20 01:41:25 [ogg.muxer:4] covers(dot)ogg: Starting all streams
2015/02/20 01:44:28 [decoder:4] Trying method "META".....
[[ snip "trying method" a lot ]]
2015/02/20 01:44:28 [request.dynamic_4835:4] Remaining: 11.8s, queued:
0.0s, adding: 30.0s (RID 6)
2015/02/20 01:44:40 [decoder:4] Decoding "[[ song 2 ]]" ended:
Mad.End_of_stream.
2015/02/20 01:44:40 [request.dynamic_4835:3] Finished with "[[ song 2 ]]".
2015/02/20 01:44:40 [amplify_4840:3] End of the current overriding.
2015/02/20 01:44:40 [request.dynamic_4835:4] Remaining: 0.0s, queued:
30.0s, taking: 30.0s
2015/02/20 01:44:40 [request.dynamic_4835:3] Prepared "[[ song 3 ]]" (RID
6).
2015/02/20 01:44:40 [amplify_4840:3] Overriding amplification: 0.461318.
2015/02/20 01:44:40 [ogg.muxer:4] covers(dot)ogg: Setting end of track
b0145a7.
2015/02/20 01:44:40 [ogg.muxer:4] covers(dot)ogg: Every ogg logical tracks
have ended: setting end of stream.
2015/02/20 01:44:40 [ogg.muxer:4] covers(dot)ogg: Starting new
sequentialized ogg stream.
2015/02/20 01:44:40 [ogg.muxer:4] covers(dot)ogg: Starting all streams
=======================
The audio stream:
http://coverstream.rainwave.cc:8000/covers.ogg
=======================
Problem #1: Stuttering
Very frequently at the end of songs, it will stutter. I think this is the
ogg muxer problems seen above. Changing the length=x value does not change
anything.
Problem #2: Dead air
Frequently there are 5+ seconds of silence at the end of a song.
Increasing the length=x parameter doesn't change anything, neither
decreasing nor increasing dead air.
Problem #3: crossfade stopped working
Any ideas? I'm clearly trying to do something strange here with the config.
- Rob
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users