bmc0 / dsp

An audio processing program with an interactive mode.
ISC License
219 stars 31 forks source link

LADSPA frontend parse errors on master, works fine on commit 5778356 #24

Closed kevinkepp closed 6 years ago

kevinkepp commented 6 years ago

I followed the guide for system-wide DSP. I am using Ubuntu 16.04, Room EQ Wizard, rew_to_dsp.sh and pulseaudio.

My config file looks like this:

input_channels=1
output_channels=1
effects_chain=eq 291 2.23 -4.5 eq 116 3.31 -6.7 eq 9948 5.00 -4.5 eq 373 5.00 -4.4 eq 229 5.00 -4.1 eq 1357 5.00 -4.0 eq 2491 5.00 -4.0 eq 1110 5.00 -3.2 eq 175 10.87 -6.3 eq 3364 5.00 -2.4 eq 1888 5.00 -1.6 eq 50.1 6.74 -2.0 eq 610 7.00 9.0 eq 500 4.00 6.5 eq 155 2.00 3.0

When loading module-ladspa-sink using pacmd and watching the log statements using pulseaudio -vvvv I see that the ladspa_dsp plugin throws parse errors and causes the module loading to fail:

dsp: parse_width(): trailing characters: .23
dsp: eq: failed to parse width: 2.23
dsp: error: failed to initialize effect: eq
E: [pulseaudio] module-ladspa-sink.c: Failed to instantiate plugin ladspa_dsp with label ladspa_dsp
E: [pulseaudio] module.c: Failed to load module "module-ladspa-sink" (argument: "sink_name=dsp master=alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.iec958-stereo plugin=ladspa_dsp label=ladspa_dsp"): initialization failed.
E: [pulseaudio] main.c: Module load failed.
E: [pulseaudio] main.c: Failed to initialize daemon.

I could resolve this issue by reverting back to commit 5778356, i.e. before numerical parameter parsing was changed in commit 03a7931. With this version of the plugin, everything works perfectly.

I haven't had time to take a closer look at what changed in 03a7931 but I guess something went wrong there.

bmc0 commented 6 years ago

What's your system locale set to? It seems to work fine on my end (LANG is set to en_US.UTF-8), so I'm going to guess that the decimal separator is not a . for your locale. Unfortunately, that means that just reverting to 5778356 causes only the integer part of each number to be parsed (it stops parsing at the first invalid character and doesn't print an error).

Adding this line to your configuration file is probably the best workaround at the moment:

LC_NUMERIC=C

This sets LC_NUMERIC to C while building the effects chain. See issue #5 for a bit more info.

Also, you may want to apply some negative gain to avoid clipping (the program does not do this automatically). Your effects chain hits about +10.25dB at 608Hz.

kevinkepp commented 6 years ago

Thanks for the quick reply! You are right, my LANG is set to en_US.UTF-8, however LC_NUMERIC was set to de_DE.UTF-8 and thus the decimal separator was wrong. Setting LC_NUMERIC in the config fixes the problem.