Skip to content
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

UI is lagging and slow #30

Closed
kamarya opened this issue Oct 3, 2022 · 20 comments
Closed

UI is lagging and slow #30

kamarya opened this issue Oct 3, 2022 · 20 comments

Comments

@kamarya
Copy link

kamarya commented Oct 3, 2022

I am using it on Ubuntu 22.04 LTS. The UI specially the plotting pointer moves are slow and lagging.

@kamarya kamarya changed the title UI is laggy UI is lagging and slow Oct 3, 2022
@zecruel
Copy link
Owner

zecruel commented Oct 3, 2022

Hi,

Are you using appimage? It was compiled using a GitHub-hosted runner with Ubuntu 20.04.

If that's the case, it might be a runtime library incompatibility. Please check the version of SDL2 and GLEW libs installed and your system.

@zecruel
Copy link
Owner

zecruel commented Oct 3, 2022

A possible issue in Ubuntu 22:
image

In the meantime, I have compiled a version without appimage with Ubuntu 22.04. Check if the problem persists:
linux.zip

@kamarya
Copy link
Author

kamarya commented Oct 3, 2022

I built it from scratch on my machine without using AppImage.

@zecruel
Copy link
Owner

zecruel commented Oct 4, 2022

Can you tell which versions of dependency libraries of your executable? (ldd ./cadzinho)
I also think it may be an incompatibility of your video card or driver with OpenGL 3.2.

@kamarya
Copy link
Author

kamarya commented Oct 4, 2022

Here is what I found through dpkg -l

ii  libsdl1.2debian:amd64                            1.2.15+dfsg2-6                             amd64        Simple DirectMedia Layer
ii  libsdl2-2.0-0:amd64                              2.0.20+dfsg-2ubuntu1.22.04.1               amd64        Simple DirectMedia Layer
ii  libsdl2-dev:amd64                                2.0.20+dfsg-2ubuntu1.22.04.1               amd64        Simple DirectMedia Layer development files
ii  libopengl-dev:amd64                              1.4.0-1                                    amd64        Vendor neutral GL dispatch library -- OpenGL development files
ii  libopengl0:amd64                                 1.4.0-1                                    amd64        Vendor neutral GL dispatch library -- OpenGL support

Open GL version:

OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.0.5

Here is the result of glxinfo | grep -i opengl:

OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.0.5
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.0.5
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

SDL2 version sdl2-config --version:

2.0.20

@zecruel
Copy link
Owner

zecruel commented Oct 4, 2022

Do you tried running the release AppImage? Or the binary in linux.zip? Are they with the same behavior?

@kamarya
Copy link
Author

kamarya commented Oct 4, 2022

Do you tried running the release AppImage? Or the binary in linux.zip? Are they with the same behavior?

I can not run an outsider executable without sand-boxing it. Would it be a valid test for you if I run it on a VM ? Have you been able to run it on Ubuntu 22.04 LTS without any problem ?

@zecruel
Copy link
Owner

zecruel commented Oct 4, 2022

I can not run an outsider executable without sand-boxing it.

CadZinho binaries don't need installation, just extract the .zip then chmod +x cadzinho and ./cadzinho

Would it be a valid test for you if I run it on a VM ?

Yes, I want to check if the behavior will be the same on different machines.

Have you been able to run it on Ubuntu 22.04 LTS without any problem ?

I launch the linux version (compiled on Unbuntu 22.04) in a Arch Linux machine, and works pretty well .

@zecruel
Copy link
Owner

zecruel commented Oct 4, 2022

This is the default behavior: Screencast_04-01-2022_15:13:41.webm

@kamarya
Copy link
Author

kamarya commented Oct 5, 2022

The crosshair cursor is lagging even in your default behaviour. UI is not responsive to mouse pointer movements. I do not expect this in an immediate UI with at least 60 fps.

@zecruel
Copy link
Owner

zecruel commented Oct 6, 2022

Well, the frame rate is set to less than 60Hz on CadZinho, to try to balance performance with intensive CPU usage.

But increasing the frame rate alone will not improve the lag feeling in the interface, maybe even intensify it.

It's true that CadZinho still needs to improve its rendering strategy, but I think it's the best possible configuration at the moment.

@zecruel zecruel closed this as completed Oct 10, 2022
@data-man
Copy link

@zecruel Please, reopen this issue.

@blogdron
Copy link

Yes, need reopen. Because frame rate is locket to 11~12 frames per second .

If im comment this delay, Im have 30fps

CadZinho/src/main.c

Lines 509 to 513 in 2b47dd0

if (gui->low_proc){
SDL_Delay(20);
SDL_FlushEvents(SDL_MOUSEMOTION, SDL_MOUSEMOTION);
}
}

Maybe add user option for set delay? No set hardcore value? =)

@zecruel zecruel reopened this May 12, 2023
@zecruel
Copy link
Owner

zecruel commented May 12, 2023

Quick solution for Windows - try: CadZinho-0-3-0.zip

Long explanation:

CadZinho uses hardware accelerated graphics via OpenGL 3.2 industry standard. So, you will need to ensure that you have downloaded and installed a compatible recent driver for your graphics hardware. This is the best recommendation.

Windows:

Apparently, on Windows this problem is more frequent (the default drivers have lazy support for OpenGL). Therefore, it is always a good idea to keep the drivers up to date, as indicated by each graphics card manufacturer.

However, there is a solution that may be more practical and portable, which is to use the Mesa3D OpenGL library, as was done in the quick solution above.

See more at: https://www.khronos.org/opengl/wiki/Getting_Started
Mesa3D built: https://github.com/pal1000/mesa-dist-win/releases/latest - download mesa3d-XX.XX.XX.7z then extract DLL files to main CadZinho folder.

@zecruel
Copy link
Owner

zecruel commented May 12, 2023

Yes, need reopen. Because frame rate is locket to 11~12 frames per second .

If im comment this delay, Im have 30fps

CadZinho/src/main.c

Lines 509 to 513 in 2b47dd0

if (gui->low_proc){
SDL_Delay(20);
SDL_FlushEvents(SDL_MOUSEMOTION, SDL_MOUSEMOTION);
}
}

Maybe add user option for set delay? No set hardcore value? =)

CadZinho was designed at 50 fps maximum for a balanced experience of using a desktop application, without the intensive use of the CPU. In heavy drawings, the refresh rate can drop significantly.

I think increasing the frame rate would result in a bad or weird user experience.

@data-man
Copy link

Quick solution for Windows

Linux users will wait commits. :)

@zecruel
Copy link
Owner

zecruel commented May 15, 2023

Hi @data-man and @blogdron.

Any updates? The problem persists?

@data-man
Copy link

data-man commented May 15, 2023

@zecruel Which branch was updated? We are Linux users. :)

@zecruel
Copy link
Owner

zecruel commented May 15, 2023

@zecruel Which branch was updated? We are Linux users. :)

The opengl branch is the most up to date and stable. The releases page has Linux, Windows and macOS binaries, in addition to the source code.

@tonich-sh tonich-sh mentioned this issue Jun 2, 2023
@zecruel
Copy link
Owner

zecruel commented Feb 29, 2024

Now the refresh delay is adjustable in the configuration: Release 0.5.0

@zecruel zecruel closed this as completed Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@data-man @blogdron @kamarya @zecruel and others