Display Driver Crashes On Second Run Of App - c#

Basically, I have a super simple metro app I'm working on at the moment. All it does at the moment is display a webcam video stream. All the relevant current code is below (capture is a CaptureElement defined in XAML, and mediaCapture is of type MediaCapture). The code works perfectly the first time I run the program in debug local system mode from VS 2012. I then close the app by dragging it from the top. However, the next time I go to run the program, my display driver crashes - from the Windows Event Viewer: "Display driver igfx stopped responding and has successfully recovered.". I'm new to doing any development in C#, so I'm not really sure where to begin looking for what's causing this. Any help would be appreciated, thanks.
private async void init()
{
mediaCapture = new MediaCapture();
MediaCaptureInitializationSettings mc = new MediaCaptureInitializationSettings();
mc.StreamingCaptureMode = StreamingCaptureMode.Video;
await mediaCapture.InitializeAsync(mc);
capture.Source = mediaCapture;
await mediaCapture.StartPreviewAsync();
}
Note: init() is called from the constructor of MainPage, the only page currently.
Note 2: Here's an error that pops up when I run it in the simulator (this error is from my regular desktop environment though (sorry for the poor quality). I'm using a Windows 7 machine I recently upgraded to Windows 8 RTM:
Note 3: The Windows built in Camera app works fine.

By the message i guess, the problem is in your graphic card drivers, if you're using the default/included ones, try using some more specific (like the ones you can get at Nvidia or ATI websites) if you're using the drivers provided by the manufacturer of your card, then try the default/generic ones. A good option could be debbuging your application inside the Simulator instead of the real machine or (if you can) use a virtual machine.

So, it turns out it was a silly mistake by myself. Hopefully if anyone else is doing the same thing though they can find this. What happened apparently is that when I closed the app, VS 2012 continued debugging. When I reopened the app (from the start menu) VS was still debugging the last run. This somehow led to the display driver crashing. If anyone wants to explain in more depth why this would happen, I'd be glad. I'll mark this as the correct answer after I'm certain that this was causing all the display driver crashes.

Related

D3DImage loses device on WPF application

I am developing a WPF application that displays a directX scene.
The code that generates the directX scene is not mine and I have no access to it. (Its not a public code I can references you guys to)
Everything was working fine until I had to format my PC and installed Windows 10. (Before that I had Windows 7)
Now I can't see the DirectX scene and the RenderCapability.Tier on WPF returns 0.
The code works on other computers (Windows 7 and Windows 10) so I'm guessing its something to do with my computer but nothing changed hardware-wise..
I tried reinstalling DirectX and I tried reinstalling the display driver (tried several different drivers) but nothing works I still get RenderCapability.Tier = 0.
The code that displays the DirectX scene is mostly taken from this link:
https://www.codeproject.com/Articles/28526/Introduction-to-D3DImage
I couldn't find any help around the internet that actually solved my problem.
Any help would be appreciated.
Thanks!
Run dxdiag.exe, Display tab, ensure it prints "D3D acceleration: enabled" and "No problems found".
Also the linked sample has a bug, on some systems you must use a query to wait for completion of rendering before passing the texture to WPF. Otherwise WPF may show incomplete renderings, or none at all. If you render with DX9, see this, you need D3DQUERYTYPE_EVENT query, issue D3DISSUE_END after you've done rendering, then sleep until GetData returns S_OK.

Xamarin PCL Android app suddenly crashes in release mode

My Xamarin (PCL) Android application suddenly randomly crashes when it released. It sometimes happens even when you are not currently using it and then message that app stopped working appears.
I wonder, is there any way to track whats going on, maybe there are some logs which I could have a look, or anything else to find out what the issue as I said it randomly happens and hard to find the problem.
Many thanks in advance.
A fast solution would be to plug your device and use the Android Device Monitor to see if it print out something on the device logs. A more reliable solution would be of course to integrate a crash reporter system like what the others have suggested or Crashlytics.
You might need to add a crash reporting tool like HockeyApp or VS App Center, or wire up your own global exception handler

Debugging by attaching a process for windows phone apps

I'm currently running VS2013 Update 3, I'm building an app and i;m trying to mimic the Rate My App that shows up rate message dialog in b/w specified intervals.
My problem is that i've made a setting using ApplicationData.current.loclasettings and it is an integer.
and i want to see the settings number being updated every time i close and run the app to ensure the logic is perfect.
but i'm unable to do it. Every time i deploy the app from vs it replace the original app and thus erasing all the settings that have been previously saved.
I've tried to use attach a process but it doesnt work on windowsphones.
Well after a bit of research and going through the documentation it is clear that there is no way you can attach a process to the app that is already running on the phone.
At least for me there was no other way because Microsoft kept the USB debugging thing a little bit undocumented or not documented at all.
So, who ever are looking forward to first launch the app on a connected windows phone and then start the the connect to a process and select the appropriate device for communication , story it is not possible, at least the build that i;m using doesn't support. may there might be a better solution in the future.

Windows 8 app blue screen after loading UI

While running performance tests my application suddenly started giving blue screen shortly after the UI was loaded.
In the code im receiving the following error:
{"Error HRESULT E_FAIL has been returned from a call to a COM component."}
"The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.\r\n"
After looking around on google i wasn't able to find anything usefull. The main answers given didn't work such as installing driver updates or reinstalling the application. Keep in mind this is an app in development and it was working fine earlier this day. Between two test launches this happened.
EDIT
After testing the application on a tablet it turns out the development pc is the only machine with the UI loading bug. Going to look into it some more and ill let you guys know if i find a solution.
Edit 2
So after testing the app on the tablet and finding that it works fine there we decided to test the app on a 2nd development pc. Needless to say the same thing happened... in other words its a rendering issue that happens on windows 8.1 PC's but not on a tablet.
Facts as of now:
- Code worked yesterday, no longer works now
- Works on tablet but not on PC
- Nothing changed in the code since it worked
- Seems to happen in the rendering stages
- Bug happens when loading more than 23 items in a listview, app restores itself then
- Any more than 23 items and it stays bugged (dark blue screen but still responds to clicks)

Windows Phone 8 app randomly crashes with error code -2147220717 (0x80040313)

I am currently developing a stopwatch and timer app in C#/XAML for Windows Phone 8. While using my app on my phone, I found that it randomly closed out/crashed and that too at different points of use (i.e. I wasn't doing the same thing each time it closed out). While debugging, I found that my app closed out with the following error code in my output window:
"The program '[1100] TaskHost.exe' has exited with code -2147220717 (0x80040313)."
I am very confused as to why this is happening. I tried creating an entirely new solution and moving my code over and I've still been getting the same issue. I have tried using the app on multiple different devices, and the same thing happens (even in the Emulator). Sometimes the app crashes after 5 minutes of use, sometimes it crashes after 30 minutes of use, it's very unpredictable which makes it very hard to find the root of the problem. My app uses the XNA Framework to play an audio sound and the Coding4Fun Toolkit for a TimeSpanPicker control, and besides that there isn't much else that's particularly notable about my app. I have tried removing the playing of the audio file and removing references to the XNA Framework, and the problem persists.
Any ideas on what the problem could be?
Thanks in advance!
That what David said +
are you sure that the phone is not running out of memory?
Edit try a windows phone analysis(Alt +F1 | Debug->Start windows phone application analysis)
If you're using XNA framework in WP project you can get a crash when updating the UI thread.
You might need to run it through a Dispatcher?
Dispatcher.BeginInvoke(() => {
// Call your update UI methods here..
});
You might also find this post helpful:
http://social.msdn.microsoft.com/Forums/wpapps/en-US/c2751845-cb70-4301-aa1a-796fa1bb8e8c/the-program-241435222-taskhostexe-managed-has-exited-with-code-0-0x0

Categories

Resources