-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PS3 gamepads do not work with macOS 12 #4923
Comments
@slouken any comment on this besides the label changes :)? I think implementing direct DS3 HID packet handling on macOS through libusb will likely work, but am unsure whether it is worth the effort. For rumble purposes it is nice, in the past I did exactly that, but I still left other data like button input to SDL at that time. |
I don't have a macOS 12 system right now, but I did report it to Apple and they're investigating. BTW, we don't have HIDAPI support for the DS3, but that's certainly something we can add, if you're interested in contributing it. |
@slouken I tried libusb router, and it does not seem to be too easy. On the other side, I did find a workaround for the native macOS HID API by reviewing my old code for DS3 dating back to 10.6 days :-) For some reason macOS driver is no longer sending the initialisation sequence for DS3, which is the reason why the gamepad does nothing. I have a suspect this happened before, because I added exactly this code some while ago, though the intent was to support rumbling. It was enough for me to run the following code to get DS3 working in all applications until replug: {
uint8_t dataBlob[] = { 0x42, 0x0C, 0x00, 0x00};
IOHIDDeviceSetReport(device, kIOHIDReportTypeFeature, 0xF4, dataBlob, sizeof(dataBlob));
} And the following sequence could be used to activate rumble support and additionally disable LEDs. {
uint8_t dataBlob[] = {
0x01,
0x00,
0x00,
0x00,
0x00,
0x00, // rumble values [0x00, right-timeout, right-force, left-timeout, left-force]
0x00,
0x00, // Gyro
0x00,
0x00,
0x00, // 0x02=LED1 .. 0x10=LED4
/*
* the total time the led is active (0xff means forever)
* | duty_length: how long a cycle is in deciseconds:
* | | (0 means "blink very fast")
* | | ??? (Maybe a phase shift or duty_length multiplier?)
* | | | % of duty_length led is off (0xff means 100%)
* | | | | % of duty_length led is on (0xff is 100%)
* | | | | |
* 0xff, 0x27, 0x10, 0x00, 0x32,
*/
0xff,
0x27,
0x10,
0x00,
0x32, // LED 4
0xff,
0x27,
0x10,
0x00,
0x32, // LED 3
0xff,
0x27,
0x10,
0x00,
0x32, // LED 2
0xff,
0x27,
0x10,
0x00,
0x32, // LED 1
0x00,
0x00,
0x00,
0x00,
0x00,
// Necessary for Fake DS3
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
};
static const size_t RumbleLengthL = 4;
static const size_t RumblePowerL = 5;
static const size_t RumbleLengthR = 2;
static const size_t RumblePowerR = 3;
dataBlob[RumbleLengthL] = dataBlob[RumbleLengthR] = 80;
dataBlob[RumblePowerL] = 255;
dataBlob[RumblePowerR] = 1;
IOHIDDeviceSetReport(device, kIOHIDReportTypeOutput, 1, dataBlob, sizeof(dataBlob));
} Question is, should we integrate it into SDL? This simple set of sequences does not cover everything but is necessary to activate DS3 support on macOS 12.0.1. I attached a small program that can be run once after connecting the gamepad as a workaround… |
I'm having trouble making an Xbox Wireless Controller work. Could this be related? |
Thank you for this! I actually prefer it to the old method, it used to be super finicky to connect. |
I tried running the script OP provided, but the D-Pad is not working, and both triggers appear as permanently pressed. Any ideas on how to tackle that? |
I have the same issue. A fix would be awesome |
same issue as well... |
I got my Dualshock 3 working using the provided binary, however PCSX2 doesnt seem to support the pressure sensitivity. Don't know if it uses SDL to be honest, anyone know more about this? Tried MGS 2 & 3, cant lower weapons without firing and grabbing an enemy in MGS3 while pressing lightly kills them instead of starting an interrogation. |
can anyone guide me into using ps3 controller on my MacBook? for use with nividia geforce |
This makes my DualShock 3 controller usable but it won't stop vibrating. Any workaround for this particular issue? |
look above for ds3activate.zip , connect your ps3 controller to your mac (wired), right click the ds3activate file and select open, if it worked, the controller should vibrate, and now it should work! |
Is it normal that it won't stop vibrating? |
i have the exact same problem, except that its my two bumpers instead of the triggers. does anyone know how to fix this? |
I've tried the script but my controller doesn't stop vibrating, need to unplug and plug on my cellphone and open octopus to stop. Any idea? |
Okay, we can't really do tech support on the script, so let's bring this back to an SDL thing:
|
Sony no longer supports the PS3 controller on PS Now, which is where most people were getting their driver. I looked into adding support to HIDAPI, but I wasn't actually able to read the controller on Windows or macOS for some reason, and Linux drivers are already working fine. |
I'll take another quick stab at this and see what I can come up with. |
So, good news, the latest SDL code supports wired PS3 controllers on macOS, thanks @vit9696! |
So we can close this issue? |
I want to leave it open for bug reports and the hope that someone can figure out why the controller initialization code doesn't work on Windows. |
If nothing pops up we can close this before 2.26 release. |
It's been confirmed that you can't talk to PS3 controllers using stock Windows drivers. This is documented in 1fc7f68. |
Confirmed, this works well on macOS for wired PS3 controllers. |
[Snip] I compiled the source and ran it (m1 MacBook). The controller rumbled but it's not working in Dolphin? Edit: My arm64 compiled version worked fine playing an SNES game via OpenEMU. I think I got Dolphin to work but I had to remap everything! |
I connected the controller and turned on ds3activate.zip, and it vibrated. But it doesn't do anything. it says its connected but nothing works and the light is off Edit: I found out that it works but only if I hold down the ps button |
|
This works great! But L2 and R2 are treated like normal buttons so i cannot modulate the pressure, can it be fixed? |
It looks like L2 and R2 aren't pressure sensitive in the DS3 controller: |
Well they are analog, in fact on PS3 and Windows they can be modulated |
Sorry, I was thinking of L3 and R3. Yes, L2 and R2 are analog triggers, and are reported as axes 4 and 5. I just tested them on macOS and they work correctly. |
If anyone is still experiencing a never ending rumble / vibration, i've sorted it by removing line 91. ie |
same problem, have you found any solutions? thank you very much !!! |
Same issue. Dpad and L2 R2 appear to be constantly pressed. Has anyone found the solution |
ps3activate does work on my m1 macmini with wired ps3 controller, but it breaks sleep mode on the os. can this be fixed? thx! |
Seems to work on Sonoma 14.5, but the L2 and R2 are not recognised? They are greyed out in the https://hardwaretester.com/gamepad and don't respond in games. Solution would be very much appreciated 🙇 |
As of macOS 12.0.1 HID controllers are recognised but fail to provide any input to macOS. In particular, IOHIDDeviceRegisterInputValueCallback/IOHIDDeviceRegisterInputReportCallback apparently never call callbacks with e.g. Sony DualShock 3, but likely others.
This was originally reported as hrydgard/ppsspp#15112 and sent as FB9745903 to Apple. The simplest project I was able to reproduce it is https://github.com/armadillu/MacJoystickHIDTest.
The text was updated successfully, but these errors were encountered: