Replies: 13 comments 12 replies
-
I'll start this (long and detailed) post with some background I've been able to piece together about Force Feedback APIs which I think is relevant, and then go on to list what I've found from experimenting with sending MIDI messages to the stick, and how I think the force feedback with the adapter can be improved. Apologies if any errors, misconceptions or omissions. tl;dr I think there is enough information from reverse engineering now to make it possible to implement the generic DirectInput effects for the FFP as least as well as was done with the original MS drivers. The first Force Feedback joystick on sale was the CH Force-FX in 1996 which used Immersion's I-FORCE 1.0 core and API. Not long after Microsoft released the Sidewinder Force Feedback Pro (FFP) using the Sidewinder Force "SWForce" API based on similar but incompatible technology from an acquisition of Exos Inc. (err … this ) The first few games supporting force feedback typically implemented one or other of these APIs but rarely both. Microsoft and Immersion "played nice" over IP in this instance and worked together to develop the DirectX 5.0 DirectInput Force Feedback API which combined many of the common effects and parameters, ensuring a level of cross-compatibility. SWForce and IForce 1.0/2.0 still existed as separate API's that were "wrappers" around the DirectInput API and each included a host of additional proprietary effects. The FFP drivers were ported to DirectInput FF but since it pre-dates the API a few aspects were not fully supported by the FFP (e.g. periodic phase).Thereafter games using DirectInput were more universally compatible. Presumably games from Microsoft studios also made use of the additional SWForce effects on top of the basic force feedback, and some games used the additional effects provided by Immersion. Most of the later (non-Microsoft) Force Feedback joysticks released licensed the IFORCE 2.0 processor (Logitech, Thrustmaster). When USB became the standard for joysticks Microsoft and Immersion also worked on the Device Class Definition for PID 1.0 which is well aligned with DirectInput. The Sidewinder Force Feedback 2 (FF2) uses this, as does this adapter. When Gameport was dropped for Windows Vista so was the support for FFP (maybe earlier - not sure what version the final driver update was for). As Sidewinder drivers ceased to be supported with newer versions of Windows, the additional SWForce effects became inaccessible for both legacy and new games, since without vendor drivers devices fall back to the generic DirectInput force feedback. This presumably affects the FF2 and USB FF Wheel but is also an unavoidable limitation of the adapter for FFP. Some more recent iterations of DirectInput appear to have dropped an axis to only provide legacy support for wheels (I'm not very clear about when this applies). The latest API is now GameInput which does support two axis force feedback again but notably appears to have dropped Custom Force effects. That's the background. Here is the IForce SDK linked thanks to @kfix And here is the Microsoft Sidewinder Force Feedback SDK Programmers Guide. As well as all of the generic DirectInput effects the FFP apparently has a number of device specific effects including
These are interesting, but given the lack of current API support there is probably not much value implementing them in the adapter. I reckon ROM and Wall effect MIDI messages (as well as Custom Forces) could be found by some educated guesswork, but to fully crack the others open would need ideally a legacy PC with the SDK including Microsoft Visual Force Factory (vforce.exe) and sniffing the MIDI lines. I haven't been able to find any trace of the SDK tools online. Only a low-res screenshot here and some libraries here. I won't list out all the limitations of the FFP with respect to DirectInput, since they are well described in the Programmer's Guide. However I do have a few clarifying points from experimentation:
I've been using some Python scripts to do all the message construction, data type conversions, checksums, serial port handling etc. and sending MIDI messages via the USB virtual serial port that was helpfully implemented in the adapter. I'm making a few assumptions:
Here's what I've found so far. This all builds on what is in the Wiki. Device GainThe adapter is already sending device gain (i.e. stick volume) messages, but they are always set to max i.e. 0x7F. Effect IDs
High refers to the greatest value in the nominal direction as e.g. played with a positive constant force Effect Parameters
Notes Another ObservationSending an "after touch" message after Start Effect is a shortcut to modify the effect gain. The modification persists the next time the effect is played. ConclusionsI think a good objective would be to fully support the PID spec as far as the FFP will allow, with the exception of Custom Forces, which I don't believe are often used. Complex logic in the adapter, for example using multiple effects to stand in for a single effect, should be avoided. Here is a list of improvements I have identified to achieve this that can work with the FFP. I will aim to submit more details in issues.
And the following mainly improve support for less commonly used effects and parameters or cover edge cases:
And one I am on the fence about - I think it's possible but the adapter logic could be complex.
I'm aware probably not many people will stumble across this post here, but it still seemed like the right discussion board to attach it to. I'd like to wiki some of the above to make it referenceable in future. |
Beta Was this translation helpful? Give feedback.
-
Hi @tloimu, I'd be keen to contribute and eventually get some of these (potential) updates into the main repository via pull request, as well as updates to the wiki, for greatest visibility. Most of the existing forks are "user preference" style customisations of axes, buttons & pinouts etc., but no one else has touched the force feedback code. I know it's been a few years so would understand if you're not interested in maintaining this project any more? If that's the case, no worries, I can fork and go my own way. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
MIDI 0xC5 0x01 = Reset (stop all effects; free all effects; reset device gain to 0x7F; enable actuators; enable auto spring centre) In modes 0x03 and 0x05 other effect commands are accepted. e.g. |
Beta Was this translation helpful? Give feedback.
-
I found a weird bug with the FFP (not the adapter) where periodic effects with finite duration stop playing prematurely if you decrease the frequency while they are playing, sometimes instantly and sometimes after a few cycles. Increasing frequency starts the effect playing again if still within duration. Probably not an issue very often in games because the frequency drop has to be quite large for this to be noticeable. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your commitment, when will there be a new firmware version? |
Beta Was this translation helpful? Give feedback.
-
Done testing and it all seems to work. Here's my plan for tloimu/adapt-ffb-joy:
I'm tagging r54 because the *_r54.hex is still the download and the current commit because it has been used for most forks, even though an *_r74.hex was never published in the main repo. r54/r74 refer to the google code commit that was previously used to version the hex. |
Beta Was this translation helpful? Give feedback.
-
@ej113 I'm amazed and happy that this project, which I thought was dead for about two years, has come out of its coma! I own a Microsoft Forcefeedback Wheel since about 24 years, but it's unused long time (due to obsolete gameport interface). I have often been close to throwing it away, but at the same time the desire to once play with it again is great. That's why I spent some time on this project 2-3 years ago, built an adapter and also spent some time on the firmware. I got the steering to work, but unfortunately the force feedback experience didn't happen. I also didn't manage to scrape together enough know-how to help myself. Since nothing else was happening in the project, I gave up and it fell asleep again. By pure chance, I looked into the project again today and saw that there is indeed something new, which made me very happy. However, I have to admit that I didn't read and understand everything. |
Beta Was this translation helpful? Give feedback.
-
THank you for breathing back life in this project! I unwrapped my dear 96755 tonight, replugged some wires on my breadboard and gave your new beta a go and it works like a breeze (Teensy2.0, SW FFPro, Win11). Tried Freespace2 and ForceTest. Both work. The "Groove" Effekt in ForceTest does nothing (but I think it didnt work before). There is a small mix-up in https://github.com/tloimu/adapt-ffb-joy/releases/tag/0.5.0beta1 Table "Which Firmware should I use?": The table mixes the Micro-Firmware and the Teensy Firmware Target Boards (but its obvious with the names of course). The firmware with 8 axes has 2 of my potis "combined", so their position is added up (to 100%). Is that on purpose? I have no idea how that was before, but the 8th axis is also "dead" in my calibration view. |
Beta Was this translation helpful? Give feedback.
-
@ej113 I just wanted to add my thanks for breathing life back into this project as Hottex said. I've applied the v5 beta to my teensy and am looking forward to giving it a thorough test. Your firmware updates combined with the jitter fix from nhede in #23 look like major steps forward. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
@ej113 Kudos for the research and documentation! I currently only have a FFB2 Joystick but a I recently got a FFBPro one that I whant to use on a old XP machine to play "SWForce". I also want to try the updatd firmware with this device to use it on a modern pc. I'm tempted to write a wrapper for SWForce to modern dinput ffb. Do you happen to know if something like this already exists? I want to also make a wrapper for iforce1 to dinput. It appears that an official wrapper was made by Immersion but I can't find it anywhere. And while on it... As the Windows native usb-pid driver does not have any user configuration setting, I've made an external dinput injector that can modify some ffb parameters. I use it to set the strength of some effects. |
Beta Was this translation helpful? Give feedback.
-
Amazing work. I have been working on a recent project to support force feedback devices on a Teensy as a host. I've run into some USB issues and went back to look at my old adapt-ffb code and stumbled on the work you have been doing since last year. Brought a smile to my face as I had mentioned some of this stuff to tloimu when I was playing around with building an Arduino library for the device. Specifically I noticed how the device wouldn't respond to certain frequencies. My main question. I had to update to Windows 11 for work and nothing WinAVR related is working for me. What toolchain are you using to make updates / compile the code? Sorry had to repost as I was signed in on the wrong github account. |
Beta Was this translation helpful? Give feedback.
-
So I've been very impressed with what has been achieved on this project! Since I was able to get the adapter to work I've been fascinated by what's going on under the hood and keen to get involved. Although the project seems to have been dormant for some time I can see that people are still building adapters for the increasingly venerable FFB Pro and using the code. Although it works very well in general I've noticed there are a few quirks of the force feedback (due to both adapt-ffb-joy and original MS firmware) so I've started some methodical testing.
I was going to wait until I had worked my way through and had a full list of the FFB capabilities and any potential improvements. But I found a simple fix already that I think will make a big impact on the feel of the device and the effects that can be perceived! I will submit this as issue #46 now and carry on testing.
What I've done so far:
Still to do:
Progress is likely to be slow since I have a lot else on, but I hope to keep plugging away when I get the chance...
Beta Was this translation helpful? Give feedback.
All reactions