Haptic Upload Error - DIERR_INVALIDPARAM

Micah Brening <micah.brening gmail.com> writes:

Uploading effects
effect 0: Sine Wave
UPLOADING EFFECT ERROR: Haptic error Unable to create effect

Aborting program execution.

An update on this matter.

The HRESULT error I am getting is DIERR_INVALIDPARAM (0x80070057)

I do not know which parameter yet.
I’ll keep looking, but if someone has some ideas, that’d be great.
Especially the Haptic writer, if possible.

That’s the news so far.

Micah

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

Micah Brening wrote:

Micah Brening <micah.brening gmail.com> writes:

Uploading effects
effect 0: Sine Wave
UPLOADING EFFECT ERROR: Haptic error Unable to create effect

Error when uploading effect to the device which is the most common.

Aborting program execution.

An update on this matter.

The HRESULT error I am getting is DIERR_INVALIDPARAM (0x80070057)

Yes. This error is soo generic it can mean a billion things, it doesn’t
mean much. 99% of the create effect errors will have this. It could be
anything from coordinate type not supported to it not liking the attack
envelope.

I do not know which parameter yet.
I’ll keep looking, but if someone has some ideas, that’d be great.
Especially the Haptic writer, if possible.

This is tricky to debug especially since windows handles force feedback
in a pretty ugly way. It basically has you pass a callback function
with available effects, but while an effect may support Sine Wave, it
doesn’t necessarily support the attack, or spherical coordinates for
example. That makes it all the trickier when trying to handle that
cross-platformwise.

Another thing is that when you run it you get a lot of supported
effects. The device name says it’s a gamepad, is it really a gamepad?
or is it some sort of joystick? A gamepad shouldn’t have constant
effect, nor the conditionals (friction, spring, damper, inertia) nor
ramp. They usually have periodic effects + custom effect (which is
basically a periodic effect).

I’m thinking my check is failing to discern the device type, or
something screwy is going on. Could also be a driver issue, but i can’t
discard me being at fault yet. I found like 5 bugs in a mac os x driver
when I was debugging the haptic subsystem on mac.

Things to do to debug. First you should dereference the entire
SDL_HapticEffect and DIEFFECT including subpointers that come out of the
function SDL_SYS_ToDIEFFECT. This will indicate what exactly is the
effect being passed.

Next you DI_EffectCallback to make sure it really has the supported
devices available. Ideally you should get each LPCDIEFFECTINFO
dereferenced again.

And finally you should check DI_DeviceObjectCallback to make sure the
number of axes are correct and that they have force feedback, thes
should be the same you see in SDL_SYS_ToDIEFFECT.

It’s a lot of work, I know, but debugging the directinput haptic stuff
is a major PITA. The idea of giving no limits to what features of
effects a device maker can remove or add pretty much makes it so you
have to do things the “directinput” way, which is pretty horrible to say
the least.

I hope this clears things up a bit. If you can send me all the stuff I
mention above, I can most likely find out where the error is. Otherwise
I’m pretty stuck, since I have no idea what could cause it. The current
code did work when I tested it on my rumplepad 2, so there must be
something weird somewhere.

Edgar
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkj1hP0ACgkQolm4VNX3QTzT8ACfTm2gn193Y/4M0wRId3U38I+l
qx0AoI+cYgRDtzMg8Ib9NKcyVRO90eZR
=oyHc
-----END PGP SIGNATURE-----