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

JslSetRumble GetOverlappedResult (hidwrite/hid.c) doesn't return (blocks) #63

Open
m-7761 opened this issue Jul 21, 2024 · 2 comments
Open

Comments

@m-7761
Copy link

m-7761 commented Jul 21, 2024

I can kind of get this API to work if I only use it every so many game frames, and disable the WAIT requirement on GetOverlappedResult.

Even still it freezes and crashes. If I take no countermeasures the game freezes (locks up) as soon as the rumble in nonzero.

This function is being called either way, so I imagine the device ignores values that don't change the rumble state.

I realize this is a different library, and my source code for your project is dated. I had/have a version that doesn't recognize the DualSense for JslSetRumble because the DS4 enum is used to test for it, but I can see that's been fixed in your code here on Github. Anyhow, that's how old my code is.

Edited: I'm just starting out and doing things in my main render thread. I'm thinking that might be a bad design.

@JibbSmart
Copy link
Owner

It's probably better to do input on a different thread. But still, JslSetRumble shouldn't be causing crashes. How often are you calling it? Is there some kind of error, or is it just taking too long to return? Does it always return eventually as far as you can tell?

Cheers

@m-7761
Copy link
Author

m-7761 commented Jul 22, 2024

I'm kind of using it now, but it's finicky. It seems like manually setting it to 0 (or 0,0) helps. I'm initiating it from a main thread, and having it tail off in a utility thread that manages cursors and stuff.

BTW I'm trying to add it to this (https://swordofmoonlight.itch.io/k) project... and game maker system. I've also been able to use the motion feedback to let players spin "items" around as if they're in their hand. It helps in that case to get the initial state of the controller (when the item is selected) and cancel it out in the rotation. I assume that's something games that use motion (somehow) have to consider.

It's probably better to do input on a different thread. But still, JslSetRumble shouldn't be causing crashes. How often are you calling it? Is there some kind of error, or is it just taking too long to return? Does it always return eventually as far as you can tell?

It's never returning, but it eventually started crashing after a while. GetOverlappedResult is set to WAIT, and it just happily waits forever because the driver isn't responding or something. I'm not sure what is considered sensible usage of rumble. I'm trying to let it "telegraph" monster "attacks" because in this kind of game catching them by eye seems too slow/ambiguous to not frustrate.

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