Novum / vkQuake

Vulkan Quake port based on QuakeSpasm
GNU General Public License v2.0
1.84k stars 223 forks source link

Mouse cursor remains visible when using AppImage version. #721

Closed robojerk closed 2 months ago

robojerk commented 2 months ago

LOW EFFORT BUG REPORTS WILL BE CLOSED

Describe the bug Using wayland version of kwin, mouse cursor remains visible when using AppImage. I didn't try a non AppImage binary.

To Reproduce Launch vkquake appimage using kwin or gamescope. I didn't try Mutter or other compositors. I didnt try in X.

Expected behavior Mouse cursor should be visible ONLY when in the menu, once a game starts it hides.

Screenshots I tried but spectacle and other screenshot apps wouldn't capture the cursor. It's there though.

Desktop (please complete the following information):

Mod In vanilla version of games and all mods

Additional context When running under kwin the Plasma feature to grow mouse on mouse shake is entertaining.

j4reporting commented 2 months ago

Confirmed. I guess this has been introduced with update to SDL-2.30.x, because the older 1.31.0 release (built with SDL2-2.28.5) seems to work fine. Latest artifact are also affected. Tested on Fedora 40, Gnome (mutter), wayland, nvidia 560.31.02.

I can't reproduce with locally built binaries (SDL2-2.30.3) , and local builds can use native wayland. The AppImage of vkQuake uses xWayland.

j4reporting commented 2 months ago

introduced in this commit? https://github.com/libsdl-org/SDL/commit/c39f86c28a54c3f108c31a58ff610fe9508d03c4

Ubuntu 20.04 doesn't support wayland. Maybe compiling on 22.04 could resolve this? Otherwise maybe downgrade SDL2 to 2.28.5 for linux binaries for now.

sezero commented 2 months ago

introduced in this commit? libsdl-org/SDL@c39f86c

Ubuntu 20.04 doesn't support wayland. Maybe compiling on 22.04 could resolve this? Otherwise maybe downgrade SDL2 to 2.28.5 for linux binaries for now.

Report this to SDL please

j4reporting commented 2 months ago

https://github.com/libsdl-org/SDL/issues/10550

Kontrabant commented 2 months ago

Should be fixed upstream now.

j4reporting commented 2 months ago

@robojerk could you pls try if this artifact fixes the mouse issue for you? https://github.com/j4reporting/vkQuake/actions/runs/10431663762

This appimage was created from the current vkQuake git master with latest SDL2 from the release-2.30.x branch. So it's not exactly 1.31.1.

robojerk commented 2 months ago

@robojerk could you pls try if this artifact fixes the mouse issue for you? https://github.com/j4reporting/vkQuake/actions/runs/10431663762

This appimage was created from the current vkQuake git master with latest SDL2 from the release-2.30.x branch. So it's not exactly 1.31.1.

No more mouse cursor :)

j4reporting commented 2 months ago

No more mouse cursor :)

Great. May I ask you to test another test build please?
these are the changes:

  1. build env upgraded from Ubuntu 20.04 to 22.04
  2. reverted SDL2 to version 2.30.6
  3. SDL2 built with xinput2 support ( libxi-dev)
  4. SDL2 built with native wayland support

This should also hide the mouse cursor with Xwayland.
The appimage uses x11 as default videodriver.

You can also test native wayland if you set SDL_VIDEODRIVER=wayland
e.g. SDL_VIDEODRIVER="wayland" ./vkquake.AppImage

There seems to be an issue with the current beta Nvidia drivers. FPS drop to ~72 in fullscreen mode ( desktop @ 144Hz, vsync off ). It seems only Vulkan applications are affected. I see the same issue with a locally compiled binary on Fedora 40. Window mode works fine, though. Opengl ( ironwail) is not affectedl.

Now the strange thing, Appimage built agaiinst SDL2 with native wayland support but w/o libdecor support runs fine in fullscreen mode!

robojerk commented 2 months ago

I quickly ran the new build as normal with and setting the SDL_VIDEODRIVER to wayland. Mouse cursor is gone in both. :)

Thanks...

j4reporting commented 2 months ago

Have you checked the FPS in fullscreen mode on native wayland? Could you also see lower FPS compared to windowed mode or with x11 (Xwayland) ?

so something like this: start vkQuake with SDL_VIDEODRIVER=wayland <path to the appimagefile>/vkquake.AppImage

then in console:

scr_showfps 1
vid_vsync 0
host_maxfps 200
vid_borderless 0
vid_desktopfullscreen 0
vid_width 2560;  vid_height 1440    <replace with your monitor's resolution >  
vid_fullscreen 1
vid_restart
map start

the fps counter should show 200 FPS.

robojerk commented 2 months ago

Mine seemed locked into 60

Also the cursor reappeared when setting SDL_VIDEODRIVER=wayland

robojerk commented 2 months ago

I had more time to play with it. I nuked the vkQuake.cfg and that solved some things. Mouse Cursor is gone again.

For awhile there I was getting this error "Couldn't init SDL video: wayland not available"

Anyways it's working now. When I go full screen with those settings you asked me to plug in it seems to max out at whatever the displays refresh rate is.. My display does 60 and 144 and that's what it seems to go to depending on what I have it set to.

j4reporting commented 2 months ago

For awhile there I was getting this error "Couldn't init SDL video: wayland not available"

sure you tried with the latest test build? The other vkquake.appimages don´t support wayland. This may explain the error. Or you logged in a X11 session instead of wayland?

. My display does 60 and 144 and that's what it seems to go to depending on what I have it set to.

Do you have VRR (variable refresh rate) enabled for your monitor? I get always 50% of the monitor's refresh rate with VRR disabled and vsync disabled in vkquake.
Have to enable vsync to get 60 or 144fps.

With VRR enabled, I get 60 / 144 with vsync disabled in vkquake.

I found one workaround. Configure window mode using a slightly smaller game resolution like 1920x1080 (desktop 2550x1440) and ALT-ENTER. This will stretch the window to fullscreen, so everything will appear a little bigger BUT you get the FPS configured with host_maxfps!

AMD Ryzen 7 4800H (Renoir series AMD Radeon RX Vega 7) AMD Driver 24.1.5

any chance to run a test on this iGPU?

robojerk commented 2 months ago

I'll admit it was late when I doing things when I was getting the SDL errors about wayland not availabe. I might have been doing something dumb.. However I redownloaded the newer build a few times to make sure and I was getting that error. I did do a combination of things and it went away but I couldn't tell which one resolved it.

I'm on KDE Plasma 6.1.4 and the option to enable/disable VRR I cannot find. Older versions show it in under Display.

Ran it under the iGPU

$ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json SDL_VIDEODRIVER="wayland" $HOME/.steam/steam/steamapps/common/Quake/vkquake.AppImage  -basedir $HOME/.steam/steam/steamapps/common/Quake

Found SDL version 2.30.6
Detected 16 CPUs.
Initializing vkQuake 1.31.2
Built with GCC 11.4.0
Host_Init
Playing registered version.
Console initialized.
UDP4 Initialized
UDPv6 Initialized
Server using protocol 999+ (FTE-RMQ)
Exe: 15:06:12 Aug 18 2024

Vulkan Initialization
Using Vulkan 1.1
Instance extensions:
 VK_KHR_surface
 VK_KHR_wayland_surface
 VK_KHR_get_surface_capabilities2
 VK_KHR_get_physical_device_properties2

Vendor: AMD
Device: AMD Radeon Graphics (RADV RENOIR)
Driver: radv Mesa 24.1.5
Using subgroup operations
Device extensions:
 VK_KHR_swapchain
 VK_KHR_get_memory_requirements2
 VK_KHR_dedicated_allocation
 VK_EXT_subgroup_size_control
Using A2B10G10R10 color buffer format
Using D32_S8 depth buffer format

I get 200 fps with that. :) When rerun with nvidia it's still locked to 60 or 144

j4reporting commented 2 months ago

It seems that KDE plasma enables VRR automatically: https://wiki.archlinux.org/title/Variable_refresh_rate#KDE_Plasma

robojerk commented 2 months ago

If I run the game under gamescope it will go to 200 if I turn VRR off in the game menu.. If I leave it on it's allover the place 90's but never over 144 but can get to 144.

Running game in gamescope there's mouse control issues. I wouldn't recommend playing it.

I find gamescope doesn;t like any arguments applied to the appimage so I need to run it from inside the Quake Dir. Adding basedir argument makes gamescope complain.

user@localhost ~/.steam/steam/steamapps/common/Quake:$ SDL_VIDEODRIVER="wayland" gamescope -f -W 1920 -H 1080 ./vkquake.AppImage

j4reporting commented 2 months ago

you forgot to include -- at the end of the list of options for gamescope. Gamescope will try to process -basedir and will not pass it on to the next process.

gamescope -f -W 1920 -H 1080 -- ./vkquake.AppImage -basedir

see man bash

A -- signals the end of options and disables further option processing.