flathub / org.chromium.Chromium

https://flathub.org/apps/details/org.chromium.Chromium
45 stars 26 forks source link

Cannot use gamepad #40

Open alkazar opened 3 years ago

alkazar commented 3 years ago

Chromium installed via my package manager can make use of my gamepad.

However, with this flatpak version of Chromium, my gamepad is not recognized, even with the device=all flag.

I tested this using: https://gamepad-tester.com/ and a wireless Xbox 360 controller.

refi64 commented 3 years ago

This is unfortunately something we're sort of stuck with for now until there's a device portal or similar for flatpak.

alkazar commented 3 years ago

I can use joysticks just fine in other flatpaks I have installed, including games like Sonic Robo Blast 2 and Tanks of Freedom. So it seems like it should be possible unless there is something specific to Chromium or the way it is packaged that is preventing it from working.

FYI, I am trying to use Stadia which requires Chrome/Chromium.

refi64 commented 3 years ago

Unfortunately we're mostly stuck like this for now, since Chromium expects to read devices from udev, which cannot be directly exposed into the sandbox due to having an unstable ABI.

On Tue, Dec 15, 2020, 8:06 AM alkazar notifications@github.com wrote:

I can use joysticks just fine in other flatpaks I have installed, including games like Sonic Robo Blast 2 and Tanks of Freedom. So it seems like it should be possible unless there is something specific to Chromium or the way it is packaged that is preventing it from working.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/flathub/org.chromium.Chromium/issues/40#issuecomment-745306515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4YSL4GC7OFHB7SOX2ZBDSU5UNLANCNFSM4UZDJBPA .

andrunko commented 3 years ago

Unfortunately we're mostly stuck like this for now, since Chromium expects to read devices from udev, which cannot be directly exposed into the sandbox due to having an unstable ABI. On Tue, Dec 15, 2020, 8:06 AM alkazar @.***> wrote: I can use joysticks just fine in other flatpaks I have installed, including games like Sonic Robo Blast 2 and Tanks of Freedom. So it seems like it should be possible unless there is something specific to Chromium or the way it is packaged that is preventing it from working. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#40 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4YSL4GC7OFHB7SOX2ZBDSU5UNLANCNFSM4UZDJBPA .

I was having a quick look at https://github.com/flathub/org.chromium.Chromium/issues/20 and noticed chromium has a libusb impl (see services/device/usb) that is used for Windows and Mac and that we could maybe try here also, but I didn't have the chance yet.

buxel commented 3 years ago

Any update on this? i just verified that a wired Xbox controller works with flatpack-steam using device=all with the limitation that the controller needs to be plugged in before launching the application.

So while technically possible, for some reason chrome still does not detect my gamepad.

EDIT: did two more tests, looks like it is a general browser issue. Firefox does not show the controller on gamepad-tester but jstest-gtk recogniozes it.

EDIT2: sorry, i totally missed yor point about udev. It looks like there is also no support planned for it.

monreal commented 3 years ago

My gamepad works on Chrome flatpak when using --filesystem=/run/udev, I wonder why Chromium (same version) does not work the same way?

refi64 commented 3 years ago

That "hack" should now work here, but it's not really supported (udev does not have a stable protocol, so any host or Flatpak update can break that).

nondebug commented 2 years ago

Hi, I found this bug while investigating a Chromium Gamepad API issue: https://crbug.com/1359677

There's also a (maybe) related issue filed against the chromium-browser snap: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1988660

I'd like to fix this by removing Chromium's dependency on udev. Is there an alternative that plays nicely with flatpak/snap sandboxing?

Victor239 commented 2 years ago

There appears to be some upstream work to create a dedicated portal for USB devices, they mention in the OP lack of integration with Chromium is an open question so there is likely space to collaborate there.

I think that Steam Flatpak users are having to install a native package of udev rules, whilst Steam Deck users don't have issues because Steam isn't Flatpak'd and thus has access to udev. Some other related issues:

ssokolow commented 2 years ago

As I understand it, the reason is because the point the Flatpak isolation boundary needs to sit at without such a portal is considered an unstable internal API by the udev developers.

soredake commented 2 years ago

Maybe related https://github.com/systemd/systemd/issues/22681

ChonkaLoo commented 1 year ago

My gamepad works on Chrome flatpak when using --filesystem=/run/udev, I wonder why Chromium (same version) does not work the same way?

Thanks also works for my xbox controller, with xone and latest Edge in flatpak.

Victor239 commented 2 months ago

I believe this latest commit should enable controllers to now be detected in Flatpaks.

Erick555 commented 2 months ago

if device=all didn't work then the new option wouldn't either as it's just one subfolder of /dev.