theyareonit / Click-Between-Frames

Geometry Dash mod to allow inputs in between visual frames
78 stars 18 forks source link

Inputs not being detected correctly on Linux #63

Closed keratomalacian closed 3 weeks ago

keratomalacian commented 3 weeks ago

After updating to the new version, inputs are not detected while playing a level, but work fine on menus. (This doesn't happen on older versions of the mod)

If I click once while the level restarts though, the cube will keep jumping as if I was holding. Here's a video showing the bug:

https://github.com/user-attachments/assets/8b0946ce-37b2-4f95-ac96-52dc30bf9656

I am on Arch Linux, running the game through wine/proton (every version that i've tried is affected) on BSPWM. This happens even if I disable all other mods. Running Geode v3.7.0 and CBF v1.2.0.

obj-obj commented 3 weeks ago

Same issue, I'm on Arch, Plasma Wayland, Geode v3.7.1 and CBF v1.2.0

ItsPancho8 commented 3 weeks ago

Same issue on Nobara 40 in wayland, using both proton (Proton GE) and Wine (Wine GE). Game is now unplayable.

ItsPancho8 commented 3 weeks ago

Also, in the steam version of the game (Proton GE) I get this popup message Screenshot_20240916_001441

obj-obj commented 3 weeks ago

@ItsPancho8 @keratomalacian Have you tried adding yourselves to the input group? the above message showed up the second time I launched the game, and CBF works perfectly fine after I added myself to it.

notsatvrn commented 3 weeks ago

I have yet to get this popup, and adding myself to the input group did nothing. Running Gentoo Linux.

totolgueimer commented 3 weeks ago

How do i add myself to the input group?

notsatvrn commented 3 weeks ago

sudo usermod -a -G input <username>

totolgueimer commented 3 weeks ago

thanks... and still doesn't work

notsatvrn commented 3 weeks ago

Another issue could be that the linux-input.exe file uses an /bin/sh shebang despite using bash syntax. If you're on a distro where /bin/sh points to a shell which doesn't support bash features then the script will fail. The file is in the game files folder under geode/unzipped/syzzi.click_between_frames/resources/syzzi.click_between_frames, you can try changing #!/bin/sh to #!/bin/bash at the top (this should be fixed though)

ItsPancho8 commented 3 weeks ago

just tried the input setup method but didnt work, now Im gonna try @notsatvrn 's idea

ItsPancho8 commented 3 weeks ago

Another issue could be that the linux-input.exe file uses an /bin/sh shebang despite using bash syntax. If you're on a distro where /bin/sh points to a shell which doesn't support bash features then the script will fail. The file is in the game files folder under geode/unzipped/syzzi.click_between_frames/resources/syzzi.click_between_frames, you can try changing #!/bin/sh to #!/bin/bash at the top (this should be fixed though)

didnt work :(

totolgueimer commented 3 weeks ago

Another issue could be that the linux-input.exe file uses an /bin/sh shebang despite using bash syntax. If you're on a distro where /bin/sh points to a shell which doesn't support bash features then the script will fail. The file is in the game files folder under geode/unzipped/syzzi.click_between_frames/resources/syzzi.click_between_frames, you can try changing #!/bin/sh to #!/bin/bash at the top (this should be fixed though)

didn't work

theyareonit commented 3 weeks ago

@notsatvrn @ItsPancho8 @totolgueimer Please send logs if you have any (the most recent file in [GD.exe folder]/geode/logs).

Also, keep in mind that CBF did not work at all when using keyboard on Linux in prior versions (inputs would register, but not between frames). So, if you want to downgrade to a prior version for now, only do so if you use mouse.

Adding yourself to the input group might only work if you're using systemd, otherwise you might need some other way to access /dev/input.

Also, you could try changing the permissions of the files in [GD.exe folder]/geode/unzipped/syzzi.click_between_frames/resources/syzzi.click_between_frames/, but I doubt it'll make a difference.

theyareonit commented 3 weeks ago

Also, the linux-input.exe program itself isn't able to print directly to the Geode log file. Instead, it prints to stderr (i.e. your terminal; maybe Steam also logs it somewhere). So, look for any lines prefixed with [CBF] in the terminal or Steam logs.

obj-obj commented 3 weeks ago

You guys did relog/restart your computers after adding yourselves to the input group, right? Run the groups command and verify that input is in there.

obj-obj commented 3 weeks ago

Please send logs if you have any. Also, keep in mind that CBF did not work at all on Linux on keyboard before (inputs would only work on frame boundaries). So, if you want to downgrade to a prior version for now, only do so if you use mouse.

The input group might only apply if you're using systemd, you might need some other way to access /dev/input. Also, you could try changing the permissions of the files in [GD folder]/geode/unzipped/syzzi.click_between_frames/resources/syzzi.click_between_frames/, but I doubt it'll make a difference.

True, if anyone is still having issues do ls -g /dev/input to see what group owns all the input devices in there.

ItsPancho8 commented 3 weeks ago

sudo usermod -a -G input <username>

How do I reverse this command? it messed up the controller input in a emulation program. And also despite restarting the system it didnt work on GD as well.

obj-obj commented 3 weeks ago

sudo usermod -a -G input <username>

How do I reverse this command? it messed up the controller input in a emulation program. And also despite restarting the system it didnt work on GD as well.

sudo gpasswd --delete $USER input

notsatvrn commented 3 weeks ago

Also, the linux-input.exe program itself isn't able to print directly to the Geode log file. Instead, it prints to stderr (i.e. your terminal; maybe Steam also logs it somewhere). So, look for any lines prefixed with [CBF] in the terminal or Steam logs.

Couldn't find anything in the terminal. I wonder if linux-input.exe.so is even starting...

Please send logs if you have any. Also, keep in mind that CBF did not work at all on Linux on keyboard before (inputs would only work on frame boundaries). So, if you want to downgrade to a prior version for now, only do so if you use mouse. The input group might only apply if you're using systemd, you might need some other way to access /dev/input. Also, you could try changing the permissions of the files in [GD folder]/geode/unzipped/syzzi.click_between_frames/resources/syzzi.click_between_frames/, but I doubt it'll make a difference.

True, if anyone is still having issues do ls -g /dev/input to see what group owns all the input devices in there.

Input owns all the devices and I did reboot after adding myself to the group. Can confirm I have access to the folder.

keratomalacian commented 3 weeks ago

i noticed that, in the Lutris terminal, this message appears:

wine: failed to start L"Z:\\home\\malacian\\Games\\GeometryDash\\geode\\unzipped\\syzzi.click_between_frames\\resources\\syzzi.click_between_frames\\linux-input.exe.so"
wine: setpriority -1 for pid -1 failed: 3

there is no more information displayed. but if i run linux-input.exe.so by myself using wine, the following error appearS:

[malacian@artix syzzi.click_between_frames]$ wine linux-input.exe.so
002c:err:winediag:getaddrinfo Failed to resolve your host name IP
0094:err:hid:udev_bus_init UDEV monitor creation failed
[CBF] Linux input program started
[CBF] Failed to open file mapping: 2

i am already in the input group, and i can access the files in there without any issue. also, the problem doesnt dissapear if i run linux-input as root.

totolgueimer commented 3 weeks ago

Also, the linux-input.exe program itself isn't able to print directly to the Geode log file. Instead, it prints to stderr (i.e. your terminal; maybe Steam also logs it somewhere). So, look for any lines prefixed with [CBF] in the terminal or Steam logs.

steam-322170.log

theyareonit commented 3 weeks ago

setpriority -1 for pid -1 failed: 3

This line seems to be irrelevant, it's spammed everywhere in the other person's log file. So, no information here.

[CBF] Failed to open file mapping: 2

This error only happens because you haven't started GD, so it's nothing to worry about.

@keratomalacian could you send the Geode log instead ([GD.exe folder]/geode/logs)? And mention which Wine/Proton version you're using.

steam-322170.log

@totolgueimer Doesn't seem to be any useful information here either, please send the Geode log as well.

theyareonit commented 3 weeks ago

For now, you could try different Proton versions to see if any of them help, as well as changing the permissions of the Linux related files. You can also try a Steam emulator instead to run the game outside of Steam using regular Wine.

notsatvrn commented 3 weeks ago

It seems to work just fine when running protontricks-launch --appid 322170 linux-input.exe.so. I guess something is wrong with the launch script? BTW, this feels noticeably better than before, awesome work!

theyareonit commented 3 weeks ago

@notsatvrn The launch script was auto generated by winemaker, so that would be kind of unfortunate. Are you running Lutris or anything, or just regular Steam? You could also potentially try manually setting the WINELOADER environment variable to the Proton installation directory (not the prefix, the directory for Proton itself).

And again, Geode logs would help too.

totolgueimer commented 3 weeks ago

It seems to work just fine when running protontricks-launch --appid 322170 linux-input.exe.so. I guess something is wrong with the launch script? BTW, this feels noticeably better than before, awesome work!

Traceback (most recent call last): File "/app/bin/protontricks-launch", line 8, in sys.exit(cli()) ^^^^^ File "/app/lib/python3.11/site-packages/protontricks/cli/launch.py", line 18, in cli main(args) File "/app/lib/python3.11/site-packages/protontricks/cli/util.py", line 159, in wrapper return cli_func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/lib/python3.11/site-packages/protontricks/cli/launch.py", line 121, in main executable_path = Path(args.executable).resolve(strict=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/pathlib.py", line 993, in resolve s = os.path.realpath(self, strict=strict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 416, in realpath File "", line 451, in _joinrealpath FileNotFoundError: [Errno 2] No such file or directory: 'linux-input.exe.so'

totolgueimer commented 3 weeks ago

nevermind, i had to manage file permissions with flatseal. But

Traceback (most recent call last): File "/app/bin/protontricks-launch", line 8, in sys.exit(cli()) ^^^^^ File "/app/lib/python3.11/site-packages/protontricks/cli/launch.py", line 18, in cli main(args) File "/app/lib/python3.11/site-packages/protontricks/cli/util.py", line 159, in wrapper return cli_func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/lib/python3.11/site-packages/protontricks/cli/launch.py", line 121, in main executable_path = Path(args.executable).resolve(strict=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/pathlib.py", line 993, in resolve s = os.path.realpath(self, strict=strict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 416, in realpath File "", line 451, in _joinrealpath FileNotFoundError: [Errno 2] No such file or directory: 'linux-input.exe.so' [karim@archlinuxpacman syzzi.click_between_frames]$ protontricks-launch --appid 322170 linux-input.exe.so steam-runtime-launcher-service[82]: W: The --socket option is deprecated. Prefer to use --session or --bus-name. steam-runtime-launch-client[83]: W: The --socket option is deprecated. Prefer to use the session bus. /bin/bash: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libtinfo.so.6: no version information available (required by /bin/bash) wine: using kernel write watches, use_kernel_writewatch 1. fsync: up and running. wine: using kernel write watches, use_kernel_writewatch 1. wine: using kernel write watches, use_kernel_writewatch 1. wine: using kernel write watches, use_kernel_writewatch 1. wine: using kernel write watches, use_kernel_writewatch 1. 0070:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 0070:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 0070:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 0070:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 wine: using kernel write watches, use_kernel_writewatch 1. wine: using kernel write watches, use_kernel_writewatch 1. wine: using kernel write watches, use_kernel_writewatch 1. wine: using kernel write watches, use_kernel_writewatch 1. wine: failed to start L"D:\karim\.local\share\Steam\steamapps\common\Geometry Dash\geode\unzipped\syzzi.click_between_frames\resources\syzzi.click_between_frames\linux-input.exe.so" La aplicación no se pudo ejecutar, o no hay ninguna aplicación asociada con el archivo especificado. ShellExecuteEx fallido: Archivo no encontrado.

notsatvrn commented 3 weeks ago

@notsatvrn The launch script was auto generated by winemaker, so that would be kind of unfortunate. Are you running Lutris or anything, or just regular Steam? You could also potentially try manually setting the WINELOADER environment variable to the Proton installation directory (not the prefix, the directory for Proton itself).

And again, Geode logs would help too.

Running through regular Steam. I'll check if that WINELOADER trick helps soon.

Log: Geode 2024-09-16 16.07.07.log

theyareonit commented 3 weeks ago

Log: Geode 2024-09-16 16.07.07.log

Odd, it doesn't seem like there are any issues here at all. If any of the Windows API functions (i.e. CreateProcess) errored, then it would've printed something to the Geode log. Not sure how using CreateProcess to start linux-input.exe could succeed, but the program wouldn't start. You're probably right that it's an issue with the script.

@notsatvrn What is the output if you try launching just the .exe file through protontricks-launch rather than the .exe.so file?

keratomalacian commented 3 weeks ago

after checking the logs and not seeing anything that could be useful, i tried running gd through a terminal using my system's wine installation. and this one actually worked! (wine 9.16, installed through pacman). seems like the custom proton/wine versions provided by lutris are the ones causing the problem.

totolgueimer commented 3 weeks ago

Wait, there's no way to play with the new version of CBF on steam?

theyareonit commented 3 weeks ago

@totolgueimer It works fine for me through Steam, so it's probably specifically Lutris that has issues.

totolgueimer commented 3 weeks ago

it doesn't work for me with steam

notsatvrn commented 3 weeks ago

Log: Geode 2024-09-16 16.07.07.log

Odd, it doesn't seem like there are any issues here at all. If any of the Windows API functions (i.e. CreateProcess) errored, then it would've printed something to the Geode log. Not sure how using CreateProcess to start linux-input.exe could succeed, but the program wouldn't start. You're probably right that it's an issue with the script.

@notsatvrn What is the output if you try launching just the .exe file through protontricks-launch rather than the .exe.so file?

Oddly enough that seems to work just fine... Very confused at this point.

theyareonit commented 3 weeks ago

Then it's probably either an issue with the WINELOADER variable or something like permissions.

totolgueimer commented 3 weeks ago

So... there's no fix right now? i'm confused

theyareonit commented 3 weeks ago

Tell me if this build works https://drive.google.com/file/d/1hnCgwjK_WR8CoIBYW4cJV39iMipbH9Wx/view?usp=sharing

totolgueimer commented 3 weeks ago

Tell me if this build works https://drive.google.com/file/d/1hnCgwjK_WR8CoIBYW4cJV39iMipbH9Wx/view?usp=sharing

This one works, thanks a lot i will do some more tests right now Just to be safe

totolgueimer commented 3 weeks ago

Now it detects correctly that youre in the input group

ItsPancho8 commented 3 weeks ago

Tell me if this build works https://drive.google.com/file/d/1hnCgwjK_WR8CoIBYW4cJV39iMipbH9Wx/view?usp=sharing

Can confirm that now GD registers the clicks correctly, but is doing this mandatory? before the linux update it was working perfectly without requiring putting a command on konsole.

theyareonit commented 3 weeks ago

before the linux update it was working perfectly without requiring putting a command on konsole.

Keyboard input didn't work at all on Linux in the previous versions. It would register the input, but not in between frames. This is the only method I found to get around that. Mouse did work before, but now it has better input precision in the newest update (would not be possible without that command).

theyareonit commented 3 weeks ago

Okay, the update is now pushed out officially, so I'll delete the Google drive upload.

ezra-351 commented 3 weeks ago

still happening for me with geode 3.7.1 and cbf 1.2.1. i'm on bazziteos on a steam deck, running through steam on gnome. made sure i was in the input group and rebooted and all that.

not seeing anything weird in the game log myself, but linux-input.exe.so fails to launch through protontricks:

Traceback (most recent call last):
  File "/usr/bin/protontricks-launch", line 33, in <module>
    sys.exit(load_entry_point('protontricks==1.11.1', 'console_scripts', 'protontricks-launch')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/protontricks/cli/launch.py", line 18, in cli
    main(args)
  File "/usr/lib/python3.12/site-packages/protontricks/cli/util.py", line 159, in wrapper
    return cli_func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/protontricks/cli/launch.py", line 191, in main
    cli_main(cli_args, steam_path=steam_path, steam_root=steam_root)
  File "/usr/lib/python3.12/site-packages/protontricks/cli/util.py", line 159, in wrapper
    return cli_func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/protontricks/cli/main.py", line 339, in main
    proton_app = find_proton_app(
                 ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/protontricks/steam.py", line 848, in find_proton_app
    tool_app = find_steam_compat_tool_app(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/protontricks/steam.py", line 609, in find_steam_compat_tool_app
    appinfo_sections = [
                       ^
  File "/usr/lib/python3.12/site-packages/protontricks/steam.py", line 531, in iter_appinfo_sections
    raise SyntaxError(

steam-322170.log

theyareonit commented 3 weeks ago

@ezra-351 The input program is starting fine in your Steam log, so the issue could be due to the Steam Deck's buttons not being detected as USB/serial devices (or not sending EV_KEY events).

How are you trying to play (i.e. which buttons are you using to input)? I don't own a Steam Deck so this would be hard to test.

Also, does the popup on the Online Levels screen show up for you?

ezra-351 commented 3 weeks ago

i'm in docked mode and am using a mouse, navigating the game menus is fine. symptoms are exactly the same as the video showcasing the issue, where the cube won't jump unless i'm holding on the start of an attempt, in which then the cube won't stop jumping. happens regardless of what buttons i press. the game works with cbf disabled. i had the popup until i added myself to the input group, i don't see it anymore.

theyareonit commented 2 weeks ago

I honestly have no idea what could be causing that since the program seems to be working perfectly fine on your machine otherwise. Are you plugging in the mouse after you start the game? If so, you should only plug it in before opening GD.

Also, check with other input devices if you have any. And maybe tell me which specific mouse it is you're trying to use.

ezra-351 commented 2 weeks ago

my mouse stays plugged in, same thing if i use the keyboard and built in buttons, i use a basilisk v3.

theyareonit commented 2 weeks ago

Are you trying to use it in left handed mode or with any other rebindings? And again, please try some other input device to see if it works (e.g. a keyboard).

ezra-351 commented 2 weeks ago

again it's the same whether i use different input methods, tried it with the keyboard and the built in buttons on the deck. no weird bindings on the mouse.

theyareonit commented 2 weeks ago

Oh, I skipped over that part when I read what you said. Still, I'm unsure how this could happen unless maybe there is some security measure that prevents some of your input devices from showing up in /dev/input.

A shot in the dark, but does this build work? @ezra-351 build.zip