Bug 102549 - module-ladspa-sink crashes pulseaudio 11.0
Summary: module-ladspa-sink crashes pulseaudio 11.0
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: modules (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: highest blocker
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-05 17:48 UTC by Zaza42
Modified: 2017-09-18 15:59 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
pulseaudio -vv >pulse11-ladspa.log 2>&1 (358.38 KB, text/plain)
2017-09-06 11:53 UTC, Zaza42
Details
0001-sink-add-more-logging.patch (2.26 KB, patch)
2017-09-06 14:04 UTC, Tanu Kaskinen
Details | Splinter Review
pulse11-gdb.log (368.26 KB, text/plain)
2017-09-06 15:29 UTC, Zaza42
Details
GDB log of PA crash on a different system than OP (217.73 KB, text/plain)
2017-09-10 12:30 UTC, Johannes Jordan
Details
0001-sink-source-don-t-try-to-update-volumes-of-not-yet-l.patch (8.60 KB, patch)
2017-09-10 19:32 UTC, Tanu Kaskinen
Details | Splinter Review

Description Zaza42 2017-09-05 17:48:31 UTC
When I tried to load ladspa module, I always get an error and pulseaudio crashes.

$ pacmd load-module module-ladspa-sink sink_name=ladspa_output.fast_lookahead_limiter sink_master=@DEFAULT_SINK@ plugin=fast_lookahead_limiter_1913 label=fastLookaheadLimiter control=14,-15,0.8

 [pulseaudio] sink.c: Assertion 'PA_SINK_IS_LINKED(s->state)' failed at pulsecore/sink.c:1726, function compute_real_ratios(). Aborting.

This bug is even active when I try to load ladspa from default.pa at startup.
 pulseaudio[1935]: [pulseaudio] main.c: Daemon startup failed.
 pulseaudio[1948]: [pulseaudio] sink.c: Assertion 'PA_SINK_IS_LINKED(s->state)' failed at pulsecore/sink.c:1707, function compute_reference_ratios(). Aborting.


I've tried to recompile swh-plugins with no luck. I'm using Debian Buster on x86_64.

There were no problems with version 10 to 6.
Comment 1 Tanu Kaskinen 2017-09-05 18:06:04 UTC
Sounds bad, but I can't reproduce this. Can you attach the full debug log? It seems that you already know how to run pulseaudio in a terminal, so I don't have to explain that. Just pass "-vv" on the command line to get debug logging (if you're not already doing that).

Please use the "Add an attachment" link. (Sometimes people paste long logs to the comment box, which makes it hard to read the discussion.)

How did you install the new pulseaudio version? Is it already packaged for Debian, or did you build from source?
Comment 2 Zaza42 2017-09-06 11:53:59 UTC
Created attachment 133991 [details]
pulseaudio -vv >pulse11-ladspa.log 2>&1

I compiled pulseaudio by hand as I always do because I try to avoid from systemd, avahi and bluetooth. (gcc version 7.2.0)
I have 2 soundcards as you can see: one internal and one external on usb.

default.pa contains:
load-module module-ladspa-sink sink_name=ladspa_output.fast_lookahead_limiter master=@DEFAULT_SINK@ plugin=fast_lookahead_limiter_1913 label=fastLookaheadLimiter control=14,-15,0.8
load-module module-ladspa-sink sink_name=ladspa_output.dyson_compress_1403.dysonCompress master=ladspa_output.fast_lookahead_limiter plugin=dyson_compress_1403 label=dysonCompress  control=0,0.25,0.5,0.5
Comment 3 Tanu Kaskinen 2017-09-06 14:04:13 UTC
Created attachment 133994 [details] [review]
0001-sink-add-more-logging.patch

I tried with a USB sound card and with those same lines in default.pa, but I still can't reproduce. I didn't find anything interesting in the log either.

I attached a patch that adds a bit more logging regarding the sink states (since the crashes were caused by some sink being in a wrong state).

Could you apply the patch and attach a new log? Also, a backtrace from gdb would be helpful. Instructions:

1) gdb --args pulseaudio -vv

2) When the gdb prompt appears, enter "run".

3) When the crash happens, enter "thread apply all bt".

4) You can exit gdb by entering "quit".
Comment 4 Zaza42 2017-09-06 15:29:43 UTC
Created attachment 134010 [details]
pulse11-gdb.log

Here you are. The same effect. :-/

(I've used screen to catch all the output.)
Comment 5 Tanu Kaskinen 2017-09-06 16:05:10 UTC
Thanks! I found out what change introduced this problem, but I don't know yet how it should be fixed. I'll look into this tomorrow.
Comment 6 Tanu Kaskinen 2017-09-07 12:58:51 UTC
As a workaround, you can put "flat-volumes = no" to ~/.config/pulse/daemon.conf.

I had flat volumes disabled, which is why I failed to reproduce the problem at first. With flat volumes enabled the crash happens when loading any filter sink.
Comment 7 Johannes Jordan 2017-09-10 12:30:44 UTC
Created attachment 134128 [details]
GDB log of PA crash on a different system than OP

I do not think this is only 'medium' severity. I updated my system and on login pulseaudio went into an infinite startup-crash loop that ate lots of system resources as well as creating a gigabyte worth of coredumps before I could stop it.

Running Arch Linux, which shipped version 11.0. Included a GDB session as per the instructions which looks a bit different to the other one. Hope it is helpful.
Comment 8 Tanu Kaskinen 2017-09-10 19:31:54 UTC
(In reply to Johannes Jordan from comment #7)

> I do not think this is only 'medium' severity.

Yeah I agree, this is a pretty horrible regression. If you're referring to the "Importance" field though, that doesn't have any real effect in our process, so don't worry about that. I now bumped the "Importance" nevertheless.

I have a patch available now.
Comment 9 Tanu Kaskinen 2017-09-10 19:32:43 UTC
Created attachment 134139 [details] [review]
0001-sink-source-don-t-try-to-update-volumes-of-not-yet-l.patch
Comment 10 Zaza42 2017-09-12 00:09:03 UTC
Okie, 0001-sink-source-don-t-try-to-update-volumes-of-not-yet-l.patch fixed the crash problem, at least for me.
Comment 11 Leho Kraav (:macmaN :lkraav) 2017-09-17 19:04:50 UTC
I confirm, the bug is real, fortunately `flat-volumes = no` fixes the startup crash. This system has no ladspa module configured. Attached patched seems to make a move in the right direction.
Comment 12 Tanu Kaskinen 2017-09-18 15:59:32 UTC
This has been fixed in PulseAudio 11.1.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.