x42 / meters.lv2

collection of LV2 plugins for audio-level metering
https://x42-plugins.com/x42/x42-meters
GNU General Public License v2.0
188 stars 28 forks source link

Frequency/Phase wheel segfaults Ardour5 when run via ssh-X #15

Open magnetophon opened 8 years ago

magnetophon commented 8 years ago

When I run Ardour5.4 via ssh -X, as soon as I open the gui of the Frequency/Phase wheel, Ardour segfaults. Oddly enough ssh -Y is fine.

x42 commented 8 years ago

Can you get a backtrace?

Two guesses: connection is too slow or stalls for ~150ms or so.

"Error writing from plugin to UI" (check stdout, and log window). The raw audio-data being transferred to the GUI (which does the analysis). The plugin does request a buffer of 65888 bytes (8192 samples * 2 channels + overhead) and Ardour provides a Ringbuffer. but if that overflows all bets are off. Partial messages cannot be recovered from.

It could well be that waking up a remote X GUI at worst every 8K/SR fails. A stall > 170ms (@48KSPS ~5fps) will do it. Ardour should print a message and bail out.

openGL drawing on remote X.. uhm. time for wayland I suppose :)

magnetophon commented 8 years ago

I've tried a couple of times to make ardour do a backtrace under nixos, but I've never succeeded, sorry.

How would wayland help here? Afaik it explicitly doesn't handle remote. Genuinely interested.

BTW in my case, drawing on the other PC and sending that over wouldn't help: it's a server motherboard with a really slow graphics card. I get better performance with remote X (on a direct cable) then I get sitting at the other PC.

x42 commented 8 years ago

Why tunnel via ssh then? Did you try to just export DISPLAY=CLIENTNAME:0 and xhost +SERVERNAME on the client?

IIUC "-X" (secure X11 forwarding) disables various x extensions. Is there an obvious difference between ssh -X SERVERNAME glxinfo vs ssh -Y SERVERNAME glxinfo ?

The x42-plugins heavily rely on shared memory with the graphics card and also Ardour's use of cairo/x11 does that. in X11 rendering always happens on the X11 server side (in your case the thin-client) so all the data (textures, pixel-maps etc) needs to be copied over the network instead. There are almost no X primitives.

Wayland's remote mechanism is more like VNC (a compressed data stream, dumped from the local gfx card)

We're getting a bit off topic here, but did you try vncserver -geometry 1920x1080 :0 on the server, launch ardour+gui there and then connect to it using a VNC client?

x42 commented 8 years ago

PS. does glxgears run over ssh -X? I just tried an it fails here over ssh

$ glxgears
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  23
  Current serial number in output stream:  24
magnetophon commented 8 years ago

vnc and the like are not an option for me, unless I buy a graphics card. When I sit locally at that machine it feels as if I'm already on a slow VNC connection. When I remote into it, it's fast, as long as I don't use vnc, xpra, etcetera.

I can't run those ssh commands in a realistic manner atm, since my whole WM is running via ssh -Y. I'll try next reboot.

x42 commented 7 years ago

ssh -X blocks X11 extensions relevant for openGL. The UI needs openGL so it won't work.

The question is where the segfault occurs, ideally the UI would just not show..

magnetophon commented 7 years ago

And you'd need those backtraces to find out, right?

x42 commented 7 years ago

Not really, I can get them myself (using ssh -xor similar). Time is what's needed most, this issue is not too high priority on my list.

magnetophon commented 7 years ago

OK. It's not a priority for me neither.