AntiMicroX / antimicrox

Graphical program used to map keyboard buttons and mouse controls to a gamepad. Useful for playing games with no gamepad support.
GNU General Public License v3.0
2.28k stars 140 forks source link

Flatpak AntiMicroX could not open uinput device file. #741

Closed AirisLuna closed 1 year ago

AirisLuna commented 1 year ago

Is there an existing issue for this?

Current Behavior

So, I installed AntiMicroX via flatpak, and it didn't work because of the message

Could not open uinput device file Please check that you have permission to write to the device: /dev/uinput

I searched about it, and saw the page on the wiki talking about it. https://github.com/AntiMicroX/antimicrox/wiki/Open-uinput-error

There I found some info and went thru all of them

First, was about the system settings, so I restarted my PC, and I still had the same error. Second was about the version, I already had the latest version, so just to be safe I removed and reinstalled it, same error. Lastly the page mentions the udev rule, my rules.d folder already had a AntiMicroX rule, but since it wasn't working I followed the guide as instructed and even after rebooting I still had the same error.

Unable to open uinput files, this may cause problems with generating events. To check possible solutions please visit: AntiMicroX Wiki

If I run the program under sudo -i flatpak run io.github.antimicrox.antimicrox the program works with the error output: ❗WARN env says KDE is running but SNI unavailable -- check KDE_FULL_SESSION and XDG_CURRENT_DESKTOP , so my guess the program doesn't have access to the folder somehow?

Adding /dev/input to flatseals paths available to the application and trying to run it again from the terminal I get this error

F: Not sharing "/dev/uinput" with sandbox: File "/dev/uinput" has unsupported type 0o20000

And if I try to add /usr/lib/udev/rules.d/ to the flatseal paths, and try to run the program

I get the error

F: Not sharing "/dev/uinput" with sandbox: File "/dev/uinput" has unsupported type 0o20000 F: Not sharing "/usr/lib/udev/rules.d" with sandbox: Path "/usr" is reserved by Flatpak Selecting uinput as a default event generator.Could not open uinput device file Please check that you have permission to write to the device: /dev/uinput Failed to open event generator. Exiting.

I also resetted flatseal settings on the program in case I turned on/off something I should've and the problem persists. Am I missing or failing to do something here? Screenshot_20230311_191016

Expected Behavior

No response

Steps To Reproduce

No response

Environment

Program Version 3.3.3
Compiled from packaging: flatpak
Built Against SDL 2.24.0
Running With SDL 2.24.0
Using Qt 5.15.8
Using Event Handler: XTest
Compositor type: 
Host OS: org.kde.Platform Version: 5.15-22.08 Architecture: x86_64

Anything else?

No response

pktiuk commented 1 year ago

Could you install steam using regular package manager (deb or rpm...)? It should provide required files.
What is your linux distro?

pktiuk commented 1 year ago

Could you also provide these parameters from terminal?

echo $XDG_CURRENT_DESKTOP
echo $KDE_FULL_SESSION
pktiuk commented 1 year ago

exclamationWARN env says KDE is running but SNI unavailable -- check KDE_FULL_SESSION and XDG_CURRENT_DESKTOP

According to this log, there is a problem with Status Notifier Item (afaik used by tray icons). This warn should be reported to KDE (I guess) and should be not linked with your uinput problem.

AirisLuna commented 1 year ago

Could you also provide these parameters from terminal?

echo $XDG_CURRENT_DESKTOP
echo $KDE_FULL_SESSION

For echo $XDG_CURRENT_DESKTOP I get the output KDE

And for the echo $KDE_FULL_SESSION true

exclamationWARN env says KDE is running but SNI unavailable -- check KDE_FULL_SESSION and XDG_CURRENT_DESKTOP

According to this log, there is a problem with Status Notifier Item (afaik used by tray icons). This warn should be reported to KDE (I guess) and should be not linked with your uinput problem.

I will check that too, and if necessary, report to KDE.

Could you install steam using regular package manager (deb or rpm...)? It should provide required files. What is your linux distro?

I'm currently using Arch Linux. And installing Steam from pacman(my current install was also using flatpak) fixed the issue, AntiMicroX launches without any errors now. I'm not sure exactly what was missing, if on my end or the flatpak install missing something. But it works flawlessly now.

Thank you for your support.

pktiuk commented 1 year ago

And installing Steam from pacman(my current install was also using flatpak) fixed the issue

I think the udev file was missing (like mentioned in wiki), but you either placed it in wrong place, with wrong permissions, or maybe your distro requires it in different location idk.