Bug Report 0.633b - QSVHelper.exe was killed, encode failed

Status
Not open for further replies.

TribalBob420

New Member
TL;DR: Shinck is the man, his QSVHelper.exe file fixed my QuickSync related crashes and his file should replace the one currently packaged in zip downloads and probably the installer download as well. Thank you Shinck.



I am using the older 0.657b version of OBS and I just created an account here so that I could come and say thank you to Shinck and also to confirm that Shinck's QSVHelper.exe file DOES in fact fix the "QSVHelper.exe was killed" crash. At least on my system it does. I would suggest packaging his version with the downloadable zip packages and probably instituting it in the installer download as well.

I was very frustrated because my streams were very limited in quality because my i7 3770K just wasn't powerful enough to handle the higher end quality presets and QuickSync was allowing me to broadcast in MUCH higher quality (FANTASTIC looking streams) with the iGPU taking all the load of my CPU but it was crashing anytime I alt-tabbed, changed resolutions, or did pretty much ANYTHING. It would also crash at random times without provocation sometimes after a couple minutes, sometimes after a couple hours.

I replaced the QSVHelper.exe packaged in the OBS zip download with Shinck's version three days ago and haven't had a crash since.

Now I can broadcast 1080p 60fps streams that look beautiful even on high motion games although the 1080p does push the limits and stutters at times, so I have settled on broadcasting in 864p @60fps with a bitrate of 4500Kbps (I do mostly high motion gaming). I'm using Lanczos downscaling, Best Quality preset with high encoding profile, encoding in full range and my stream looks amazing. I'm broadcasting to YouTube so the end user will only get 720p (or one of the lower resolutions automatically offered by YT) but I figure it's better (for end-user quality) to broadcast the QuickSync in 864p quality and then let YT use their higher quality x.264 encoders to downscale it to 720p and the others.

So, Shinck, you are THE man. People like you are what makes forum communities great, very few end users have the knowledge and technical skill to really troubleshoot a problem and even those who do will rarely take the time to share their solution with others. Thank you for your help!
 

vadym

New Member
TL;DR: Shinck is the man, his QSVHelper.exe file fixed my QuickSync related crashes and his file should replace the one currently packaged in zip downloads and probably the installer download as well. Thank you Shinck.



I am using the older 0.657b version of OBS and I just created an account here so that I could come and say thank you to Shinck and also to confirm that Shinck's QSVHelper.exe file DOES in fact fix the "QSVHelper.exe was killed" crash. At least on my system it does. I would suggest packaging his version with the downloadable zip packages and probably instituting it in the installer download as well.

I was very frustrated because my streams were very limited in quality because my i7 3770K just wasn't powerful enough to handle the higher end quality presets and QuickSync was allowing me to broadcast in MUCH higher quality (FANTASTIC looking streams) with the iGPU taking all the load of my CPU but it was crashing anytime I alt-tabbed, changed resolutions, or did pretty much ANYTHING. It would also crash at random times without provocation sometimes after a couple minutes, sometimes after a couple hours.

I replaced the QSVHelper.exe packaged in the OBS zip download with Shinck's version three days ago and haven't had a crash since.

Now I can broadcast 1080p 60fps streams that look beautiful even on high motion games although the 1080p does push the limits and stutters at times, so I have settled on broadcasting in 864p @60fps with a bitrate of 4500Kbps (I do mostly high motion gaming). I'm using Lanczos downscaling, Best Quality preset with high encoding profile, encoding in full range and my stream looks amazing. I'm broadcasting to YouTube so the end user will only get 720p (or one of the lower resolutions automatically offered by YT) but I figure it's better (for end-user quality) to broadcast the QuickSync in 864p quality and then let YT use their higher quality x.264 encoders to downscale it to 720p and the others.

So, Shinck, you are THE man. People like you are what makes forum communities great, very few end users have the knowledge and technical skill to really troubleshoot a problem and even those who do will rarely take the time to share their solution with others. Thank you for your help!

i didn't undestand what to do with that 2 files shinck attached
tell me, please how to fix this problem
thx
 

vadym

New Member
I also suffered the crashes of QSVhelper.exe at random times. With more demanding games like witcher 3 it happens quite often between 10 - 20 minutes.

So I had a closer look in the source code and identified, that OBS.exe terminates the QSVhelper.exe if it's not responding for 1s. There is IPC communication between this two processes, so at normal operation there should be communication even if there is nothing to encode and OBS.exe will terminate QSVhelper.exe only if it's really stalled. I tried to increase the timeout to 10s but this didn't help, no change of the behaviour.

This shows that QSVhelper.exe permantly hangs and there is no quick workaround.

After terminating QSVhelper.exe OBS.exe exits itself with a crash (function CrashError), there is no crashdump (function DumpError).

I downloaded a quite new Intel Media SDK and replaced the existing includes and libmfx with this but it doesn't helped either.

The question is, why does it only happen with WIN 7 and WIN 8 works without problems?

To identify the location where it hangs I first implemented more debug outputs for the Media SDK calls to the QSVHelper.log file.
With this additional logs I saw that SDK encode sync-operations permanently failed with MFX_ERR_DEVICE_FAILED. The only possibility to recover is to reset the Intel encoding device (Quick Sync Encoder). This is now implemented but not tested because I want to find the root cause for this error.

I studied the Intel Media SDk and found, that the quick sync device can operate in two modes, D3D9 and D3D11. In my case it operates always in D3D9 mode and I tried to force it to D3D11 mode, but it doesn't work because it uses special features of DirectX 11.1 which aren't available on Windows 7, only on Windows 8 onwards. And for D3D11 QSVhelper implemented a special D3D11 device and D3D11 frame allocator for the used frame buffers. For D3D9 there is no such device or frame allocator though it's available.
So here is the big difference between Win8 and Win7 in the implementation of the QSVhelper.
And I looked at the implementation for Win7 without the dedicated D3D11 device. There are only pointer to shared frame buffers between QSVhelper.exe and OBS.exe filled from OBS.exe handed over to Media SDK functions! In case of the D3D11 device this buffers are first copied to this device and after that handed over to Media SDK.
And in Media SDK documentation there is absolutely disadvised to implement the coding toolchain in more than one thread and here we hand over buffers possessed by 2 processes!
After identifying this problem I implemented a Direct3D9 device and a Direct3D9 frame allocator analogous to the Direct3D11 device and according to Intel Media SDK samples.

Since this optimization of QSVhelper.exe I could encode video for many hours on Win7 (Intel i7 4770, Games on Nvidia GTX 660ti, 16MB Ram) and the code to reset the QSV device in case of stalled operation never has to be executed...

I attached the Code patch and for those of you who couldn't compile OBS yourself the QSVhelper.exe executable (hope this isn't against the forum rules..)


PS: The QSVhelper.exe ist 32bit even on Win64 builds of OBS because it's known, that binding the 32bit libmfx.lib of Intel Media SDK provides more performance than 64bit bindings. So you can replace the existing QSVhelper.exe with the attached 32bit version on 32bit and 64bit builds of OBS.

what to do with code patch
 

dodgepong

Administrator
Forum Admin
Locking this thread. This is for an old build of OBS Classic. If you are still having QSV problems, I recommend upgrading to OBS Studio, as OBS Classic is not being maintained anymore.
 
Status
Not open for further replies.
Top