DS4 Conflates IMU/Gyro with Sticks

Hello everyone! First time poster here.

I’v got some strange gamepad behaviour with my DS4 controllers that I’m trying to track down where it’s coming from.

Basically I’m getting IMU/Gyro data passed through with my controller axis calls like these:

state.left_x = SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_LEFTX);
state.left_y = SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_LEFTY);

I have been searching wide and far for information on how the DS4 motion data is being passed around in SDL2 but I just can’t find any information on it.
The above calls are meant to pick up the analogue stick and it does that fine. But sometimes I also get those variables flushed full of motion data.

Would anyone be able to point me in the direction of some info on how SDL handles IMU/movement? Or if you recognize this behavior and know whats going on?

I’m working on Raspbian Buster 32bit or a RPi4.
SDL ver: libsdl2-dev is already the newest version (2.0.9+dfsg1-1+rpt1)

Cheers, Fred

Searching this very forum :slight_smile: I found some more info!
Seems like there’s something in the works! https://bugzilla.libsdl.org/show_bug.cgi?id=4815

Does anyone know if this is close to being merged in, or if it should be working well enough to patch in current sdl?

Otherwise I believe that Gyro/Accel data currently comes in as a completely separate ‘Joystick’ device?

That could match what I’m observing that currently the system (not my original code) seems to add a controller when I start shaking the DS4 around.

EDIT: Is there a way to get an identification of the Joystick device that is representing the Gyro/Accel input?