Emulator Issues #11662
closedGamepad doesn't work on ChromeOS [includes fix]
0%
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?
- Get a Chromebook with Android apps support and a bluetooth gamepad
- Install Dolphin from Play Store
- Add any game
- Go to config and bind the buttons to a bluetooth gamepad
- Start a game
- 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.
Updated by Techjar over 5 years ago
It would be much easier if you actually submit a PR on GitHub.
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
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.)
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.
Updated by LazerTag about 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.
Updated by Billiard26 about 5 years ago
- Status changed from New to Work started
A fix is already in the works: https://github.com/dolphin-emu/dolphin/pull/8420
Updated by LazerTag about 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.
Updated by JosJuice almost 5 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)