|
Post by virtual on Aug 15, 2017 16:12:07 GMT
I have question about Force feedback:
DirectInput - Create effect1 - Start effect1 - Create effect2 - Start effect2 .... After ~5 min Stop effect1
vJoy FFB Callback ... After ~5 min I get one FFB Packet with type "PT_EFOPREP" (Effect Operation Report) and extract from it "FFB_EFF_OP" stucture (contains EFF_STOP). But it don't contain information about what exactly effect was stopped. Exist any method to know any information about effect from this Packet?
|
|
|
Post by Shaul (Admin) on Aug 17, 2017 5:20:22 GMT
It has been a very long time since I wrote the support to FFB. AFAIR vJoy can handle only one effect at a time.
|
|
|
Post by virtual on Aug 18, 2017 17:23:53 GMT
Yes, very possible that vJoy can handle only one active effect. But all other FFB packets have enough effect information. Exception: changing an "type specific" parameters (this packets refer to some effect or to all possible effects; Similar problem have "PT_EFOPREP" packets). enum FFBOP have "EFF_SOLO" ( msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.idirectinputeffect.idirectinputeffect.start(v=vs.85).aspx: "All other effects on the device should be stopped before the specified effect is played. If this flag is omitted, the effect is mixed with existing effects already started on the device"). I tried to use "EffectBlockIndex" to distinguish between effects, but it was always "1" or unknown (not effect reports: PT_CTRLREP, PT_BLKFRREP, ...). Another my problem: vJoy often disable callback function. It occur sometimes on startup, sometimes after some time. I solve this by using timer (interval 100 ms) that causes FfbRegisterGenCB. Possible this work of Direct Input in "exclusive" mode. And another problem: Ramp Force. This only one effect that causes SlimDX "E_INVALIDARG" exception. Possible this bug in SlimDX.
|
|
|
Post by Shaul (Admin) on Aug 19, 2017 8:38:33 GMT
Without going into details, vJoy does not do much with FFB. It just presents itself as a FFB capable device and passes the application's FFB packets down the line to the Receptor.
|
|
|
Post by firstplatolv on Sept 15, 2017 8:54:47 GMT
virtual I managed to get a working feeder with FFB support, using vJoy in C# and I had similar problem with determining what "PT_EFOPREP" refers to. I won't be able to go into details because it's not fresh in my memory, but IIRC "PT_EFOPREP" refers to previous EFF_REPORT packet. So I ended up storing the previous EFF_REPORT packet until a new packet arrives. FFB_REPORT has EffectType field by which you can determine to which effect "PT_EFOPREP" refers to. Regarding vJoy disabling callback, i'm pretty sure there is a bug in your code, because I never experienced this (and I had users running my feeder/receptor for hours). P.S. I suggest you use FfbMon app (part of vJoy) to monitor packets, then use something like FFB inspector and send an effect. You will see the order of packets (and order is important).
|
|
|
Post by virtual on Sept 15, 2017 16:59:55 GMT
Main problem occur when application download to device several effects but not start them at once. Download a effect to device cause "PT_EFFREP" packet. But start or stop effect cause single "PT_EFOPREP" packet which don't contains any information about effect. Of course, I can use previous packets to determinate a effect but it can be incorrect in some causes (read my first post example). I think to determinate a effect need use parameter "EffectBlockIndex". Currently, it always equal "1" (unknown for non-effect reports) - very high chance what vJoy correct support only one active effect.
P.S.: Someone tested Ramp Force? I get a error when create this effect.
|
|
|
Post by firstplatolv on Sept 15, 2017 21:10:04 GMT
AFAIK there is no real benefit of loading multiple effects of the same type in memory of device. Even if you could find a scenario where that is needed, not all wheels handle that too well. So at least in my implementation, there is no such problem as you described, since there is only one ET_CONST loaded in memory, then if EFF_REPORT has EffectType ET_CONST, I'm stopping that effect. I did experiment with SharpDX and SlimDX only briefly but I didn't like how things are done there and abandoned them. Now I use WGI (which is good for Windows 10 , but nothing else) and basically start by loading one effect of each type in memory of device, and then modify parameters on the fly and start or stop them. Effect parameters can be updated without actually having to repeatedly load and unload the effect, so it's kinda neat.
So the real question is, what would be the purpose of loading multiple effects of the same type in memory of device and can you predict the behavior of various devices under those conditions?
P.S. RampForce works fine here for WGI. I get an error, when trying to send RampForce through FFB inspector (which uses SlimDX) though.
|
|
|
Post by firstplatolv on Sept 16, 2017 3:56:39 GMT
Now that I read your initial post again, it seems kinda strange. Without knowing what actually happens when you use "...", I can only say that it shouldn't look like this. Why do you mention those 5 minutes? Are you trying to send FFB effect only once in 5 minutes or is this what you're getting from some game in terms of FFB data? You need to be more specific. If you're not getting EffectReport packet, a packet that contains specific effect parameters and packet that contains operation, your FFB is not working correctly. You should always receive this data. I vaguely remember that I had a problem with FFB sort of working but really not working for vJoy. Turns out I had to enable all axes in Configure vJoy, otherwise I would receive only a few packets and then basically FFB would die. Not sure if it helps, but it would be easier to assist if you would be more specific about the context you're experiencing this problem. I can assure you that FFB works with vJoy and multiple effects can be run at the same time without any problems and EffectBlockIndex is not needed to successfully distinguish and control effects.
|
|
|
Post by virtual on Sept 16, 2017 16:53:21 GMT
Some examples:
======================================== Example 1 (About "stop" of runned effects) ======================================== Variant 1 - Create and start a effect1 with duration = infinity; - Create and start a effect2 with duration = infinity; - Stop effect1.
Variant 2 - Create and start a effect1 with duration = infinity; - Create and start a effect2 with duration = infinity; - Stop effect2.
Both variants have same report packets.
======================================== Example 2 (About "start" of preloaded effects) ======================================== Variant 1 - Create and download a effect1; - Create and download a effect2; - Start effect1.
Variant 2 - Create and download a effect1; - Create and download a effect2; - Start effect2.
Both variants have same report packets.
======================================== Example 3 (About changing type-specific parameters) ======================================== Variant 1 - Create and start a effect1 (Square) with duration = infinity; - Create and start a effect2 (SawtoothUp) with duration = infinity; - Change type-specific parameters "PeriodicForce" of effect1.
Variant 2 - Create and start a effect1 (Square) with duration = infinity; - Create and start a effect2 (SawtoothUp) with duration = infinity; - Change type-specific parameters "PeriodicForce" of effect2.
Both variants have same report packets.
|
|
|
Post by firstplatolv on Sept 19, 2017 11:27:34 GMT
Turns out you're right. I've experimented a little with my app, and yeah, currently there is no way to determine to which effect the EFF_STOP refers to. What is interesting though is that it never was a problem in games I tried. Not sure if it applies to all games, but at least the ones I try, never explicitly stop effects, they just change effect parameters and the effect stops once it has played for the duration defined. So this might a be a problem in theory, but I've yet to seen real world application where this is a practical problem. This could be a practical problem if you're attempting to load more than one instance of the same effect type in device's memory, because then you have no way of telling for which of the instances you need to apply parameters you receive. But I spoke to people who currently design Windows Gaming Input (it's the new Windows standard API for input) and they said, that you really shouldn't ever load more than one instance of the same effect type, because different wheels handle those cases differently (some would only play the newest, some would attempt to play both, but there is no standard behavior in these cases), so they are to be avoided if possible.
|
|
|
Post by virtual on Sept 19, 2017 16:24:47 GMT
I don't have any physical FFB devices, so I desire to make 1:1 model - full playback DirectInput FFB actions. Currently it probably impossible. Probably it don't necessary in most cases. Simple I don't known how many games or user applications use multi-effects and how they use them. I work on "prediction system" to partially close multi-effects problem. For example: "stop" command probably not refer to ended effect (actually I can stop a effect in any time, even when it ended and get "stop" report packet).
|
|
|
Post by AletEnadnence on Sept 24, 2020 1:15:35 GMT
|
|
|
Post by LloydBub on Nov 6, 2020 19:59:15 GMT
Hi, here on the forum guys advised a cool Dating site, be sure to register - you will not REGRET it <a href=https://bit.ly/384HTnk>https://bit.ly/384HTnk</a>
|
|