Hi Gilou,

2018-07-17 21:27 GMT-05:00 Gilou <contact+...@gilouweb.com>:
>
> Hi there!
>
> I wanted to replace a "complicated" setup using named pipes and metadata
> passthrough with the "new" pipe() operator, but it craps out if I put it
> next to a switch().
>
> I'm using the well-known StereoTools from
> https://www.stereotool.com/download/stereo_tool_cmd (version 9.01) with
> liq 1.3.3 (compiled using opam) on Ubuntu 18.04.
>
> Current code does output.external() to a named pipe (mkfifo), I then use
> input.external() using cat to stream it back to liq, then to icecast.
> That works nicely and has for quite some time now, but it's a bit bulky
> especially when you have to handle metadata.
>
> So I did:
>
> pl1 = playlist("music1")
> pl2 = playlist("music2")
>
> radio = switch([
> ({ 0h-12h }, pl1),
> ({ 12h-0h }, pl2)
> ])
>
> cross = smart_crossfade(radio)
>
> binary = "/usr/local/bin/stereo_tool_cmd_64"
> preset = "GENERIC PRESETS/Jeff - Groove! (soft)"
> cmd = binary ^ " -p '" ^ preset ^ "' -q - - 2>/dev/null"
>
> # stereo_tool_cmd_64 takes an input and an output file
> # treats - as stdin / stdout
> # -q means quiet
> # cmd should look like:
> # stereo_tool_cmd_64 -p 'preset' -q - - 2>/dev/null
> flux_traite = mksafe(pipe(id="st", process=cmd, cross))
>
> output.icecast(…, flux_traite)
>
> And after the first song is played, the next ones starts, then it seems
> that stereotools crashes, so liq switches to blank, then back on the pipe.
>
> So I thought, let's add some buffer on the pipe!
> But well, I tried up to 15s and it didn't help.
> I removed everything and debuggged my way until I found it works as
> expected as long as I don't use switch()...
>
> Then I thought... Maybe it's using the same clock and getting lost
> trying to sync (not sure how it does it then but well) ?
> So I gave pipe its own clock:
> flux_traite = mksafe(clock(pipe(id="st", process=cmd, cross)))
>
> That fails too. So I thought maybe stereotool thinks the file ends for
> some reason.. And added a buffer on the source (the smart_crossfade here)
>
> cross = buffer(smart_crossfade(radio), buffer=3.0)
> flux_traite = mksafe(pipe(id="st", process=cmd, cross))
>
> And... it looks like it works but the buffer() probably doesn't like the
> situation:
> 2018/07/18 03:12:29 [warp_prod_8852:3] Buffer emptied, start buffering...
> 2018/07/18 03:12:33 [warp_prod_8852:3] Buffer emptied, start buffering...
>
> And liq uses an awful lot of CPU then, even crashing...
> Segmentation fault (core dumped)
>
> If I put the switch() off, it works as expected (the oiginal script has
> playlist, rotate, ....)
>
> Help ? ;)

I'm gonna have a look at this asap, thanks for reporting.

Romain

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to