falkTX / Carla

Audio plugin host
https://kx.studio/carla
1.6k stars 147 forks source link

Crash in combination with KDE Plasma and/or Pipewire #1746

Closed Krumel closed 1 year ago

Krumel commented 1 year ago

Since switching to Pipewire, I've been plagued by seemingly random crashes of Carla. After a bit of careful observation, I think I have found the specific issue I am experiencing.

The crash is triggered by hovering over icons in the KDE Task Manager.

In Carla I can see two audio "clients" kwin_wayland and plasmashell, which are connected but don't have any audio channels. Screenshot_20230221_184350

Hovering over the task icons I can see those flickering. Hovering over task icons quickly usually triggers a crash within a few seconds.

When this happens the Carla log gets absolutely spammed by these lines:

'c != NULL' failed at ../pipewire/pipewire-jack/src/pipewire-jack.c:5985 jack_transport_query()
[carla] Carla assertion failure: "fBuffer != nullptr" in file CarlaEnginePorts.cpp, line 159

When this happens Carla becomes unresponsive, throws multiple error-windows that Jack has crashed and usually needs to be killed (sometimes even with signal 9)

I'm not sure if this is an issue of Carla, Pipewire or KDE (or even kwin-wayland?).

I'm attaching a log of Carla of one of the crashes, but there doesn't seem to be much more than the above two lines. carla_log.txt

SnipeXandrej commented 1 year ago

I seem to be having the same issue as you https://github.com/falkTX/Carla/issues/1738#issuecomment-1409857268 https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2863

I haven't used anything other than Plasma for a long time, so I am guessing that this isn't an issue in other Wayland DE's?

SnipeXandrej commented 1 year ago

I have come to the conclusion that these crashes of Carla are because of PipeWire JACK crashing from plasmashell! And not Carla from plasmashell.

You can see this by trying to record something like spotify in Audacity and then moving your mouse to crash JACK, Carla does not need to be open, the recording will suddenly stop.

I asked in the KDE Plasma matrix channel what to do, I was instructed to report this to PipeWire. I will post a link to the bug report shortly.

SnipeXandrej commented 1 year ago

Here's the bug report: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3070

pinkflames commented 1 year ago

Regrettably Plasma and PipeWire are right that the project which crashes is the one with whom the initial issue belongs (even if the bug is in another project), so Carla project needs to debug this and then pass the issue further, if they identify that the failure is in another project such as PipeWire or Plasma. And, if they refuse to handle the issue while the other projects pass the buck, since they're not the ones crashing, then sadly you're the one who keeps the pieces. Sorry.

dire-alpaca commented 1 year ago

I am glad I found others with this issue as I am experiencing the same thing. As @SnipeXandrej / @Krumel mentioned, I believe this is a Plasma/Pipewire issue with the rendering of those thumbnails causing pipewire-jack to crash.

My workflow is generally jack_mixer and Carla running with some virtual sinks/routing/plugins/etc. jack_mixer dies for me as well when this occurs and I get the looping error that @Krumel mentioned.

I have moved my Plasma panels to task manager vs icon-only task manager widgets and disabled hovering on all of them and will test some more. It wasn't happening all the time for me because I had two panels with icon-only task managers that were not on my primary monitor. Makes it hard to identify what was happening.

I will probably just post more results to the Pipewire issues mentioned in this thread, but I don't think this is specifically a carla issue.

SnipeXandrej commented 1 year ago

but I don't think this is specifically a carla issue.

Yeah, that's what I also think, as other apps that are using JACK also crash, even when Carla is not running at all. I made a more detailed explanation at the issue/bug report mentioned above (https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3070).

Btw, I basically eliminated (I THINK) all PipeWire Jack crashes by using "Latte Tasks" instead of the default Task Managers, because disabling thumbnails in the default Task Managers still seems to crash JACK, Latte Tasks with thumbnails enabled also crashes JACK, but when disabled, the crashes stop. But I still had the occasional crash when I was adjusting the volume, I believe. So then I decided to use pamixer -i 5 and pamixer -d 5 to increase/decrease my volume instead of using the Plasma PA widget to adjust the volume, and this seems to have eliminated all crashes, at least by seeing it run without a single crash for the past 42 hours (it would crash like every 30 minutes before these 2 workarounds! sometimes even multiple times in less then a minute...).

marcan commented 1 year ago

This is clearly not a Carla problem since it affects all JACK clients under PipeWire, so I think this bug can be closed. Even jack_rec crashes.

On the other hand, there's an argument that the way Carla reacts to the JACK shutdown is nasty, but that's essentially a different bug (and mostly cosmetic, since if JACK dies there isn't much Carla can do anyway).

pinkflames commented 1 year ago

The issue should be fixed in PipeWire's git master, so this can be closed, too.

Krumel commented 1 year ago

It's been a while since I checked on this (I've just been using Latte-Dock as a workaround), but since I saw that the pipewire issue has been closed, I checked again and can confirm this being fixed.

Thanks to everyone for their support.