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

Fix gain packet & packet helper class #3

Closed
wants to merge 4 commits into from

Conversation

cyberluke
Copy link

C++ library issue:
Gain packet is always zero [FIXED]

C# wrapper issue:
Ffb_h_Packet incorrectly truncates packet data from 10 bytes to 2 bytes [FIXED]

… pointer, GC, unwanted marshalling and thread context block)
@cyberluke
Copy link
Author

cyberluke commented Sep 3, 2022

Added a secondary API to solve big performance impact under C# managed code.

Normally in C++ you copy data from pointer and continue in separate thread unblocking the receiving callback - as can be seen in one Sourceforge.net hosted VJoy C++ implementation.

But in C# the issue is that you cannot work like that with nested integer pointers. After discussion with my colleague, he point me out that even C++ developers think that using nested pointers is not the best practice for high performance throughput (which packet data definitely is).

In FAQ, you mention that if people have issues with slow FFB response, they should update their computer. This could be true a few years back, but I don't think the app is that demanding for todays computers and I believe the proposed changes present a solution for this user group as well.

So before, when using async processing in C#, the delay was constantly increasing with ingame FFB packets and latency was often around 50-200ms.

Now after this change, it looks like 0ms latency in C#
solved

Additionaly FYI, Ramp effect has been fixed in my another PR and has been merged to SlimDX master last week.

@cyberluke
Copy link
Author

Right now I have compiled this VJoy kernel driver and the last thing that needs to be fixed is HID reporting of FFB capabilities. I believe that could be the issue why some app behave differently using vjoy than direct connection. I think it sends incorrect range of force feedback. I already compared this using enumEffects in SlimDX and see that my real FFB device returns completely different parameters than what VJoy reports. Also it is flight stick, not driving wheel.

@cyberluke cyberluke closed this Sep 9, 2022
@njz3
Copy link
Owner

njz3 commented Aug 17, 2023

Just discovering your work on vjoy (being off for a while).
Sure I can merge your code.

@njz3 njz3 reopened this Aug 17, 2023
@cyberluke
Copy link
Author

I don't have a capacity for the next 2-3 months, but here is a working video of whole solution: https://www.youtube.com/watch?v=pIR5bgpmE7E

@cyberluke
Copy link
Author

cyberluke commented Aug 17, 2023

By the way I have big issues compiling this under Windows XP.

The worst habit of opensource developers is to hijack / rewrite / rape the Visual Studio solution file over and over. I am even not able to find a working commit in a timeline that would compile on Windows XP. That's why I stopped working on vJoy at the moment.

And you make a similar mistake as your predecessor: You constantly keep updating SLN files with latest Windows SDK while breaking compatibility. You should keep old SLN files and create some structured folder architecture. Open source development should have a higher purpose than current commercial development.

Visual Studio C++ and their SLN upgrade process is not compatible with how GIT works.

Thank you!

@njz3
Copy link
Owner

njz3 commented Aug 17, 2023

Sure, we have time to merge. I have seen that there are only conflicts related to project files, which should not be that hard to fix.
I just fixed the bug for Windows 11 compatibility (and probably future Windows versions), so I guess the life of vJoy has been extended by several years now...

@cyberluke
Copy link
Author

BTW: Here is pull request for SlimDX that solves Ramp effect Force Feedback: SlimDX/slimdx#515 (already merged)

@njz3
Copy link
Owner

njz3 commented Aug 17, 2023

By the way I have big issues compiling this under Windows XP.

The worst habit of opensource developers is to hijack / rewrite / rape the Visual Studio solution file over and over. I am even not able to find a working commit in a timeline that would compile on Windows XP. That's why I stopped working on vJoy at the moment.

And you make a similar mistake as your predecessor: You constantly keep updating SLN files with latest Windows SDK while breaking compatibility. You should keep old SLN files and create some structured folder architecture. Open source development should have a higher purpose than current commercial development.

Visual Studio C++ and their SLN upgrade process is not compatible with how GIT works.

Thank you!

Then I did a bad thing again. I moved everything to VS2022 and minimum Windows 10 and x64 version to hint the bug for Windows 11.

@cyberluke
Copy link
Author

Project such as yours has a long history - from Sourceforge to Github.

I have multi-boot machine Win XP, Win7, Win10.

Here are some of my personal commits for vJoy: https://github.com/cyberluke/vJoy

I was not able to compile it even under Win7 x64 due to Visual Studio project configuration. I spent around 30 hours of clean time only with that.

vJoy has a big impact on retrogaming and I become active in retrogaming community since COVID lockdowns. Right now someone from USA is shipping me MSDN CDs and books about Windows Kernel Driver development, so I can learn and understand why vJoy does not compile.

@njz3
Copy link
Owner

njz3 commented Aug 17, 2023

Small clarification as you are clearly misthinking something: vjoy is not my project, it was lead by Shaul until a few years ago when he gave up for personnal reasons.
What I can only confirm is that maintaining vJoy is a very time consuming hobby, and nobody will pay you the huge number of hours spent working late in the night for such hobby project. I spent the last 3 days of my vacations to find the Windows 11 loading bug because it would allow my vJoyIOFeeder app to work on Windows 11. I would prefer spending this time playing with my kids...
That is good for everybody if your are willing to pursue the project and maintain it. Nobody has time for that.

@cyberluke
Copy link
Author

I understand. I think you have more skills with kernel driver development. For me it would be easier to fund someone like you to solve compiling vJoy for Win XP. That could be a win win :-D

@njz3
Copy link
Owner

njz3 commented Aug 17, 2023

I understand. I think you have more skills with kernel driver development. For me it would be easier to fund someone like you to solve compiling vJoy for Win XP. That could be a win win :-D

I have to decline.
A good thing I suggest is that you start to play with WinDbg and kernel debugging tools (KDNET) for a few days, then you will be at practically the same level of knowledge as me and you probably can take the lead of the project.
That's something you can capitalize and monetize as coding in the windows kernel is very rare on this planet. It will never be my case (my daily job is not development).

njz3 pushed a commit that referenced this pull request Aug 25, 2023
@cyberluke
Copy link
Author

Hi, I'm back. Thank you very much for merging my PR!

I'm now testing ACCFFB https://github.com/Jabbah/irFFB/releases/tag/v0.2-beta that is using vJoy. I will need to help them to update to your vJoy fork to get better FFB in ACC game. (Assetto Corsa Competizione)

@cyberluke cyberluke closed this Jun 27, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants