-
Notifications
You must be signed in to change notification settings - Fork 144
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
Losing connection with vJoy #164
Comments
I have now disabled power management of vJoy device and will see if that resolves problem. EDIT: It did not. |
Would it be possible to share your script so that we can have a look at what's going on? If anything, FreePIE is just sending axis/button states to the vjoy library that communicates with the driver. Sounds as if FreePIE is not pushing updates anymore. |
You can paste the script in a code block (see the github markdown documentation), but if this is all there is to it then nothing looks out of the ordinary. Good to know that All I can think of right now is adding a watch/log when the status of the joystick changes, though I do not see a reason for the device to suddenly get unacquired. However, the example feeder does handle this case by reacquiring the device if updating fails: FreePIE does not do this, though it should be trivial to add that. Are you in a position to make this change and recompile FreePIE, or should I send you an updated binary (+ send a pull-request once this is confirmed to work)? |
I'm trying to befriend the FreePIE code and Visual Studio environment. Do you think this will be acceptable ?
|
Can't you check it in the BeforeNextExecute |
Seems like a better place. Yes, I missed that one. |
You could do that in At the same time you could add a conditional to all |
I'll change to System.Console.WriteLine or to be quiet when I reaquire the device. |
Well I'm having problems recreating the detach. Will continue trying to recreate detach. |
I've finally managed to lose connection and verified FreePIE automatically connects back again. I'll try to have a PR ready by tomorrow. Busy weekend. |
Cool :). Was it the |
I check joystick.GetVJDStatus(Index) in CheckAlive() which is called from the DoBeforeNextExecute loop. It might be less expensive to just check retval from joystick.Set* calls but I'm thinking at that time it is already too late and you will miss one event? So for now I poll at every loop. Still no idea why it disconnects tho.. |
I agree it is a weird situation, especially since no-one has ever faced this before. However, this looks like expected behaviour thanks to the boolean returns from the Using the boolean will be faster because it's readily available (unlike If false is returned and the event is missed, it can easily be sent again after reacquiring the device, in the same private void UpdateJoystickField(Action updater)
{
if (!updater())
{
joystick.Acquire();
if (!updater())
throw new Exception("Failed to update joystick after .Acquire()!");
}
} |
PR created. |
I have a .py script that reads my thrustmaster joystick buttons and creates new buttons in a vJoy device from combinations of those. This because the TM buttons have ON or OFF position and when in OFF I can't bind them in simulators as I would like. So I create a vJoy button only device which I feed to enable buttons when the joystick button is not detected. And then I can bind the vJoy buttons inside the simulator.
It all works nice for a while but FreePIE losing connection to vJoy requires alt+tab out of simulation to stop script (shift+f5) and restart it again (f5), which makes it work again.
Sometimes connection lost in 10 minutes sometimes it lasts up to two hours or more.
I have checked vJoyList for owner of devices.
Sometimes the vJoy is still owned by FreePIE and sometimes the owner PID is blank.
FreePIE's own monitor is working. I can see in "Watch" window that the values are changing so connection with joystick is working fine (even without restarting script).
There is nothing written to the "Console" or "Error" windows when it fails
vJoy is still running and a simple stopping the script in freepie and starting it again makes it work fine again. No restart of vJoy or computer needed.
Checking the vJoy device through "USB game controllers" -> Vjoy -> Properties shows all darkened out buttons so none is received.
It appears to me that the connection between FreePIE and vJoy gets broken.
The text was updated successfully, but these errors were encountered: