canonical / steam-snap

Steam as a snap
75 stars 9 forks source link

Xbox 360 Controller not working in game #179

Closed aaronprisk closed 1 year ago

aaronprisk commented 1 year ago

Describe the bug Wired Xbox 360 Controller is not detected by Steam Snap and does not work while playing games.

To Reproduce 1) Plug in wired Xbox 360 controller 2) Launch Steam Snap 3) Launch installed game with gamepad support

Expected behavior Gamepad should be detected by Steam and work in supported titles

Environment

os_release: 
    name:               "Ubuntu"
    version:            "22.10 (Kinetic Kudu)"
snap_info: 
    steam_revision:     124
    snapd_revision:     18357
lspci: 
    2d:00.0:            Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT / 6800M] (rev c1)
glxinfo: 
    gpu:                NAVI22 (navi22, LLVM 15.0.7, DRM 3.47, 5.19.0-35-generic)
    gpu_version:        4.6 (Core Profile) Mesa 23.0.0 - kisak-mesa PPA
lscpu: 
    model_name:         AMD Ryzen 9 5900X 12-Core Processor
xdg_current_desktop:    ubuntu:GNOME
desktop_session:        ubuntu

Logs journalctl -xe repeats the following line when attempting to use controller:

Couldn't initialize virtual gamepad: Couldn't open /dev/uinput for writing

Additional Context Steam Snap can be made to detect controller and even work within Controller Settings and Big Picture mode by issuing:

sudo snap connect steam:joystick
aaronprisk commented 1 year ago

I discovered the following will allow the controller to work as expected in Steam settings and in-game: 1) Adding uinput under plugs in the Steam Snap snap.yaml 2) Repack and install Snap 3) Connecting joystick and uinput via

snap connect steam:joystick
snap connect steam:uinput
Motophan commented 1 year ago

@aaronprisk how would one edit the snap? I have /var/lib/snapd/snap/steam/124/meta/snap.yaml but even under sudo / root it is unwriteable. I am sorry I know this is not a support forum but I cannot figure out how to edit and repackage the snap while I wait for this to get mainlined

kenvandine commented 1 year ago

Just connecting the joystick plug will get it working, remapping buttons will require snap changes.

snap connect steam:joystick

On Sun, Apr 2, 2023, 4:30 PM Motophan @.***> wrote:

@aaronprisk https://github.com/aaronprisk how would one edit the snap? I am sorry I know this is not a support forum but I cannot figure out how to edit and repackage the snap while I wait for this to get mainlined

— Reply to this email directly, view it on GitHub https://github.com/canonical/steam-snap/issues/179#issuecomment-1493433459, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANMBORSZ5MSOUZLEOFRJ3W7HOW7ANCNFSM6AAAAAAWBYX47Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

aaronprisk commented 1 year ago

@kenvandine was something recently changed in regards to controller support? As you mentioned, I only needed to add the joystick plug for it to work now.

aaronprisk commented 1 year ago

@Motophan For Snap testing purposes, you can do the following:

snap download SNAP_NAME
unsquashfs SNAP_NAME.snap

Browse to the newly created squashrootfs-root directory that was created. In the meta directory, you'll find snap.yaml.

Then while in the squashrootfs-root directory, you can test the snap by running:

snap try

Or you can repackage and install to test via:

snap pack
snap SNAP_NAME.snap --dangerous

And finally launch the snap by running

snap run SNAP_NAME

You can find more info here: https://snapcraft.io/blog/development-tips-and-tricks-snap-try-and-snapcraft-pack

ZoopOTheGoop commented 1 year ago

This should be working now with the uinput plug autoconnection, feel free to reopen if not.