Auto-connecting the joystick interface for the chromium snap

This is a request to auto-connect the joystick interface for the chromium snap.
It has recently been pointed out to me that this interface was needed to enable playing stadia games in chromium with a joystick. Auto-connecting it would make the process even smoother for end-users.

3 Likes

Sorry for the delay on this, it was misfiled since it used the ‘store’ category instead of ‘store-requests’.

I’m somewhat conflicted about this since obviously we want to allow joysticks for games that are snaps, but chromium is not a game itself. I wonder if there is a way to use snapctl is-connected joystick and let the user know. Can you comment on if there is an acceptable UX around this? @reviewers - what do others think?

snapctl is-connected sounds like a very nice improvement, I’m looking forward to being able to use it in a few places.

However I’m not sure what the UX would look like in this specific case. I guess this would require patching chromium non-trivially to detect when it tries to access a joystick and fails to do so, and display some user feedback (ideally non-blocking, e.g. a dismissable ribbon that suggests connecting the interface). That sounds like a sizeable amount of work to address a corner case.

1 Like

@oSoMoN - well, I think perhaps it wouldn’t be a contextual prompt, but perhaps something in the wrapper that could inform the user that if they want to play games, then they may want to connect the joystick. I realize this isn’t perfect UX.

@reviewers - can others comment?

In absence of any existing way to prompt the user, I feel we should auto-connect.

If a user has Chromium installed, it’s almost certainly likely to be used for general web browsing. They will likely not be installing it primarily for gaming (unlike for example, Steam). As such there may be a significant time delta between the installation of the browser, and subsequent discovery and attempt to play a game in the browser. As such they’re likely to be confused why their gamepad / joystick “doesn’t work” in the browser, which may claim to be supported.

For this reason, I’m +1 on auto-connecting joystick for Chromium.

I’m -1 on auto-connecting joystick to Chromium. Chromium is not a game, so joystick is not crucial to its use/experience.

There’s a well-established pattern of browsers requesting permissions to devices they need, that would be a better pattern, I think.

  • Daniel

@jdstrand - What is the threat-model if joystick is auto-connected? I notice that the interface allows all input devices via AppArmor but then this is constrained via the device cgroup to be only devices tagged as a joystick by udev. So I don’t see a huge problem myself in auto-connecting this (but if I am missing something please let me know).

So +1 from me to auto-connect joystick in this case since playing games via a web-browser is pretty common these days and we auto-connect joystick for other games etc.

Device files provide an attack surface to the kernel. We don’t auto-connect joystick in general because most snaps don’t need it and we are limiting the scope of an attack against a joystick driver to only those snaps that reasonably need it.

I’m conflicted because a browser is a huge piece of software that processes vast amounts of untrusted input (even if chromium itself has a solid security design and is well coded, it gets CVE updates routinely and it would be a shame if one of those could be chained with a joystick driver CVE to break out of the sandbox). A browser isn’t historically a platform for gamers, but as this request suggests, it is becoming one.

@reviewers - if you haven’t voted yet, can you review the topic and cast your vote?

With the advent of Google Stadia, which prefers Chromium/Chrome, the scope of the browser is changing. I am +1 for auto-connecting the joystick interface as we do for games.