moonlight-stream / moonlight-android

GameStream client for Android
GNU General Public License v3.0
3.97k stars 623 forks source link

[Issue]: Android TV not possible to use multiple controllers? #1274

Open lyndonguitar opened 10 months ago

lyndonguitar commented 10 months ago

Describe the bug

I am running Moonlight using NVIDIA Shield Pro 2019 (Android TV) and it works fine. but when I connect multiple controllers, they all get recognized as one controller(player 1) only. This isn't the case when I'm using Moonlight Client on other devices like Steam Deck, Steam Link(hardware), or Xbox Series.

I've noticed the Android TV version seems to be also missing the "Force gamepad #1 always connected" option/toggle, and I've while digging around I've read that the issue can be related to that option, so these can be related?

Continuously troubleshooting as I post this.

Steps to reproduce

  1. Connect multiple controllers to NVIDIA Shield. Mine was connected via Bluetooth, two Xbox Series Controllers. I also tested a 8bitdo bluetooth adapter and connected one controller to that dongle = same result.

  2. Check via windows "Set up USB game controllers", in-game, or any other app that detects controller. All controllers will get detected as player 1 with same controllers. it's like co-pilot is on.

Affected games

Tested with Windows itself, Steam Big Picture, Yuzu emulator, and a variety of games.

Other Moonlight clients

PC

Moonlight adjusted settings

No

Moonlight adjusted settings (please complete the following information)

I use default settings

Moonlight default settings

Yes

Gamepad-related connection issue

Yes

Gamepad-related input issue

Yes

Gamepad-related streaming issue

Yes

Android version

Android 11

Device model

NVIDIA Shield Pro 2019

Server PC OS version

Windows 11 build 22621

Server PC GeForce Experience version

3.27.0.120

Server PC Nvidia GPU driver version

545.92

Server PC antivirus and firewall software

Windows Defender, no third party AVs

Screenshots

No response

Relevant log output

No response

Additional context

No response

cgutman commented 10 months ago

I've noticed the Android TV version seems to be also missing the "Force gamepad 1 always connected" option/toggle, and I've while digging around I've read that the issue can be related to that option, so these can be related?

Some of the clients have different names for that setting. On Android, it's called "Automatic gamepad presence detection". Can you make sure that option is enabled?

Queuecumber commented 9 months ago

I can confirm this behavior, Automatic gamepad presence detection is enabled

zhliau commented 9 months ago

I can confirm this issue as well, but only on Android TV. I have a TCL R646 on V258 firmware, running Moonlight Android version 12.02 and no matter what I cannot get multiple controllers detected as separate input devices in the Set Up USB Game Controllers control panel in Windows. It definitely worked before as we've completed multiple co-op games via Moonlight + Sunshine, but suddenly I cannot get multiple controllers to work. I've tried reverting versions up to 11.0 and it didn't seem to fix anything. Automatic gamepad presence detection doesn't seem to affect anything either.

Weirdly enough, using the same controllers paired to my Android phone running the same Moonlight version works!

zhliau commented 8 months ago

After a lot of searching and troubleshooting, factory resetting my TV several times, I've discovered the cause of this issue. It appears to be a combination of:

  1. Android 11. My TV runs V258 firmware which is Android 11.
  2. Accessibility functionality. In my case, I use ProjectIvy Launcher to completely replace the default Google TV launcher, and some of its advanced functionality requires enabling the accessibility service.

I can easily reproduce this by toggling the accessibility service in settings. With it on, only a single controller device shows up in the Game Controllers control panel on my Sunshine host regardless of how many actual controllers are connected. With it toggled off, all controllers appear as individual devices.

In my case the fix was to:

It may be worth trying to find anything (app/service/etc) related to Accessibility and disabling or removing it.

There is a relevant bug opened in Google's issue tracker which is marked as closed, but as far as I could find it's closed because it was "fixed" in Android 12. https://issuetracker.google.com/issues/163120692?pli=1

This bug is not related to Moonlight/Sunshine.