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

Status
Not open for further replies.

Shinck

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.
 

koala

Active Member
Although I sat the problem out by using an outdated Intel driver on Windows 7 (where everything worked well) and now updated to Windows 10 (where the problem doesn't appear), I congratulate that you debugged and dug deeply to find the root cause. Great! I hope this patch will at eventually find its way into the main code of OBS.
 

Bumi

New Member
Hi,

I'm having this issue on Windows 10. Not sure how to fix it.. I have not tried the older driver yet. But I will tomorrow.
But here is my log.
 

Attachments

  • 2015-08-28-2258-40.log
    7.9 KB · Views: 79

Shinck

New Member
For QSV Errors it's always more informative to attach also the QSVHelper.log from the pluginData Directory.
This log will be overwritten with every new Encoding task so it has to be saved directly after the crash error.
 

Bumi

New Member
Yea... I have noticed.. Nvida NVENC works great.. But I prefer QuickSync. So I guess I'll have to stay with nvidia for a while..
 

Bumi

New Member
For some reason on Windows 10... When I selected "Resolution Downscale: None" I haven't had any crashes so far... Will update if I do.. But it is stable for now!

Can anyone else confirm it as well?

EDIT 1:
Been streaming for over 4 hours.. Still no crash after I turned off down scaling.
 
Last edited:

millar

New Member
Had the same QSVhelper.exe crashes.

Windows 7, Intel dual core g3258, AMD r9 290.

Using the most recent drivers it was crashing within 5 minutes every time.

Someone mentioned old drivers working so I started rolling back the drivers using archived ones from THIS site. The first one (v15.36.3.34) still didn't work, the second one (v15.33.18) did. The actual drivers version says 10.18.10.3496 in the system panel.

Been running fine for about an hour now. Working like a charm.

Just made an account to mention this for anyone who's looking for a solution. Tapping into the Integrated GPU is amazing for my CPU limited system, I'm just running a 30 second replay buffer at 30fps and half-1080p with zero performance drop. Pretty unexpected, OBS is a nice piece of software.
 

MrMCGuy

New Member
IK this is old, but i found a REAL solution.
First off, bios must have audio enabled.
Set the RAM there to something high, leaving it on auto would cause QSV error again.
Computer > Device Manager > Display Adapters > Intel HDxxxx > Uninstall (CHECK "uninstall driver software")
Restart PC
Go here to get August's IRIS drivers, http://www.guru3d.com/files-details/intel-iris-and-hd-graphics-driver-v15-36-3-64-download.html
Intel actually deleted that from their site in 3/2015 so thats the only download I found to be good.
Right click the .rar, properties, un-block
Exctract all
Install

That solved it for me on Windows 7 64bit.
2 Hours stream, no issues.

UPDATE: Broke after some windows updates.
It says my computer doesnt meet the minimum requirements for the file help please
 

Dave_Scream

New Member
Forget the attachment...
Thank you Shinck, you spend so much time to teach and fix this issue.

The old driver worked for me on win7 but there was problem. Old driver dont allow connect virtual monitor to make Intel HD card work for QSV encoding, so I must connect second monitor to HD Graphics card to allow it work, but in this situation, when 1 monitor connected to GeForce and second monitor connected to Internal card, OBS have problems with windows capturing.

So now I try to install your fix, then use latest intel driver wich allow me to connect virtual monitor to Intel, and will connect both my monitors to geforce. And there will be no problems with OBS window capturing.
 

gdlk

Member
Guys important update. On Win10 i got "QSVhelper was killed" error only if i'm trying to encode with nonstandart fps (something like 48 fps).
If i'm using 30 or 60 fps everything works fine. Tried it many times. So now i'm just using 60 fps for encoding. Hope this will help someone.

PS: I'm using latest 0.656b version. i7-3770k cpu. Standtart Intel video drivers from windows update (10.18.10.4276).
 
Last edited:

Kevin L.

New Member
Only registered to say 'Thanks!' and to confirm that the solution works for me:

Intel HD Driver: 15.31.9.64.3165

Streamed yesterday for about 4 hours without any issue. High FPS <3

My system:
Intel Core i5 3570K
GIGABYTE Z77X-D3H
ASUS STRIX GeForce GTX 970
16 GB RAM
 

Freizon

New Member
currently having the same issues with obs crashing and giving error message:
QSVHelper.exe was killed, encode failed.
This only happens when streaming cs:go but never when streaming payday 2.
Streaming with 3500kb/s, 720p@60fps,
Using the latest intel HD drivers, since I had problems with older ones pointed out on this thread,
pc setup is i5-4460, R9 380 4gb, asus z97 p mobo, 12gb ddr3-1600 ram.
 

flaneur

New Member
First of all, a big thank you to Shinck who made this file public that solved a problem many might have encountered.

I'll keep this post straight. My rig:

i7-4790K
GTX980 Ti
Intel HD 4600 Graphics (drivers are the latest as of June 18th 2016)
OBS 0.657b 64 bits (QSVHelper.exe by Shinck) + QSV
Win 7 x64

Game played: STAR CITIZEN
Stream duration: 3+ hours
Crashe occurences: NONE

The only thing that bothers me is that OBS asks me to update to last version (which currently is 0.657b) as one file has been altered. Other than that, it works like a charm.

Again, thank you Shinck.

dSlcsP8.jpg
 
Last edited:
Status
Not open for further replies.
Top