savonet/liquidsoap

The `filter.iir` functions are broken

vitoyucepi opened this issue · 1 comments

Description

It seems that the filter.iir functions are broken since 540a837.

Error 9: Failure: Early computation of source content-type detected for source iir_filter!
Raised at Stdlib.failwith in file "stdlib.ml" (inlined), line 29, characters 17-33
Called from Source.operator#content_type in file "src/core/source.ml", line 407, characters 14-190
Called from Source.operator#audio_channels in file "src/core/source.ml", line 420, characters 53-70
Called from Iir_filter.iir.(fun) in file "src/core/operators/iir_filter.ml", line 71, characters 21-40
Called from CamlinternalOO.iter_f in file "camlinternalOO.ml", line 371, characters 12-17
Called from CamlinternalOO.run_initializers_opt in file "camlinternalOO.ml", line 381, characters 24-40
Called from Lang_source.add_operator.f in file "src/core/lang_source.ml", line 438, characters 39-44
Called from Liquidsoap_lang__Evaluation.apply.f in file "src/lang/evaluation.ml", line 174, characters 8-12
Called from Liquidsoap_lang__Evaluation.eval_term in file "src/lang/evaluation.ml", line 347, characters 10-43
Called from Liquidsoap_lang__Evaluation.eval in file "src/lang/evaluation.ml", line 359, characters 10-38
Called from Liquidsoap_lang__Evaluation.eval in file "src/lang/evaluation.ml" (inlined), line 375, characters 2-25
Called from Liquidsoap_lang__Evaluation.eval_toplevel in file "src/lang/evaluation.ml", line 494, characters 38-46
Called from Liquidsoap_lang__Runtime.type_and_run.(fun) in file "src/lang/runtime.ml" (inlined), line 41, characters 46-74
Called from Liquidsoap_lang__Startup.time in file "src/lang/startup.ml" (inlined), line 30, characters 12-16
Called from Liquidsoap_lang__Runtime.type_and_run.(fun) in file "src/lang/runtime.ml", line 41, characters 9-75
Called from Stdlib__Fun.protect in file "fun.ml", line 33, characters 8-15
Re-raised at Stdlib__Fun.protect in file "fun.ml", line 38, characters 6-52
Called from Liquidsoap_lang__Runtime.type_and_run in file "src/lang/runtime.ml", line 30, characters 4-612
Called from Liquidsoap_lang__Runtime.report in file "src/lang/runtime.ml" (inlined), line 215, characters 12-23
Called from Liquidsoap_lang__Runtime.from_lexbuf in file "src/lang/runtime.ml", line 229, characters 2-159

Steps to reproduce

  1. main.liq
    s = sine()
    s = filter.iir.butterworth.high(s, frequency=250., order=2)
    output.dummy(s)
  2. compose.yaml
    services:
      ls20:
        image: savonet/liquidsoap:rolling-release-v2.0.x
        command: /tmp/test/main.liq
        volumes:
          - ./:/tmp/test/
      ls21:
        image: savonet/liquidsoap:rolling-release-v2.1.x
        command: /tmp/test/main.liq
        volumes:
          - ./:/tmp/test/
      ls22:
        image: savonet/liquidsoap:rolling-release-v2.2.x
        command: /tmp/test/main.liq
        volumes:
          - ./:/tmp/test/
      ls23:
        image: savonet/liquidsoap:rolling-release-v2.3.x
        command: /tmp/test/main.liq
        volumes:
          - ./:/tmp/test/
  3. docker compose up

Expected behavior

The filter.iir functions should not fail.

Liquidsoap version

Liquidsoap 2.2.0+git@540a837e2
Copyright (c) 2003-2023 Savonet team
Liquidsoap is open-source software, released under GNU General Public License.
See <http://liquidsoap.info> for more information.

Liquidsoap build config

* Liquidsoap version  : 2.2.0+git@540a837e2

 * Compilation options
   - Release build       : false
   - Git SHA             : 540a837e2
   - OCaml version       : 4.14.2
   - OS type             : Unix
   - Libs versions       : angstrom=0.16.0 bigarray=[distributed with Ocaml] bigstringaf=0.10.0 bytes=[distributed with OCaml 4.02 or above] camomile=1.0.2 camomile.default_config=1.0.2 camomile.dyn=1.0.2 camomile.lib_default=1.0.2 camomile.library=1.0.2 cry=0.6.7 curl=0.9.2 dtools=0.4.5 dune-build-info=3.16.0 dune-private-libs.dune-section=3.16.0 dune-site=3.16.0 dune-site.private=3.16.0 duppy=0.9.3 fileutils=0.6.4 gen=1.1 liquidsoap-lang=2.2.0 liquidsoap_builtins liquidsoap_core liquidsoap_optionals liquidsoap_oss liquidsoap_runtime menhirLib=20240715 metadata=0.1.0 mm=0.8.5 mm.audio=0.8.5 mm.base=0.8.5 mm.image=0.8.5 mm.midi=0.8.5 mm.video=0.8.5 pcre=7.5.0 sedlex=3.2 seq=[distributed with OCaml 4.07 or above] stdlib-shims=0.3.0 str=[distributed with Ocaml] stringext=1.6.0 threads=[distributed with Ocaml] threads.posix=[internal] unix=[distributed with Ocaml] uri=4.4.0
   - architecture        : amd64
   - host                : x86_64-pc-linux-gnu
   - target              : x86_64-pc-linux-gnu
   - system              : linux
   - ocamlopt_cflags     : -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC
   - native_c_compiler   : gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64
   - native_c_libraries  : -lm

 * Configured paths
   - mode              : default
   - standard library  : (set by dune-site)
   - scripted binaries : (set by dune-site)
   - rundir            : (set by dune-site)
   - logdir            : (set by dune-site)

 * Supported input formats
   - MP3               : no (requires mad)
   - AAC               : no (requires faad)
   - Ffmpeg            : no (requires ffmpeg)
   - Flac (native)     : no (requires flac)
   - Flac (ogg)        : no (requires ogg)
   - Opus              : no (requires opus)
   - Speex             : no (requires speex)
   - Theora            : no (requires theora)
   - Vorbis            : no (requires vorbis)

 * Supported output formats
   - FDK-AAC           : no (requires fdkaac)
   - Ffmpeg            : no (requires ffmpeg)
   - MP3               : no (requires lame)
   - MP3 (fixed-point) : no (requires shine)
   - Opus              : no (requires opus)
   - Speex             : no (requires speex)
   - Theora            : no (requires theora)
   - Vorbis            : no (requires vorbis)

 * Tags
   - Taglib (ID3 tags) : no (requires taglib)
   - Vorbis            : no (requires vorbis)

 * Input / output
   - ALSA              : no (requires alsa)
   - AO                : no (requires ao)
   - FFmpeg            : no (requires ffmpeg)
   - GStreamer         : no (requires gstreamer)
   - JACK              : no (requires bjack)
   - OSS               : yes
   - Portaudio         : no (requires portaudio)
   - Pulseaudio        : no (requires pulseaudio)
   - SRT               : no (requires srt)

 * Audio manipulation
   - FFmpeg            : no (requires ffmpeg)
   - LADSPA            : no (requires ladspa)
   - Lilv              : no (requires lilv)
   - Samplerate        : no (requires samplerate)
   - SoundTouch        : no (requires soundtouch)

 * Video manipulation
   - camlimages        : no (requires camlimages)
   - FFmpeg            : no (requires ffmpeg)
   - frei0r            : no (requires frei0r)
   - ImageLib          : no (requires imagelib)
   - SDL               : no (requires tsdl-image & tsdl-ttf)

 * MIDI manipulation
   - DSSI              : no (requires dssi)

 * Visualization
   - GD                : no (requires gd)
   - Graphics          : no (requires graphics)
   - SDL               : no (requires tsdl-image & tsdl-ttf)

 * Additional libraries
   - FFmpeg filters    : no (requires ffmpeg)
   - FFmpeg devices    : no (requires ffmpeg)
   - camomile          : yes
   - inotify           : no (requires inotify)
   - irc               : no (requires irc-client-unix)
   - lastfm            : no (requires lastfm)
   - lo                : no (requires lo)
   - magic             : no (requires magic)
   - memtrace          : no (requires memtrace)
   - mem_usage         : no (requires mem_usage)
   - osc               : no (requires osc)
   - SecureTransport   : no (requires osx-secure-transport)
   - ssl               : no (requires ssl)
   - posix-time2       : no (requires posix)
   - windows service   : no (requires winsvc)
   - YAML support      : no (requires yaml)
   - XML playlists     : no (requires xmlplaylist)

 * Monitoring
   - Prometheus        : no (requires prometheus)

Installation method

From source/self-built

Additional Info

Based on #4123.

The problem is present in 2.2.x and 2.3.x, but not in 2.1.x.

Thanks!