Project

General

Profile

Actions

Emulator Issues #14001

open

Android - two identical Bluetooth controllers indistinguishable due to matching firmware names

Emulator Issues #14001: Android - two identical Bluetooth controllers indistinguishable due to matching firmware names

Added by caryboe about 1 month ago. Updated 28 days ago.

Status:
New
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:

Description

Game Name?

N/A - Issue affects controller configuration globally, not a specific game

Game ID? (right click the game in the game list, Properties, Info tab)

N/A

MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)

N/A

What's the problem? Describe what went wrong.

When two Nintendo Switch Pro Controllers are connected simultaneously via Bluetooth on Android, Dolphin only shows a single device entry — Android/1/Nintendo Switch Pro Controller — in the device dropdown for both GameCube Controller Port 1 and Port 2. Because both controllers broadcast identical firmware names, Dolphin cannot distinguish between them and treats both as the same device. Whichever controller connects second has its inputs mishandled, with buttons being interpreted as navigation/back commands rather than gamepad inputs.

What steps will reproduce the problem?

  1. Pair two Nintendo Switch Pro Controllers to an Android device via Bluetooth
  2. Open Dolphin → GameCube Input → tap the settings gear for Controller Port 1
  3. Tap the Device dropdown — only one entry appears for both controllers: Android/1/Nintendo Switch Pro Controller
  4. Repeat for Controller Port 2 — identical single entry
  5. Connect both controllers and test — whichever connects second behaves erratically, with buttons triggering navigation actions instead of mapped inputs

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

Unknown

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

Yes, 2603

If the issue isn't present in the latest release, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

N/A

If your issue is a graphical issue, please attach screenshots and record a three frame fifolog of the issue if possible. Screenshots showing what it is supposed to look like from either console or older builds of Dolphin will help too. For more information on how to use the fifoplayer, please check here: https://wiki.dolphin-emu.org/index.php?title=FifoPlayer

[Attach any fifologs if possible, write a description of fifologs and screenshots here to assist people unfamiliar with the game.]

N/A - This is a controller input issue
What are your PC specifications? (CPU, GPU, Operating System, more)

Device: Lenovo Y700 Gen 4 tablet
CPU: Snapdragon 8 Elite
RAM: 12GB
Operating System: Android 15

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

Tested with a gamepad testing app — Android itself correctly identifies both controllers as separate gamepad devices and all buttons register correctly on both. The issue is specific to Dolphin's Android input layer, which merges both controllers into a single device entry due to identical names. The PC version of Dolphin differentiates identical controllers via their Bluetooth MAC address — requesting the same capability be extended to the Android version. Connection order workaround exists but is not a proper fix — whichever controller connects first works correctly, the second does not.

Updated by JosJuice about 1 month ago Actions #1

  • Operating system Android added
  • Operating system deleted (N/A)

Updated by caryboe 28 days ago Actions #2

# Follow-up findings after attempting a fix:
After investigating the source code, I located the relevant code in Source/Core/InputCommon/ControllerInterface/Android/Android.cpp in the AndroidDevice::GetPreferredId() function.
The current implementation uses m_controller_number as the unique device identifier, which returns the same value for two identical controllers connected simultaneously, making them indistinguishable in Dolphin's device dropdown.

I attempted a fix by replacing m_controller_number with m_device_id (Android's internal input device ID), which successfully caused both controllers to appear as distinct entries in the device dropdown (e.g. Android/21/Nintendo Switch Pro Controller and Android/22/Nintendo Switch Pro Controller).
However this approach is not viable as a permanent solution because Android reassigns device IDs every time a Bluetooth controller disconnects and reconnects, which happens frequently during normal use.

The correct solution would be to use each controller's Bluetooth MAC address as the unique identifier , since this never changes regardless of reconnection. However Android does not expose the MAC address directly through the InputDevice API. It would need to be retrieved via the BluetoothDevice API and then cross-referenced with the corresponding InputDevice by matching device names.

I'm guessing this is why the fix has not been implemented yet — it requires bridging two separate Android APIs. The PC version of Dolphin already handles this correctly via MAC address differentiation, and the same approach should theoretically be implementable on Android.

Updated by JosJuice 28 days ago Actions #3

We're not doing anything with MAC addresses on other OSes, we're just asking the OS for a list of devices. I wonder why m_controller_number is set to the same value for two different controllers in your case, because that's not the behavior I would expect from the Android APIs.

Updated by caryboe 28 days ago Actions #4

Update — Fix implemented and tested:

A working fix has been developed and thoroughly tested. The solution uses InputDevice.getDescriptor() as a stable unique identifier for each physical controller, persisting across reconnections, reboots, and device ID changes.

A controller label field was added to the main controller configuration screen where you can assign unique (must be unique) names to each controller. Labels are stored in Dolphin.ini under a [ControllerLabels] section keyed by descriptor, making them portable across devices and reinstalls. Unfortunately, I was not able to make this field mandatory, but in an additional enhancement development, this should be mandatory - especially when/if connecting more than one contoller.

Testing confirmed:

Labels persist across Bluetooth timeouts and reconnections
Labels survive full power cycles and dock removal/reinsertion
Works with multiple identical controllers including third party ones that clone Nintendo's firmware name
No special hardware required
Scales to 3 and 4 controllers

Known limitation: Re-connection order matters! — controllers should be connected in consistent order for correct port assignments.
A pull request will follow.

Actions

Also available in: PDF Atom