bmc0 / dsp

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

PulseAudio crashes with the ladspa dsp plugin when 'avoid-resampling = yes' on Ubuntu 20.04 #56

Closed cepamoi closed 3 years ago

cepamoi commented 3 years ago

Hello,

I use DSP with the ladspa plugin with PulseAudio on Kubuntu 20.04. It works very well with the PulseAudio default config. However, when I set "avoid-resampling = yes" in the /etc/pulse/daemon.conf config file, PulseAudio crashes when I load the ladspa dsp config: pacmd load-module module-ladspa-sink sink_name=ATH-M50X master=alsa_output.pci-0000_00_05.0.analog-stereo plugin=ladspa_dsp label=ladspa_dsp:ATH-M50X

Of course, this may be a bug in PulseAudio, but this may also be caused by the ladspa dsp plugin. So here are more details.

The content of my file ~/.config/ladspa_dsp/config_ATH-M50X:

LC_NUMERIC=C
effects_chain=@ATH-M50X.txt

And the file ~/.config/ladspa_dsp/ATH-M50X.txt:

gain -7
eq 167 2.59 -2.0 eq 327 2.37 3.2 eq 1397 0.62 1.2 eq 2608 3.12 -2.3 eq 5826 5.21 6.7 eq 7966 2.55 -2.1 eq 9166 3.30 3.4 eq 18679 0.06 -2.4 highshelf 19122 0.41 -9.3 

I tried to attach gdb to PulseAudio and I get the following backtrace when PulseAudio crashes:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fe922785859 in __GI_abort () at abort.c:79
#2  0x00007fe922c664b2 in pa_sink_suspend () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-13.99.so
#3  0x00007fe922c6576c in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-13.99.so
#4  0x00007fe922c66853 in pa_sink_reconfigure () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-13.99.so
#5  0x00007fe922c5ba93 in pa_sink_input_cork () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-13.99.so
#6  0x00007fe91c09ef67 in  () at /usr/lib/pulse-13.99.1/modules/module-ladspa-sink.so
#7  0x00007fe922c65264 in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-13.99.so
#8  0x00007fe922c65dbf in pa_sink_put () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-13.99.so
#9  0x00007fe91c0a2608 in module_ladspa_sink_LTX_pa__init () at /usr/lib/pulse-13.99.1/modules/module-ladspa-sink.so
#10 0x00007fe922c414b1 in pa_module_load () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-13.99.so
#11 0x00007fe922c2d374 in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-13.99.so
#12 0x00007fe922c3520a in pa_cli_command_execute_line_stateful () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-13.99.so
#13 0x00007fe91cc235d3 in  () at /usr/lib/pulse-13.99.1/modules/libcli.so
#14 0x00007fe922bc1eb8 in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-13.99.so
#15 0x00007fe922b62ba3 in pa_mainloop_dispatch () at /lib/x86_64-linux-gnu/libpulse.so.0
#16 0x00007fe922b62ed2 in pa_mainloop_iterate () at /lib/x86_64-linux-gnu/libpulse.so.0
#17 0x00007fe922b62f70 in pa_mainloop_run () at /lib/x86_64-linux-gnu/libpulse.so.0
#18 0x0000558d9e3da39f in main ()

Do you know if this is a bug in PulseAudio or in the ladspa dsp plugin? Thanks.

bmc0 commented 3 years ago

Thanks for the detailed report. This is in fact a PulseAudio bug. PulseAudio appears to crash immediately after loading any LADSPA plugin if avoid_resampling is enabled.

I actually discovered this problem relatively recently myself and intended to report it upstream, but haven't done so yet. The bug was introduced during the 13.0 development cycle (12.2 doesn't crash). Feel free to report the bug to the PulseAudio developers if you want.

cepamoi commented 3 years ago

Hello,

Thanks for your quick reply. I just opened an issue in the PulseAudio bug tracker: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1081