Force feedback driver problems.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi all.

I'm trying to write a force feedback driver for a custom joystick that
is not connected through a USB port.

I've adapted the vhidmini example from the 2003 DDK and copied a report
descriptor from an existing joystick.

I'm using this setup:

* 2003 DDK
* Testing on a Windows 2000 professional and a Windows XP professional
machine.
* DevicesArePolled is set to TRUE in my driver.

The joystick driver works great. DirectX enumerates it as a force
feedback joystick and starts to poll it for it's positions as soon as I
start one of the joystick samples from the DirectX SDK.

Now to my problems:

If I register my own driver as the joysticks force feedback driver.
DirectX sends force commands to the driver perfectly (I'm using the
ffdrv1 example from the DDK here) but for some reason DirectX stops
polling my kernel mode driver for the position of the joystick.

If I stick with the default force feedback driver (pid.dll) the polling
works fine. I get a couple of feature report requests for my "pid pool
report" and then a couple of write reports to my "PID Device Control
Report" and "Set Device Gain Report" but I never get any other calls
from DirectX. The Joystick that I copied the report descriptor from
doesn't use pid.dll so I suspect that the report descriptor isn't 100%
compatible with pid.dll and therefore pid.dll doesn't know how to send
the forces to my kernel mode driver.

The debug output from DirectX shows an error "Device is not acquired in
exclusive mode" when I use pid.dll as force feedback driver.
I'm using a standard example from the DirectX SDK to test that works
fine for the other joystick.
I've not opened any handle to the driver from any other application.
The joystick looks fine both in DXDiag and DX Caps Viewer.

My questions:

* Why does DirectX stop to poll my joystick for it's positions when I
use a custom Force Feedback driver? To register a custom Force Feedback
driver I simply change the CLSID under the OEMForceFeedback of my
joystick regkey to the CLSID of my ffdrv1.dll. Is there anything else
that I have to do?

* Where can I get my hands on a working report descriptor that is
compatible with pid.dll? (The one in the PID document on usb.org isn't
recognized as a force feedback joystick at all by DirectX)

If anyone can help me with this I'd be very grateful.

/Frasse.

.



Relevant Pages

  • Re: Analog Gamepads
    ... Descent has a little bit of a bug anyway, in that it doesn't allow for rounding errors in it's calculations, so whenever you're using a joystick, even if it is perfectly centered the ship still moves around a little. ... The absolute most a gamepad or OS should do is standardize the values, so that the center of the stick and the extreme positions have defined values. ... For example, the Linux joystick drivers always report numbers that range from -32767 to +32767, with 0 at the center, regardless of what the actual device reports. ... If a game needs that, it's up to the game to implement whatever algorithm works best for that game. ...
    (alt.lang.asm)
  • [patch 08/13] input: force feedback driver for PID devices
    ... Add force feedback driver for PID devices. ... * Send envelope report to the device ...
    (Linux-Kernel)
  • [patch 07/12] input: force feedback driver for PID devices
    ... Add force feedback driver for PID devices. ... * Send envelope report to the device ...
    (Linux-Kernel)
  • Re: PS3s Joystick on FreeBSD (can be possible?)
    ... Do you know about any progress with joystick supports? ... ugen1.5: at usbus1 ... it may already work in e.g. SDL games. ... Uses some non-standart report (i.e. reporting buttons/axes as ...
    (freebsd-current)
  • Re: Combat Flight Simulator and Combat Flight Simulator 2
    ... it is a Microsoft Game, ... recognise either MS Sidewinder Precision 2 joystick or Logitech Extreme ... you might run the DirectX diagnostic - ... is your joystick a "Wingman Extreme" or a "Wingman Extreme ...
    (microsoft.public.windows.vista.games)