ricardoquesada / bluepad32

Bluetooth gamepad, mouse and keyboard support for ESP32 and PicoW
https://bluepad32.readthedocs.io/
Other
503 stars 53 forks source link

[Bug]: 2nd Controller causes the first PS5 Virtual Device to get knocked off #77

Closed microbmen closed 3 months ago

microbmen commented 4 months ago

What happened?

If I connect a PS5 controller, with virtual device (true) , It connects the 2 devices , PS5 game , and PS5 touch.

If I then connect another controller, say an XBOX controller, the Xbox controller doesnt connect, and the PS5 touch disconnects. Then a subsequent connect of the XBOX controller connects, but it thinks the XBOX controller is a mouse and odd things happen.

(I think this is true, i only have 1 PS5 controller to test. could be my controller maybe?? need someone to confirm)

Bluepad32 Version

latest, 4.0 beta 1.

Bluepad32 Platform

None

Platform version

Arduino IDE 2.1.0,

Controller

PS5 + Virtual Device followed by an XBOX connect.

ESP32 chip

ESP32

ESP32 board

ESP32-S3-WROOM1 DevKit from Lolin. This is the store URL: https://example.com

OS

None

Relevant log output

No response

Relevant sketch

using the example sketch this happens.
ricardoquesada commented 4 months ago

weird... could you confirm that you are using Arduino IDE ?

microbmen commented 4 months ago

yes using the Arduino IDE. can someone else confirm this? i only have 1 PS5 controller at this time. Not sure if my controller is doing something weird. Steps to reproduce 1) flash ESP32 with firmware and load the example controller sketch. 2) ensure that the virtual device is enabled (true) // Enables mouse / touchpad support for gamepads that support them. // When enabled controllers like DualSense and DualShock4 generate two connected devices: // - First one: the gamepad // - Second one, which is a "virtual device", is a mouse // By default it is disabled. BP32.enableVirtualDevice(true); 3) upload to the ESP32, 4) connect a PS5 controller 5) watch the serial output, you will see idx 0 and idx 1 scrolling by. 6) try and connect another controller, - eg Xbox. 7) Xbox controller will not connect and idx 1 disappears... 8) try and reconnect xbox again, and it will connect as idx 1. 9) xbox controller wont really work (as its dumping mouse) ... and also the touch on the PS5 controller wont work any longer either...

Thanks!

ricardoquesada commented 3 months ago

just to confirm, you have not changed the max connected devices, which should be 4, correct?

microbmen commented 3 months ago

Correct, max is default at 4.

A few more discoveries for you on this bug.

1) If you connect the Xbox controller first (idx 0) then the PS5 controller (idx 1, idx 2) everything works as expected. 2) if you connect the PS5 controller first (idx 0, idx 1) then the xbox controller 2nd , you never get to idx 2. idx 1 disconnects on the PS5 , and a subsequest connect connects the xbox as idx 1 as device mouse. 3) The Bug appears on Xbox firmware 5.20 (& 5.17) , Xbox firmware 3.1 functions as expected. (ive upgraded and downgraded to prove this out) Perhaps its a BLE issue?

(Again im still not sure if its just my ps5 controller, but at this point i dont think its the issue... per point # 1 above)

hope this helps.

ricardoquesada commented 3 months ago

mmm... interesting... I'll look at it during the weekend.

ricardoquesada commented 3 months ago

fixed. will be part of 4.0-beta3