Reverse Engineering the Force Feedback Pro

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
cal
DBB Ace
DBB Ace
Posts: 29
Joined: Sat Jan 07, 2012 6:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by cal »

That would be more than interesting. Last night, I got the USB.org's sample PID HID working (enumerates and I get sensible FFB data to the stick) with LUFA, but even with that HID, the OEMForceFeedback-registry key's values for Effects lack the binding to the X-Y-axis and I need to manually modify the entries (enable two bits in the Attributes-value that bind X and Y axis to the effect respectively) in order for the joystick to be considered as FFB device. I also need to figure out what response messages I need to give back to PC to certain FFB-commands the stick receives to give proper feedback on creating an effect.

It could be possible that the FFP2's HID and protocol might give some insight on the latter topic. Altho, I am afraid that FFP2 is actually working via MS's custom drivers for Sidewinders instead of using the standard PID HID-driver. Thus, its HID descriptor might not help that much.

On the other hand, if the standard PID approach doesn't work well, it might be possible (or even easier) to mimic FFP2 with the 3DPVert and use its drivers and protocol for FFP-adaptation. I understood that feature-wise, FFP2 and FFP are very similar (same buttons, axis and effects). Do you know if force feedback works also in 64-bit Windows 7 with FFP2 - meaning that the drivers are still maintained?
User avatar
Grendel
3d Pro Master
3d Pro Master
Posts: 4390
Joined: Mon Oct 28, 2002 3:01 am
Location: Corvallis OR, USA

Re: Reverse Engineering the Force Feedback Pro

Post by Grendel »

I don't know for sure but I bet W7 still supports the FFP2. Give me a few days, I'll try to capture the FFP2s descriptors.
NamelessPFG
DBB Cadet
DBB Cadet
Posts: 6
Joined: Tue Jan 24, 2012 3:18 pm

Re: Reverse Engineering the Force Feedback Pro

Post by NamelessPFG »

I own a SideWinder Force-Feedback 2 and can confirm that not only does it work on Vista/Win7 64-bit, but that force-feedback does indeed work in every game I know that has it, even with nothing more than the bare-bone drivers already present in Vista/Win7 64-bit. Good thing all of them allow in-game configuration of the FFB, too, because the drivers sure don't!

It also has a very tight centering force with practically no center play, but the centering forces are also gradual and ramp up more as you move away from center, unlike the Logitech WingMan Strike Force 3D I've tried. No wonder the SWFFB2 has the cult following that it does in the flight sim community over a decade after its release and discontinuation...it's not just a FFB stick, but a FFB stick with well-implemented forces.

However, low-level driver work and descriptor sniffing is beyond my league. I'll have to leave that to Grendel.
cal
DBB Ace
DBB Ace
Posts: 29
Joined: Sat Jan 07, 2012 6:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by cal »

That's comforting to know, that the plan B of using FFP2's USB protocol is at least possible in Win7 64bit. Hopefully tho, we can get the PID driver would work for it. That way it would also allow extensions (like those extra sliders for e.g. elevator/rudder trims in IL2). FFP2's custom driver (if it uses one) might not allow for such extensions.
User avatar
Grendel
3d Pro Master
3d Pro Master
Posts: 4390
Joined: Mon Oct 28, 2002 3:01 am
Location: Corvallis OR, USA

Re: Reverse Engineering the Force Feedback Pro

Post by Grendel »

Entertaining -- the FF2's report descriptor is 1343 bytes long :shock:. 3 Feature reports, 14 output reports, and 2 input reports. Here are the descriptors decoded by the analyzer software. I attached the trace -- download and remove the .txt extension then load into DataCenter (64 bit version).

Regular descriptors:

Code: Select all

 Device Descriptor	    	 Radix:  
bLength	18
bDescriptorType	DEVICE (0x01)
bcdUSB	1.10 (0x0110)
bDeviceClass	Defined in Interface (0x00)
bDeviceSubClass	Defined in Interface (0x00)
bDeviceProtocol	Defined in Interface (0x00)
bMaxPacketSize0	8
idVendor	0x045e
idProduct	0x001b
bcdDevice	a.00 (0x0a00)
iManufacturer	Not Requested (1)
iProduct	SideWinder Force Feedback 2 Joystick (2)
iSerialNumber	None (0)
bNumConfigurations	1

  Configuration Descriptor	    	 Radix:  
bLength	9
bDescriptorType	CONFIGURATION (0x02)
wTotalLength	41
bNumInterfaces	1
bConfigurationValue	1
iConfiguration	None (0)
bmAttributes.Reserved	0
bmAttributes.RemoteWakeup	RemoteWakeup Supported (0b1)
bmAttributes.SelfPowered	Bus Powered (0b0)
bMaxPower	100mA (0x32)

 Interface Descriptor	    	 Radix:  
bLength	9
bDescriptorType	INTERFACE (0x04)
bInterfaceNumber	0
bAlternateSetting	0
bNumEndpoints	2
bInterfaceClass	Human Interface Device (0x03)
bInterfaceSubClass	None (0x00)
bInterfaceProtocol	None (0x00)
iInterface	None (0)

 HID Descriptor	    	 Radix:  
bLength	9
bDescriptorType	HID (33)
bcdHID	1.00 (0x0100)
bCountryCode	0x00
bNumDescriptors	1
bDescriptorType	REPORT (34)
wDescriptorLength	1343

  Endpoint Descriptor	    	 Radix:  
bLength	7
bDescriptorType	ENDPOINT (0x05)
bEndpointAddress	1 IN (0b10000001)
bmAttributes.TransferType	Interrupt (0b11)
wMaxPacketSize.PacketSize	64
wMaxPacketSize.Transactions	One transaction per microframe if HS (0b00)
bInterval	1

  Endpoint Descriptor	    	 Radix:  
bLength	7
bDescriptorType	ENDPOINT (0x05)
bEndpointAddress	2 OUT (0b00000010)
bmAttributes.TransferType	Interrupt (0b11)
wMaxPacketSize.PacketSize	16
wMaxPacketSize.Transactions	One transaction per microframe if HS (0b00)
bInterval	4
Here's the beast -- the Report Descriptor:

Code: Select all

Get Report Descriptor
 General	    	 Radix:  
Timestamp	0:09.269.305.483
Duration	169.997.583 ms
Length	1343 Bytes
  Report Descriptor	    	 Radix:  
Usage Page	Generic Desktop Controls (0x01)
Usage	Joystick (0x04)
Collection	Application (0x01)
  Report ID	1
  Usage	Pointer (0x01)
  Collection	Physical (0x00)
    Unit	0
    Unit Exponent	0
    Logical Minimum	-512
    Logical Maximum	511
    Physical Minimum	0
    Physical Maximum	1023
    Report Count	1
    Report Size	10
    Usage	X (0x30)
    Input	Data (0x02)
    Report Size	6
    Input	Constant (0x01)
    Usage	Y (0x31)
    Report Size	10
    Input	Data (0x02)
    Report Size	6
    Report Count	1
    Input	Constant (0x01)
    Logical Minimum	-32
    Logical Maximum	31
    Physical Minimum	0
    Physical Maximum	63
    Unit	20
    Usage	Rz (0x35)
    Input	Data (0x02)
    Report Size	2
    Input	Constant (0x01)
    Unit	0
  End Collection	
  Report Size	7
  Report Count	1
  Logical Minimum	0
  Logical Maximum	127
  Physical Minimum	0
  Physical Maximum	127
  Usage	Slider (0x36)
  Input	Data (0x02)
  Report Size	1
  Input	Constant (0x01)
  Usage	Hat switch (0x39)
  Logical Minimum	0
  Logical Maximum	7
  Physical Minimum	0
  Physical Maximum	315
  Unit	20
  Report Size	4
  Report Count	1
  Input	Data (0x42)
  Report Count	1
  Input	Constant (0x01)
  Unit	0
  Usage Page	Button (0x09)
  Usage Minimum	Button 1 (primary/trigger) (0x01)
  Usage Maximum	Button 8 (0x08)
  Logical Minimum	0
  Logical Maximum	1
  Physical Minimum	0
  Physical Maximum	1
  Report Count	8
  Report Size	1
  Input	Data (0x02)
  Report Count	4
  Report Size	8
  Input	Constant (0x01)
  Usage Page	PID Page (0x0f)
  Usage	Undefined (0x92)
  Collection	Logical (0x02)
    Report ID	2
    Usage	Undefined (0x9f)
    Usage	Undefined (0xa0)
    Usage	Undefined (0xa4)
    Usage	Undefined (0xa5)
    Usage	Undefined (0xa6)
    Logical Minimum	0
    Logical Maximum	1
    Physical Minimum	0
    Physical Maximum	1
    Report Size	1
    Report Count	5
    Input	Data (0x02)
    Report Count	3
    Input	Constant (0x03)
    Usage	Undefined (0x94)
    Logical Minimum	0
    Logical Maximum	1
    Physical Minimum	0
    Physical Maximum	1
    Report Size	1
    Report Count	1
    Input	Data (0x02)
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	7
    Report Count	1
    Input	Data (0x02)
  End Collection	
  Usage	Undefined (0x21)
  Collection	Logical (0x02)
    Report ID	1
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x25)
    Collection	Logical (0x02)
      Usage	Undefined (0x26)
      Usage	Undefined (0x27)
      Usage	Undefined (0x30)
      Usage	Undefined (0x31)
      Usage	Undefined (0x32)
      Usage	Undefined (0x33)
      Usage	Undefined (0x34)
      Usage	Undefined (0x40)
      Usage	Undefined (0x41)
      Usage	Undefined (0x42)
      Usage	Undefined (0x43)
      Usage	Undefined (0x28)
      Logical Maximum	12
      Logical Minimum	1
      Physical Minimum	1
      Physical Maximum	12
      Report Size	8
      Report Count	1
      Output	Data (0x00)
    End Collection	
    Usage	Undefined (0x50)
    Usage	Undefined (0x54)
    Usage	Undefined (0x51)
    Logical Minimum	0
    Logical Maximum	32767
    Physical Minimum	0
    Physical Maximum	32767
    Unit	4099
    Unit Exponent	-3
    Report Size	16
    Report Count	3
    Output	Data (0x02)
    Unit Exponent	0
    Unit	0
    Usage	Undefined (0x52)
    Logical Minimum	0
    Logical Maximum	255
    Physical Minimum	0
    Physical Maximum	10000
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x53)
    Logical Minimum	1
    Logical Maximum	8
    Physical Minimum	1
    Physical Maximum	8
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x55)
    Collection	Logical (0x02)
      Usage Page	Generic Desktop Controls (0x01)
      Usage	X (0x30)
      Usage	Y (0x31)
      Logical Minimum	0
      Logical Maximum	1
      Report Size	1
      Report Count	2
      Output	Data (0x02)
    End Collection	
    Usage Page	PID Page (0x0f)
    Usage	Undefined (0x56)
    Report Count	1
    Output	Data (0x02)
    Report Count	5
    Output	Constant (0x03)
    Usage	Undefined (0x57)
    Collection	Logical (0x02)
      Usage	Instance 1 (0x000a0001)
      Usage	Instance 2 (0x000a0002)
      Unit	20
      Unit Exponent	-2
      Logical Minimum	0
      Logical Maximum	255
      Physical Minimum	0
      Physical Maximum	0
      Unit	0
      Report Size	8
      Report Count	2
      Output	Data (0x02)
      Unit Exponent	0
      Unit	0
    End Collection	
    Usage Page	PID Page (0x0f)
    Usage	Undefined (0xa7)
    Unit	4099
    Unit Exponent	-3
    Logical Minimum	0
    Logical Maximum	32767
    Physical Minimum	0
    Physical Maximum	32767
    Report Size	16
    Report Count	1
    Output	Data (0x02)
    Unit	0
    Unit Exponent	0
  End Collection	
  Usage Page	PID Page (0x0f)
  Usage	Undefined (0x5a)
  Collection	Logical (0x02)
    Report ID	2
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x5b)
    Usage	Undefined (0x5d)
    Logical Minimum	0
    Logical Maximum	255
    Physical Minimum	0
    Physical Maximum	10000
    Report Count	2
    Output	Data (0x02)
    Usage	Undefined (0x5c)
    Usage	Undefined (0x5e)
    Unit	4099
    Unit Exponent	-3
    Logical Maximum	32767
    Physical Maximum	32767
    Report Size	16
    Output	Data (0x02)
    Physical Maximum	0
    Unit	0
    Unit Exponent	0
  End Collection	
  Usage	Undefined (0x5f)
  Collection	Logical (0x02)
    Report ID	3
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x23)
    Logical Minimum	0
    Logical Maximum	1
    Physical Minimum	0
    Physical Maximum	1
    Report Size	4
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x58)
    Collection	Logical (0x02)
      Usage	Instance 1 (0x000a0001)
      Usage	Instance 2 (0x000a0002)
      Report Size	2
      Report Count	2
      Output	Data (0x02)
    End Collection	
    Logical Minimum	-128
    Logical Maximum	127
    Physical Minimum	-10000
    Physical Maximum	10000
    Usage	Undefined (0x60)
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Physical Minimum	-10000
    Physical Maximum	10000
    Usage	Undefined (0x61)
    Usage	Undefined (0x62)
    Report Count	2
    Output	Data (0x02)
    Logical Minimum	0
    Logical Maximum	255
    Physical Minimum	0
    Physical Maximum	10000
    Usage	Undefined (0x63)
    Usage	Undefined (0x64)
    Report Size	8
    Report Count	2
    Output	Data (0x02)
    Usage	Undefined (0x65)
    Physical Maximum	10000
    Report Count	1
    Output	Data (0x02)
  End Collection	
  Usage	Undefined (0x6e)
  Collection	Logical (0x02)
    Report ID	4
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x70)
    Logical Minimum	0
    Logical Maximum	255
    Physical Minimum	0
    Physical Maximum	10000
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x6f)
    Logical Minimum	-128
    Logical Maximum	127
    Physical Minimum	-10000
    Physical Maximum	10000
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x71)
    Unit	20
    Unit Exponent	-2
    Logical Minimum	0
    Logical Maximum	255
    Physical Minimum	0
    Physical Maximum	0
    Output	Data (0x02)
    Usage	Undefined (0x72)
    Logical Maximum	32767
    Physical Maximum	32767
    Unit	4099
    Unit Exponent	-3
    Report Size	16
    Report Count	1
    Output	Data (0x02)
    Unit	0
    Unit Exponent	0
  End Collection	
  Usage	Undefined (0x73)
  Collection	Logical (0x02)
    Report ID	5
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x70)
    Logical Minimum	-255
    Logical Maximum	255
    Physical Minimum	-10000
    Physical Maximum	10000
    Report Size	16
    Report Count	1
    Output	Data (0x02)
  End Collection	
  Usage	Undefined (0x74)
  Collection	Logical (0x02)
    Report ID	6
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x75)
    Usage	Undefined (0x76)
    Logical Minimum	-128
    Logical Maximum	127
    Physical Minimum	-10000
    Physical Maximum	10000
    Report Size	8
    Report Count	2
    Output	Data (0x02)
  End Collection	
  Usage	Undefined (0x68)
  Collection	Logical (0x02)
    Report ID	7
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x6c)
    Logical Minimum	0
    Logical Maximum	10000
    Physical Minimum	0
    Physical Maximum	10000
    Report Size	16
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x69)
    Logical Minimum	-127
    Logical Maximum	127
    Physical Minimum	0
    Physical Maximum	255
    Report Size	8
    Report Count	12
    Output	Data (0x0102)
  End Collection	
  Usage	Undefined (0x66)
  Collection	Logical (0x02)
    Report ID	8
    Usage Page	Generic Desktop Controls (0x01)
    Usage	X (0x30)
    Usage	Y (0x31)
    Logical Minimum	-127
    Logical Maximum	127
    Physical Minimum	0
    Physical Maximum	255
    Report Size	8
    Report Count	2
    Output	Data (0x02)
  End Collection	
  Usage Page	PID Page (0x0f)
  Usage	Undefined (0x77)
  Collection	Logical (0x02)
    Report ID	10
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x78)
    Collection	Logical (0x02)
      Usage	Undefined (0x79)
      Usage	Undefined (0x7a)
      Usage	Undefined (0x7b)
      Logical Minimum	1
      Logical Maximum	3
      Report Size	8
      Report Count	1
      Output	Data (0x00)
    End Collection	
    Usage	Undefined (0x7c)
    Logical Minimum	0
    Logical Maximum	255
    Physical Minimum	0
    Physical Maximum	255
    Output	Data (0x02)
  End Collection	
  Usage	Undefined (0x90)
  Collection	Logical (0x02)
    Report ID	11
    Usage	Undefined (0x22)
    Logical Maximum	40
    Logical Minimum	1
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
  End Collection	
  Usage	Undefined (0x96)
  Collection	Logical (0x02)
    Report ID	12
    Usage	Undefined (0x97)
    Usage	Undefined (0x98)
    Usage	Undefined (0x99)
    Usage	Undefined (0x9a)
    Usage	Undefined (0x9b)
    Usage	Undefined (0x9c)
    Logical Minimum	1
    Logical Maximum	6
    Report Size	8
    Report Count	1
    Output	Data (0x00)
  End Collection	
  Usage	Undefined (0x7d)
  Collection	Logical (0x02)
    Report ID	13
    Usage	Undefined (0x7e)
    Logical Minimum	0
    Logical Maximum	255
    Physical Minimum	0
    Physical Maximum	10000
    Report Size	8
    Report Count	1
    Output	Data (0x02)
  End Collection	
  Usage	Undefined (0x6b)
  Collection	Logical (0x02)
    Report ID	14
    Usage	Undefined (0x22)
    Logical Minimum	1
    Logical Maximum	40
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x6d)
    Logical Minimum	0
    Logical Maximum	255
    Physical Minimum	0
    Physical Maximum	255
    Report Size	8
    Report Count	1
    Output	Data (0x02)
    Usage	Undefined (0x51)
    Unit	4099
    Unit Exponent	-3
    Logical Minimum	0
    Logical Maximum	32767
    Physical Minimum	0
    Physical Maximum	32767
    Report Size	16
    Report Count	1
    Output	Data (0x02)
    Unit Exponent	0
    Unit	0
  End Collection	
  Usage	Undefined (0xab)
  Collection	Logical (0x02)
    Report ID	1
    Usage	Undefined (0x25)
    Collection	Logical (0x02)
      Usage	Undefined (0x26)
      Usage	Undefined (0x27)
      Usage	Undefined (0x30)
      Usage	Undefined (0x31)
      Usage	Undefined (0x32)
      Usage	Undefined (0x33)
      Usage	Undefined (0x34)
      Usage	Undefined (0x40)
      Usage	Undefined (0x41)
      Usage	Undefined (0x42)
      Usage	Undefined (0x43)
      Usage	Undefined (0x28)
      Logical Maximum	12
      Logical Minimum	1
      Physical Minimum	1
      Physical Maximum	12
      Report Size	8
      Report Count	1
      Feature	Data (0x00)
    End Collection	
    Usage Page	Generic Desktop Controls (0x01)
    Usage	Byte Count (0x3b)
    Logical Minimum	0
    Logical Maximum	511
    Physical Minimum	0
    Physical Maximum	511
    Report Size	10
    Report Count	1
    Feature	Data (0x02)
    Report Size	6
    Feature	Constant (0x01)
  End Collection	
  Usage Page	PID Page (0x0f)
  Usage	Undefined (0x89)
  Collection	Logical (0x02)
    Report ID	2
    Usage	Undefined (0x22)
    Logical Maximum	40
    Logical Minimum	1
    Physical Minimum	1
    Physical Maximum	40
    Report Size	8
    Report Count	1
    Feature	Data (0x02)
    Usage	Undefined (0x8b)
    Collection	Logical (0x02)
      Usage	Undefined (0x8c)
      Usage	Undefined (0x8d)
      Usage	Undefined (0x8e)
      Logical Maximum	3
      Logical Minimum	1
      Physical Minimum	1
      Physical Maximum	3
      Report Size	8
      Report Count	1
      Feature	Data (0x00)
    End Collection	
    Usage	Undefined (0xac)
    Logical Minimum	0
    Logical Maximum	0
    Physical Minimum	0
    Physical Maximum	0
    Report Size	16
    Report Count	1
    Feature	Data (0x00)
  End Collection	
  Usage	Undefined (0x7f)
  Collection	Logical (0x02)
    Report ID	3
    Usage	Undefined (0x80)
    Report Size	16
    Report Count	1
    Logical Minimum	0
    Physical Minimum	0
    Logical Maximum	0
    Physical Maximum	0
    Feature	Data (0x02)
    Usage	Undefined (0x83)
    Logical Maximum	255
    Physical Maximum	255
    Report Size	8
    Report Count	1
    Feature	Data (0x02)
    Usage	Undefined (0xa9)
    Usage	Undefined (0xaa)
    Report Size	1
    Report Count	2
    Logical Minimum	0
    Logical Maximum	1
    Physical Minimum	0
    Physical Maximum	1
    Feature	Data (0x02)
    Report Size	6
    Report Count	1
    Feature	Constant (0x03)
  End Collection	
End Collection	

  Sample Input Report [1]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (10b)	X
Byte 3.0 (10b)	Y
Byte 5.0 (6b)	Rz
Byte 6.0 (7b)	Pointer
Byte 7.0 (4b)	Hat switch
Byte 8.0 (1b)	Button 1 (primary/trigger)
Byte 8.1 (1b)	Button 2 (secondary)
Byte 8.2 (1b)	Button 3 (tertiary)
Byte 8.3 (1b)	Button 4
Byte 8.4 (1b)	Button 5
Byte 8.5 (1b)	Button 6
Byte 8.6 (1b)	Button 7
Byte 8.7 (1b)	Button 8
  Sample Input Report [2]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (1b)	Undefined
Byte 1.1 (1b)	Undefined
Byte 1.2 (1b)	Undefined
Byte 1.3 (1b)	Undefined
Byte 1.4 (1b)	Undefined
Byte 2.0 (1b)	Undefined
Byte 2.1 (7b)	Undefined

  Sample Output Report [1]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (8b)	PID Page Array
Byte 3.0 (16b)	Undefined
Byte 5.0 (16b)	Undefined
Byte 7.0 (16b)	Undefined
Byte 9.0 (8b)	Undefined
Byte 10.0 (8b)	Undefined
Byte 11.0 (1b)	X
Byte 11.1 (1b)	Y
Byte 11.2 (1b)	Undefined
Byte 12.0 (8b)	Instance 1
Byte 13.0 (8b)	Instance 2
Byte 14.0 (16b)	Undefined
 Sample Output Report [2]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (8b)	Undefined
Byte 3.0 (8b)	Undefined
Byte 4.0 (16b)	Undefined
Byte 6.0 (16b)	Undefined
 Sample Output Report [3]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (4b)	Undefined
Byte 2.4 (2b)	Instance 1
Byte 2.6 (2b)	Instance 2
Byte 3.0 (8b)	Undefined
Byte 4.0 (8b)	Undefined
Byte 5.0 (8b)	Undefined
Byte 6.0 (8b)	Undefined
Byte 7.0 (8b)	Undefined
Byte 8.0 (8b)	Undefined
 Sample Output Report [4]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (8b)	Undefined
Byte 3.0 (8b)	Undefined
Byte 4.0 (8b)	Undefined
Byte 5.0 (16b)	Undefined
 Sample Output Report [5]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (16b)	Undefined
 Sample Output Report [6]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (8b)	Undefined
Byte 3.0 (8b)	Undefined
 Sample Output Report [7]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (16b)	Undefined
Byte 4.0 (8b)	Undefined
Byte 5.0 (8b)	Undefined
Byte 6.0 (8b)	Undefined
Byte 7.0 (8b)	Undefined
Byte 8.0 (8b)	Undefined
Byte 9.0 (8b)	Undefined
Byte 10.0 (8b)	Undefined
Byte 11.0 (8b)	Undefined
Byte 12.0 (8b)	Undefined
Byte 13.0 (8b)	Undefined
Byte 14.0 (8b)	Undefined
Byte 15.0 (8b)	Undefined
 Sample Output Report [8]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	X
Byte 2.0 (8b)	Y
 Sample Output Report [10]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (8b)	PID Page Array
Byte 3.0 (8b)	Undefined
 Sample Output Report [11]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
 Sample Output Report [12]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	PID Page Array
 Sample Output Report [13]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
 Sample Output Report [14]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (8b)	Undefined
Byte 3.0 (16b)	Undefined

  Sample Feature Report [1]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	PID Page Array
Byte 2.0 (10b)	Reserved
 Sample Feature Report [2]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (8b)	Undefined
Byte 2.0 (8b)	PID Page Array
Byte 3.0 (16b)	PID Page Array
  Sample Feature Report [3]	    	 Radix:  
Byte 0.0 (8b)	Report ID
Byte 1.0 (16b)	Undefined
Byte 3.0 (8b)	Undefined
Byte 4.0 (1b)	Undefined
Byte 4.1 (1b)	Undefined
As a dump:

Code: Select all

radix: hexadecimal
05 01 09 04 A1 01 85 01 09 01 A1 00 66 00 00 55
00 16 00 FE 26 FF 01 35 00 46 FF 03 95 01 75 0A
09 30 81 02 75 06 81 01 09 31 75 0A 81 02 75 06
95 01 81 01 15 E0 25 1F 35 00 45 3F 66 14 00 09
35 81 02 75 02 81 01 66 00 00 C0 75 07 95 01 15
00 25 7F 35 00 45 7F 09 36 81 02 75 01 81 01 09
39 15 00 25 07 35 00 46 3B 01 66 14 00 75 04 95
01 81 42 95 01 81 01 66 00 00 05 09 19 01 29 08
15 00 25 01 35 00 45 01 95 08 75 01 81 02 95 04
75 08 81 01 05 0F 09 92 A1 02 85 02 09 9F 09 A0
09 A4 09 A5 09 A6 15 00 25 01 35 00 45 01 75 01
95 05 81 02 95 03 81 03 09 94 15 00 25 01 35 00
45 01 75 01 95 01 81 02 09 22 15 01 25 28 35 01
45 28 75 07 95 01 81 02 C0 09 21 A1 02 85 01 09
22 15 01 25 28 35 01 45 28 75 08 95 01 91 02 09
25 A1 02 09 26 09 27 09 30 09 31 09 32 09 33 09
34 09 40 09 41 09 42 09 43 09 28 25 0C 15 01 35
01 45 0C 75 08 95 01 91 00 C0 09 50 09 54 09 51
15 00 26 FF 7F 35 00 46 FF 7F 66 03 10 55 FD 75
10 95 03 91 02 55 00 66 00 00 09 52 15 00 26 FF
00 35 00 46 10 27 75 08 95 01 91 02 09 53 15 01
25 08 35 01 45 08 75 08 95 01 91 02 09 55 A1 02
05 01 09 30 09 31 15 00 25 01 75 01 95 02 91 02
C0 05 0F 09 56 95 01 91 02 95 05 91 03 09 57 A1
02 0B 01 00 0A 00 0B 02 00 0A 00 66 14 00 55 FE
15 00 26 FF 00 35 00 47 A0 8C 00 00 66 00 00 75
08 95 02 91 02 55 00 66 00 00 C0 05 0F 09 A7 66
03 10 55 FD 15 00 26 FF 7F 35 00 46 FF 7F 75 10
95 01 91 02 66 00 00 55 00 C0 05 0F 09 5A A1 02
85 02 09 22 15 01 25 28 35 01 45 28 75 08 95 01
91 02 09 5B 09 5D 15 00 26 FF 00 35 00 46 10 27
95 02 91 02 09 5C 09 5E 66 03 10 55 FD 26 FF 7F
46 FF 7F 75 10 91 02 45 00 66 00 00 55 00 C0 09
5F A1 02 85 03 09 22 15 01 25 28 35 01 45 28 75
08 95 01 91 02 09 23 15 00 25 01 35 00 45 01 75
04 95 01 91 02 09 58 A1 02 0B 01 00 0A 00 0B 02
00 0A 00 75 02 95 02 91 02 C0 15 80 25 7F 36 F0
D8 46 10 27 09 60 75 08 95 01 91 02 36 F0 D8 46
10 27 09 61 09 62 95 02 91 02 15 00 26 FF 00 35
00 46 10 27 09 63 09 64 75 08 95 02 91 02 09 65
46 10 27 95 01 91 02 C0 09 6E A1 02 85 04 09 22
15 01 25 28 35 01 45 28 75 08 95 01 91 02 09 70
15 00 26 FF 00 35 00 46 10 27 75 08 95 01 91 02
09 6F 15 80 25 7F 36 F0 D8 46 10 27 95 01 91 02
09 71 66 14 00 55 FE 15 00 26 FF 00 35 00 47 A0
8C 00 00 91 02 09 72 26 FF 7F 46 FF 7F 66 03 10
55 FD 75 10 95 01 91 02 66 00 00 55 00 C0 09 73
A1 02 85 05 09 22 15 01 25 28 35 01 45 28 75 08
95 01 91 02 09 70 16 01 FF 26 FF 00 36 F0 D8 46
10 27 75 10 95 01 91 02 C0 09 74 A1 02 85 06 09
22 15 01 25 28 35 01 45 28 75 08 95 01 91 02 09
75 09 76 15 80 25 7F 36 F0 D8 46 10 27 75 08 95
02 91 02 C0 09 68 A1 02 85 07 09 22 15 01 25 28
35 01 45 28 75 08 95 01 91 02 09 6C 15 00 26 10
27 35 00 46 10 27 75 10 95 01 91 02 09 69 15 81
25 7F 35 00 46 FF 00 75 08 95 0C 92 02 01 C0 09
66 A1 02 85 08 05 01 09 30 09 31 15 81 25 7F 35
00 46 FF 00 75 08 95 02 91 02 C0 05 0F 09 77 A1
02 85 0A 09 22 15 01 25 28 35 01 45 28 75 08 95
01 91 02 09 78 A1 02 09 79 09 7A 09 7B 15 01 25
03 75 08 95 01 91 00 C0 09 7C 15 00 26 FF 00 35
00 46 FF 00 91 02 C0 09 90 A1 02 85 0B 09 22 25
28 15 01 35 01 45 28 75 08 95 01 91 02 C0 09 96
A1 02 85 0C 09 97 09 98 09 99 09 9A 09 9B 09 9C
15 01 25 06 75 08 95 01 91 00 C0 09 7D A1 02 85
0D 09 7E 15 00 26 FF 00 35 00 46 10 27 75 08 95
01 91 02 C0 09 6B A1 02 85 0E 09 22 15 01 25 28
35 01 45 28 75 08 95 01 91 02 09 6D 15 00 26 FF
00 35 00 46 FF 00 75 08 95 01 91 02 09 51 66 03
10 55 FD 15 00 26 FF 7F 35 00 46 FF 7F 75 10 95
01 91 02 55 00 66 00 00 C0 09 AB A1 02 85 01 09
25 A1 02 09 26 09 27 09 30 09 31 09 32 09 33 09
34 09 40 09 41 09 42 09 43 09 28 25 0C 15 01 35
01 45 0C 75 08 95 01 B1 00 C0 05 01 09 3B 15 00
26 FF 01 35 00 46 FF 01 75 0A 95 01 B1 02 75 06
B1 01 C0 05 0F 09 89 A1 02 85 02 09 22 25 28 15
01 35 01 45 28 75 08 95 01 B1 02 09 8B A1 02 09
8C 09 8D 09 8E 25 03 15 01 35 01 45 03 75 08 95
01 B1 00 C0 09 AC 15 00 27 FF FF 00 00 35 00 47
FF FF 00 00 75 10 95 01 B1 00 C0 09 7F A1 02 85
03 09 80 75 10 95 01 15 00 35 00 27 FF FF 00 00
47 FF FF 00 00 B1 02 09 83 26 FF 00 46 FF 00 75
08 95 01 B1 02 09 A9 09 AA 75 01 95 02 15 00 25
01 35 00 45 01 B1 02 75 06 95 01 B1 03 C0 C0
Attachments
FF2conct.tdc.txt
Connecting the FF2 to a USB port captured. Remove the .txt extension.
(26.69 KiB) Downloaded 9335 times
cal
DBB Ace
DBB Ace
Posts: 29
Joined: Sat Jan 07, 2012 6:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by cal »

Thanks!

Crivens! It really looks like it is using the PID driver in there instead of a custom one. At least all the PID-related report descriptors are there and looking very familiar. Compared to the USB.org's sample PID HID it is slightly larger (offers a couple of more effect types and some PID states etc.). I'll need to compare these two now and see what is wrong with the USB.org's sample as to why it is not automatically (without RegEdit-magic that is) recognized as a FFB device. On the other hand, the Sidewinder's seem to come with registry keys for FFB from the .inf-files so, in the end, it might be possible that this 3DPVert+FFB might need a simple .inf-file too to make it fully functional. Well have to see. It could still be a problem in descriptor I'm using or the answers I'm giving (which is none now) when the device is first plugged-in to PC and Windows starts to look drivers for it.

Indeed, as you noticed, these PID descriptors tend to get huge and I have only started to understand something on why much of the stuff is there (well, not really understand "why" but at least I can see how it brings more information about the effects protocol).

On the side note; I just got the 3DPVert ported to LUFA and have included a working "enable FFB mode" command there too at startup. I'm still sorting the code a little bit to isolate your original 3DPVert code since you are distributing it with a bit more restrictive license than what I have in store for the FFB code (going out in MIT license to make it simple). This first port however is strictly for FFP and Teensy 2 (I severely amputated it from many of the other parts) since the other sticks have no FFB and at this point I wanted to simplify the prototyping by having as little of moving parts as possible. I'll also have some extra inputs in it to allow additional buttons and potentiometers to be plugged in. It should be quite a simple matter to include the amputated parts back in once the whole thing works together. I'll upload it into the site in a day or two and we are finally approaching the position where I hoped to be in the very early stages of the project :)
cal
DBB Ace
DBB Ace
Posts: 29
Joined: Sat Jan 07, 2012 6:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by cal »

Here's the report descriptors with descriptive texts in place of the "undefined"s. Biggest differences seem to be in the memory management reports and effect indexing mechanism. FF2 also seems to support more force feedback features than FFP (e.g. non-zero phase in periodic effects and startup delay for an effect). So, Microsoft did some other under-the-hood improvements too to the FF2 than just the form factor and USB connectivity.

I would not be surprised to see that the Windows' PID driver is actually made for the FF2 features in mind and it might be required to adhere to that subset and ways of usages its descriptor has...

Code: Select all

Usage Page   Generic Desktop Controls (0x01)
Usage   Joystick (0x04)
Collection   Application (0x01)
  Report ID   1
  Usage   Pointer (0x01)
  Collection   Physical (0x00)
    Unit   0
    Unit Exponent   0
    Logical Minimum   -512
    Logical Maximum   511
    Physical Minimum   0
    Physical Maximum   1023
    Report Count   1
    Report Size   10
    Usage   X (0x30)
    Input   Data (0x02)
    Report Size   6
    Input   Constant (0x01)
    Usage   Y (0x31)
    Report Size   10
    Input   Data (0x02)
    Report Size   6
    Report Count   1
    Input   Constant (0x01)
    Logical Minimum   -32
    Logical Maximum   31
    Physical Minimum   0
    Physical Maximum   63
    Unit   20
    Usage   Rz (0x35)
    Input   Data (0x02)
    Report Size   2
    Input   Constant (0x01)
    Unit   0
  End Collection   
  
  Report Size   7
  Report Count   1
  Logical Minimum   0
  Logical Maximum   127
  Physical Minimum   0
  Physical Maximum   127
  Usage   Slider (0x36)
  Input   Data (0x02)
  Report Size   1
  Input   Constant (0x01)
  Usage   Hat switch (0x39)
  Logical Minimum   0
  Logical Maximum   7
  Physical Minimum   0
  Physical Maximum   315
  Unit   20
  Report Size   4
  Report Count   1
  Input   Data (0x42)
  Report Count   1
  Input   Constant (0x01)
  Unit   0
  Usage Page   Button (0x09)
  Usage Minimum   Button 1 (primary/trigger) (0x01)
  Usage Maximum   Button 8 (0x08)
  Logical Minimum   0
  Logical Maximum   1
  Physical Minimum   0
  Physical Maximum   1
  Report Count   8
  Report Size   1
  Input   Data (0x02)
  
  Report Count   4
  Report Size   8
  Input   Constant (0x01)
  
  ----> Here's the FFB part of it all ---->

  Usage Page   PID Page (0x0f)
  Usage   PID State Report (0x92)
  Collection   Logical (0x02)
    Report ID   2
    Usage   Device Paused (0x9f)
    Usage   Actuators Enabled (0xa0)
    Usage   Safety Switch (0xa4)
    Usage   Actuator Override Switch (0xa5)
    Usage   Actuator Power (0xa6)
    Logical Minimum   0
    Logical Maximum   1
    Physical Minimum   0
    Physical Maximum   1
    Report Size   1
    Report Count   5
    Input   Data (0x02)
    Report Count   3
    Input   Constant (0x03)	
    Usage   Effect Playing (0x94)
    Logical Minimum   0
    Logical Maximum   1
    Physical Minimum   0
    Physical Maximum   1
    Report Size   1
    Report Count   1
    Input   Data (0x02)	
    Usage   Effect Block Index (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   7
    Report Count   1
    Input   Data (0x02)
  End Collection   
  
  Usage   Set Effect Report (0x21)
  Collection   Logical (0x02)
    Report ID   1
    Usage    Effect Block Inde (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Effect Type (0x25)
    Collection   Logical (0x02)
      Usage   ET Constant Force (0x26)
      Usage   ET Ramp (0x27)
      Usage   ET Square (0x30)
      Usage   ET Sine (0x31)
      Usage   ET Triangle (0x32)
      Usage   ET Sawtooth Up (0x33)
      Usage   ET Sawtooth Down (0x34)
      Usage   ET Spring (0x40)
      Usage   ET Damper (0x41)
      Usage   ET Inertia (0x42)
      Usage   ET Friction (0x43)
      Usage   ET Custom Force Data (0x28)
      Logical Maximum   12
      Logical Minimum   1
      Physical Minimum   1
      Physical Maximum   12
      Report Size   8
      Report Count   1
      Output   Data (0x00)
    End Collection   
	
    Usage   Duration (0x50)
    Usage   Trigger Repeat Interval (0x54)
    Usage   Sample Period (0x51)
    Logical Minimum   0
    Logical Maximum   32767
    Physical Minimum   0
    Physical Maximum   32767
    Unit   4099
    Unit Exponent   -3
    Report Size   16
    Report Count   3
    Output   Data (0x02)
	
    Unit Exponent   0
    Unit   0
    Usage   Gain (0x52)
    Logical Minimum   0
    Logical Maximum   255
    Physical Minimum   0
    Physical Maximum   10000
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Trigger Button (0x53)
    Logical Minimum   1
    Logical Maximum   8
    Physical Minimum   1
    Physical Maximum   8
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Axes Enable (0x55)
    Collection   Logical (0x02)
      Usage Page   Generic Desktop Controls (0x01)
      Usage   X (0x30)
      Usage   Y (0x31)
      Logical Minimum   0
      Logical Maximum   1
      Report Size   1
      Report Count   2
      Output   Data (0x02)
    End Collection   
	
    Usage Page   PID Page (0x0f)
    Usage   Direction Enable (0x56)
    Report Count   1
    Output   Data (0x02)
    Report Count   5
    Output   Constant (0x03)
    Usage   Direction (0x57)
    Collection   Logical (0x02)
      Usage   Instance 1 (0x000a0001)
      Usage   Instance 2 (0x000a0002)
      Unit   20
      Unit Exponent   -2
      Logical Minimum   0
      Logical Maximum   255
      Physical Minimum   0
      Physical Maximum   0
      Unit   0
      Report Size   8
      Report Count   2
      Output   Data (0x02)
      Unit Exponent   0
      Unit   0
    End Collection   
	
    Usage Page   PID Page (0x0f)
    Usage   Start Delay (0xa7)
    Unit   4099
    Unit Exponent   -3
    Logical Minimum   0
    Logical Maximum   32767
    Physical Minimum   0
    Physical Maximum   32767
    Report Size   16
    Report Count   1
    Output   Data (0x02)
    Unit   0
    Unit Exponent   0
  End Collection   
  
  Usage Page   PID Page (0x0f)
  Usage   Set Envelope Report (0x5a)
  Collection   Logical (0x02)
    Report ID   2
    Usage    Effect Block Inde (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Attack Level (0x5b)
    Usage   Fade Level (0x5d)
    Logical Minimum   0
    Logical Maximum   255
    Physical Minimum   0
    Physical Maximum   10000
    Report Count   2
    Output   Data (0x02)
    Usage   Attack Time (0x5c)
    Usage   Fade Time (0x5e)
    Unit   4099
    Unit Exponent   -3
    Logical Maximum   32767
    Physical Maximum   32767
    Report Size   16
    Output   Data (0x02)
    Physical Maximum   0
    Unit   0
    Unit Exponent   0
  End Collection   
  
  Usage   Set Condition Report (0x5f)
  Collection   Logical (0x02)
    Report ID   3
    Usage   Effect Block Index (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Parameter Block Offset (0x23)
    Logical Minimum   0
    Logical Maximum   1
    Physical Minimum   0
    Physical Maximum   1
    Report Size   4
    Report Count   1
    Output   Data (0x02)
    Usage   Type Specific Block Offset (0x58)
    Collection   Logical (0x02)
      Usage   Instance 1 (0x000a0001)
      Usage   Instance 2 (0x000a0002)
      Report Size   2
      Report Count   2
      Output   Data (0x02)
    End Collection   
    Logical Minimum   -128
    Logical Maximum   127
    Physical Minimum   -10000
    Physical Maximum   10000
    Usage   CP Offset (0x60)
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Physical Minimum   -10000
    Physical Maximum   10000
    Usage   Positive Coefficient (0x61)
    Usage   Negative Coefficient (0x62)
    Report Count   2
    Output   Data (0x02)
    Logical Minimum   0
    Logical Maximum   255
    Physical Minimum   0
    Physical Maximum   10000
    Usage   Positive Saturation (0x63)
    Usage   Negative Saturation (0x64)
    Report Size   8
    Report Count   2
    Output   Data (0x02)
    Usage   Dead Band (0x65)
    Physical Maximum   10000
    Report Count   1
    Output   Data (0x02)
  End Collection   
  
  Usage   Set Periodic Report (0x6e)
  Collection   Logical (0x02)
    Report ID   4
    Usage   Effect Block Index (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Magnitude (0x70)
    Logical Minimum   0
    Logical Maximum   255
    Physical Minimum   0
    Physical Maximum   10000
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Offset (0x6f)
    Logical Minimum   -128
    Logical Maximum   127
    Physical Minimum   -10000
    Physical Maximum   10000
    Report Count   1
    Output   Data (0x02)
    Usage   Phase (0x71)
    Unit   20
    Unit Exponent   -2
    Logical Minimum   0
    Logical Maximum   255
    Physical Minimum   0
    Physical Maximum   0
    Output   Data (0x02)
    Usage   Period	(0x72)
    Logical Maximum   32767
    Physical Maximum   32767
    Unit   4099
    Unit Exponent   -3
    Report Size   16
    Report Count   1
    Output   Data (0x02)
    Unit   0
    Unit Exponent   0
  End Collection  
  
  Usage   Set Constant Force Report (0x73)
  Collection   Logical (0x02)
    Report ID   5
    Usage   Effect Block Index (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Magnitude (0x70)
    Logical Minimum   -255
    Logical Maximum   255
    Physical Minimum   -10000
    Physical Maximum   10000
    Report Size   16
    Report Count   1
    Output   Data (0x02)
  End Collection   
  
  Usage   Set Ramp Force Report (0x74)
  Collection   Logical (0x02)
    Report ID   6
    Usage   Effect Block Index (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Ramp Start (0x75)
    Usage   Ramp End (0x76)
    Logical Minimum   -128
    Logical Maximum   127
    Physical Minimum   -10000
    Physical Maximum   10000
    Report Size   8
    Report Count   2
    Output   Data (0x02)
  End Collection   
  
  Usage   Custom Force Data Report (0x68)
  Collection   Logical (0x02)
    Report ID   7
    Usage   Effect Block Index (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Custom Force Data Offset (0x6c)
    Logical Minimum   0
    Logical Maximum   10000
    Physical Minimum   0
    Physical Maximum   10000
    Report Size   16
    Report Count   1
    Output   Data (0x02)
    Usage   Custom Force Data (0x69)
    Logical Minimum   -127
    Logical Maximum   127
    Physical Minimum   0
    Physical Maximum   255
    Report Size   8
    Report Count   12
    Output   Data (0x0102)
  End Collection   
  
  Usage   Download Force Sample (0x66)
  Collection   Logical (0x02)
    Report ID   8
    Usage Page   Generic Desktop Controls (0x01)
    Usage   X (0x30)
    Usage   Y (0x31)
    Logical Minimum   -127
    Logical Maximum   127
    Physical Minimum   0
    Physical Maximum   255
    Report Size   8
    Report Count   2
    Output   Data (0x02)
  End Collection   
  
  Usage Page   PID Page (0x0f)
  Usage   Effect Operation Report (0x77)
  Collection   Logical (0x02)
    Report ID   10
    Usage   Effect Block Index (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Effect Operation (0x78)
    Collection   Logical (0x02)
      Usage   Op Effect Start (0x79)
      Usage   Op Effect Start Solo (0x7a)
      Usage   Op Effect Stop (0x7b)
      Logical Minimum   1
      Logical Maximum   3
      Report Size   8
      Report Count   1
      Output   Data (0x00)
    End Collection   
    Usage   Loop Count (0x7c)
    Logical Minimum   0
    Logical Maximum   255
    Physical Minimum   0
    Physical Maximum   255
    Output   Data (0x02)
  End Collection   
  
  Usage   PID Block Free Report (0x90)
  Collection   Logical (0x02)
    Report ID   11
    Usage   Effect Block Index (0x22)
    Logical Maximum   40
    Logical Minimum   1
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
  End Collection   
  
  Usage   PID Device Control (0x96)
  Collection   Logical (0x02)
    Report ID   12
    Usage   DC Enable Actuators (0x97)
    Usage   DC Disable Actuators (0x98)
    Usage   DC Stop All Effects (0x99)
    Usage   DC Device Reset (0x9a)
    Usage   DC Device Pause (0x9b)
    Usage   DC Device Continue (0x9c)
    Logical Minimum   1
    Logical Maximum   6
    Report Size   8
    Report Count   1
    Output   Data (0x00)
  End Collection   
  
  Usage   Device Gain Report (0x7d)
  Collection   Logical (0x02)
    Report ID   13
    Usage   Device Gain (0x7e)
    Logical Minimum   0
    Logical Maximum   255
    Physical Minimum   0
    Physical Maximum   10000
    Report Size   8
    Report Count   1
    Output   Data (0x02)
  End Collection   
  
  Usage   Set Custom Force Report (0x6b)
  Collection   Logical (0x02)
    Report ID   14
    Usage   Effect Block Index (0x22)
    Logical Minimum   1
    Logical Maximum   40
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Sample Count (0x6d)
    Logical Minimum   0
    Logical Maximum   255
    Physical Minimum   0
    Physical Maximum   255
    Report Size   8
    Report Count   1
    Output   Data (0x02)
    Usage   Sample Period (0x51)
    Unit   4099
    Unit Exponent   -3
    Logical Minimum   0
    Logical Maximum   32767
    Physical Minimum   0
    Physical Maximum   32767
    Report Size   16
    Report Count   1
    Output   Data (0x02)
    Unit Exponent   0
    Unit   0
  End Collection   
  
  Usage   Create New Effect Report (0xab)
  Collection   Logical (0x02)
    Report ID   1
    Usage   Effect Type (0x25)
    Collection   Logical (0x02)
      Usage   ET Constant Force (0x26)
      Usage   ET Ramp (0x27)
      Usage   ET Square (0x30)
      Usage   ET Sine (0x31)
      Usage   ET Triangle (0x32)
      Usage   ET Sawtooth Up (0x33)
      Usage   ET Sawtooth Down (0x34)
      Usage   ET Spring (0x40)
      Usage   ET Damper (0x41)
      Usage   ET Inertia (0x42)
      Usage   ET Friction (0x43)
      Usage   ET Custom Force Data (0x28)
      Logical Maximum   12
      Logical Minimum   1
      Physical Minimum   1
      Physical Maximum   12
      Report Size   8
      Report Count   1
      Feature   Data (0x00)
    End Collection   
    Usage Page   Generic Desktop Controls (0x01)
    Usage   Byte Count (0x3b)
    Logical Minimum   0
    Logical Maximum   511
    Physical Minimum   0
    Physical Maximum   511
    Report Size   10
    Report Count   1
    Feature   Data (0x02)
    Report Size   6
    Feature   Constant (0x01)
  End Collection   
  
  Usage Page   PID Page (0x0f)
  Usage   PID Block Load Report (0x89)
  Collection   Logical (0x02)
    Report ID   2
    Usage   Effect Block Index (0x22)
    Logical Maximum   40
    Logical Minimum   1
    Physical Minimum   1
    Physical Maximum   40
    Report Size   8
    Report Count   1
    Feature   Data (0x02)
    Usage   Block Load Status (0x8b)
    Collection   Logical (0x02)
      Usage   Block Load Success (0x8c)
      Usage   Block Load Full (0x8d)
      Usage   Block Load Error (0x8e)
      Logical Maximum   3
      Logical Minimum   1
      Physical Minimum   1
      Physical Maximum   3
      Report Size   8
      Report Count   1
      Feature   Data (0x00)
    End Collection   
    Usage   RAM Pool Available (0xac)
    Logical Minimum   0
    Logical Maximum   0
    Physical Minimum   0
    Physical Maximum   0
    Report Size   16
    Report Count   1
    Feature   Data (0x00)
  End Collection   
  
  Usage   PID Pool Report (0x7f)
  Collection   Logical (0x02)
    Report ID   3
    Usage   RAM Pool Size (0x80)
    Report Size   16
    Report Count   1
    Logical Minimum   0
    Physical Minimum   0
    Logical Maximum   0
    Physical Maximum   0
    Feature   Data (0x02)
    Usage   Simultaneous Effects Max (0x83)
    Logical Maximum   255
    Physical Maximum   255
    Report Size   8
    Report Count   1
    Feature   Data (0x02)
    Usage   Device Managed Pool (0xa9)
    Usage   Shared Parameter Blocks (0xaa)
    Report Size   1
    Report Count   2
    Logical Minimum   0
    Logical Maximum   1
    Physical Minimum   0
    Physical Maximum   1
    Feature   Data (0x02)
    Report Size   6
    Report Count   1
    Feature   Constant (0x03)
  End Collection   
End Collection   
cal
DBB Ace
DBB Ace
Posts: 29
Joined: Sat Jan 07, 2012 6:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by cal »

Finally, I managed to get some actual code published (please, notify me if the credits in the code are not as you would like them to be).

The project site now contains source code and hex file for the prototype version 1 in the downloads-section. It combines 3DPVert, LUFA (for USB comms) and code to enable FFP's "force feedback"-mode at startup. The HID descriptor has also a few additional controls for extra controls.

3DPVert code in this prototype has been stripped to only contain FFP-related code for simplicity.

To see the device as FFB device (e.g. in FEdit or a game) you need to do the registry magic mentioned in the project wiki-page. The code outputs all force feedback data it gets from the host to its USART TX port so it can be viewed with a device reading serial data.
cal
DBB Ace
DBB Ace
Posts: 29
Joined: Sat Jan 07, 2012 6:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by cal »

The thingy mostly works now.

The FF2 descriptor made the real difference in finding out what the WIndows PID driver really accepts. I've done full scale testing with FEdit, FConst and some preliminary testing with IL2 game too. With FEdit, I can play effects mostly fine. In IL2, there are some weird glitches and issues in the effects making it not really playable yet, but I consider this level of achievement as a proper proof of concept :)

Also, no need for that registry magic anymore - plug the joystick in and Windows will automatically generate correct OEM/FFB registry entries it likes to have. The decisive factor was the FF2 descriptors and that I needed to report a correct PID state reports when requested. None of which seem to be documented anywhere in sufficient detail - as you might guess. The FF2 descriptor also has several features not really supported by FFP (like phase or offset of periodic forces).

Creating effects, playing and stopping them work. The Windows USB-protocol implementation did (surprise surprise) not actually match the one described in USB.org's documents, but had some shortcuts that caused some pulling of hair (or what's left of it) at a time.

Almost all effect types now work when played using e.g. FEdit; constant effect, sine, triangle, square, spring, friction, inertia almost as much as FFP can support them. There were lots of nasty number format conversions and FFP limitations to stumble into. Ramps are not fully working yet - FFP also has very strict limits on what kind of ramps it actually can perform (only rampup from MIN to MAX or rampdown from MAX to MIN - nothing in between).

FFP can play up to 10 effects simultaneously even tho it can hold 40 definitions in its memory. Both properties are now taken into account. The adapter now needs to keep all 40 definitions in memory (taking a lot of RAM) since USB data updates are not always sent to MIDI immediately and need to be cached in the adapter. Some optimization could be done but ATmega32U4 can just take it all already now.

Most on-fly updates to already playing effects are also now working. E.g. changing direction or magnitude of a force already playing work. There are some limitations in FFP as it does allow changing e.g. magnitude of already playing constant force, but not periodic forces.

All that after tens of hours of tedious trial and error, half-educated guesses and even a few reboots due blue-screens in XP. Windows 7 64-bit works too.

FFB also seem to affect the joystick position reports by making some of the values jump erratically every now and then. I remember seeing some button line activity when playing effects - possibly it reports to PC whether an effect is playing or not or something like that. At the moment, I just ignore all that data, but it might be causing the erratic jumps (and random reported button clicks) in the input reports.

I suspect that there are also issues with the way I use LUFA-library too since I run into random issues if I get a large burst of output data going to the joystick in a short period of time. There seem to be also some timing issues with the MIDI-data to joystick. There are also some timing issues in replying to some USB-requests too quickly from the adapter to PC. I hope to get these solved by getting in touch with some LUFA-experts. It now looks very plausible to have a generic sample force feedback joystick project added to LUFA too.

I have already updated some of the MIDI-protocol documentation parts in the project Wiki and I'll post the new version of the code in the coming days too.

Thank you to all involved - especially Grendel and Ulao - for the help and support to get this thing already this far! I hope we can finalize it to be actually playable with any decent game.

BTW: I just got a second FFP with €10 to make sure the efforts are not wasted for me if one happens to break...
User avatar
Grendel
3d Pro Master
3d Pro Master
Posts: 4390
Joined: Mon Oct 28, 2002 3:01 am
Location: Corvallis OR, USA

Re: Reverse Engineering the Force Feedback Pro

Post by Grendel »

Congratulations, fantastic work ! Well done ! :)
cal
DBB Ace
DBB Ace
Posts: 29
Joined: Sat Jan 07, 2012 6:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by cal »

The complied hex-file for Teensy 2, source code and some updates to the wiki are now available at the project pages as version with label "proto 2".
wwweagle
DBB Cadet
DBB Cadet
Posts: 1
Joined: Tue Mar 13, 2012 8:40 am

Re: Reverse Engineering the Force Feedback Pro

Post by wwweagle »

With current development, if I turn off force feedback in the game, the FFP would work just like a FFP2 with force feedback turned off, right?
That alone is a great achievement.
Merlin
DBB Cadet
DBB Cadet
Posts: 1
Joined: Tue Mar 13, 2012 2:49 am
Location: Manchester, UK
Contact:

Re: Reverse Engineering the Force Feedback Pro

Post by Merlin »

Hi,

I am Merlin from the AmiBay forum. I want to say a massive thanks to all of the heroes in this thread, for working to get a USB adapter for my beloved Force Feedback Pro joysticks working. I still believe that these are the best joysticks ever made, bar none.

One question; I have the Sidewinder Force Feedback steering wheel too in my collection of Sidewinder controllers. Would it be possible to create a driver for this new adapter of yours for the steering wheel too? I would be prepared to help out if needed, just tell me what I need to do.

Thanks.
cal
DBB Ace
DBB Ace
Posts: 29
Joined: Sat Jan 07, 2012 6:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by cal »

Uh - the Real Life (tm) caught me a bit and is still keeping me in its grips for a while. Thus, the project has not really moved forward that much. I've used the adapter with FFB now for several hours tho when flying IL2 and even if its effects are not quite right yet (the MIDI-protocol has some number conversion quirks that I need to root out still - which is a tedious task to say the least) I have at least seen that it does not "crash" the joystick anymore even after couple of hours of use as some of the earlier versions did. This means that the principles and most of the details too in the USB and MIDI lines are pretty close what they should be.

Even if all of the effects work already now using FEdit, IL2 seem to use FFB a bit differently. It updates some of the effect parameters in ways that FEdit never does, which causes glitches and wrong effect gains/magnitudes in some of the effects. For example, the fluttering effect of turbulence under the wings of the airplane in IL2 is way too strong with the adapter now and the spring effect signifying the varying air pressure against the wing controls seem to throw the stick to wrong directions or at least too strongly at some directions.

Merlin, about your Sidewinder steering wheel. What you would need to get is to reverse engineer the protocol used in the game port to control the effects on the wheel. The USB side should be quite straight forward now that we got the Windows' FFB protocol there somewhat in order. I wonder if the wheel too is using some form of the MIDI protocol. Unfortunately, you need a working game port to see that. If you have a game port, you can dispatch the MIDI pin to a serial input (maybe with a small resistor in series for added safety) and read the MIDI data easily (while you play effects to it) since it is quite a basic serial protocol (31250 baud, 8N1).

You should also find out whether the wheel is using the analog inputs in the game port or that weird MS overdrive protocol to make it digital. I could imagine, the data is sent in analog format since a wheel and pedals could easily be modeled as a single analog joystick. Many pedals seem to model the break and gas pedals with a single axis. You can check this by seeing if the X and Y axis in the wheel's game port act like a joystick. There are numerous articles in the web about this. Some links about this are found also from the adapt-ffb-joy-project page discussed here.
HackNFly
DBB Cadet
DBB Cadet
Posts: 5
Joined: Tue May 08, 2012 9:53 am

Re: Reverse Engineering the Force Feedback Pro

Post by HackNFly »

Cal, just wanted to say I'm very impressed by your work, and am looking forwards to trying it out. I have all the parts and a new Teensy 2.0 to try it out. However there's no apparent way to contact you through the google.code website. Just wanted to point that out as other people may have run into the project from other places on the web.

~Santiago
HackNFly
DBB Cadet
DBB Cadet
Posts: 5
Joined: Tue May 08, 2012 9:53 am

Re: Reverse Engineering the Force Feedback Pro

Post by HackNFly »

Has anyone else got this working? I have the teensy wired up and it is working with the Grendel's code with an MS FFP, I trid loading adapt-ffb-joy-proto2.hex and nothing happens when I plug it in, just a blinking light. I tried moving D0->B0 D1->B1 D2->B2 D3->B3
But still just a blinking light. Were there any other wire changes other than that? I also suggest putting a link on the code website to link back here for more information.

Thanks for all the work, I'm looking forwards to having my FFP work completely again.
User avatar
Grendel
3d Pro Master
3d Pro Master
Posts: 4390
Joined: Mon Oct 28, 2002 3:01 am
Location: Corvallis OR, USA

Re: Reverse Engineering the Force Feedback Pro

Post by Grendel »

Besides moving Dx to Bx, you probably need to connect B0 to D0 as well. Looks like D3 is the MIDI output pin that needs to be wired to pin 12 or 15 on the D-SUB 15 connector (forgot which one of the two, probably 12...)
HackNFly
DBB Cadet
DBB Cadet
Posts: 5
Joined: Tue May 08, 2012 9:53 am

Re: Reverse Engineering the Force Feedback Pro

Post by HackNFly »

Just wanted to say that I successfully got it working. The problem was that I was following the original diagram for Grendel's adapter and I forgot that the FFP doesn't have a pin 13. I had to connect to pin 11 instead. The joystick initialized just fine without pin 11 connected, making the diagnosis more difficult. However this had to be connected to get force feedback to work. Cal was kind enough to send me a basic wiring diagram

AVR---D15
--------------

B0+D0 --- 2
B1 --- 7
B2 --- 10
B3 --- 14

D3 --- (R220) --- 12
B4 --- (R2.2k) --- 11
B5 --- (R2.2k) --- 3

+5V --- 1
GND --- 4

Its currently working without the two capacitors. Were those capacitors needed to get the other Sidewinder models to work, or are they there to stay within protocol?

Anyways, I'm happy to announce I have my force feedback pro up and running like it was back in '97.
nic_swede
DBB Cadet
DBB Cadet
Posts: 1
Joined: Tue May 15, 2012 8:35 am

Re: Reverse Engineering the Force Feedback Pro

Post by nic_swede »

Hi guys!

I can see that you had success with the MS FFB joysticks, really good work!
My question is: did anyone manage to convert the SW FFB precision wheel as well?
I have a gameport one.

Regards,
Niclas
User avatar
Grendel
3d Pro Master
3d Pro Master
Posts: 4390
Joined: Mon Oct 28, 2002 3:01 am
Location: Corvallis OR, USA

Re: Reverse Engineering the Force Feedback Pro

Post by Grendel »

nic_swede: no, sorry.

HackNFly: the caps are neccessary to create the pulses the sticks require to detect an "event". If you leave them out the only capacitance in the sytem will be the wire (probably in the low pF range) and there's no telling how reliable this will work in the long run. I would suggest to put 1nF caps in.
HackNFly
DBB Cadet
DBB Cadet
Posts: 5
Joined: Tue May 08, 2012 9:53 am

Re: Reverse Engineering the Force Feedback Pro

Post by HackNFly »

Thanks for the update, I'll put the caps back in later this weekend.

Just wanted to share the news. I'm sure this is the nostalgia you descent fans feel when playing. I just got Mechwarrior 3 working on my computer with my Sidewinder FFP with the original forces. Theres still some work being done on the firmware, but I swear this was just like it was15 years ago when I first got the stick. I'm really happy with it. I also have another force feedback joystick that is usb enabled, and it simply doesn't compare. Its hard to imagine there being a more comfortable joystick out there.

Thanks Cal and Grendel for all the hard work that made this possible.
ffb.boy.30
DBB Cadet
DBB Cadet
Posts: 1
Joined: Thu May 24, 2012 9:26 am

Re: Reverse Engineering the Force Feedback Pro

Post by ffb.boy.30 »

Hi
I'm doing a FFB joystick and I've some question
I use a descriptor given on microchip forum like you I've 2 input report => 1:joystick data 2:PID info
My joystick work with the windows panel and the data seem to be ok with USBlyser.
But when I try to launch FFconst the software is blocked until I remove my card .
With USBlyser I've seen that an OUT request is done 0x0C 0x04 it is a reset.
What I've to do?
thanks
FFB.BOY.30
kbh01
DBB Cadet
DBB Cadet
Posts: 1
Joined: Wed May 30, 2012 1:54 pm

Re: Reverse Engineering the Force Feedback Pro

Post by kbh01 »

Thank you for your work on this.
I'm experiencing two issues with the program:
1) When i plug the stick in nothing happens (the center spring effect stays deactivated) but then when I "use" the Force Feedback (e.g. by launching fedit) the stick seems to come out of FFB Mode into "normal" mode with activated spring effect - so basically the modes are in reverse. Any idea on this?
2) the stick randomly reports very short button presses from the Buttons 5 to 9 and the little directional pad on the top every couple of seconds. (can be seen in the windows configurationn window) Is it possible that maybe I'm using the wrong recistors? Or any other idea where these could come from?
joeykork
DBB Cadet
DBB Cadet
Posts: 2
Joined: Sat May 19, 2007 2:16 am
Location: Phoenix, AZ

Re: Reverse Engineering the Force Feedback Pro

Post by joeykork »

Very cool! I had been waiting for someone to implement HID-FF on the AVR, not being able to do it myself. Several people in the past seemed to have figured it out on PIC and kept the code to themselves :-(

After perusing the Google Code tree, I ran to my closet and pulled out the CH Force FX I have been wanting to convert to USB since I found it 3 years ago!

It is one of the very first consumer force feedback sticks, and uses I-Force API 1.0 over a serial cable for receiving force effects. MS licensed I-Force for their FF sticks (because of patents) but I do not know if they also licensed and used the same IForce protocol or stepper-controller implementation.

Looking at the I-Force API, I'm not sure if the direct-to-serial IForce protocol is the same as the MIDI streams sent to the MS FFP.

I'm thinking that to convert this stick to USB, i need make the following changes to the adapt-ffb-joy code:
[*] exchange the OverDrive controls with generic ADC I/O for internal connection to the stick's pots and buttons
[*] implement the differences between MS-FFP's and ForceFX's effect-set and I-Force encapsulation

I've got other AVR projects I need to complete first to try and build the required experience for me to pull that off, but please keep those kinds of changes in mind when/if you're going to restructure your code base to make it modular for other DIY FF stick conversions.

this is awesome stuff, thank you cal and Grendel!
cal
DBB Ace
DBB Ace
Posts: 29
Joined: Sat Jan 07, 2012 6:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by cal »

Back from dormancy - again...

The adapt-ffb-joy-project pages in Google Code contains a greatly improved version of the adapter code for AVR since version "proto2". Check the revision "r54" for the latest hex-file and source. It fixes the random button reports kbh01 mentioned about. It also fixes stuttering of e.g. a game application caused by the adapter (funny that a joystick may cause Windows app to hang for hundreds of milliseconds) and most of the issues with periodic effects. The random button presses were caused by spending too much time handling ADC-interrupts and the stutters were caused by debug logging slowing down the responsiveness to USB-events - and a undocumented quirk in Windows' USB PID driver (what a surprise indeed :P) that needed a workaround.

I now also added some documentation about the wiring to the pages. A proper circuit diagram is still missing, but you should get the picture. The wiring posted by HackNFly is what should work. I've extensively play tested the adapter with IL2 game and the latest version shows no issues.

As for the lack of center spring when when joystick initially comes online - yes, it does that. I didn't dig deeper into it, but I think it is the initalization sequence I make (I sniffed out the MIDI-sequence from an actual game port version and used it). Anyway, the current situation helps me to see if the stick initialization to FFB-mode really worked or not when plugging it in. And when I launch FEdit or a game, it works as expected i.e. the auto-center-spring is diabled. So the issue is not having the modes reversed, but that the initial default mode is auto-center-disabled instead of how it works when FFP is connected to a real game port. You get the auto-center-spring on if you switch to and away from any application using FFB. I need to consider to change this in future - I think this is an easy one to change. Good input!

About the caps and FFP - use them if needed. My setup did not work if I put the caps in place, so I'm running without them fine. I have two FFP sticks and both behave the same. There might be differences on inherent capacitances in FFP itself compared to e.g. 3DPro. But anyway, take the pragmatic approach and use whatever works - but just be aware that you might need them or need to avoid them :)

To ffb.boy.30: FFConst has trouble with adapt-ffb-joy too, but in the form that FFConst refuses to recognize the stick as FFB device at all. There is something different that FFConst expects than FEdit or any of the games tried do. FEdit and the games work. The adapt-ffb-joy-project also has a C#-source code submitted by saldsj3 that you can use to test the effects too. He's made serious testing on the adapt-ffb-joy and helped to iron out several issues there.

To joeykork: I noticed too that all of the people claiming to have nailed the HID/PID FFB never posted any code out (except for a couple that implemented only a simple vibrate-effect on e.g. XBox-controller or some Logitech mouse). Didn't help me or anyone else that they only claimed to make it work but never shared the results. This was the reason I decided to go public with all the info and code I made.

And you are right, it is likely that the serial IForce and MIDI-protocols differs quite a bit on certain level. But I would not expect too much differences in the deeper content since there are certain things you need to send for FFB. Thus, it should be quite doable as soon as you figure out the serial on-the-wire-protocol.

And this the kind of project is exactly what was my secondary goal on making the FFB for FFP. And now that there are only minor issues in the FFP-support, I'm very tempted to refactor the code a bit more modular. The current structure already separates the conversion of FFB-signaling from USB to joystick into separate file and set of functions (ffb.c, ffb.h). Reading the joystick's positinal data tho is more integrated into the main functions/files and could be more seprated. Basically, you just remove the 3DPro*-files, modify the input report construction and rewrite the ffb.c - just like that :) Let me know when you get to do the first run on the subject!

As for someone asking on contacting me, send me a message here or pick on tloimu at the G...

It sure is nice to see some interest on the force feedback topic.

BTW: I made the adapt-ffb-joy a composite USB device so that it now has USB serial device too for debugging and configuration. This part is quite preliminary still but already now you can enable/disable effects using a regular terminal application on the joystick. The project pages have some plans for this written out, but any further ideas on how it could be used would be welcome.
Poil
DBB Cadet
DBB Cadet
Posts: 5
Joined: Sat Mar 24, 2012 2:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by Poil »

A short message just to say thanks ! I loved this joystick and you revival it
duduke
DBB Cadet
DBB Cadet
Posts: 3
Joined: Wed Sep 19, 2012 2:47 pm

Re: Reverse Engineering the Force Feedback Pro

Post by duduke »

A quick question, since I'm running Teensy++2 (AT90USB1286 instead of ATMEGA32U4) do I need to compile my own HEX?

P.S. I've already tried the one on site, but I keep getting - "Unknown USB Device" errors.

Thanks.
duduke
DBB Cadet
DBB Cadet
Posts: 3
Joined: Wed Sep 19, 2012 2:47 pm

Re: Reverse Engineering the Force Feedback Pro

Post by duduke »

A bit of progress...
I've modified the makefile to compile for TEENSY++ 2 (at90usb1286) and it now compiles and loads.
When i'm connecting my ForceFeedbackPro, it is detected and all buttons/movements work (woohoo!).
But, I cannot get forcefeedback effects to run. (using either fedit.exe or ForceTest.exe).

Any ideas? Help? anyone? :)
gez
DBB Cadet
DBB Cadet
Posts: 2
Joined: Fri Oct 19, 2012 7:25 am

Re: Reverse Engineering the Force Feedback Pro

Post by gez »

Hi,

I tried to build a adapt-ffb-joy according to the doc on google code, unfortunately the device does not work perfectly - there seem to be some serious jitter on the different axes and it looks like some buttons are triggered randomly. Have anyone experienced the same? When I inserted the device for the first time Windows (7x64) found drivers for a HID-compliant game controller but complained about lacking drivers for LUFA Joystick wFFB could that have something to do with it? I rewired everything to make sure that wasn't the problem.

Thanks in advance,
Gez
Poil
DBB Cadet
DBB Cadet
Posts: 5
Joined: Sat Mar 24, 2012 2:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by Poil »

Hi,

It's normal, but in peripherals and printers control pannel, you'll find your joystick

Cu
gez
DBB Cadet
DBB Cadet
Posts: 2
Joined: Fri Oct 19, 2012 7:25 am

Re: Reverse Engineering the Force Feedback Pro

Post by gez »

Yeah, I do see it there, so at least that's normal. It's the settings panel I reach through there where I noticed the flickering of the axes, random button triggering and non-functional tophat - I assume that isn't normal? :lol: Are you also running r54 on Teensy 2.0?

Gez
Poil
DBB Cadet
DBB Cadet
Posts: 5
Joined: Sat Mar 24, 2012 2:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by Poil »

Yep

I had the same problem, it was a bad contact on my midi connector.

Best regards
TMSio
DBB Cadet
DBB Cadet
Posts: 1
Joined: Sat Nov 10, 2012 9:28 am

Re: Reverse Engineering the Force Feedback Pro

Post by TMSio »

Hi to all,
I m new in this forum, i hear speaking about this project, and i want to try do to this.
I build the circuit, and i put inside teensy adaptffbjoy-r54.hex code.
If i connect all to my laptop (win 7 32bit) it work fine (just x and y axes inverted ... if i move my ffb to right the mouse move in left direction and the same if i move uo the mouse goes down).
if i connenct to my desktop (win 7 64 bit ultimate) i see in the devices Lufa Joystick wFFB with yellow"!"
(the same in windows 32 bit) but the joystick don t work... no mouse moviment and no force feedback.

I try with adapt-ffb-joy-proto1 and adapt-ffb-joy-proto2 code but no change.

Can someone hlp to me?

Thank you

Best regards

Emiliano

Sorry for my english :(
User avatar
Overkill211
DBB Cadet
DBB Cadet
Posts: 11
Joined: Wed Nov 07, 2012 11:09 pm

Re: Reverse Engineering the Force Feedback Pro

Post by Overkill211 »

For those interested, I've whipped up a PCB adapter board to plug the pin-type Teensy 2.0 board into.

Just something I really wanted to try building. I've missed my FFPro, ever since I "upgraded" to the FF2. The newer stick just never felt as well laid-out as the original. Some games really needed that 9th button, too.

Image

Built 99% to the published circuit diagram, with 1 extra connection... I hope to make it compatible with all the MS overdrive sticks, code-wise. I'll probably have to get past the "Hello World" tutorial, though. :roll:

Might save you some assembly headaches. I've tested all 5 that I have assembled (made 6, but one's mine, naturally) with my FFPro... all working.

Contact me if you're interested.
Poil
DBB Cadet
DBB Cadet
Posts: 5
Joined: Sat Mar 24, 2012 2:23 am

Re: Reverse Engineering the Force Feedback Pro

Post by Poil »

Why have you got 4 resistors and 3 capacitors ?

On http://adapt-ffb-joy.googlecode.com/fil ... ircuit.png we have only 3/2 oO
User avatar
Overkill211
DBB Cadet
DBB Cadet
Posts: 11
Joined: Wed Nov 07, 2012 11:09 pm

Re: Reverse Engineering the Force Feedback Pro

Post by Overkill211 »

I added those to re-connect pin 13 on the DB-15 connector. These are connected to B6 on the Teensy. It has no effect on current operation, but I figured that if someone changed a bit of code, the adapter could support the non-FFB Sidewinder sticks that use Pin 13, instead of 11. If not, oh well... an additional few cents in components.
malaki
DBB Cadet
DBB Cadet
Posts: 1
Joined: Wed Jan 30, 2013 3:38 am

Re: Reverse Engineering the Force Feedback Pro

Post by malaki »

does this one fit into a box like the 3dpvert?
User avatar
Overkill211
DBB Cadet
DBB Cadet
Posts: 11
Joined: Wed Nov 07, 2012 11:09 pm

Re: Reverse Engineering the Force Feedback Pro

Post by Overkill211 »

If you can find a small enough box to accommodate it, and don't mind that the mini-usb will be recessed, then probably.
I didn't really design for a box... sorry. Works perfectly on a slot-mount plate, or mounted directly to a case wall. I plan on case-mount, myself.
sdecorme
DBB Cadet
DBB Cadet
Posts: 1
Joined: Wed Feb 20, 2013 1:45 am

Re: Reverse Engineering the Force Feedback Pro

Post by sdecorme »

Hi,
I've been reading this post , I've tried the descriptor given below it seem to work like a charm in W7 64bits.
I can receive som FFB effects on my device
I've just a problem with the RAM function calculate . how it works ? is someone look at the PID description o fthe USB ?
Thanks
User avatar
Overkill211
DBB Cadet
DBB Cadet
Posts: 11
Joined: Wed Nov 07, 2012 11:09 pm

Re: Reverse Engineering the Force Feedback Pro

Post by Overkill211 »

First board is safely in it's new home in the Netherlands. Just 4 left, now.
Post Reply