Project

General

Profile

Actions

Emulator Issues #11662

closed

Gamepad doesn't work on ChromeOS [includes fix]

Added by ExceptionStock over 5 years ago. Updated over 4 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
Android
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-11617

Description

Game Name?

Game-independent but I tried with Super Mario Sunshine

What's the problem? Describe what went wrong.

When using Android version on ChromeOS GamePad can be configured but in the game no reaction to button presses

What steps will reproduce the problem?

  1. Get a Chromebook with Android apps support and a bluetooth gamepad
  2. Install Dolphin from Play Store
  3. Add any game
  4. Go to config and bind the buttons to a bluetooth gamepad
  5. Start a game
  6. Press any buttons on gamepad

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

yes

Is the issue present in the latest stable version?

yes

What are your PC specifications? (CPU, GPU, Operating System, more)

Pixelbook.

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

The issue comes from the fact that getDescriptor on ChromeOS returns "" for gamepad which is actually within the specs as the speconly guarantees the stability of ID, and "" is a valid ID. Then in Source/Android/jni/ButtonManager.cpp we have lines like:
sscanf(value.c_str(), "Device '%127[^\']'-Axis %d%c", dev, &bindnum, &modifier);
Unfortunately %127[^\'] doesn't accept empty string, so you need something like:
if (value.find(""Device ''") == 0) {
dev[0] = '\0';
sscanf(value.c_str(), "Device ''-Axis %d%c", &bindnum, &modifier);
} else {
sscanf(value.c_str(), "Device '%127[^\']'-Axis %d%c", dev, &bindnum, &modifier);
}
This needs to be modified in 4 places in Source/Android/jni/ButtonManager.cpp: 2 time with -Button and 2 times wit -Axis.
With this changes gamepad and Dolphin work perfectly on ChromeOS.

Actions #1

Updated by Techjar over 5 years ago

It would be much easier if you actually submit a PR on GitHub.

Actions #2

Updated by ExceptionStock over 5 years ago

True but it's tricky for me to get my organization's approval to share my code, so I had to opt for describing the issue in detail instead

Actions #3

Updated by delroth over 5 years ago

IARC is usually painless for contributing to emulator projects, I'd give it a shot. (You can find me on moma.)

Actions #4

Updated by LazerTag over 5 years ago

I apologize if this isn't the place, but this bug is the one thing keeping Chromebook users from being able to play with Dolphin using a real controller. Any chance of this getting prioritized soon for a future release? Thanks for your time.

Actions #5

Updated by LazerTag almost 5 years ago

ExceptionStock wrote:

True but it's tricky for me to get my organization's approval to share my code, so I had to opt for describing the issue in detail instead

Many months later it seems like we might never see this fix :( I get it there simply are not enough of us Chromebook users out there but literally tens of us would be super excited to get this fixed in Dolphin :)

@ExceptionStock if you see this, is there anyway you can get this in there? I work as a sysAdmin at a software developer so I get how hard it might be to get this passed your agreement with your company. Just know until you or someone feels interested in picking this up Dolphin just is not much fun for us non-coders. thanks for the ear on the subject and I'll just leave it at that.

Actions #6

Updated by Billiard26 almost 5 years ago

  • Status changed from New to Work started
Actions #7

Updated by LazerTag almost 5 years ago

Billiard26 wrote:

A fix is already in the works: https://github.com/dolphin-emu/dolphin/pull/8420

Hi, last reply I will make here so as not to bug anyone further. This is really great news for Chromebook users, ty! I'll just follow it from github link you provided.

Actions #8

Updated by JosJuice over 4 years ago

  • Status changed from Work started to Fixed
  • Fixed in set to 5.0-11617
  • Operating system Android added
  • Operating system deleted (N/A)
Actions

Also available in: Atom PDF