The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
jjshi
Posts: 3
Joined: Mon Aug 16, 2021 5:43 am

The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by jjshi »

I am staring to using the Simconnect API for a video stream output, but the prepar3D application crashes upon the SimConnect_BeginVideoStream event is called.
The application is running on Windows 10. I am using the VLC media player to open the sdp file to receive the video stream. But there is no stream received, the prepar3D crash instead.

The sdp file is as the following:
v=0
o=-0 0 IN IP4 127.0.0.1
s=No Name
t=0 0
m=video 7070 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 H264/90000
a=fmtp:96 packetization - mode = 1

The code is as the following:
void CALLBACK MyDispatchProcSD_Host(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext)
{
......//other events here

case PrePare3DCommunication::EVENT_ID::EVENT_POSITION:
{
static const TCHAR* TEST_STREAM_ADDRESS = TEXT("127.0.0.1");
SIMCONNECT_DATA_VIDEO_STREAM_INFO streamInfo;
strcpy_s(streamInfo.szSourceAddress, TEST_STREAM_ADDRESS);
strcpy_s(streamInfo.szDestinationAddress, TEST_STREAM_ADDRESS);
streamInfo.uWidth = 640;
streamInfo.uHeight = 480;
streamInfo.uBitRate = 512000;
streamInfo.uFormat = 0;
streamInfo.uFramerate = 24;
streamInfo.uPort = 7070;

hr = SimConnect_BeginVideoStream(hSimConnect_host, "Virtual Cockpit - View 00", streamInfo);
}
break;

...//other events
}

The event is called by pressing the "u". During dubug find the return result is S_OK.

Do not know why the application crash upon receive the event. Can anyone help? Thanks.

Best regards
JJSHHI
Prabhatpatidaraerx
Posts: 1
Joined: Mon Oct 04, 2021 11:15 am

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by Prabhatpatidaraerx »

Hey I am also facing the same issue.
I am using managed code

here is sample I used

SIMCONNECT_DATA_VIDEO_STREAM_INFO stream_Info;
stream_Info.szDestinationAddress = "192.168.20.88";
stream_Info.szSourceAddress = "192.168.20.62";
stream_Info.uPort = 1234;
stream_Info.uBitRate = 800000;
stream_Info.uHeight= 360;
stream_Info.uWidth = 480;
stream_Info.uFramerate= 30;
stream_Info.uFormat = 0;

and when I tried to call BeginVideoStream(viewName,stream_Info)
P3d got crashed

Have you find any solution for this
seanmcleod
Posts: 55
Joined: Thu Mar 24, 2011 1:18 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by seanmcleod »

Prabhatpatidaraerx, jjshi did you manage to figure out what was causing the crash?
PrepUser2022
Posts: 3
Joined: Fri Mar 11, 2022 10:26 am

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by PrepUser2022 »

I'm encountering a comparable crash when running Prepar3D.exe 5.3.17.28160 and using a Win64 Debug add-on to try to create a stream for a child window. Whether the child window is docked or undocked doesn't appear to make a difference. The test PC is equipped with two display adapters:

Intel UHD Graphics 360
nVidia GeForce GTX 1060 "Max Design"

A default scenario file consistently creates the same arrangement of child windows and assigns a custom camera to each.

I have been able to modify the details of each custom camera successfully using SimConnect, e.g. by calling SimConnect_CameraSetRelative6DofByName.

However, if I try to create a stream on a child window by calling SimConnect's SimConnect_BeginVideoStream function, Prepar3D itself will crash.

Typical code is as follows:

SIMCONNECT_DATA_VIDEO_STREAM_INFO settings = { "127.0.0.1", //Source
"127.0.0.1", //Destination
49000, //Port
480, //Width
360, //Height
30, //FPS
800000, //BPS
0 };//.H264 encoding

hr = SimConnect_BeginVideoStream(currentSimConnectHandle, "IRCam - View 05", settings);
PrepUser2022
Posts: 3
Joined: Fri Mar 11, 2022 10:26 am

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by PrepUser2022 »

The Windows specifications are as follows:

Edition: Windows 10 Home
Version: 21H2
OS build 19044.1586

I was able to perform a screenshot of the Prepar3D debug console shortly before the crash. Most statements pertain to successful calls to SimConnect_CameraSetRelative6DofByName.

I believe that the only Prepar3D debug output that pertains to SimConnect_BeginVideoStream is ...

< 71.94356 [384] ObjectData: RequestID=2 ObjectID=2 DefineID=0 dwSize=48
< 71.97684 [384] ObjectData: RequestID=2 ObjectID=2 DefineID=0 dwSize=48
PrepUser2022
Posts: 3
Joined: Fri Mar 11, 2022 10:26 am

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by PrepUser2022 »

A more complete view of the Prepar3D's debug console at the time of the crash:

> 159.68032 [1, 1] Open: Version=0x000--23 Name ="PTZAddon"
< 159.68512 [384] ObjectData: RequestID=2 ObjectId=2 DefineID=0 dwSize=48
< 159.73587 [384] ObjectData: RequestID=2 ObjectId=2 DefineID=0 dwSize=48
> 159.79096 [1.2] BeginVideoStream:szViewName="IRCam - View 05", StreamInfo=1965022384
> 159.79216 [1.3] BeginVideoStream:szViewName="IRCam - View 05", StreamInfo=1965022384
< 159.70443 [1] >>>>> EXCEPTION=1, SendID=3, Index=-1 <<<<<
User avatar
Rob McCarthy
Lockheed Martin
Posts: 3703
Joined: Wed Aug 24, 2011 1:37 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by Rob McCarthy »

Hello everyone,

We're investigating the issue and will report back once we have more information.

Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead
seanmcleod
Posts: 55
Joined: Thu Mar 24, 2011 1:18 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by seanmcleod »

Rob, you haven't asked for anymore details from users reporting the issue so can we assume you can at least repro the issue?
seanmcleod
Posts: 55
Joined: Thu Mar 24, 2011 1:18 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by seanmcleod »

Rob, are there known versions of 5.x, e.g. 5.2 or 5.1 that are known to work in terms of SimConnect_BeginVideoStream that we could use for our project?

I noticed that the original post is from Aug 2021 and the next post from Oct 2021. They don't mention the exact version they were using, but that was before 5.3 was released. So it appears that version 5.2 possibly also has this bug?

We need to produce a working version for our client in the next 4 months. So we need to know if there is an earlier version we can fall back on while waiting for information on when this will be fixed for version 5.3, which may not be soon enough for our project.
seanmcleod
Posts: 55
Joined: Thu Mar 24, 2011 1:18 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by seanmcleod »

Rob, or anyone else at Lockheed Martin, can we have an update please?
seanmcleod
Posts: 55
Joined: Thu Mar 24, 2011 1:18 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by seanmcleod »

Still silence from Lockheed Martin, and in particular no answer to my question of which versions of P3D have a working implementation of BeginVideoStream.

So I purchased and renewed my developer license for P3D V4.5 and tried to see whether BeginVideoStream works in V4.5.

The first time I called BeginVideoStream I received a firewall notification request from the Windows firewall manager, which I approved and immediately after that P3D crashed. Thinking it may have just been a timing issue with the firewall request I then re-ran P3D and ran my SimConnect client app to call BeginVideoStream again.

Unfortunately P3D V4.5 crashes every time I try.

So has BeginVideoStream ever worked in any version of P3D?

Or is there some other common denominator that has changed independent of P3D which is causing an issue which results in any version of P3D crashing when BeginVideoStream is called. For example, some GPU driver update, or DirectX update, or some other Windows update that has gone through affecting graphics etc. since presumably Lockheed Martin at least saw this working at some point in time when they implemented BeginVideoStream and whenever they actually tested it?

So in my particular case I'm running Windows 11, with an nVidia GeForce RTX 2070.

This is the Event Log entry I get for the crash.

Code: Select all

Faulting application name: Prepar3D.exe, version: 4.5.13.32097, time stamp: 0x5d8abf93
Faulting module name: g2d.dll, version: 4.5.13.32097, time stamp: 0x5d8abf01
Exception code: 0xc0000005
Fault offset: 0x00000000000c6622
Faulting process id: 0x8454
Faulting application start time: 0x01d84c47aade1588
Faulting application path: C:\Program Files\Lockheed Martin\Prepar3D v4\Prepar3D.exe
Faulting module path: C:\Program Files\Lockheed Martin\Prepar3D v4\g2d.dll
Can we please get some sort of update from Lockheed Martin?

Are there any P3D users who can confirm that BeginVideoStream doesn't crash on their system? If so, what combination of P3D version, OS version, GPU etc. works for you?
User avatar
Beau Hollis
Lockheed Martin
Posts: 2452
Joined: Wed Oct 06, 2010 3:25 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by Beau Hollis »

Hello all,

Sorry for the delayed response. We found the issue and it should be working again in the next release. Thank your for the detailed reports on this. There was a new error we were not handling properly. We think the new error was a result of updates to Microsoft media foundation in windows.

Thanks
Beau Hollis
Prepar3D Software Architect
seanmcleod
Posts: 55
Joined: Thu Mar 24, 2011 1:18 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by seanmcleod »

Hi Beau

Will there be a hot fix for V4.5 or will the BeginVideoStream functionality only be fixed for V5.3 Hotfix 3 and later?

Any timeframe, even rough for V5.3 Hotfix 3, are we talking weeks or months?

Thanks
seanmcleod
Posts: 55
Joined: Thu Mar 24, 2011 1:18 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by seanmcleod »

Still looking for an answer to my last question from a couple of weeks ago.
User avatar
Beau Hollis
Lockheed Martin
Posts: 2452
Joined: Wed Oct 06, 2010 3:25 pm

Re: The Prepar3D v5 application crash when using SimConnect_BeginVideoStream

Post by Beau Hollis »

Unfortunately I can't share any details on the release schedule at this time. I am not aware of any plans to update v4.
Beau Hollis
Prepar3D Software Architect
Post Reply