savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.4k stars 130 forks source link

CueSheet Metadata not submitted to IceCast2 #169

Closed daslicht closed 10 years ago

daslicht commented 10 years ago

Hello, When I setup LiquidSoap to playback a cuesheet for a mp3 file which consists of multiple songs, playback is working but I get no Song Information displayed in IceCast2: Image

Setup:

Ubuntu Server 13 Liquidsoap 1.1.1 IceCast Icecast 2.3.3


LIQ

#!/usr/bin/liquidsoap

# Log dir
set("log.file.path","/tmp/basic-radio.log")

radio =cue_cut(mksafe(playlist("AnSolas&LightRocker-LiveSet2012.cue")))  

set("radio.cue_in_metadata","liq_cue_in")
set("radio.cue_out_metadata","liq_cue_out")

output.icecast(%mp3,
                host = "localhost", port = 8000,
                user = "hackme",
                password = "hackme",  
                mount = "stream.mp3",
                radio)

CueSheet

TITLE "May All Beings Be Happy"
PERFORMER "AnSolas & LightRocker"
FILE "Mixdown-MixdownFinalA_16Bit_BWF.mp3" MP3
  TRACK 01 AUDIO
    TITLE "Sebtembuar"
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    TITLE "Lets GoA!"
    INDEX 01 09:01:00
  TRACK 03 AUDIO
    TITLE "Silkyway"
    INDEX 01 19:35:00
  TRACK 04 AUDIO
    TITLE "Together (2012 Remix )"
    INDEX 01 33:37:00
  TRACK 05 AUDIO
    TITLE "November Dreams"
    INDEX 01 42:16:00
  TRACK 06 AUDIO
    TITLE "Guitar Disco"
    INDEX 01 51:20:00

Opening the CueSheet with VLC results in: Image

Parsing the CueSheet with LiquidSoap

root@vps58220:/home# liquidsoap 'print(playlist.parse("AnSolas&LightRocker-LiveSet2012.cue"))'
[([("liq_cue_out","541."), ("liq_cue_in","0."), ("title","Sebtembuar"), ("album","May All Beings Be Happy"), ("artist","AnSolas & LightRocker"), ("track","1")],"./Mixdown-MixdownFinalA_16Bit_BWF.mp3"), ([("liq_cue_out","1175."), ("liq_cue_in","541."), ("title","Lets GoA!"), ("album","May All Beings Be Happy"), ("artist","AnSolas & LightRocker"), ("track","2")],"./Mixdown-MixdownFinalA_16Bit_BWF.mp3"), ([("liq_cue_out","2017."), ("liq_cue_in","1175."), ("title","Silkyway"), ("album","May All Beings Be Happy"), ("artist","AnSolas & LightRocker"), ("track","3")],"./Mixdown-MixdownFinalA_16Bit_BWF.mp3"), ([("liq_cue_out","2536."), ("liq_cue_in","2017."), ("title","Together (2012 Remix )"), ("album","May All Beings Be Happy"), ("artist","AnSolas & LightRocker"), ("track","4")],"./Mixdown-MixdownFinalA_16Bit_BWF.mp3"), ([("liq_cue_out","3080."), ("liq_cue_in","2536."), ("title","November Dreams"), ("album","May All Beings Be Happy"), ("artist","AnSolas & LightRocker"), ("track","5")],"./Mixdown-MixdownFinalA_16Bit_BWF.mp3"), ([("liq_cue_in","3080."), ("title","Guitar Disco"), ("album","May All Beings Be Happy"), ("artist","AnSolas & LightRocker"), ("track","6")],"./Mixdown-MixdownFinalA_16Bit_BWF.mp3")]
No output defined, nothing to do.
root@vps58220:/home# 

LS Log

2014/04/14 18:28:45 >>> LOG START
2014/04/14 18:28:45 [protocols.external:3] Found "/usr/bin/wget".
2014/04/14 18:28:45 [main:3] Liquidsoap 1.1.1
2014/04/14 18:28:45 [main:3] Using: graphics=[distributed with Ocaml] pcre=7.0.2 dtools=0.3.1 duppy=0.5.1 duppy.syntax=0.5.1 cry=0.2.2 mm=0.2.1 xmlplaylist=0.1.3 lastfm=0.3.0 ogg=0.4.5 vorbis=0.6.1 opus=0.1.0 speex=0.2.0 mad=0.4.4 flac=0.1.1 flac.ogg=0.1.1 dynlink=[distributed with Ocaml] lame=0.3.2 shine=0.1.1 gstreamer=0.2.0 frei0r=0.1.0 voaacenc=0.1.0 theora=0.3.0 schroedinger=0.1.0 gavl=0.1.5 bjack=0.1.4 alsa=0.2.1 ao=0.2.0 samplerate=0.1.2 taglib=0.3.1 magic=0.7.3 camomile=0.8.4 inotify=1.0 faad=0.3.2 soundtouch=0.1.7 portaudio=0.2.0 pulseaudio=0.1.2 ladspa=0.1.4 dssi=0.1.1 sdl=0.9.0 camlimages=4.0.0 lo=0.1.0 yojson=1.1.7 gd=1.0a5
2014/04/14 18:28:45 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2014/04/14 18:28:45 [dynamic.loader:3] Could not find dynamic module for aacplus encoder.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/cry.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ogg.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/faad.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/voaacenc.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/vorbis.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lame.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/pulseaudio.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/flac_ogg.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/flac.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/mad.cmxs.
2014/04/14 18:28:45 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/taglib.cmxs.
2014/04/14 18:28:45 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2014/04/14 18:28:45 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2014/04/14 18:28:45 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2014/04/14 18:28:45 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2014/04/14 18:28:45 [threads:3] Created thread "generic queue #1".
2014/04/14 18:28:45 [threads:3] Created thread "generic queue #2".
2014/04/14 18:28:45 [AnSolas&LightRocker-LiveSet2012(dot)cue:3] Loading playlist...
2014/04/14 18:28:45 [AnSolas&LightRocker-LiveSet2012(dot)cue:3] No mime type specified, trying autodetection.
2014/04/14 18:28:45 [AnSolas&LightRocker-LiveSet2012(dot)cue:3] Playlist treated as format application/x-cue
2014/04/14 18:28:45 [AnSolas&LightRocker-LiveSet2012(dot)cue:3] Successfully loaded a playlist of 6 tracks.
2014/04/14 18:28:45 [stream(dot)mp3:3] Connecting mount stream.mp3 for hackme@localhost...
2014/04/14 18:28:45 [decoder:3] Method "MAD" accepted "./Mixdown-MixdownFinalA_16Bit_BWF.mp3".
2014/04/14 18:28:45 [stream(dot)mp3:3] Connection setup was successful.
2014/04/14 18:28:45 [threads:3] Created thread "wallclock_main" (1 total).
2014/04/14 18:28:45 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
2014/04/14 18:28:45 [mksafe:3] Switch to safe_blank.
2014/04/14 18:28:45 [AnSolas&LightRocker-LiveSet2012(dot)cue:3] Prepared "./Mixdown-MixdownFinalA_16Bit_BWF.mp3" (RID 1).
2014/04/14 18:28:45 [mksafe:3] Switch to AnSolas&LightRocker-LiveSet2012(dot)cue with transition.
<<<manual stopped the script here>>
2014/04/14 18:29:08 [main:3] Shutdown started!
2014/04/14 18:29:08 [main:3] Waiting for threads to terminate...
2014/04/14 18:29:08 [stream(dot)mp3:3] Closing connection...
2014/04/14 18:29:08 [AnSolas&LightRocker-LiveSet2012(dot)cue:3] Finished with "./Mixdown-MixdownFinalA_16Bit_BWF.mp3".
2014/04/14 18:29:08 [clock.wallclock_main:3] Streaming loop stopped.
2014/04/14 18:29:08 [threads:3] Thread "wallclock_main" terminated (0 remaining).
2014/04/14 18:29:08 [main:3] Cleaning downloaded files...
2014/04/14 18:29:08 [main:3] Freeing memory...
2014/04/14 18:29:08 >>> LOG END

Anything missing ?

.

daslicht commented 10 years ago

I have found some intereresting things, it looks like that when using cue sheets no metadata are processed at all:

For example if I just playback a single mp3 I get :

liq:

def apply_metadata(m) =
  print(m)
end
radio = on_metadata(apply_metadata,radio)

output (single mp3 as source file):

[
("filename","Chillloop.mp3"), 
("status","playing"), 
("year","2012"),
("initial_uri","Chillloop.mp3"), 
("on_air","2014/04/15 14:32:17"), 
("rid","0"), 
("kind","{audio=2;video=0;midi=0}"), 
("artist","AnSolas"), 
("decoder","MAD"), 
("encoding","Studio One 1.5.2.12713"), 
("date","2012"), 
("temporary","false"), 
("title","Chill Loop")
]

If I do the same with a cuesheet I get the following output:

output (cue-sheet as source file):

[
("filename","./Mixdown-MixdownFinalA_16Bit_BWF.mp3"), 
("status","playing"), 
("source","AnSolas&LightRocker-LiveSet2012(dot)cue"), 
("initial_uri","./Mixdown-MixdownFinalA_16Bit_BWF.mp3"), 
("on_air","2014/04/15 14:29:35"), 
("rid","1"), 
("kind","{audio=2;video=0;midi=0}"), 
("decoder","MAD"), 
("temporary","false")
]
toots commented 10 years ago

Tanks for the detailed report. Looking at it now.

daslicht commented 10 years ago

You're welcome, I keep trying things either, Thank You !

daslicht commented 10 years ago

wao fixed? How could I try it / apply it to my installed version please?

toots commented 10 years ago

Unfortunately, the fix is in the compiled code so you'd need to recompile from git. Another option is to play with playlist.reloadable, which doesn't have the bug.

daslicht commented 10 years ago

Like this? radio = cue_cut(mksafe(playlist.reloadable("Playlist.cue")))

daslicht commented 10 years ago

I tried the following:

daslicht@vps58220:/home$ ./start.liq
At line 10, char 42-80:
  this value has type
    (_*_) (inferred at /usr/lib/liquidsoap/1.1.1/utils.liq, line 590, char 3-17)
  but it should be a subtype of (the type of the value at /usr/lib/liquidsoap/1.1.1/utils.liq, line 5, char 13)
    source(_) (inferred at /usr/lib/liquidsoap/1.1.1/utils.liq, line 6, char 54-70)
daslicht@vps58220:/home$ 

start.liq:

#!/usr/bin/liquidsoap

# LOGGING
# set("log.file.path","/tmp/basic-radio.log")
set("log.file",false)
set("log.stdout",true)
set("log.level",3)

radio =cue_cut(mksafe(playlist.reloadable("AnSolas&LightRocker-LiveSet2012.cue")))  

output.icecast(%mp3,
                host = "localhost", port = 8000,
                user = "hackme",
                password = "hackme",  
                mount = "stream.mp3",
                radio)
daslicht commented 10 years ago

@toots I just tried to built it from source after cloning the repo to my server as described here: http://liquidsoap.fm/doc-svn/build.html

If you are using the git sources, you need to initialize all submodules by invoking make init, make update and finally ./bootstrap.

Thats what I get :

root@vps58220:/home/ls/liquidsoap# ls
bootstrap  CHANGES  configure.ac  COPYING  doc  examples  gui  INSTALL  m4  Makefile  Makefile.defs.in  Makefile.rules  README  RELEASING  scripts  src
root@vps58220:/home/ls/liquidsoap# make init
Makefile.rules:10: Makefile.defs: No such file or directory
make: *** No rule to make target `Makefile.defs'.  Stop.
daslicht commented 10 years ago

anyone ?

daslicht commented 8 years ago

@toots Is that meanwhile fixed? I do not had any success with playlist.reloadable either. please

toots commented 8 years ago

Well liquidsoap has been released with these changes included so I think it has all come full circle now..

daslicht commented 8 years ago

I just tried it again , this time on ubuntu:

#!/usr/bin/liquidsoap

# LOGGING
# set("log.file.path","/tmp/basic-radio.log")
set("log.file",false)
set("log.stdout",true)
set("log.level",3)

radio =cue_cut(mksafe(playlist.reloadable("AnSolas&LightRocker-LiveSet2012.cue")))  

output.icecast(%mp3,
                host = "localhost", port = 8000,
                user = "***",
                password = "***",  
                mount = "stream.mp3",
                radio)

result:

root@v22015072938226788:/etc/ices2/music# sudo -u liquidsoap liquidsoap radio.liq
At line 10, char 42-80:
  this value has type
    (_*_) (inferred at /usr/lib/liquidsoap/1.1.1/utils.liq, line 590, char 3-17)
  but it should be a subtype of (the type of the value at /usr/lib/liquidsoap/1.1.1/utils.liq, line 5, char 13)
    source(_) (inferred at /usr/lib/liquidsoap/1.1.1/utils.liq, line 6, char 54-70)
root@v22015072938226788:/etc/ices2/music# 
daslicht commented 8 years ago
root@v22015072938226788:/etc/ices2/music# liquidsoap --version
Liquidsoap 1.1.1
smimram commented 8 years ago

This means that playlist.relaodable returns a pair, and not a source as expected. You can start with something like

fs = playlist.reloadable(...)
s = snd(fs)
radio = cue_cut(mksafe(s))
...
daslicht commented 8 years ago

@toots: Does version 1.1.1 include those cue sheet fixes ?

@smimram: Thank you !

toots commented 8 years ago

No, you need 1.2.0.

daslicht commented 8 years ago

Is there somewhere a precompiled version 1.2.0 for ubuntu ? please?

toots commented 8 years ago

You will have to get in touch with the distribution. We only maintain the opam packages for liquidsoap. They should be easy to install on ubuntu, tho. See: http://liquidsoap.fm/download.html