DualShock4: battery level, led color change and auto turn off
-
Hello! So, since I have started using the DS4 on RetroPie on my RPi 3B+ more than a year ago I always thought the experience was limited comparing with the use on an actual PS4. Of course, the lack of official Sony drivers doesn't help in that way. But it works pretty great, even in Wireless mode (if you use a USB Bluetooth dongle, the built-in BT can't handle it very well), even vibration works. The limitations I have noticed are
1) No way to check the battery level with the controller only(This feature was added to RetroArch apparently recently I guess, I didn't noticed when, but it requires you to enter the retroarch menu to see battery level). 2) The led color is always max bright blue, for all controllers connected, which drains the battery faster and you can't distinguish between players 1, 2 etc because the colors are the same. 3) The controller only turns off if you power off the system or manually turn them off by holding the PS button for 10 seconds. If you leave them on, they will only turn off when battery runs drySome time ago I messed with udev rules to try and create a script that changed the led color and brightness when you connected the controller and it worked ok, except all the controllers still remains with the same color. I also tried to make a script that checks battery from time to time using cron and "report" value by blinking the controller led in patterns that varies depending on the battery level, this one was pretty meh. Regarding the not turning off issue I barely looked into it
Since I noticed that RetroArch now reports battery level I've been thinking in messing with this again, maybe use their notification system to report low battery level for the controllers? And since it detects controllers on port #0, #1, etc it could also change the led colors and brightness to predefined ones. About the auto turn off, I know there is something like a system file related to the input data from the controllers that reports every button press and it could be used to turn off the controller if it doesn't detect any input in a given amount of time. Anyone has a thought on these matters? I know they aren't huge problems but it could improve the experience and that is always positive. I'm willing to mess with coding if someone with experience in RetroPie could help pointing me out where to start or in which way should I go. I appreciate any help!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.