igo95862 / bubblejail

Bubblewrap based sandboxing for desktop applications
244 stars 17 forks source link

Steam game doesn't recognize joystick/gamepad #108

Open jackunity69 opened 3 months ago

jackunity69 commented 3 months ago

Description

I already check the joysticks and gamepads after configuring the instance in the GUI, steam does recognize my gamepad but the game is not. Do you know how to solve this? Thank you.

[common]
executable_name = "/usr/bin/steam"
share_local_time = false
filter_disk_sync = false
dbus_name = ""

[x11]

[wayland]

[network]

[pulse_audio]

[home_share]
home_paths = [
    "/home/user/.local/share/Steam/steamapps",
]

[direct_rendering]
enable_aco = false

[systray]

[joystick]

[root_share]
paths = []
read_only_paths = [
    "/sys/devices/system/cpu",
]

[pipewire]
igo95862 commented 3 months ago

Hello @jackunity69

I would recommend spawning a terminal inside the sandbox. For example using alacritty: bubblejail run steam alacritty

Using terminal you can use the jstest to see if any controllers are detected. (or any other equivalent programm that tests controllers)

The current controller algorithm is very error prone and should be reworked using udev. See #16

jackunity69 commented 3 months ago

I tried jstest inside the sandbox it does recognize the gamepad, however the game still not. Maybe I'll try not to share home directory and download the game inside the sandbox. Thank you for the update though!

igo95862 commented 3 months ago

Maybe I'll try not to share home directory and download the game inside the sandbox.

I doubt that it will change anything.

The biggest issue will be if the game uses udev to enumerate controllers. In that case only passing entire udev socket would work.

igo95862 commented 3 months ago

By the way does the Steam itself recognize the gamepad? I think if you go to options there should be gamepad options.

Also try disabling the Steam Input.

jackunity69 commented 2 months ago

Yeah I've done that, still no works with the game. Steam does recognize the gamepad.

odomingao commented 2 months ago

I have this issue as well. Works fine with sandboxed native emulators, however no WINE game will recognize the controller.

igo95862 commented 2 months ago

Probably something changed about how wine detects controllers. This needs to be investigated.

Hmm... Do an old Proton versions detect controllers? They definitely worked for me back when I started bubblejail in 2019.

odomingao commented 2 months ago

I couldn't find any game that would run with older Proton (6 and below) - if anyone knows of a game that is known to work, I'll test and report back.

Steam itself now also doesn't detect my controller anymore, though it used to.

odomingao commented 1 month ago

Maybe I'll try not to share home directory and download the game inside the sandbox.

I doubt that it will change anything.

The biggest issue will be if the game uses udev to enumerate controllers. In that case only passing entire udev socket would work.

@igo95862 , how can I do this?

I do get the error 0088:err:hid:udev_bus_init UDEV monitor creation failed in the wine shell

edit: passing /dev/uinput doesn't work

igo95862 commented 1 month ago

It looks like if /.flatpak-info file is presented it will disable udev: https://github.com/ValveSoftware/wine/blob/f80ddae9e217f2bad68455891371fa0f524451e7/dlls/winebus.sys/bus_udev.c#L2103

odomingao commented 1 month ago

It looks like if /.flatpak-info file is presented it will disable udev: https://github.com/ValveSoftware/wine/blob/f80ddae9e217f2bad68455891371fa0f524451e7/dlls/winebus.sys/bus_udev.c#L2103

hmm, I tried to create the file (/.flatpak-info) and pass it to the sandbox. Didn't seem to work, as I still get the same warning in the wine shell

igo95862 commented 1 month ago

So creating the empty /.flatpak-info will actually cause games to fail to launch:

pressure-vessel-wrap[2648]: W: Running under Flatpak, unknown version
pressure-vessel-wrap[2648]: E: pressure-vessel (SteamLinuxRuntime) cannot be run in Flatpak 1.10.x or older. For Proton 5.13+, unofficial community builds that do not use pressure-vessel are available.

I tested several games both native and in proton experimental and the controller worked in all of them.

Not sure if it my controller or my selection of games but I didn't encounter any issues.

igo95862 commented 1 month ago

Octopath Traveler did not want to use controller at first but as soon as I disabled the Steam Input it worked.

odomingao commented 1 month ago

Yep, it seems to work now on Steam (tested with DSR, Proton Experimental). They must have fixed it.

jackunity69 commented 1 month ago

It's still doesn't work on my game(it's a fighting game UNDER NIGHT IN-BIRTH II Sys:Celes), maybe the game engine is old(dx9 game) or wayland/hyprland issue idk. I also changed my pc configuration to have dual gpu for vm gpu passthrough.

odomingao commented 1 month ago

@jackunity69 make sure to test with Proton Experimental. 9 wasn't working for me, but experimental did;

jackunity69 commented 1 month ago

@odomingao yeah already did that but still though, I just run the game on vm now. though I still using bubblejail on kb/mouse game. I'll try other game in future to test out if it's the game problem or wayland/hyprland issue. Thank you guys.