Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How i can get force feedback data #210

Open
nosazik opened this issue Jan 29, 2022 · 18 comments
Open

How i can get force feedback data #210

nosazik opened this issue Jan 29, 2022 · 18 comments

Comments

@nosazik
Copy link

nosazik commented Jan 29, 2022

I want to take data to converting pwm arduino with freepie and vjoy

@AndersMalmgren
Copy link
Owner

We never got forcefeedbackdata working with vjoy sadly. If someone wants to have a go at fixing this i gladly pull the code

@nosazik
Copy link
Author

nosazik commented Jan 30, 2022

We never got forcefeedbackdata working with vjoy sadly. If someone wants to have a go at fixing this i gladly pull the code

Did u try the new version of vjoy 2.2.1 njz3/vjoy or njz3/vJoyIOFeederWithFFB?
I think they implement this
Had to update Dll of new version of vjoy on freepie to get work

@AndersMalmgren
Copy link
Owner

No, i haven't been active in freepie for a while now

@nosazik
Copy link
Author

nosazik commented Jan 30, 2022

No, i haven't been active in freepie for a while now

sad

@AndersMalmgren
Copy link
Owner

It's not very hard to setup freepie with visual studio if you want to have a go at it. Basicly just load it up and hit f5

@MarijnS95
Copy link
Contributor

I worked on this terribly long ago, one of the FFB branches on my fork: https://github.com/MarijnS95/FreePIE/branches/yours

I didn't have FFB hardware back then so relied on others to try random builds which never worked out, but I'm pretty sure I managed to successfully test and get this working with minimal trivial changes when I eventually owned one. Probably never got to cleaning/pushing/PR'ing it.

I'll look around on my old harddisk and see what I can still find and push to that branch!

@AndersMalmgren
Copy link
Owner

I worked on this terribly long ago, one of the FFB branches on my fork: https://github.com/MarijnS95/FreePIE/branches/yours

I didn't have FFB hardware back then so relied on others to try random builds which never worked out, but I'm pretty sure I managed to successfully test and get this working with minimal trivial changes when I eventually owned one. Probably never got to cleaning/pushing/PR'ing it.

I'll look around on my old harddisk and see what I can still find and push to that branch!

I think he wants to take the data and transform it out to his Arduino rather than a forcefeedback device if I'm not mistaken

@MarijnS95
Copy link
Contributor

Being a bit more clear (now that I remember again...), this is perhaps mostly irrelevant for you since extracting data from vJoy is only part of the problem: that branch also passes the data back into an XInput device (it was used back then to have multiple input devices, among which an FFB-driven wheel, feed a single unified vJoy device for games that didn't support this).

However, that branch should also contain some code/fixes to expose vJoy FFB data to Python, if it wasn't already there.

Also noticed just now that https://github.com/AndersMalmgren/FreePIE/commits/Ffb contains many such changes too.

@AndersMalmgren
Copy link
Owner

Hey guys, i merged ftb into a new branch with current master. Was a few conflcits. I tested with a joystick and it can still read values off the plugin. didnt try vjoy since I dont have vjoy driver installed etc. Be ny guest to take it from there :D

https://github.com/AndersMalmgren/FreePIE/tree/ftb_merge_master

@AndersMalmgren
Copy link
Owner

I tried above branch with this test software,.

https://www.fs-force.com/support.php#ForceTest

And that do triggers stuff in freepie

@AndersMalmgren
Copy link
Owner

image

Doesnt matter though what I send, FreePIE reads it all as DeviceGain.

@nosazik
Copy link
Author

nosazik commented Feb 1, 2022

image

@nosazik
Copy link
Author

nosazik commented Feb 1, 2022

I don't have a joystick that supports force feedback xD
Can I get force feedback data without supported device?

@nosazik
Copy link
Author

nosazik commented Feb 1, 2022

i saw a lot of DIY steering wheel, but depends on program like EMC utility lite or another pay program.
I think with freepie can do better than

@AndersMalmgren
Copy link
Owner

I don't have a joystick that supports force feedback xD Can I get force feedback data without supported device?

You need to forward the callback to python and handle the incoming stream of data yourself. The code in that branch only exposes a method to forward ffb to a ffb device. I would try with a real game and see what data it catches

@AndersMalmgren
Copy link
Owner

You need to register to VJoyFfbWrap.OnFfbCallback to start getting ffb data. Its exposed today only through vJoy[0].registerFfbDevice which indeed requires a ffb device. But you can easy add yoru method to start getting all packets in the console.

        public void RegisterFfbCallback(Action callback)
        {
            if (!FfbEnabled) throw new NotSupportedException("This VJoy device does not have FFB enabled");
            VJoyFfbWrap.OnFfbCallback += (id, type, data) => callback();
        }
        public void registerFfbCallback(Action callback)
        {
            holder.RegisterFfbCallback(callback);
        }
if starting:
	vJoy[0].registerFfbCallback(lambda : diagnostics.debug("called"))

You should start seing data packets in the freepie console now.

@cyberluke
Copy link

@nosazik I have some update:

  1. njz3/vJoyIOFeederWithFFB does not contain integration with DirectInput. It only forwards packets to PWM (Arduino / Teensy) providing support for Sega Model 3 and other arcade machines.

  2. njz3/vjoy is recommended and provides some FFB fixes, be sure to update VJoyInterface.dll and VJoyInterfaceWrap.dll in your FreePIE directory

I made some progress with FFB and also have working SlimDX (Direct Input) implementation:
#48

I have further forked njz3/vjoy and provided a refactored API that is faster for C# (because of nested pointers used in original vjoy, which even C++ guys do not like).

Now I'm on Win XP machine with VS2008 and fixing Ramp Effect in SlimDX FFB...will fork it as well. Hopefully they'll accept pull requests.

@cyberluke
Copy link

You can use vJoyIOFeederWithFFB without FreePIE and send PWM to your Arduino.

That's what it is for.

If you want to use it inside FreePIE, you need to download source codes, Visual Studio (I'm using VS2015). Then write plugin interfacing vJoyIOFeederWithFFB. You can use just BackForceFeeder, which is console app: https://github.com/njz3/vJoyIOFeederWithFFB/tree/master/BackForceFeeder ...that should be simple to integrate. Or just use additional VJoy device and sent it to BackForceFeeder, which will send it to Arduino.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants