Skip to content
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

DS4 motion movements ignored #29

Open
OperationNT414C opened this issue Aug 13, 2017 · 3 comments
Open

DS4 motion movements ignored #29

OperationNT414C opened this issue Aug 13, 2017 · 3 comments

Comments

@OperationNT414C
Copy link

OperationNT414C commented Aug 13, 2017

Hello,

DS4 motion movement seem to be ignored. When I tried to activate logs and add a log inside "SceMotion_sceMotionGetState", there was no call detected. Then I add log at the hook point:

BIND_FUNC_EXPORT_HOOK(SceMotion_sceMotionGetState, KERNEL_PID, "SceMotion", TAI_ANY_LIBRARY, 0xBDB32767);
LOG("sceMotionGetState hook result: %d\n", SceMotion_sceMotionGetState_hook_uid);
log_flush();

It returns a negative value (which means that the hook have failed). Do you have any idea why this function hook fails? I tried it on Enso and on default Henkaku.

Thank you for your help!

@OperationNT414C
Copy link
Author

By looking at some taihen code ("module.c"), I wrote inside the plugin some lines to get accessible modules. Here is the output:

ds4vita_log.txt

"SceMotion" isn't an accessible module. However, undocumented "SceMotionDev" module exists. My guess is that "SceMotion" is just a "helper" for "SceMotionDev" and it is loaded only in application context.

@xerpi
Copy link
Owner

xerpi commented Aug 14, 2017

Yeah that's right, SceDriverUser is the user module that is a wrapper from SceMotionDev to SceMotion, as you can see here and here.

@OperationNT414C
Copy link
Author

OperationNT414C commented Aug 25, 2017

Hello xerpi,

Thank you for you clarification.
In fact, my main purpose was to understand how "ds4vita" connects to the PS Vita through BlueTooth and see if the PS TV follows the same protocol. By "luck", it is the case. :-)

From this knowledge (thanks to your code ;-) ), I was able to create plugins for PS TV which catch DS3/4 controllers BlueTooth signal, retrieve accelerometer/gyroscope sensor data and interpret them for "SceMotion" calls. Here is the code:
https://github.com/OperationNT414C/DSMotion

It would have been better to directly hook "SceMotionDev" calls and inject sensors retrieved data but those functions are not documented. Do you know any procedure to "understand" how an undocumented function works? (I mean, at least, knowing the function signature)

Those plugins also work on a real PS Vita with "ds3vita" and "ds4vita". However, with "ds3vita", motion sensors data seems to much spaced over time. The PS TV driver for DS3 doesn't have this issue: do you think it could be related to the data sent through call "ds3_set_operational"?

Anyway, it is not an important usecase :-). Thank you again for your sources, I wouldn't be able to do it without them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants