Jump to content
The simFlight Network Forums
Sign in to follow this  
RainerM

Prepar3D v5 HF2 does not quit when COM ports used for VRInsight

Recommended Posts

Hello Pete,
folks,

 

My problem is, that when I'm using the FSUIPC feature for VRInsight serial devices the Prepar3D v5  flight sim does not quit all processes when I'm leaving it with CTRL+C or by the "Exit..." menu function.

I have this entry in the FSUIPC ini:

[VRInsight]
1=COM3,COM12

Everything works great with it besides the mentioned problem. All is set up according to the FSUIPC manual including the Virtual Serial Ports Emulator software. When I start the sim (Prepar3D v5 Hotfix 2) the VRInsight software SerialFP2 is starting and my MCP panel is functional.

After the flight when I quit the sim the windows are all closing and I'm back to desktop. But a background process is left -> "Prepar3D exe" using about 2 gigs of main memory. It's visible with the windows task-manager. Another evidence of the running process is the microphone icon in the system tray which pops up when an application accesses the microphone, in this case Prepar3D v5. It remains in the tray after quitting the sim. When I shut down the background task by the task-manager function the microphon icon is removed.

Commenting out or removing the [VRInsight] entry in the FSUIPC ini solves the problem, no background process remains in the main memory after quitting the sim. This is 100% reproducible for me. It doesn't matter whether SerialFP2 or Virtual Serial Ports Emulator were started.

 

********* FSUIPC6, Version 6.0.10 (19th July 2020) by Pete & John Dowson *********
Prepar3D.exe version = 5.0.31.35253
Running inside Prepar3D v5
Module base=7FFA9B9D0000
Windows 10 Home 64 Bit reported as Build 18363, Release ID: 1909 (OS 10.0)
Reading options from "C:\Users\Rainer\Documents\Prepar3D v5 Add-ons\FSUIPC6\FSUIPC6.ini"
Checking the Registrations now ...
User Name="Rainer Meisel"
User Addr="rainer@meisel21.net"
FSUIPC6 Key is provided

...

      672 VRI port 1 "COM3" opened
      672 VRI driver port 1 "COM12" also opened
...

   162125 -------------------- Starting everything now ----------------------
   162125 Ready Flags: Ready-To-Fly=Y, In Menu=N, In Dlg=N
   162703 Run: "c:\Program Files (x86)\VRInsight\bin\SerialFP2.exe 0 30"
   163719 VRI COM3 <--- CMDRST [to Device]
   163813 Advanced Weather Interface Enabled
   163891 VRI COM3 <--- CMDCON [to Device]
   164453 VRI COM12 <--- CMDCON [to VRI Driver]
   164516 VRI COM3 <--- CMDFUN [to Device]
   164578 VRI FMER ("MCP Combi") detected on port COM3
   164578 VRI COM12 <--- CMDFMER [to VRI Driver]
   164703 VRI COM3 <--- CMDVER [to Device]
   164750 VRI COM12 <--- CMD2.520 [to VRI Driver]
   165438 Deactivated for PID=16228, "SerialFP2.exe"
   165453 Lost focus to PID=16228, "SerialFP2.exe"
   172735 Lost focus to PID=16228, "SerialFP2.exe"
   195047 WRITE0[16228]  330A,   2 bytes: D2 07                                            ..
   195391 VRI COM3 <--- CMDFR... [to Device]
   195625 VRI COM3 <--- ALT10000 [to Device]
   195828 VRI COM3 <--- DSP1*00* [to Device]
   196016 VRI COM3 <--- DSP0<00> [to Device]
   282610 KEYDOWN: VK=18, Waiting=0, Repeat=N, Shifts=4
   282610 .. Key not programmed -- passed on to FS
   289438 Ready Flags: Ready-To-Fly=Y, In Menu=Y, In Dlg=Y
   289438 Sim stopped: average frame rate for last 129 secs = 25.0 fps
   289438    Max AI traffic was 31 aircraft
   289438 -------------------------------------------------------------------
   291641 === Closing session: waiting for DLLStop to be called ...
   299156 === DLLStop called ...
   299156 === Closing external processes we started ...
   299172 VRI COM3 <--- CMDRST.. [to Device]
   300360 === About to kill any Lua plug-ins still running ...
   300500 === Closing global Lua thread
   301516 === About to kill my timers ...
   301719 === Restoring window procs ...
   301719 === Unloading libraries ...
   301719 === stopping other threads ...
   301719 === ... Button scanning ...
   301813 === ... Axis scanning ...
   301922 === Releasing joystick devices ...
   301922 === Freeing macro memory
   301922 === Removing any offset overrides
   301922 === Clearing any displays left
   301922 === NOTE: not calling SimConnect_Close ...
   301922 === AI slots deleted!
   301922 === Freeing button memory ...
   301922 === Deleting wxstationlist.bin file ...
   301922 === Closing my Windows ...
   301922 === Freeing FS libraries ...
   301922 === Deleting wxstationlist.bin file ...
   301922 === Closing my Windows ...
   301922 === Freeing FS libraries ...
   302922 === Closing devices ...
   305422 #A Terminating VRI thread
   305438 ... returned okay!

 

 

 

Best wishes,

Rainer

 

 

Edited by RainerM

Share this post


Link to post
Share on other sites
5 minutes ago, RainerM said:

   302922 === Closing devices ...
   305422 #A Terminating VRI thread
   305438 ... returned okay!

Is that the end of the Log?

Have you had this working before okay?

It sounds like it is stuck within the serial port functions in Windows. Unfortunately we don't have any VRInsight stuff to test with, but there are others here who do and I hope we hear from them.

Are you using LINDA at all? That's the main add-on we had similar reports on before, but i don't know if that's now used for VRI stuff. 

Pete

 

Share this post


Link to post
Share on other sites

Yes, this is the end of the log.

This was the first time I'm trying to use the VRInsight facility of FSUIPC. So the answer is no, I haven't had this working before.

I have tried LINDA but it was a disaster for me (the response time to button presses was 1 second and above). Then I removed every LINDA software part I was aware - for example the LUA script start commands in the FSUIPC ini file.

Thanks,

Rainer

Share this post


Link to post
Share on other sites
14 minutes ago, RainerM said:

This was the first time I'm trying to use the VRInsight facility of FSUIPC. So the answer is no, I haven't had this working before.

Ah, so ... it is a mystery.  We need to know where it is hung.

I don't know if it will be any good, but could you try this to get for information?

https://www.nirsoft.net/utils/what_is_hang.html

Pete

 

Share this post


Link to post
Share on other sites

WhatIsHang finds exactly the process I found in the task-manager windows Immediatly after Prepar3D shuts down the process "Prepar3D.exe" shows up in the WhatIsHang window.

This is the upper part of the details view for this process. I left the memory data aside...

 

Hang report for C:\Program Files\Lockheed Martin\Prepar3D v5\Prepar3D.exe
Generated by using WhatIsHang on 22.08.2020 15:43:00
Web site: http://www.nirsoft.net


Remarks:
* The program hangs in a single system call. You can look in the call stack and  stack data to find out which API function cause this hang.


Strings found in the stack:
FS98CHILD
!This program cannot be run in DOS mode.

$
@USVWATAVAWH¬$`ôÿÿHì 


Modules found in the stack:
C:\Users\Rainer\Documents\Prepar3D v5 Add-ons\FSUIPC6\FSUIPC6.dll , John L. Dowson , FSUIPC6 DLL: FS Universal IPC interface, IPC Interface and More, for Lockheed-Martin P3D versions 4 & 5
C:\Program Files (x86)\12bPilot\SODE\SimObjectAnimationModule64.dll , 12bPilot , SimObject Animation Module, SimObject Animation Module for FSX/P3D
C:\Program Files\Lockheed Martin\Prepar3D v5\api.dll , Lockheed Martin® , Lockheed Martin® Prepar3D®, api dll
C:\Program Files\Lockheed Martin\Prepar3D v5\language.dll , Lockheed Martin® , Lockheed Martin® Prepar3D®, language dll

ThreadID: 14460


Execute Address:
00007FFB1AA7F9A4  ntdll.dll!NtWaitForAlertByThreadId+0x14

Call Stack:


Stack Data:
0000001A7DB8EE98  00007FFB1A9E7619  ntdll.dll!RtlDllShutdownInProgress+0x439
0000001A7DB8EEA0  00007FFAFC1A0000
0000001A7DB8EEA8  000000007FFE0384
0000001A7DB8EEB0  0000000000000000
0000001A7DB8EEB8  00007FFB1AA0502A  ntdll.dll!RtlActivateActivationContextUnsafeFast+0x12a
0000001A7DB8EEC0  0000001A7DC573A0
0000001A7DB8EEC8  00007FFB1A9E74D2  ntdll.dll!RtlDllShutdownInProgress+0x2f2
0000001A7DB8EED0  0000000000000000
0000001A7DB8EED8  0000000000000000
0000001A7DB8EEE0  0000001A7DB8EF88
0000001A7DB8EEE8  000001EEC928DAA4
0000001A7DB8EEF0  000001EEC928DAA4
0000001A7DB8EEF8  000000000000387C
0000001A7DB8EF00  0000000000000000
0000001A7DB8EF08  0000000000000000
0000001A7DB8EF10  0000001A7DB8EEF0
0000001A7DB8EF18  000001EE00000000
0000001A7DB8EF20  0000000000000000
0000001A7DB8EF28  FFFFFFFFFFFFFFFF
0000001A7DB8EF30  0000000000000000
0000001A7DB8EF38  00007FFB1A9E72FD  ntdll.dll!RtlDllShutdownInProgress+0x11d
0000001A7DB8EF40  000001EEC928DA9C
0000001A7DB8EF48  0000000000001722
0000001A7DB8EF50  0000000000000000
0000001A7DB8EF58  0000000000000000
0000001A7DB8EF60  0000000000000000
0000001A7DB8EF68  0000000000003D94
0000001A7DB8EF70  0000000000000000
0000001A7DB8EF78  0000000000000000
0000001A7DB8EF80  0000000000000000
0000001A7DB8EF88  00000000FFFFFFFA
0000001A7DB8EF90  0000001A7DC58000
0000001A7DB8EF98  0000000000000000
0000001A7DB8EFA0  0000000000000000
0000001A7DB8EFA8  0000000000000000
0000001A7DB8EFB0  0000000000000000
0000001A7DB8EFB8  0000000000000000
0000001A7DB8EFC0  0000000000000000
0000001A7DB8EFC8  0000000000000000
0000001A7DB8EFD0  0000FAA5DD76A2C7
0000001A7DB8EFD8  0000000000000000
0000001A7DB8EFE0  0000000000000000
0000001A7DB8EFE8  0000000000000001
0000001A7DB8EFF0  0000000000000001
0000001A7DB8EFF8  0000000000000001
0000001A7DB8F000  00000000000007D0
0000001A7DB8F008  000001EEC928DA9C
0000001A7DB8F010  0000000000000001
0000001A7DB8F018  00007FFB1A9FB576  ntdll.dll!RtlEnterCriticalSection+0x1f6
0000001A7DB8F020  0000000000000000
0000001A7DB8F028  0000000000000000
0000001A7DB8F030  00000000FFFFFFFA
0000001A7DB8F038  0000000000000000
0000001A7DB8F040  0000000000000000
0000001A7DB8F048  0000000000000000
0000001A7DB8F050  0000000000000000
0000001A7DB8F058  0000000000000000
0000001A7DB8F060  000001EEC928D984
0000001A7DB8F068  0000000000000001
0000001A7DB8F070  0000000000000000
0000001A7DB8F078  00007FFB1A9FB3C0  ntdll.dll!RtlEnterCriticalSection+0x40
0000001A7DB8F080  0000000000000000
0000001A7DB8F088  0000000000000000
0000001A7DB8F090  000001EEC928D984
0000001A7DB8F0A8  00007FFAA4A4FEE4  FSUIPC6.dll+0x1fee4
0000001A7DB8F0D8  00007FFAA4A5BFEF  FSUIPC6.dll!DLLStop+0x98f
0000001A7DB8F0F0  00007FFAA4E46840  FSUIPC6.dll+0x416840
0000001A7DB8F198  00007FFADE6CD654  SimObjectAnimationModule64.dll+0xd654
0000001A7DB8F1C8  00007FFADE6CDB28  SimObjectAnimationModule64.dll+0xdb28
0000001A7DB8F218  00007FFADE6CC7CB  SimObjectAnimationModule64.dll+0xc7cb
0000001A7DB8F238  00007FF60F5D0000  Prepar3D.exe+0x0
0000001A7DB8F248  00007FFABD1263A3  api.dll!?SimConnect_LoadModule@@YAIPEB_W@Z+0xa3
0000001A7DB8F258  00007FF60F5D0000  Prepar3D.exe+0x0
0000001A7DB8F278  00007FFABD0FDCC8  api.dll!?WindowDecorationsEnabled@@YA_NXZ+0x268
0000001A7DB8F2A8  00007FFABD10E616  api.dll!?application_real_frame_delta_seconds_f64_get@@YANXZ+0xe56
0000001A7DB8F2C0  000001EE860F0000  language.dll+0x0
0000001A7DB8F2D8  00007FF60F5D1562  Prepar3D.exe+0x1562
0000001A7DB8F2F8  00007FFABD0D0000  api.dll+0x0
0000001A7DB8F300  00007FF60F5D1000  Prepar3D.exe+0x1000
0000001A7DB8F498  00007FFB1AA01724  ntdll.dll!LdrLoadDll+0x124
0000001A7DB8FB98  00007FF60F5D17BE  Prepar3D.exe+0x17be
0000001A7DB8FBD8  00007FFB1A197BD4  KERNEL32.DLL!BaseThreadInitThunk+0x14
0000001A7DB8FC08  00007FFB1AA4CE51  ntdll.dll!RtlUserThreadStart+0x21


Processor Registers:
RAX: 00000000000001CA
RBX: 0000000000000000
RCX: 000001EEC928DAA4
RDX: 0000000000000000
RSI: 0000000000000000
RDI: 0000001A7DB8EF18
RBP: 0000001A7DC573A0
RSP: 0000001A7DB8EE98
RIP: 00007FFB1AA7F9A4  ntdll.dll!NtWaitForAlertByThreadId+0x14

Share this post


Link to post
Share on other sites
On 8/22/2020 at 2:53 PM, RainerM said:

WhatIsHang finds exactly the process I found in the task-manager windows Immediatly after Prepar3D shuts down the process "Prepar3D.exe" shows up in the WhatIsHang window.

Okay, after some analysis with this data and he code in FSUIPC, i can see that this problem is one which has occurred periodically before with COM devices. I'm pretty sure it is associated with using COM to USB adapters with small IO buffers or other flow problems and which in turn cause the low level driver in Windows to hang.

Certainly the analysis shows that the thread trying to close the COM ports is waiting for a return from a call made into Windows.

Could you please tell me exactly how your VRI device is connected to the PC?  Is is a built-in COM port board (the recommended way) or a line adapter COM to USB? If the latter can you tell me the make please?  I ask because i've had serious problems with some of those devices.  I ended up paying more for the Brainboxes ones -- I can recommend those, never a problem since. (I don't use VRI devices but my PFC cockpit is mostly on COM port , as is my GA28R VFR cockpit).

Anyway, one of the workarounds for VRI devices we devised which has worked for others is:

VRIDisableCMDRST=Yes

in the [General] section of the FSUIPC6.INI file (if the parameter is already there, make sure it is set you 'Yes'. Else add the line. This will simply not try to reset the device when you finish.

Pete

 

 

 

Share this post


Link to post
Share on other sites
4 hours ago, Pete Dowson said:

Could you please tell me exactly how your VRI device is connected to the PC?  Is is a built-in COM port board (the recommended way) or a line adapter COM to USB? If the latter can you tell me the make please?

I use the first version of VRInsight's MCP combo panel. The only option to connect this device to the PC is the attached USB cable.

It installs as "USB Serial Port (COM3)" and uses FTDI drivers. So it seems to be a cheap FTDI USB to COM solution.
FTDI driver date 09.03.2016 version 2.12.16.0

4 hours ago, Pete Dowson said:

Anyway, one of the workarounds for VRI devices we devised which has worked for others is:

VRIDisableCMDRST=Yes

in the [General] section of the FSUIPC6.INI file (if the parameter is already there, make sure it is set you 'Yes'. Else add the line. This will simply not try to reset the device when you finish.

Unfortunately this doesn't help. The COM Port and its handling process does not quit. Same without this option.

Share this post


Link to post
Share on other sites
3 hours ago, RainerM said:

The only option to connect this device to the PC is the attached USB cable.

It installs as "USB Serial Port (COM3)" and uses FTDI drivers. So it seems to be a cheap FTDI USB to COM solution.

Ouch. So the adapter is built into the device. Shame.

3 hours ago, RainerM said:

Unfortunately this doesn't help. The COM Port and its handling process does not quit. Same without this option.

I'm not sure what else to suggest.  I suppose we could have yet another thread which waits a few minutes and if no shutdown occurs can do the same ruthless termination as you'd do yourself via Task Manager in any case.

Maybe trying an alternative USB port on your PC will help. One question on that: you aren't connecting to a USB-3 port (blue coloured) on the PC are you? If so, don't. Many older USB devices don't work well on USB3 ports.

There used to be a VRI expert who used to visit here, but i think he packed up.  I think now the only folks around here who know much about VRI devices are those doing LINDA. Did you stop using that for a reason? I think you don't need to use SerialFP2 if you use LINDA, which may well help. I was never happy with that driver.

Pete

 

Share this post


Link to post
Share on other sites

@RainerM if I might chip in here. I do not use SerialFP2 with my VRI MCP panels except to install the FTDI serial to USB drivers. As the support developer I would recommend you investigate LINDA 3.2.6 which works with all VRI combo MCP panels and P3Dv5.

There is a 30s delay on P3D closing before the MCP is released. This was added to FSUIPC6 to ensure that the P3D background task correctly terminated. This should solve your issue.

  • Like 1

Share this post


Link to post
Share on other sites
On 8/25/2020 at 11:46 PM, Pete Dowson said:

Ouch. So the adapter is built into the device. Shame.

In my oppinion the adapter is build into the cable or into the USB plug. I know such cables from my job (for example this one). I think so because the sim hangs even without switching the VRInsight combo panel on. It's enaugh to plug it into the PC. And since the cable is powered anyway the virtual COM port is visible in my system and FSUIPC can open it with the panel switched off.

 

On 8/25/2020 at 11:46 PM, Pete Dowson said:

you aren't connecting to a USB-3 port (blue coloured) on the PC are you? If so, don't. Many older USB devices don't work well on USB3 ports.

I'm connecting to a red one 🙂 USB 3.2. Ok, thanks for this hint. I'll try it.

 

On 8/26/2020 at 1:46 PM, Scotfleiger said:

As the support developer I would recommend you investigate LINDA 3.2.6 which works with all VRI combo MCP panels and P3Dv5.

As I stated earlier I've already tried LINDA. This is a different story. For the given problem it doesn't matter if SerialFP2 or LINDA is running or not. Thanks for the suggestion anyway.

 

Rainer

 

Share this post


Link to post
Share on other sites

It works now but I don't why.

I did some analysis with Process Monitor from Sysinternals and tried a workaround with Virtual Serial Ports Emulator (accessing the buggy FTDI USB COM port with VSE between...). I changed a lot of settings and set them back to the original value afterwards. So I would say, I've the same setup as before, but it works now. Prepar3d closes now all processes after a couple of seconds.

One of my last manipulations was to deactivate the COM port device in the device manager and activate it again. I updated the FTDI driver earlier before but without success as well. Maybe the deactivation / actviation cleaned up some internals.

However - it's all guesswork now since I can't reproduce the bad behavior anmymore.

I'm happy with the working system now. Maybe I'll have now a look on LINDA again.

 

Pete, thank you for the support!

 

Best wishes,

Rainer

 

 

Share this post


Link to post
Share on other sites
15 minutes ago, RainerM said:

Pete, thank you for the support!

Well, I wasn't really much help, so I'm very pleased it solved itself, somehow!

Pete

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.