Permalink
Browse files

long hard road outta hell

  • Loading branch information...
1 parent 7829f33 commit 379a8e6529a7cf3571887723a1763b6773bcaa5a @comotion committed Jul 16, 2012
Showing with 238 additions and 18 deletions.
  1. +80 −11 ls/hangover.liq
  2. +141 −0 ls/output.liq
  3. +17 −7 setup.sh
View
@@ -13,28 +13,59 @@
# -> auto
# -> studio
+#rate=44100
+#set("frame.audio.samplefreq",rate)
+
# the nexturl is where we get the next track uri from
nexturl = "http://delta9.pl/next"
endurl = "http://delta9.pl/end"
blankurl = "http://delta9.pl/blank"
metaurl = "http://delta9.pl/meta"
noiseurl = "http://delta9.pl/noise"
-set("log.file.path", "./penis")
+set("log.file.path", "./playout.log")
set("log.stdout", true)
-set("log.level", 4)
+set("log.level", 3)
+#set("clock.allow_streaming_errors",true) # allow funky happenings
+#set("root.max_latency",7.) # reset the output when we're late instead of trying to catch up
set("server.telnet", true)
+set("server.telnet.port", 1234)
# LIVE SOURCE
# studio: stream harbor, live stream comes in here
set("harbor.bind_addr","0.0.0.0")
-live = input.harbor(id="liveharbor", "live",port=8000,password="dubdabdub")
+live = buffer(id="livebuffer",fallible=true,input.harbor(id="liveharbor", "live",port=8008, icy=true, password="dubdabdub"))
# FALLBACK SOURCE
# reads all files on startup, so will either fail
# on startup or never after (unless you underrun :-F)
safeword = playlist.safe(id="fail", "./fail.m3u");
+deadair = amplify(0.00001, noise())
+weird = stretch(ratio=1.9,flanger(
+ filter.iir.resonator.allpass(frequency=100.,
+ filter(freq=323.,mode="low",q=1.3,wetness=0.42,
+ echo( add([
+ sine(445.),
+ amplify(3.,
+ comb(sine())
+ )
+ ]))
+ )
+ )
+ ))
+ignore(weird)
+ignore(safeword)
+ignore(deadair)
+#summe = sine()
+#safeword = deadair
+
+## UDP SOURCE
+
+#udpin = input.udp(id="udpin",host="localhost", port=31338,"audio/pcm")
+#udpin = input.oss(id="ALSA!")
+#udpin = mksafe(input.external(id="udpin", "nc -u -l -p 31338"))
+#udpin = mksafe(single
# MAIN SOURCE
# auto:
@@ -72,16 +103,36 @@ end
next = request.dynamic(id="hangover:dynamic", next_one)
onnext = on_end(id="endoftrack", end_uri,next)
playout = smart_crossfade(server.insert_metadata(onnext))
+requests = request.queue()
+mixq = request.queue(id="mixq")
+
+# FALLBACK no.X: random directory play (the "wontreach")
+wontreach = playlist(id="random", mode="random",reload=600,"/srv/mu")
+morn = playlist(id="morning", mode="random", reload=600, "/srv/mu/morn")
+midd = playlist(id="midday", mode="random", reload=600, "/srv/mu/midd")
+eve = playlist(id="evening", mode="random", reload=600, "/srv/mu/eve")
+program = switch(id="program",[
+ ({ 5h-14h}, morn),
+ ({ 14h-21h }, midd),
+ ({ 21h-04h00 }, eve),
+ ({ true }, wontreach)
+ #({ 1w }, monday_source),
+ #({ (6w or 7w) and 0h-12h }, week_ends_mornings),
+])
+
# INPUTS
-failsafes = fallback(id="failsafes", [playout, safeword, blank()])
-sources = fallback(id="sources", track_sensitive=false, [live, failsafes])
+failsafes = eat_blank(id="blankfall", fallback(id="failsafes", [requests, program, wontreach, safeword , blank()]))
+s = fallback(id="sources", track_sensitive=false, [live, playout, failsafes])
+
+#s = smooth_add(normal=s,special=switch([({ 0m0s or 30m0s }, jingles_dyn)]))
+sources = smooth_add(normal=s,special=mixq,p=0.5)
input =
on_metadata(id="metadata!",meta_uri,
on_blank(id="blank!",
blank_uri,
on_noise=noise_uri,
- sources
+ audio_to_stereo(id="source:stereo", sources)
)
)
@@ -99,8 +150,26 @@ server.register("nexturl", set_nexturl)
# OUTPUTS
-# kinda uninterrupted when buffered
-output.alsa(id="alsa",input)
-#output.external("nextprogram")
-#output.icecast.vorbis(
-
+#clock.assign_new(sync=false,[ # makes things glitchy over UDP
+# output.external(id="UT",
+# %external(header=false,samplerate=44100,channels=2,restart_on_crash=true,
+ #process="schroot -d /opt -- stereo_tool_cmd -s /opt/metafusion.sts - - " ),
+# process="stereo_tool_cmd -s /opt/modiknown.sts - - " ),
+# "socat - UDP-SENDTO:localhost:4200",
+ #"socat - IP-DATAGRAM:delia:240,cool-write,shut-none",
+# input)
+#])
+
+# .. OGG ICE OUTPUT
+#map_metadata(id,f,src)
+#insert key1=“val1”,key2=“val2”,..
+input = server.insert_metadata(id="meta",input)
+
+
+output.icecast(id="ut",host='localhost', port=8888, password="dubdabdub", icy_metadata="true",mount="in",format="audio/ogg",
+fallible=true,
+#output.icecast(id="ut",host='localhost', port=8888, password="dubdabdub", icy_metadata="false",mount="in",format="audio/ogg",
+ %external(header=false,samplerate=44100,channels=2,restart_on_crash=true,
+ process="stereo_tool_cmd -s /opt/modiknown.sts - - | oggenc -q 10 -r - " ),
+ #%ogg(%flac),
+input)
View
@@ -0,0 +1,141 @@
+#!/usr/bin/liquidsoap
+set("log.file.path", "./penis.UT")
+set("log.stdout", true)
+set("log.level", 4)
+set("clock.allow_streaming_errors",true) # allow funky happenings
+#set("frame.audio.samplerate",44100)
+
+set("server.telnet.port",4444)
+set("server.socket.path","iceout.sock")
+set("server.socket",true)
+set("server.telnet", true)
+
+
+#source = eat_blank(id="hangover",track_sensitive=false, buffer(fallible=true,input.external(id="HANGOVER",
+ #restart_on_error=true,restart=true,
+ #"nc -lup 4200")
+#))
+set("harbor.bind_addr","0.0.0.0")
+source= strip_blank(id="instrip", length=5.,input.harbor(id="inharbor", "in", icy=true,port=8888, password="dubdabdub"))
+
+
+deadair = amplify(id="deadair",1.00001, noise())
+deadair = rewrite_metadata([("artist","BASSIVE"), ("title", "BASSOFF")],deadair)
+ignore(deadair)
+
+# FALLBACK no.X: random directory play (the "wontreach")
+wontreach = playlist(id="random", mode="random",reload=600,"/srv/mu")
+
+input = fallback(id="IN",track_sensitive=false, [source, wontreach, deadair])
+
+# based on output.aplay
+def output.dabplus(
+ ~id,
+ ~dest,
+ ~port="15002",
+ ~samplerate=44100,
+ ~channels=2,
+ ~bitrate=96,
+ ~padport=14000,
+ ~padbytes=25,
+ fmt, s)
+ def crcdabplus(m) =
+ "chroot /dabplus crc-dabplus -b #{bitrate} -c #{channels} -r 48000 -g -d tcpserver://:#{padport} \
+ -p #{padbytes} -t dls -q 2 -E \
+ -f 'audio/x-raw-int,rate=#{samplerate},channels=#{channels},width=16,depth=16,signed=true,endianness=1234' \
+ | resocat - TCP:#{dest}:#{port},forever"
+ #-o tcpclientsink://host=#{dest},port=#{port}"
+ end
+ output.external( id=id,fallible=true, fmt, crcdabplus("blah"), s)
+end
+
+# .. DAB OUTPUT PIPE
+#clock.assign_new(sync=false,[output.dabplus(id="dabplus", dest="tx.radionova.no",port="15002",
+ #%wav(header=false,channels=2), input)])
+
+#clock.assign_new(sync=false,[output.external(id="dabplus", %wav(header=false,channels=2),
+# "/opt/dabcmd.sh", input)])
+
+#clock.assign_new(sync=false,[output.external(id="dabplus", %wav(header=false,channels=2),
+# "/opt/dabcmd.sh", input)])
+
+# .. ICECAST OUTPUT
+### main stream
+output.icecast(host='haack.oslobass.no', port=8000, user="source", password="aicuV3eeboh9u",
+ mount="bass.mp3",
+ name='Oslo Bass Radio',
+ description='Oslo Bass Radio',
+ url='http://oslobass.no',
+ format="audio/mpeg",
+ encoding="UTF-8",
+ genre="Bass",
+ %mp3(bitrate=192,id3v2=true),
+input)
+output.icecast(host='haack.oslobass.no', port=8000, user="source", password="aicuV3eeboh9u",
+ mount="oslobass",
+ name='Oslo Bass Radio',
+ description='Oslo Bass Radio',
+ url='http://oslobass.no',
+ format="audio/mpeg",
+ encoding="UTF-8",
+ genre="Bass",
+ %mp3(bitrate=192,id3v2=true),
+input)
+output.icecast(host='haack.oslobass.no', port=8000, user="source", password="aicuV3eeboh9u",
+ mount="bass_lofi.mp3",
+ name='Oslo Bass Radio',
+ description='Oslo Bass Radio; lofi edition',
+ url='http://oslobass.no',
+ format="audio/mpeg",
+ encoding="UTF-8",
+ genre="Bass",
+ %mp3(bitrate=64,stereo=false),
+mean(input))
+output.icecast(host='haack.oslobass.no', port=8000, user="source", password="aicuV3eeboh9u",
+ mount="bass_hifi.mp3",
+ name='Oslo Bass Radio',
+ description='Oslo Bass Radio; hifi edition',
+ url='http://oslobass.no',
+ format="audio/mpeg",
+ encoding="UTF-8",
+ genre="Bass",
+ %mp3.vbr(id3v2=true,quality=1),
+input)
+output.icecast(host='haack.oslobass.no', port=8000, user="source", password="aicuV3eeboh9u",
+ mount="bass_flac.ogg",
+ name='Oslo Bass Radio',
+ description='Oslo Bass Radio; flac edition',
+ url='http://oslobass.no',
+ format="audio/mpeg",
+ encoding="UTF-8",
+ genre="Bass",
+ %ogg(%flac(samplerate=44100, channels=2, compression=5, bits_per_sample=16)),
+input)
+# delia streams were only here till krav got a grip on dns
+
+# .. FILE OUTPUT
+output.file(
+ append=true,
+ reopen_when={0m0s},
+ %mp3(bitrate=64),"/srv/rec/tonify-%Y-%m-%d-%H-%M-%S.mp3",
+input)
+
+# .. OGG ICE OUTPUT
+output.icecast(host='localhost', port=8000, user="source", password="aicuV3eeboh9u", mount="dab",
+ name='Oslo Bass Radio',
+ description='Oslo Bass Radio',
+ url='http://oslobass.no',
+ %wav(header=false), input)
+
+# .. DAB OUTPUT SOCKET
+#clock.assign_new(sync=false, [
+#output.external(id="UTSOCK",
+ #%wav(header=false,channels=2),
+ #"socat - UDP-SENDTO:localhost:4222",
+ #"nc -u localhost 4222",
+# "resocat - ABSTRACT-SENDTO:dabplus,cool-write,shut-none",
+ #input)
+#])
+
+#output.alsa(id="ALSA",device="postpro", input)
+
View
@@ -1,6 +1,9 @@
#!/bin/sh
#git clone git://github.com/comotion/hangover
os=`uname -o`
+olddir=`pwd`
+mkdir -p inst
+cd inst
case $os in
*BSD)
@@ -24,22 +27,29 @@ case $os in
make install
cd -
;;
- Linux)
+ *Linux)
dist=`lsb_release -si`
case $dist in
Debian|Ubuntu)
- apt-get install luarocks zlib1g-dev liquidsoap liquidsoap-plugin-lame
+ apt-get install luarocks zlib1g-dev liquidsoap liquidsoap-plugin-lame libbz2-dev
# somethings wrong with the debian headers
#apt-get install tokyocabinet-bin libtokyocabinet-dev
- [ -d bzip2-1.0.6 ] || wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz -qO - | tar xzf -
- cd bzip2-*
- make && make install
- cd -
+ #[ -d bzip2-1.0.6 ] || wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz -qO - | tar xzf -
+ #cd bzip2-*
+ #make && make install
+ #cd -
[ -d tokyocabinet-1.4.47 ] || wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.47.tar.gz -qO - | tar xzf -
cd tokyocabinet-1.4.47 && ./configure && make ;make install
cd -
+ [ -d tokyocabinet-lua-1.10 ] || wget http://fallabs.com/tokyocabinet/luapkg/tokyocabinet-lua-1.10.tar.gz -qO - | tar xzf -
+ cd tokyocabinet-lua*
+ #./configure CFLAGS='-I/usr/local/include/lua51 -I/usr/local/include -std=c99 -fPIC'
+ #make CFLAGS='-I/usr/local/include/lua51 -I/usr/local/include -std=c99 -fPIC'
+ ./configure && make
+ make install
+ cd -
;;
*)
echo "What is this $os $dist ??"
@@ -56,5 +66,5 @@ sed -i 's/\[\%w_\]/[%_w]/g' /usr/local/share/lua/5.1/orbit/model.lua
-cd web
+cd $olddir/web
#[ ! -d sabot ] && git clone git://github.com/comotion/sabot || ( cd sabot && git pull )

0 comments on commit 379a8e6

Please sign in to comment.