falkTX / Carla

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

Calf plugins crash Carla #1573

Open daveriedstra opened 2 years ago

daveriedstra commented 2 years ago

Calf plugins seem to crash Carla when closing their GUIs. Other plugins (LSP, Panagement) work fine in Carla, and the Calf plugin host works fine on its own. The crash doesn't happen 100% of the time, but usually within a handful of tries.

Repro:

When run from the terminal, this is the output:

$ carla
Carla 2.4.1 started, status:
  Python version: 3.9.7
  Qt version:     5.15.2
  PyQt version:   5.15.4
  Binary dir:     /usr/lib/carla
  Resources dir:  /usr/share/carla/resources
Frontend pixel ratio is 1.0
libjack.so.0 loaded successfully!
Segmentation fault (core dumped)

Here's as much of the Carla internal logs as I was able to grab before the crash (ie, right before hitting the close button):

======= Starting engine =======
======= Engine started ========
Carla engine started, details:
  Driver name:  JACK
  Sample rate:  48000
  Process mode: Multi client
qt.qpa.wayland: setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x2b32220) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x2b73c90) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents
Error opening file /home/dried/.lv2/gunshot.lv2/manifest.ttl (No such file or directory)
Will use LV2 Gtk2 UI for 'Calf Equalizer 5 Band', NOT!
CALF DEBUG: instance 0x33c5f20 data 0x33e5950
CALF DEBUG: calf 0x7fe968ee3e50 cpi 0x7fe9683190f0

My system details (tl;dr: Pop!_OS on swaywm wayland):

$ lsb_release -a
No LSB modules are available.
Distributor ID: Pop
Description:    Pop!_OS 21.10
Release:    21.10
Codename:   impish
$ uname -a
Linux gedachte 5.15.11-76051511-generic #202112220937~1640185481~21.10~b3a2c21 SMP Wed Dec 22 15:41:49 U x86_64 x86_64 x86_64 GNU/Linux
$ jackd --version
jackdmp version 1.9.19 tmpdir /dev/shm protocol 9
$ sway --version
sway version 1.5.1

Please let me know if I can do anything to help chase this down. If this would be more appropriate on the Calf repo, I can move it there.

falkTX commented 2 years ago

Calf uses gtk2 which only supports X11, not Wayland. So you might need to run Carla with X11. I think there is some Qt related env var for this

daveriedstra commented 2 years ago

Interesting. I'd been using Carla with Calf plugins on wayland for a few years now (it must have been using xwayland), and only in the past 3ish months has this been happening. Additionally, I was able to reproduce the crashes after starting Carla with GDK_BACKEND=x11 QT_QPA_PLATFORM=xcb carla which I think are the vars you're thinking of (per the arch wiki).

I'm going to go check this out in an x session... I was able to reproduce the crash in an X11 Gnome session on the same system.

falkTX commented 2 years ago

I was mostly assuming it was related, seems like it is not. You disable the "prefer ui bridges by default" I guess, as otherwise these UIs wouldnt run in the same process. You lose the fancy graphs but in turn no crashes.

In any case, it is best to leave calf alone while it still uses gtk as UI library. Try to find replacements. Gtk2 wont be with us forever...

daveriedstra commented 2 years ago

You disable the "prefer ui bridges by default"

Yes, "Use UI bridges instead of direct handling" was disabled, but I was able to repro the crash with it enabled (after restarting Carla of course).

It would be a shame to give up Calf, those are my go-to for a bunch of stuff. But if the lack of movement on https://github.com/calf-studio-gear/calf/issues/248 is any indication, you're right about leaving Calf due to GTK2.

Thanks for the help (& all your work in general), I'll let you choose whether or not to close this (in case you think it points to an issue with the UI bridges or something).