necroware / gameport-adapter

GamePort adapter to connect old DB15 joysticks to USB port
GNU General Public License v3.0
287 stars 55 forks source link

Support for the SideWinder Force Feedback Pro #12

Open afmenez opened 2 years ago

afmenez commented 2 years ago

The SideWinder Force Feedback Pro was like a Precision Pro with motors for force feedback effects.

afmenez commented 2 years ago

I have this device and I would be willing to take a shot implementing this, but currently I have no access to the adapter.

No0ne commented 2 years ago

Hi! I have a SideWinder Force Feedback Wheel and I just tested sniffing the MIDI output from my Win98 PC while the original driver is running.

Screenshot 2022-02-02 at 21 40 02

Maybe this works by setting up a USB MIDI interface within the adapter and just forwarding those SysEx and other messages? But I think the hardware needs to be modified so that the TX pin of the onboard UART is connected to the MIDI out pin of the gameport.

necroware commented 2 years ago

That's awesome! Thank you very much. I will take a closer look at it on the weekend. So far I don't use the RX/TX pins on purpose, because I like to keep the serial port free for debugging. That makes the life easier during the development. I usually do this in all of my Arduino projects and use the RX/TX only if I need a really fast serial connection.... I'll have to think about it.

But your data is already very exciting and gives a lot of stuff to think about ;)

No0ne commented 2 years ago

Cool! I've another issue, how to debug this? screen I'm just slowly turning the wheel, moving the pedals and not pressing any buttons but there seems some bits to be shifted around? (analog joysticks are working perfectly btw.)

caradas commented 2 years ago

I tried to implement daisychaining on the SW Gamepad last weekend and had something looking almost exactly the same. The problem was that the 3rd bit of the 3-bit wide bus was read to late. To confirm it i changed the order of lines 176-178 on Sidewinder.h to move the problem arround by reading b1 or b2 last.

No0ne commented 2 years ago

Thanks, but I tried every of the six permutations, didn't make any difference 🤔

necroware commented 2 years ago

I opened a new issue about the timing problems to keep this one about FFB Pro

opensourcerebel commented 2 years ago

@No0ne I am trying to implement FFB for the sidewinder wheel - do you have that sniff in a text format? Or any other resources for that manner? @necroware may be you have some resources about the FFB? I know about pins 12 and 15 from the DB15 connectors from here: https://youtu.be/947DewHwbsE?t=989 :) In the meantime I am giving that thing a read: https://patents.google.com/patent/US5628686A/en. That is also a good read: https://www.descentbb.net/viewtopic.php?t=19061&start=120. Here there is even better info: https://code.google.com/archive/p/adapt-ffb-joy/wikis/SidewinderFFBWheel.wiki

No0ne commented 2 years ago

Shure, I will try to connect my mt32-pi and just save the midi output coming in via gpio to a text file and upload it here.

opensourcerebel commented 2 years ago

@No0ne no need, in this wiki there is enough data: https://code.google.com/archive/p/adapt-ffb-joy/wikis/SidewinderFFBWheel.wiki. Thanks for the help!

Hedda commented 2 years ago

Any news on Sidewinder FFB Pro support?

necroware commented 2 years ago

Any news on Sidewinder FFB Pro support?

Unfortunately no, I have no FFB device and nobody contributed to the implementation so far. However, I know, that couple of people are trying to implement this.

Hedda commented 2 years ago

@necroware Do you live in the EU and are willing to look at implementing support for MS SideWinder Force Feedback Pro?

My OCD made me collect more than a few of the original Microsoft SideWinder Force Feedback Pro joysticks over the years and I might be willing to donate one of my Microsoft SideWinder Force Feedback Pro joysticks to you if you would be willing to then look into adding full force feedback compatibility with it.

PS: I remember reading someone released a SideWinder FFB firmware for Teensy but not sure if they ever made it open source(?):

https://www.descentbb.net/viewtopic.php?t=19061&start=280

https://code.google.com/archive/p/adapt-ffb-joy/downloads

https://www.reddit.com/r/hotas/comments/qd3kow/ms_sidewinder_ffb_pro_teensy_and_now_it_works_on/

https://github.com/tloimu/adapt-ffb-joy

https://github.com/tloimu/adapt-ffb-joy/wiki

PPS: By the way, I also read that Immersion Corp's Force Feedback patents have expired since a few years back now (finally!):

https://www.reddit.com/r/hotas/comments/bmnr8f/as_of_today_immersion_corps_force_feedback/

https://patents.google.com/patent/US6275213

https://patents.google.com/patent/US6424333

CyberLuke-GBG commented 2 years ago

Hi, I'm another software dev and I have this Sidewinder Forcefeedback Pro (USB version). I have a small experience with Arduino and MIDI.

Currently I bought a great joystick InterAct FX Racing Wheel (SV-281) and it does have force feedback and gameport connector. It works in the same manner as this Microsoft one. It requires sound card with midi (mpu-401) interface. Gameport features both midi in, midi out and serial connection. So it sends MIDI directly to soundcard via gameport and the software driver in the OS will use it for force feedback. It is quite simple. You just need to parse MIDI. The hard part is how to implement USB HID with force feedback for DirectX input?

I definitely need to write something for this InterAct. It's for RC cars, Trackmania, etc. And the issue is it works only in Win98 due to 16-bit VxD driver. There is no WDM driver for Windows 2000/XP.

I just need to buy some Teensy or Arduino first.

I think the hardest part here will be modifying Arduino USB HID library to output force feedback data and make it work with DirectX input layer.

cyberluke commented 2 years ago

Hi, I'm another software dev and I have this Sidewinder Forcefeedback Pro (USB version). I have a small experience with Arduino and MIDI.

Currently I bought a great joystick InterAct FX Racing Wheel (SV-281) and it does have force feedback and gameport connector. It works in the same manner as this Microsoft one. It requires sound card with midi (mpu-401) interface. Gameport features both midi in, midi out and serial connection. So it sends MIDI directly to soundcard via gameport and the software driver in the OS will use it for force feedback. It is quite simple. You just need to parse MIDI. The hard part is how to implement USB HID with force feedback for DirectX input?

I definitely need to write something for this InterAct. It's for RC cars, Trackmania, etc. And the issue is it works only in Win98 due to 16-bit VxD driver. There is no WDM driver for Windows 2000/XP.

I just need to buy some Teensy or Arduino first.

I think the hardest part here will be modifying Arduino USB HID library to output force feedback data and make it work with DirectX input layer.

necroware commented 2 years ago

Hi guys, I also got InterAct FX Racing Wheel (SV-281) some time ago and already was trying to reverse engineer the protocol. I made additional pluggable part, which can be inserted between the joystick and the gameport to grab the communication with a logic analyzer. So it is in the works, but I currently don't know yet how much time it will take to develop everything completely. The SV-281 currently doesn't work at all with this adapter, so the whole protocol has to be reverse engineered. Unfortunately I didn't find any protocol documentation so far.

Hedda commented 2 years ago

@necroware Do you live in the EU and are willing to look at implementing support for MS SideWinder Force Feedback Pro?

My OCD made me collect more than a few of the original Microsoft SideWinder Force Feedback Pro joysticks over the years and I might be willing to donate one of my Microsoft SideWinder Force Feedback Pro joysticks to you if you would be willing to then look into adding full force feedback compatibility with it.

@necroware Maybe it would make more sense for me to ship it or donate/contribute a similar sum to the shipping cost (around $30/€30/£30) to you via PayPal so that you can buy a Microsoft SideWinder Force Feedback Pro joystick from eBay yourself?

I might perhaps consider donating more if you be willing to send me a few of your Necroware GamePort Adapters in return.

PS: By the way, I live in Sweden myself.

necroware commented 2 years ago

@Hedda no, you don't need to. I'm currently short on time anyway and I don't think, that I will find any time this year to continue with this project. On my youtube channel I mentioned already couple of times why this year is quite shitty and it currently doesn't look like it's getting better. May be in that time someone else will come up with a solution. There are already couple of people, who wanted to implement FFB.

cyberluke commented 2 years ago

@necroware Where to get the pluggable part for SV-281? I can look into that.

lucasstinis commented 1 year ago

Hi, I'm thinking of getting/building 2 of these adapters, and was wondering if you expect the current 2.1 version of the adapter to be compatible on a hardware level with the SW FFB Pro, if support ever gets implemented, or if you think it will require an entirely new board to work properly. Thanks!

necroware commented 1 year ago

FFB needs MIDI pins. They are wired already, so it should be only a question of software, I guess. I would like not to change the compatibility if possible, so everybody can use the same software.

Hedda commented 1 year ago

Hi, I'm thinking of getting/building 2 of these adapters, and was wondering if you expect the current 2.1 version of the adapter to be compatible on a hardware level with the SW FFB Pro, if support ever gets implemented, or if you think it will require an entirely new board to work properly. Thanks!

Hardware-wise the original MS Sidewinder FFB Pro should really work like a non-FFB joystick via any Gameport MIDI adapter, the problem is that the force feedback does not work with the software support for it inside the gameport adapter firmware, without custom force feedback software support for the original MS Sidewinder FFB Pro it works like any dumb non-FFB joystick without FFB :(

I am guessing that what necroware means is that while software support can be solved s you should be able to use the same hardware you might end up still having to use a different software (firmware image) for the original MS Sidewinder FFB Pro than for the other joysticks?

Hedda commented 1 year ago

@NolanNicholson with you working on pull request https://github.com/necroware/gameport-adapter/pull/45 as well as https://github.com/NolanNicholson/SWFFB-Arduino you already found this older Adapt-FFB-Joy Arduino library and its developers reversed engineered documentation for Microsoft Sidewinder Force Feedback Pro (and the development forks of the Adapt-FFB-Joy project):

https://code.google.com/archive/p/sidewinder-arduino/

Adapt-FFB-Joy (originally for Teensy 2.0) look to support Microsoft Sidewinder Force Feedback Pro joystick with force feedback using a separate firmware image build:

https://github.com/tloimu/adapt-ffb-joy

Discussion about porting to ATmega32u4 on Arduino Pro Micro and Arduino Leonardo boards:

https://github.com/tloimu/adapt-ffb-joy/issues/20

Project wiki:

https://github.com/tloimu/adapt-ffb-joy/blob/wiki/README.md

https://github.com/tloimu/adapt-ffb-joy/blob/wiki/README.md#about-the-project

I believe that the most interesting part is that tloimu has in his wiki for that project as he has there done his best to document the MS Sidewinder Force feedback MIDI protocol as it has been reverse-engineered:

https://github.com/tloimu/adapt-ffb-joy/blob/wiki/SidewinderFFBMIDI.md

USB HID descriptor with force feedback development page:

https://github.com/tloimu/adapt-ffb-joy/blob/wiki/USBFfbHid.md

@Kreeblah recently also look to have made an updated custom PCB for the Adapt-FFB-Joy project project based on an ATmega32u4RC-MU to substitute for the original ATmega32u4-MU (as well as designed board with surface mounted components):

https://github.com/Kreeblah/SidewinderToUSBV2

http://descentbb.net/viewtopic.php?t=15526

PS: There looks as well to be a few forks of Adapt-FFB-Joy project code that might have added improvements to the original code?

https://github.com/tloimu/adapt-ffb-joy/network/members

Checkout fork example by JayBee which include an alternative patch set for adaptffbjoy-r54:

https://github.com/JayBee-git/adapt-ffb-joy

Hedda commented 1 year ago

Cool, tloimu made a stand-alone Force Feedback Tester -> https://github.com/tloimu/adapt-ffb-joy/tree/master/FeedbackTester

NolanNicholson commented 1 year ago

@Hedda - Thanks for collecting all this information in one place. It's really useful!

The 2.1 hardware design for gameport-adapter has a pin hooked up for MIDI TX. It differs from adapt-ffb-joy in two ways.

One, it's on an "ordinary" digital pin, instead of the 32u4's TX pin, so it cannot send MIDI comms using the hardware serial functionality. Arduino has a SoftwareSerial library that would allow sending 31 kbaud messages on pins other than the hardware TX pin, but I'm nervous the overhead of running SoftwareSerial might interfere with performance-sensitive packet decoding. (I tried including it in the firmware, and packets started coming in incorrectly, but I haven't done a ton of testing yet.) It might also be possible to roll something from scratch; MIDI is slow enough.

Two, adapt-ffb-joy puts a 220 ohm resistor in series with the output, which I understand to be pretty typical for MIDI lines. gameport-adapter lacks this resistor. I'm not sure if it's necessary for the Sidewinder.

Hedda commented 1 year ago

I believe that the most interesting part is that tloimu has in his wiki for that project as he has there done his best to document the MS Sidewinder Force feedback MIDI protocol as it has been reverse-engineered:

https://github.com/tloimu/adapt-ffb-joy/blob/wiki/SidewinderFFBMIDI.md

USB HID descriptor with force feedback development page:

https://github.com/tloimu/adapt-ffb-joy/blob/wiki/USBFfbHid.md

Another reference is this old but relevant community discussion about reverse engineering the Force Feedback Pro protocol:

https://www.descentbb.net/viewtopic.php?t=19061&start=280

Hedda commented 1 year ago

tloimu made a stand-alone Force Feedback Tester -> https://github.com/tloimu/adapt-ffb-joy/tree/master/FeedbackTester

@NolanNicholson Force feedback for Linux is btw documented (inc. list of force feedback commands under section 5.3.1) here -> https://www.kernel.org/doc/html/v4.17/input/ff.html (but note that Linux PID-drivers do work differently than Windows drivers).

FYI, Dirks Software also has a small free Force Feedback Diagnostic Program made for quickly testing MS FFB2 on Windows:

https://www.fs-force.com/support.php -> https://www.dirks-software.ca/downloads/ForceTest.exe

Another tip for testing is to download the free-to-play flight simulation platform/game "DCS World" ("Digital Combat Simulator World", a.k.a "DCS") and test force feedback with TF-51 Mustang and Su-25T (planes are free to play as a demo in the one terrain/map that is included for free), and you should also be able to test force feedback with any helicopters in DCS World (though only the AH-6 Little bird is available for free as a demo). There are also several free mods from the community that add planes like the A-4 and the T-45. Many people have otherwise recommended the paid-for Black Shark 3 / Ka-50 DLC for its force feedback experience (as well as other paid-for DLC terrains/maps). Enabled force feedback features depend on the plane/helicopter.

Other non-free games that support force feedback as Mechwarrior, Rise of Flight, World of Warplanes, and War Thunder, as well as the IL-2 series of combat flight simulator games.

Checkout fork example by JayBee which include an alternative patch set for adaptffbjoy-r54:

https://github.com/JayBee-git/adapt-ffb-joy

By the way, some more digging shows that JayBee's fork at https://github.com/JayBee-git/adapt-ffb-joy/ contains the latest code of Adapt-FFB-Joy and consolidates fixes and additional features from other forks of adapt-ffb-joy have branches with additional features. That above-mentioned old also community discussion mentions that JayBee's fork included changes from https://github.com/DEV-OGRE/adapt-ffb-joy/tree/feature/shift-and-frame-buffer as well as https://github.com/r8dhex/adapt-ffb-joy/tree/feature/shiftEnable and https://github.com/r8dhex/adapt-ffb-joy/tree/feature/moreButtons).

Hedda commented 1 year ago

tloimu made a stand-alone Force Feedback Tester -> https://github.com/tloimu/adapt-ffb-joy/tree/master/FeedbackTester

FYI, Dirks Software also has a small free Force Feedback Diagnostic Program made for quickly testing MS FFB2 on Windows:

https://www.fs-force.com/support.php -> https://www.dirks-software.ca/downloads/ForceTest.exe

Also check out this project meant to bring Force Feedback functionality to Elite Dangerous but could probably be useful for more:

https://github.com/bobhelander/EDForceFeedback

fedit.exe under /EDForceFeedback/FFUtils/ is btw apparently Microsoft Force Editor that was included with DirectX back in the day.

https://documentation.help/Force-Editor/fedit_7xdg.htm

There also looks to be some other related Force Feedback unitilities software there too:

https://github.com/bobhelander/EDForceFeedback/tree/master/EDForceFeedback/FFUtils

Hedda commented 1 year ago

Noticed @NolanNicholson started a project for Arduino Pro Micro -> https://github.com/NolanNicholson/SWFFB-Arduino

Any updates on your Microsoft Sidewinder Force Feedback Pro support for the Necroware GamePort Adapter project?

Seen that initial commits for MS FFB Pro without force-feedback support were merged in https://github.com/necroware/gameport-adapter/pull/48 (which replaced PR https://github.com/necroware/gameport-adapter/pull/45).

https://github.com/necroware/gameport-adapter/tree/sw-ffb-pro

necroware commented 1 year ago

Unfortunately I still have no FFB Pro joystick. I added correct detection, but there is one report without sufficient information, that the initialization doesn't work. Unfortunately, I can't investigate one that.

Hedda commented 1 year ago

Unfortunately I still have no FFB Pro joystick. I added correct detection, but there is one report without sufficient information, that the initialization doesn't work. Unfortunately, I can't investigate one that.

@necroware my offer stands if reconsider a donation of $30/€30 or shipping one of my Mircosoft SideWinder Force Feedback Pro.

A tip is can still find the original Mircosoft SideWinder Force Feedback Pro for less on different eBay and similar sites in Europe.

@necroware Do you live in the EU and are willing to look at implementing support for MS SideWinder Force Feedback Pro? My OCD made me collect more than a few of the original Microsoft SideWinder Force Feedback Pro joysticks over the years and I might be willing to donate one of my Microsoft SideWinder Force Feedback Pro joysticks to you if you would be willing to then look into adding full force feedback compatibility with it.

@necroware Maybe it would make more sense for me to ship it or donate/contribute a similar sum to the shipping cost (around $30/€30/£30) to you via PayPal so that you can buy a Microsoft SideWinder Force Feedback Pro joystick from eBay yourself?

I might perhaps consider donating more if you be willing to send me a few of your Necroware GamePort Adapters in return.

PS: By the way, I live in Sweden myself.

necroware commented 1 year ago

@Hedda yes, I remember, but I'm currently short on time anyway. The FFB Pro basic implementation is done, it would be nice, if someone who has the joystick would look on the serial console and see, what's wrong.