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

Wayland: waiting for events and blocking #614

Closed
ggarra13 opened this issue Dec 25, 2022 · 7 comments
Closed

Wayland: waiting for events and blocking #614

ggarra13 opened this issue Dec 25, 2022 · 7 comments
Assignees
Labels
fixed The issue or PR was fixed. Platform: Wayland platform specific (Unix/Wayland)

Comments

@ggarra13
Copy link
Contributor

ggarra13 commented Dec 25, 2022

Describe the bug
When my video player application runs, it stutters and eventually hangs.

To Reproduce
I am unable to reproduce it with the simple examples. However, I traced the problem to two functions. First, the stuttering happens in:

Fl_Gl_Wayland_Gl_Window_Driver::swap_buffers() when it calls:
wl_display_read_events(fl_wl_display()); // this stops the event loop for some seconds and then continues.

The hanging, happens eventually when calling fd_callback() in:
wl_display_dispatch()

It is unclear to me if one is the reason for the other.

I commented all the Wayland code in swap_buffers() right before eglSwapBuffers and then I was able to play my movie without stuttering or blocking. This, of course, is not the solution as the demo programs became unresponsive to the mouse and my application would crash sometimes when leaving the main window and entering it again.

Expected behavior
I expect Wayland to work as X11 does, playing my movie without stuttering or blocking.

Screenshots
I don't have screenshots, but I have my application free to download and compile with just a simple runme.sh script. It takes about 20 mins to compile, thou.
https://github.com/ggarra13/mrv2

I also added @ManoloFLTK 's ToyGL3Player which does not animate properly with NVidia drivers and current Wayland code.

FLTK Version

  • Version: 1.4.0 HEAD
  • Installed as package from: git
    b26db74

FLTK Configure / Build Options

include( ExternalProject )

set( FLTK_TAG master )

set( patch_cmd )

if (APPLE OR WIN32)
set( wayland OFF )
set( pango OFF )
else()
set( wayland ON ) # we'll leave it on, albet it is way too buggy.
set( pango ON )
endif()

ExternalProject_Add(
FLTK
GIT_REPOSITORY "https://github.com/fltk/fltk.git"
GIT_TAG ${FLTK_TAG}
GIT_PROGRESS 1
PATCH_COMMAND ${patch_cmd}
CMAKE_ARGS
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DFLTK_BUILD_EXAMPLES=OFF
-DFLTK_BUILD_TEST=OFF
-DOPTION_BUILD_SHARED_LIBS=0
-DOPTION_USE_SYSTEM_ZLIB=0
-DOPTION_USE_SYSTEM_LIBJPEG=0
-DOPTION_USE_SYSTEM_LIBPNG=0
-DOPTION_USE_PANGO=${pango}
-DOPTION_USE_WAYLAND=${wayland}
)

Operating System / Platform:
Linux.
Ubuntu 22.04 on Wayland

Linux/Unix Runtime, if applicable:

  • Wayland

Additional context
Add any other context about the problem here.

@ggarra13
Copy link
Contributor Author

The problem described here with Wayland was traced to an incompatibility of NVidia drivers, FLTK and Wayland.

@ManoloFLTK ManoloFLTK added the Platform: Wayland platform specific (Unix/Wayland) label Dec 30, 2022
@ggarra13
Copy link
Contributor Author

ggarra13 commented Jan 3, 2023

I am adding the ToyGL3player.cxx file that @ManoloFLTK created which works fine on Ubuntu with Mesa/nouveau drivers but does not work fine with NVidia drivers.
ToyGL3player.zip

@ggarra13
Copy link
Contributor Author

@ManoloFLTK Sorry for the bother. I was wondering if you had an NVidia card on a Linux box to replicate the Wayland issues.

@ManoloFLTK
Copy link
Contributor

No, I don't have that.
I only have access to a virtual Linux system on a MacBook Pro.

@ManoloFLTK
Copy link
Contributor

@ggarra13 Could you, please, report whether ToyGL3player works with NVidia and after commit 1581662 (26 jan 2023) ?

@ggarra13
Copy link
Contributor Author

ggarra13 commented Jan 26, 2023 via email

@ManoloFLTK
Copy link
Contributor

@ggarra13 Is this issue still valid? If not, please, close it.

@ggarra13 ggarra13 closed this as completed May 5, 2024
@ManoloFLTK ManoloFLTK added the fixed The issue or PR was fixed. label May 5, 2024
@ManoloFLTK ManoloFLTK self-assigned this May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed The issue or PR was fixed. Platform: Wayland platform specific (Unix/Wayland)
Projects
None yet
Development

No branches or pull requests

2 participants