Closed Bug 1460347 Opened 6 years ago Closed 5 years ago

Enable joystick interface with firefox snap

Categories

(Release Engineering :: Release Automation: Snap, defect)

Unspecified
Linux
defect
Not set
normal

Tracking

(firefox71 fixed)

VERIFIED FIXED
Tracking Status
firefox71 --- fixed

People

(Reporter: extraymond, Assigned: jlorenzo)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180507191226

Steps to reproduce:

Trying to use gamepad api in firefox snap.


Actual results:

Gamepad can not be found.


Expected results:

Snaps can request to use joystick with joystick interface, it would be nice to enable it.

Relevant link: https://docs.snapcraft.io/reference/interfaces
Component: Untriaged → DOM: Device Interfaces
OS: Unspecified → Linux
Product: Firefox → Core
Who owns our Snap builds?
Flags: needinfo?(sledru)
This is Johan!
Flags: needinfo?(sledru) → needinfo?(jlorenzo)
Thank you for the bug report!

Adding this permission looks like the right thing to do. However, I don't have a gaming controller to test out. Do you confirm your gamepad is mapped to /dev/js*, extraymond?
Component: DOM: Device Interfaces → Release Automation: Snap
Flags: needinfo?(jlorenzo) → needinfo?(extraymond)
Product: Core → Release Engineering
QA Contact: jlorenzo
Version: 61 Branch → unspecified
(In reply to Johan Lorenzo [:jlorenzo] from comment #3)
> Adding this permission looks like the right thing to do. However, I don't
> have a gaming controller to test out.

To clarify: I have a PS4 controller ready. However, my Linux machine detects it as /dev/bus/usb/001/010.
(In reply to Johan Lorenzo [:jlorenzo] from comment #4)
> To clarify: I have a PS4 controller ready. However, my Linux machine detects
> it as /dev/bus/usb/001/010.

That was on Arch Linux. On Ubuntu 16.04, the same controller is mapped to /dev/hidraw0. Without Snap, I can play [1] on Firefox 60. I'll have the Snap version tested.

[1] http://webassembly.org/demo/Tanks/
Ah, I can't open Tanks on the Snap version of 60.0. The website reads:
> Your browser does not support WebGL

The browser console says:
> Error: WebGL warning: Failed to create WebGL context: WebGL creation failed:
> * Error during native OpenGL init
> * Exhausted GL driver caps.
> * Exhausted GL driver options.

When open in a Terminal, the firefox snap binary returns:
> libGL error: No matching fbCongis or visuals found
> libGL error: Failed to lead driver: swrast

We did declare the "opengl" permission[1]. I don't see any other which can match. Ken, how can I get better logs on this? 

[1] https://searchfox.org/mozilla-central/rev/d4b9e50875ad7e5d20f2fee6a53418315f6dfcc0/taskcluster/docker/firefox-snap/snapcraft.yaml.in#26
Flags: needinfo?(ken.vandine)

(In reply to Johan Lorenzo [:jlorenzo] from comment #3)

Thank you for the bug report!

Adding this permission looks like the right thing to do. However, I don't
have a gaming controller to test out. Do you confirm your gamepad is mapped
to /dev/js*, extraymond?

Sorry for the long delay!!!
My controller is mapped at /dev/input/js0, and is confirmed working by jstest-gtk.
However there are no gamepads found by calling navigator.getGamepads()

Flags: needinfo?(extraymond)

Additional info:
Joystick in snap that enables the joystick interface works fine: for example -> retroarch, so snap's interface is working as expected.

The current version of firefox didn't enable the joystick interface in the snapcraft.yaml.
I think that might be the case.

Awesome! Thanks for the info. Then, the fix is easy :)

Flags: needinfo?(ken.vandine)
Assignee: nobody → jlorenzo
Pushed by jlorenzo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6eb5b0b83574
snap: enable joystick interface r=mtabara
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED

Thx!! Confirmed working on firefox snap.

Tested on channel: beta, revision 278.
Joysticks tested: Logitech F310(under Xinput mode), steam wireless controller, both works.
Thx Devs!

Awesome!

Marking this bug as verified per comment 14.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: