-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GUI startup delay under X11 #451
Comments
I did not notice anything in regards to delay at all, for me it works just like any other gui framework/toolkit. i do not even understand what you mean by delay here... gui opens but first render takes a while? host daw is locked up temporarily while gui opens..? how big of a delay are we talking here that it is noticeable for you? |
I got a screen recording that probably explains the situation better. Basically the DAW becomes unresponsive for around 4 seconds. The delay is definitely not normal compared to the stock plugin from REAPER. rec2.mp4 |
Another observation that the problem can only be reproduced under X11. There is no delay under Wayland. This is the Xorg version I have
|
I've pinpointed that the function that causes the freeze is https://github.com/lv2/pugl/blob/e33b2f6b0cea6d6263990aa9abe6a69fdfba5973/src/x11.c#L651 Still trying to figure out the cause though. |
Some further research indicates that this might be related to NVIDIA driver.
I noticed also that even the #include <stdio.h>
#include <X11/extensions/Xrandr.h>
int main(void)
{
Display* dp;
XRRScreenConfiguration *conf;
dp = XOpenDisplay(NULL);
conf = XRRGetScreenInfo(dp, DefaultRootWindow(dp));
short rate = XRRConfigCurrentRate(conf);
printf("rate: %d\n", rate);
XRRFreeScreenConfigInfo(conf);
XCloseDisplay(dp);
} I'm not sure if it's really necessary to obtain the refresh rate at every window construction though. This property doesn't seem to be used a lot in pugl. I also found another way to compute the refresh rate in GLFW. This might be the way to go to avoid the freeze https://github.com/glfw/glfw/blob/b35641f4a3c62aa86a0b3c983d163bc0fe36026d/src/x11_monitor.c#L48 |
This problem doesn't seem to be NVIDIA specific. Probably just the problem of X11. I checked on another Arch Linux machine with only one integrated graphics card and it still has a delay, just much less. By defining |
The above program works properly and exits in a fraction of a millisecond for me, Manjaro on AMD. |
I'd still like to know if anyone else has encountered this, because it certainly seems NVidia specific to me (which is frankly not surprising at all), but...
This hint is currently the only use of xrandr, and DPF's pugl is vendored anyway, so the issue in DPF can be easily fixed by doing just that. |
This is no longer the case. Current develop uses upstream pugl as a submodule (and is only a couple commits behind latest version). |
Well, after some work on both ends, it's now using (almost) exactly upstream pugl, which is a great improvement. It's still "vendored" in the sense that it's a local library that can be compiled with whatever flags though (it also still violates the library's namespace and does a weird monolithic build thing while also adding a bunch of internal-except-not hacks and so on, but that's beside the point here). |
I notice that any GUI plugin built with DPF seems to have a significant start-up delay on Linux. This problem is especially noticeable in REAPER, where the GUI is deconstructed and reconstructed every time you float/dock the plugin (by double click on the plugin in the chain on the left) or switching between plugins
![image](https://private-user-images.githubusercontent.com/5229241/323344076-21b31957-defc-4eb1-a176-7c3ad26e231f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTI1NjcsIm5iZiI6MTczOTY5MjI2NywicGF0aCI6Ii81MjI5MjQxLzMyMzM0NDA3Ni0yMWIzMTk1Ny1kZWZjLTRlYjEtYTE3Ni03YzNhZDI2ZTIzMWYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMDc1MTA3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2YxY2IzMTk2ZjBjOTU1NTYwYWMyOTg2NjI5MmJkZTc0NjFjYmNlOTcxYzc5ZDliMGE1Njc0OGU5N2ZkODQ0OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.RCnM4a_2ZkcwHCpi7Za4SjZ0hnGlAvz7ZjVKozK4Je0)
In Ardour, the GUI is only constructed once so the problem is less problematic.
I can notice the delay in both the example plugins (compiled with
develop
branch) liked_states
and third party plugins like the dragonfly-reverb.The only example plugins that doesn't have this problem is
![image](https://private-user-images.githubusercontent.com/5229241/323347958-8d5b534e-c928-43ef-b3ff-67381d44db9a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTI1NjcsIm5iZiI6MTczOTY5MjI2NywicGF0aCI6Ii81MjI5MjQxLzMyMzM0Nzk1OC04ZDViNTM0ZS1jOTI4LTQzZWYtYjNmZi02NzM4MWQ0NGRiOWEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMDc1MTA3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmE4YjU1NjUyNTQ3N2VjNTllZDZlMmJkODY5MDYzYWVkY2Y5MGMzZWJjNzcwZTZmNzc2MzJjNDFlYjBjMGEwNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.zuMJwejCakzIFiJBUesuK_-aUcc26yrKU8ufJuPGzDs)
d_embedextui
, though I don't think I can see the GUI been renderedRight now, what I know is
I'll post more info when I locate the problem, but I want to post the issue in advance in case this is a known problem. Has anyone noticed this problem before?
The text was updated successfully, but these errors were encountered: