Bluetooth Dualshock 4 controller on an iMac

Issue:
If I turn my controller on first, before I start Citra, everything works fine, I auto-configured my controller in Citra too, by the way; perfect. However, if I take a break and turn the controller off to save battery, then return to the game - still open - and turn the controller back on again, Citra does not recognise it any more. I have to quit it and restart it for it to pick up the Dualshock 4 connection again. Same behaviour if I start Citra first and then connect the controller; it won’t be recognised. It only does one check on start up and thats it. Other apps, such as OpenEmu, seem to do constant, or at least repeated, checking which overcomes this limitation. It’d be great if Citra could implement the same. Thanks.

System Information

  • Operating System: MacOS 11.6.1
  • CPU: Intel Core i5 2600S
  • GPU: nVidia Quadro K2100M
  • Citra Version (found in title bar): Nightly 1733
  • Game: Metroid: Samus Returns
  • Screenshot of Issue (include the full Citra window including titlebar):

Diagnostic Log
Upload your log file as an attachment by dragging & dropping.

In order to save a copy of the log, follow this guide:
https://community.citra-emu.org/t/how-to-upload-the-log-file/296

In order for us to provide better support, we need to see the log generated by Citra. This guide will walk you through how you can obtain the log file: How to Upload the Log File.

Citra doesn’t have native support for DS4 controllers, nor specific controller profiles. This means that every time your controller gets disconnected, the OS assigns a new controller ID to the controller, making Citra fail to recognize it. Though, this is probably more MacOS related than anything else.

Yes, I can understand that. But as I pointed out, the other popular emulator app that you can get on all platforms, including macOS, OpenEmu, deals with it quite efficiently. I imagine that it has a permanent background loop running that scans for controllers and if it sees one, does some sort of check on it and connects it. I’ve used OpenEmu extensively with this controller and its never made any mistake by connecting it as one thing then reconnecting it with another identity or anything like that. AFAIK which isn’t much, macOS maintains a fixed identity code for a hot-pluggable item, such as the Apple Bluetooth Keyboard or the Apple Bluetooth Trackpad, and always reconnects them the same. If it were not too much trouble for you guys to code something similar into Citra, I for one would be extremely thankful to you!

I wouldn’t really put a DS4 controller in the same catagory as Apple products designed to be used this way…

Regardless, its probably possible to do something similar, but what OpenEmu has done is completely different from Citra’s input system. It directly supports automapping of the controller. Which means it automaps the controller every time it is encountered. Our entire input system would need to be rewritten. Yuzu, Citra’s sister project, has something similar implemented already so when a dev decides to work on this, hopfully we can port the framework off of Yuzu.