[RESOLVED] DGAvcDecDI crashes when playing mkv-file

Support forum for DGAVCDecDI
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 12:16 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj » Thu Jan 06, 2011 4:11 pm

admin wrote:You need to ask DiAVC about it. I have confirmed that DGSource() itself is threadsafe. I can open a script several times in simultaneous VirtualDub instances and they play fine and independently.
As far as I know possibility to run several applications simultaneously is not equal to multi-threading. Threadsafe means that you can run several threads within one application process in operating system. It is because every process runs in its own memory area which is isolated from other processes. But threads run in shared memory area which one process owns.
admin wrote:Beyond that, it's your problem to get MT working. I know nothing about it, and more precisely, I don't care at all about it.
Yes, you told me already about it. It is a pity (for me of course).
admin wrote:And what are you after anyway? The source filter is already multithreaded and the remainder of your script is running fine under MT. What are you trying to achieve by MT'ing the souce filter?
I am trying to use all cores of my CPU. I don't know exactly how it works with DSS2() but it works smoothly on all cores and when I am not MT'ing before this filter it works on one core only. The same situation with your plug-in - it can works on one core only when I am not turning on MT before it.

May be MT spawns several threads when filter loads the video. And consequent filters runs within these threads.
admin wrote:You are free to use DSS2() if that works better for you. :)
I know, I know... But DiAVC decoder is better than it analogues. So I tried to use it.

User avatar
admin
Site Admin
Posts: 3833
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin » Thu Jan 06, 2011 4:18 pm

I know, I know... But DiAVC decoder is better than it analogues. So I tried to use it.
What makes you think that DSS2() cannot use the DiAVC decoder?

One more time: DiAVC runs multithreaded distributed on all your CPUs. There is no need to try to instantiate DGSource() multiple times. If you cannot get DiAVC to use all your cores, then again, talk to DiAVC about it!

prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 12:16 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj » Thu Jan 06, 2011 4:25 pm

admin wrote:
I know, I know... But DiAVC decoder is better than it analogues. So I tried to use it.
What makes you think that DSS2() cannot use the DiAVC decoder?
At present I not quite understand how to make it work with DiAVC.
admin wrote:One more time: DiAVC runs multithreaded distributed on all your CPUs. There is no need to try to instantiate DGSource() multiple times. If you cannot get DiAVC to use all your cores, then again, talk to DiAVC about it!

On forum.???.org I've got reply regarding this. There is no need to perform special action to force decoder for using multithreading.

And I've notice that when I run following script within VirtualDub all my cores were used. But that happened only one time and only within VirtualDub

Code: Select all

SetMTmode(5,4)
DGSource()
SetMTMode(2,4)
May be MT spawns several threads when filter is loading the video. And consequent filters run within these threads. I think this explanation is reasonable. Every filter (including DGSource) runs in its own thread which has been spawned by MT.

User avatar
admin
Site Admin
Posts: 3833
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin » Thu Jan 06, 2011 4:37 pm

What version of Avisynth are you running? Also, what version of MT.dll?

If you give me enough information I will try to duplicate the issue.

prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 12:16 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj » Thu Jan 06, 2011 4:57 pm

I have usual Avisynth (last 32-bit version from SourceForge) and MT-libraries from SEt version 2009.07.12. I've got Avisynth MT here http://forum.???.org/showthread.php?p ... ost1301410

There are my Avisynth files

http://www.filefactory.com/file/b4g40cf ... isynth.zip

MD5: 869C8001ACF985372DC9E0F7A8328745
Size: 2'200'278

prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 12:16 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj » Thu Jan 06, 2011 5:16 pm

Not quite. Firstly you need to install usual Avisynth and after that you should copy dll-s from SEt distributive over dll-s from official Avisynth.

User avatar
admin
Site Admin
Posts: 3833
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin » Thu Jan 06, 2011 6:03 pm

I asked which one you are *running*.

User avatar
admin
Site Admin
Posts: 3833
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin » Thu Jan 06, 2011 6:57 pm

I installed Avisynth MT and MT.dll. I ran this script:

loadplugin("dgavcdecodedi.dll")
dgsource("X:\RATATOUILLE\BDMV\STREAM\00027.dgi")

and this one:

loadplugin("f:\don\Programming\C++\DiAVC\DGAVCDecodeDI\x32\Release\dgavcdecodedi.dll")
dgsource("X:\RATATOUILLE\BDMV\STREAM\00027.dgi")
SetMTMode(2,0)
tweak(sat=0.0)

They both ran fine and both gave a utilization graph like this:

Image

So, the first script shows that the decoder is using all the cores. The second shows that you can MT additional functions after the DGSource() call.

You *do not need* to MT DGSource(). DiAVC takes care of threading for the source filter. But just for fun, I added SetMTMode(5,0) before DGSource(). It still worked but
was slower than without it.

prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 12:16 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj » Fri Jan 07, 2011 8:46 am

When I run my script (DiAVCDecode), It crashes all time

Code: Select all

SetMTMode(5,4)
DGSource()
SetMTMode(2,4)
MVTools processing part ...


If I am running following script (DiAVCDecode), it works but with one thread only. It is because only 1 thread actually load video source as I wrote early.

Code: Select all

DGSource()
SetMTMode(2,4)
MVTools processing part ...
If I am running this script (DSS2), it also works with one thread only.

Code: Select all

DSS2()
SetMTMode(2,4)
MVTools processing part ...
But if I am running script listed below (DSS2), it runs on all my cores with 4 threads. And all cores utilization is 100% (not just 5 or 10 like your screenshot shows). x264 FPS processing speed is also much higher (15 or 16 FPS instead of 4-5 with 1 thread only).

Code: Select all

SetMTMode(5,4)
DSS2()
SetMTMode(2,4)
MVTools processing part ...
You show me on your screenshot all cores with 1-thread-only-loading. I see it because utilization of your cores is just 5-10 percent. OS just distribute in your case load from 1 thread to all your cores. But it is NOT multi-threading.

As I think decoder will not spawns additional threads automatically. You should tell him so explicitly. And it is can be done with SetMTMode calling BEFORE using DGDecode.

User avatar
admin
Site Admin
Posts: 3833
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin » Fri Jan 07, 2011 9:51 am

My CPU utilization is low because I was not transcoding but only decoding and playing the script in VirtualDub.

You are a self-confessed amateur yet here you are lecturing me on threading.

Post Reply