The online racing simulator
ForceFeedback Inspector (aka shake it baby)
(13 posts, started )
ForceFeedback Inspector (aka shake it baby)
I once figured out that I could use an application that would allow me to generate any force feedback effect supported by a device so that I could sniff the USB communication and see what raw data the device actually gets. There doesn't seem to be anything like this around so I kinda hacked myself up such tool.

What I present here is a bit of a testing version of ForceFeedback Inspector. If you'd like to give it a try and report back any issues, I'd appreciate it.
If nothing else it could serve as an example how to use force feedback with SlimDX as some working sample code was pretty hard to come by.
Have fun!

+ Use OBJECTIDS instead of OBJECTOFFSETS to indentify Force Feedback actuators. This might resolve the E_INVALIDARG exception upon effect creation.
+ Unacquire device before changing axes range.

+ Doesn't hang on attempt to update device's status when the application looses focus
+ Slightly more organized error reporting
+ Add description for "Directions" effect parameter
(+) More strings moved to resources, a little bit of code reorganizing for better readability

+ Bumped the required .NET runtime version to 4.0
+ Built against January 2012 version of SlimDX
+ Added tooltips to force feedback parameters
+ Removed ClickOnce installer. You may now uninstall the previous versions from "Programs and Features" (Vista+) or "Add/Remove programs"(XP)
To run this application, you will need SlimDX x86 runtime to be installed. (You probably don't have it even if you were using this tool before)

+ Supports up to 8 force feedback effects being played back at once
+ Supports multiple force feedback devices connected at once (untested)
+ Shows hardware information about connected devices
+ Numerous code cleanups and improvements
- In order to follow Microsoft specs, the application releases acquired devices when it looses focus

Known issue: Attempt to create a Ramp Force effect throws E_INVALIDARG exception, although it could as well be a bug in SlimDX or Logitech drivers.
- Create Directions controls in an extra panel, don't add them to GroupBox
- Add better code commentary to some sections
- Describe what each FFB effect parameter is for (MSDN database kinda sucks).
Attached files - 41.9 KB - 3705 views - 41 KB - 1075 views
I get an error when trying to run it... "The program has stopped working".
Whops, I knew this was way too easy, should be fixed now.
BTW, to be able to build the source yourself you'll need to have SlimDX SDK installed (you wouldn' guess that, would you? .
Just tried it, but so far all I get is "Cannot acquire the device. Make sure no other application is using the device"
This is something I wouldn't expect to fail as it's just a DirectInput call handled by DirectX. It worked for me with Logitech devices, perhaps some other manufacturers' drivers might have a problem with "CooperativeLevel.Background | CooperativeLevel.Exclusive" which IIRC is somewhat out of DX specs (although it works for me:shrug
Missed your reply, thought I had subscribed properly.

I was trying this with a G25. I can try it on a second PC soon.
If you won't be able to get it working anywhere, I guess I could tweak a few out-of-specs hacks in the source... I didn't really debug it as I made it as an ad-hoc tool for myself
Same on the second machine (much less devices attached, G25 again).
If I just use "Send effect" with the startup values (10000|-1|0|0|-1 & 5000 & 0)
I get "Cannot create effect. E_INVALDARG: An invalid par. (...) -21470248)"

I'd be very thankful if you could have another look at some point. Maybe you could revisit your todo list as well
I was so ashamed of the original version that I decided to update it to something that almost looks like a legitimate application. Have fun...
Nice to see progress!

Unfortunately (just a very quick test) I get the same error message (but with "-2147024809" this time).
Let me know if any information could be helpful.
The first stop would be to check if you have .NET 3.5 SP1 installed. The same goes for your device drivers. If none of these help, you could try changing the default values of the effect, maybe your device just doesn't like them for whatever obscure reason...
Bump to v2.1.0.0, as of now FFBInspector needs .NET 4.0 and manually installed SlimDX libraries.
Update to v2.2.0.0, fixes one embarrasing bug.

ForceFeedback Inspector (aka shake it baby)
(13 posts, started )