Author Topic: Force feedback message  (Read 20299 times)

ffb_boy

  • Member
  • ***
  • Posts: 10
Force feedback message
« on: April 23, 2011, 06:17:14 pm »
Hi,
I've done a joystick with capabilities so I can receive data from my race game . But I don't know how to use them .
I've read "Device Class Definition for Physical Interface Devices (PID)"  but nothing looks like data I receive .
the constant force looks like this
0x04 0x00 0x00 0x00 0x?? 0x00 0xE8 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00
And 0X?? is the force value as a signed byte.

And when I touch a wall the game send me something like this
0x02 0x66 0x00 0x00 0x00 0x?? 0x96 0x00 0x24 0x00 0x00 0x00 0x00 0x00 0x00
0x03 0x64 0x00 0x?? 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x41 0x05 0x41 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x?? seems to be a the force value.

Where can I find specification about this packet format ?

Thks



Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Force feedback message
« Reply #1 on: April 24, 2011, 09:53:18 am »
The device's report descriptor defines the data the device will send and receive. What is the report descriptor for the Output report(s)?

Jan

ffb_boy

  • Member
  • ***
  • Posts: 10
Re: Force feedback message
« Reply #2 on: April 24, 2011, 11:23:12 am »
Hi
My system is a clone of an existing system, there is no report descriptor , I found a description of the report in the windows register but no output report .
here it is
05 01
09 04
a1 01
09 01
a1 00
85 07
09 30
15 00
26 00 10
35 00
46 00 10
75 10
95 01
81 02
09 31
26 fe 01
46 fe 01
81 02
09 32
26 ff 00
46 ff 00
75 08
81 02
05 09
19 01
29 0c
25 01
45 01
75 01
95 0c
81 02
05 01
09 39
25 07
46 3b 01
55 00
65 14
75 04
95 01
81 42
65 00
09 35
26 ff 00
46 ff 00
75 08
81 02
c0

But the game I use to make my log send always the same thing even if the wheel change ?

Maybe there is a filter done by the driver ?

Any idea ?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Force feedback message
« Reply #3 on: April 24, 2011, 11:55:55 am »
Every HID has a report descriptor.

If a HID doesn't have an Output or OUT Feature report, it can't send data to the PC.

Use a protocol analyzer to capture the descriptor on enumeration or you can use the HID API to see what the device supports. Start by getting the HIDP_CAPS structure with HidP_GetCaps.

http://msdn.microsoft.com/en-us/library/ms899404.aspx

See my HID page for example code.

Jan

ffb_boy

  • Member
  • ***
  • Posts: 10
Re: Force feedback message
« Reply #4 on: April 24, 2011, 01:26:00 pm »
When I sniff with USBTRace the initialisation of the original wheel , There is no report descriptor .
That why I tought that the driver make a filter between directx and the wheel to describe the output.
I can reproduce the FFB effect , but my problem is to know what to do with the data I get .
Do you know if there is sample about spring effect or other effect with a µController, I use a 18F4550 but no matter
all the chip are the same .
I will look again at the wheel driver if I find something about the output.

Thks
 
Here is what I've found in the driver

; Effects
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback,Attributes,1,00,00,00,00,e8,03,00,00,e8,03,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback,CLSID,0,%CLSID_IMMPID%
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C20-8E33-11D0-9AD0-00A0C9A06E35},,0,"Constant Force"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C20-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,26,00,00,00,01,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C21-8E33-11D0-9AD0-00A0C9A06E35},,0,"Ramp Force"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C21-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,27,00,00,00,02,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C22-8E33-11D0-9AD0-00A0C9A06E35},,0,"Square Wave"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C22-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,30,00,00,00,03,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C23-8E33-11D0-9AD0-00A0C9A06E35},,0,"Sine Wave"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C23-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,31,00,00,00,03,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C24-8E33-11D0-9AD0-00A0C9A06E35},,0,"Triangle Wave"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C24-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,32,00,00,00,03,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C25-8E33-11D0-9AD0-00A0C9A06E35},,0,"SawtoothUp Wave"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C25-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,33,00,00,00,03,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C26-8E33-11D0-9AD0-00A0C9A06E35},,0,"Sawtooth Down Wave"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C26-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,34,00,00,00,03,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C27-8E33-11D0-9AD0-00A0C9A06E35},,0,"Spring Force"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C27-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,40,00,00,00,04,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C28-8E33-11D0-9AD0-00A0C9A06E35},,0,"Damper Force"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C28-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,41,00,00,00,04,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C29-8E33-11D0-9AD0-00A0C9A06E35},,0,"Inertia"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C29-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,42,00,00,00,04,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C2A-8E33-11D0-9AD0-00A0C9A06E35},,0,"Friction"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C2A-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,43,00,00,00,04,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C2B-8E33-11D0-9AD0-00A0C9A06E35},,0,"Custom Force"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{13541C2B-8E33-11D0-9AD0-00A0C9A06E35},Attributes,1,28,00,00,00,05,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873612-BCB7-11d0-A156-524153480000},,0,"Axis Barrier"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873612-BCB7-11d0-A156-524153480000},Attributes,1,40,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873613-BCB7-11d0-A156-524153480000},,0,"Angle Barrier"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873613-BCB7-11d0-A156-524153480000},Attributes,1,40,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873614-BCB7-11d0-A156-524153480000},,0,"Axis Wall"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873614-BCB7-11d0-A156-524153480000},Attributes,1,40,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873615-BCB7-11d0-A156-524153480000},,0,"Angle Wall"
HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873615-BCB7-11d0-A156-524153480000},Attributes,1,40,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873610-BCB7-11d0-A156-524153480000},,0,"Dynamic"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873610-BCB7-11d0-A156-524153480000},Attributes,1,60,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873611-BCB7-11d0-A156-524153480000},,0,"Texture"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873611-BCB7-11d0-A156-524153480000},Attributes,1,61,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873616-BCB7-11d0-A156-524153480000},,0,"Spring at Current Location"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873616-BCB7-11d0-A156-524153480000},Attributes,1,83,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873617-BCB7-11d0-A156-524153480000},,0,"Angle Spring"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873617-BCB7-11d0-A156-524153480000},Attributes,1,84,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873618-BCB7-11d0-A156-524153480000},,0,"Pop"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873618-BCB7-11d0-A156-524153480000},Attributes,1,85,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873619-BCB7-11d0-A156-524153480000},,0,"Smart Pop"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B3873619-BCB7-11d0-A156-524153480000},Attributes,1,86,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361A-BCB7-11d0-A156-524153480000},,0,"Sweep Sine Wave"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361A-BCB7-11d0-A156-524153480000},Attributes,1,92,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361B-BCB7-11d0-A156-524153480000},,0,"Sweep Square Wave"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361B-BCB7-11d0-A156-524153480000},Attributes,1,93,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361C-BCB7-11d0-A156-524153480000},,0,"Sweep Triangle Wave"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361C-BCB7-11d0-A156-524153480000},Attributes,1,94,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361D-BCB7-11d0-A156-524153480000},,0,"Sweep Sawtooth Up Wave"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361D-BCB7-11d0-A156-524153480000},Attributes,1,95,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361E-BCB7-11d0-A156-524153480000},,0,"Sweep Sawtooth Down Wave"
; HKLM,%KEY_OEM%\VID_04D8&PID_0002\OEMForceFeedback\Effects\{B387361E-BCB7-11d0-A156-524153480000},Attributes,1,96,00,00,00,FF,BE,00,00,65,03,00,00,65,01,00,00,20,00,00,00



[USBPnP3.AddReg.HW]
HKR,,ReportDescriptor,1,05,01,09,04,A1,01,09,01,A1,00,85,07,09,30,15,00,26,00,10,35,00,46,00,10,75,10,95,01,81,02,09,31,26,FE,01,46,FE,01,81,02,09,32,26,FF,00,46,FF,00,75,08,81,02,05,09,19,01,29,10,25,01,45,01,75,01,95,10,81,02,05,01,09,35,26,FF,00,46
HKR,,ReportDescriptorPart2,1,FF,00,75,08,95,01,81,02,C0


But this value don't look like the value I've posted before.
Thks
« Last Edit: April 24, 2011, 01:43:04 pm by ffb_boy »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Force feedback message
« Reply #5 on: April 24, 2011, 01:54:02 pm »

ffb_boy

  • Member
  • ***
  • Posts: 10
Re: Force feedback message
« Reply #6 on: April 24, 2011, 03:29:31 pm »
Thks
I think I've read all the post in the net about the FFB subject  ;D 
The FFB protocol is a mystery .
So I will continue lonely to extract data send by the game.
Thanks to spending time to answer me

ffb_boy

  • Member
  • ***
  • Posts: 10
Re: Force feedback message
« Reply #7 on: April 26, 2011, 02:42:59 am »
For information,
I've made a soft that send FFB effect to my system , and it appears that the driver convert the value .
So I've to find the protocol I'm on the good  way. ;D

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Force feedback message
« Reply #8 on: April 26, 2011, 10:18:51 am »
Good luck with it!

Jan