Hi @toots,
I have the same problem.

I tested it on different versions. The most stable is 1.3.1 with opam 1.2.0 
from the Debian repository. OCaml version 4.01.0. (But this version loads CPU 
very much #475 )

I also tried to install the release version of opam 1.2.2 and the version of 
liquidsoap from 1.3.2 to 1.3.3-1, and also opam 2.0.0 beta 5 with liquidsoap 
1.3.3. Version OCaml 4.05.0.

Attempts to reproduce were through the external encoder and through fdkaac. The 
decoder was used by the faad.

The result is the same. Stream just drops without killing the process.

The liquidsoap was assembled with the minimum configuration from opam + cry, 
faad, fdkaac, ladspa, samplerate.

### Below is the configuration and end of the logs on which I tested.
Judging by the logs, it almost always drops before or after the jingles.

**.log**
```
2018/07/25 00:11:49 [decoder:4] Trying method "MP4" for 
"/radio/collection/jingles/sg_preview.m4a"...
2018/07/25 00:11:49 [decoder.mp4:4] Libfaad recognizes 
"/radio/collection/jingles/sg_preview.m4a" as MP4 (44100Hz,2 channels).
2018/07/25 00:11:49 [decoder:3] Method "MP4" accepted 
"/radio/collection/jingles/sg_preview.m4a".
2018/07/25 00:11:49 [jingles:4] Remaining: 10.0s, queued: 0.0s, adding: 30.0s 
(RID 5)
2018/07/25 00:11:54 [smart_cross_10647:4] Buffering end of track...
2018/07/25 00:11:54 [smart_cross_10647:4] More buffering will be needed.
2018/07/25 00:11:55 [decoder:4] Decoding 
"/radio/collection/jingles/sg_preview.m4a" ended: 
Aac_decoder.Make_mp4(Generator).End_of_track.
2018/07/25 00:11:56 [jingles:3] Finished with 
"/radio/collection/jingles/sg_preview.m4a".
2018/07/25 00:11:56 [jingles:4] Remaining: 0.0s, queued: 30.0s, taking: 30.0s
2018/07/25 00:11:56 [jingles:3] Prepared 
"/radio/collection/jingles/sg_preview.m4a" (RID 5).
2018/07/25 00:11:56 [rotate_10643:3] Switch to mksafe with forgetful transition.
2018/07/25 00:11:56 [mksafe:4] Activations changed: static=[], 
dynamic=[rotate_10643:ladspa_10645:smart_cross_10647].
2018/07/25 00:11:56 [mksafe:4] Activations changed: 
static=[rotate_10643:ladspa_10645:smart_cross_10647], 
dynamic=[rotate_10643:ladspa_10645:smart_cross_10647].
2018/07/25 00:11:56 [smart_cross_10647:3] Analysis: -78.517370dB / -15.047655dB 
(5.02s / 1.98s)
2018/07/25 00:11:56 [joshcross:4] Before: ("kind","{audio=2;video=0;midi=0}")
2018/07/25 00:11:56 [joshcross:4] Before: ("decoder","MP4")
2018/07/25 00:11:56 [joshcross:4] Before: 
("filename","/radio/collection/jingles/sg_preview.m4a")
2018/07/25 00:11:56 [joshcross:4] Before: ("temporary","false")
2018/07/25 00:11:56 [joshcross:4] Before: ("source","jingles")
2018/07/25 00:11:56 [joshcross:4] Before: 
("initial_uri","/radio/collection/jingles/sg_preview.m4a")
2018/07/25 00:11:56 [joshcross:4] Before: ("playlist_length","1")
2018/07/25 00:11:56 [joshcross:4] Before: ("status","playing")
2018/07/25 00:11:56 [joshcross:4] Before: ("tool","qaac 2.67, CoreAudioToolbox 
7.10.9.0, AAC-LC Encoder, CVBR 256kbps, Quality 96")
2018/07/25 00:11:56 [joshcross:4] Before: ("on_air","2018/07/25 00:11:20")
2018/07/25 00:11:56 [joshcross:4] Before: ("rid","0")
2018/07/25 00:11:56 [joshcross:4] Before: ("playlist_position","0")
```

**config.liq**
```
#!/usr/local/bin/liquidsoap

set("init.daemon.pidfile.path", "/radio/technical/liquidsoap/liquidsoap.pid")
%include "utils.liq"

set("decoder.stream_decoders",["MP4"])
set("decoder.file_decoders",["MP4"])
set("decoder.file_extensions.mp4",["m4a"])
set("decoder.mime_types.mp4",["audio/x-m4a"])

home = "/radio"
pl = "#{home}/collection"
muz = "#{pl}/music"
jin = "#{pl}/jingles"
logs = "#{home}/logs"

set("log.file.path", "#{logs}/liquidsoap.log")
set("log.level", 5)

music = mksafe(playlist("#{muz}"))
jingles = mksafe(playlist("#{jin}"))

stream = rotate(weights = [2, 1], [music, jingles])
stream = ladspa.matrixspatialiser(width = 3, stream)
stream = joshcross(stream)
stream = skip_blank(stream)

cfg = output.icecast(
        host = *********,
        port = ****,
        user = "source",
        password = *********,
        name = ************,
        description = ***********,
        genre = *******,
        url = ************,
        encoding = "UTF-8"
)

cfg(
        %external(
                channels = 2,
                samplerate = 44100,
                header = true,
                restart_on_crash = false,
                restart_on_metadata,
                restart_after_delay = 30,
                process="WINEDEBUG=-all /opt/wine-devel/bin/wine 
/radio/technical/qaac/qaac.exe -v 256 -q 2 --adts -s --log /radio/logs/qaac.log 
--threading --delay=0 --gapless-mode=2 --no-delay --rate=44100 - -o -"
        ),
        mount = "source.aac",
        format = "audio/aac",
        stream
)


#cfg(
#       %fdkaac(
#               channels = 2,
#               samplerate = 44100,
#               vbr = 5,
#               afterburner = true,
#               aot = "mpeg4_aac_lc",
#               transmux = "adts",
#               sbr_mode = false
#       ),
#       mount = "source.aac",
#       stream
#)

```
**utils.liq**
```
def joshcross (~start_next=5.,~fade_in=3.,~fade_out=3.,
                     ~default=(fun (a,b) -> sequence([a, b])),
                     ~high=-15., ~medium=-32., ~margin=4.,
                     ~width=2.,~conservative=false,s)
  fade.out = fade.out(type="sin",duration=fade_out)
  fade.in  = fade.in(type="sin",duration=fade_in)
  add = fun (a,b) -> add(normalize=false,[b, a])
  log = log(label="joshcross")

  def transition(a,b,ma,mb,sa,sb)

    list.iter(fun(x)-> log(level=4,"Before: #{x}"),ma)
    list.iter(fun(x)-> log(level=4,"After : #{x}"),mb)

    if ma["type"] == "J" or mb["type"] == "J" then
      log("Old or new file is a jingle: sequenced transition.")
      sequence([sa, sb])
    elsif
      # Do not fade if it's already very low.
      b >= a + margin and a <= medium and b <= high
    then
      log("new >= old + margin, old <= medium and new <= high.")
      log("Do not fade if it's already very low.")
      log("Transition: crossed, no fade.")
      add(sa,sb)

    else
      log("Transition: crossed, fade-in, fade-out.")
      add(fade.out(sa),fade.in(sb))
    end
  end

  smart_cross(width=width, duration=start_next, conservative=conservative,
              transition,s)
end

def 
skip_blank(~id="",~threshold=-40.,~max_blank=20.,~min_noise=0.,~track_sensitive=true,s)
  
on_blank({source.skip(s)},threshold=threshold,max_blank=max_blank,min_noise=min_noise,track_sensitive=track_sensitive,s)
end
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/savonet/liquidsoap/issues/572#issuecomment-407679287
------------------------------------------------------------------------------
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