Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash or silence when using compressor.multiband.interactive #4

Closed
hbiedka opened this issue Feb 27, 2022 · 5 comments
Closed

Crash or silence when using compressor.multiband.interactive #4

hbiedka opened this issue Feb 27, 2022 · 5 comments
Assignees

Comments

@hbiedka
Copy link

hbiedka commented Feb 27, 2022

Describe the bug
When I am using compress.multiband.interactive, liquidsoap does not work properly:

  • If the Icecast output in mp3 format is set up, app crashes and throws an error as below:
liquidsoap: psymodel.c:576: calc_energy: Assertion `el >= 0' failed.
Aborted (core dumped)
  • If not (eg. Icecast2 but with Vorbis encoding), Liquidsoap streams a silence.

The same script works properly without compress.multiband.interactive.

To Reproduce
My code looks like this:


#postprocessing function
def orban(dry)

    radio = normalize(target=-17., window = 0.03, gain_min= -32., gain_max = 0., dry)
    
    #multiband compressor - THIS DOES NOT WORK!
    radio = compress.multiband.interactive(id="vitalizer",radio)

    # Initial compression low ration - this works OK
    comp_attack = interactive.float(min=0.,max=20.,step=0.5,"comperssor_attack",unit="ms",0.5)
    comp_release = interactive.float(min=1.,max=500.,step=1.,"comperssor_release",unit="ms",1.0)
    comp_thr = interactive.float(min=-60.,max=0.,step=1.,"comperssor_threshold",unit="dB",-36.0)
    comp_ratio = interactive.float(min=1.,max=10.,step=0.1,"comperssor_ratio",unit="",1.0)
    comp_gain = interactive.float(min=0.,max=20.,step=0.1,"comperssor_gain",unit="dB",6.)
    comp_window = interactive.float(min=0.,max=10.,step=0.1,"comperssor_window",unit="s",0.)
    
    radio = compress(attack = comp_attack, release = comp_release, threshold = comp_thr, ratio=comp_ratio, gain = comp_gain, window = comp_window, radio)

    wet = limit(radio)

    c = interactive.float("wetness", min=0., max=1., 1.)
    output = dry_wet(c, dry, wet)
    
    #set web service
    interactive.harbor(port=11000)

    #backup set data
    interactive.persistent("/var/log/emiter/orban.json")

    #return output
    output
end

this function is between request.dynamic and input.harbor fallback (live and playouts/playlist) and ouptut.icecast x2 (program stream in mp3 and Ogg Vorbis) and output.file (program recording to .ogg files)

Expected behavior
Script works properly with and without multiband compressor.

Version details

  • OS: Docker container based on image liquidsoap-main:v2.0.2
  • Version 2.0.2

Install method
As above

@toots
Copy link
Member

toots commented Mar 6, 2022

Hi.

Thanks. This looks like a bug in the floating point data returned by the operator. I've assigned it to @smimram maybe he could help take a look at this.

@smimram
Copy link
Member

smimram commented Mar 6, 2022

The compressor might return values outside the [-1,1] range which could cause the issue. Could you try using the clip operator to ensure that, e.g. by replacing output by clip(output) and tell us if it improves the situation?

@hbiedka
Copy link
Author

hbiedka commented Mar 7, 2022

Hi,

I have changed output for clip(output) and it does not changed anything.

@toots
Copy link
Member

toots commented Mar 11, 2022

I've been hit by this one as well and I hope that the upcoming changes to float array with the latest clipping patch to ocaml-lame here: https://github.com/savonet/ocaml-lame will fix it.

@toots
Copy link
Member

toots commented Mar 11, 2022

Upon futher investigation, it turns out that nan values are the one making lame crash. There's a patch in ocaml-lame but it's not usable in liquidsoap at the moment.

Unless this is really pressing I'd recommend to wait for the upcoming 2.0.4 release, it will include the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants