CrendKing / avisynth_filter

DirectShow filters that put AviSynth and VapourSynth into video playing
MIT License
108 stars 8 forks source link

New test builds of AviSynth Filter can't be loaded or registered... #71

Closed Nuihc88 closed 2 years ago

Nuihc88 commented 2 years ago

Environment

Describe the bug

Newer test builds of AviSynth Filter won't load into filter graph, can't be re-registered into system or loaded directly into the player after removing and using pre-existing Filter Configuration (loading into player as registered or external filter) fails silently.

This behavior doesn't depend on the Player (PotPlayer Portable [v201209 x32 & v210707 x64], MPC-HC Portable [v1.9.7.0 x32], MPC-BE Portable [v1.5.5.5433 x32] ), Source Filter (Internal Defaults, LAV Filters[v0.76.1] ), Renderer (MadVR, EVR) or File Format (XviD, x264, x265).

Given that not everyone encounters the problem, it might be Windows version specific. I'm not noticing anything out of place using Depends or CFF Explorer.

To Reproduce

  1. Copy newer build over older working one.
  2. Launch Player & Load Video.
  3. Check whether AviSynth Filter is running. (for me it isn't.)
  4. Try re-registering the filter .ax through a bat file (to see it silently fail).
  5. Try re-registering the filter from player's external filter configuration (to see that it doesn't get added back to filter list).
CrendKing commented 2 years ago

What I don't get is, https://github.com/CrendKing/avisynth_filter/commit/8db13d4b7ed88323242b73bd1259474e1a4a50f4 doesn't introduce anything that would break registration. And since no log is even generated, the failure must occur very early.

It'd very simple to know what happened if you can debug this on your end. If you don't know how, may be I can write a tutorial for you?

CrendKing commented 2 years ago

If you know how to debug C++ program in VSCode, I just added a template launch.json to help debugging (esp. registration issues): https://github.com/CrendKing/avisynth_filter/commit/aec00f77b5e2eace6525f6009348a0707a43e115. Otherwise, I can add a wiki.

Nuihc88 commented 2 years ago

Several users have confirmed latest commits working form them, so this unable-to-load issue could be specific to you. Could be hardware or software environment related. We need more info to dig into, that's why I suggest a separate ticket.

I can still release a version, fix your problem, and release another version just for you later.

That's fine, though i doubt that i'm the only one affected since my current system isn't even all that heavily modified, as i use mostly portable software.

It'd very simple to know what happened if you can debug this on your end. If you don't know how, may be I can write a tutorial for you?

I am willing to try debugging as time allows, but don't have much experience doing it. Feel free to go ahead with the tutorial.

CrendKing commented 2 years ago

Here is the wiki: https://github.com/CrendKing/avisynth_filter/wiki/How-to-debug

However, since I just added the launch.json file, for this issue particularly, you need to do a bit extra in the first section. After you extract the source code in step 3, create a new folder called .vscode. Download this file, and put it in that folder. Everything else should be fine.

Nuihc88 commented 2 years ago

Main Call Stack:

ntdll.dll!0000000077c49e5a() (Unknown Source:0)
KernelBase.dll!000007fefdb01430() (Unknown Source:0)
kernel32.dll!00000000779e16e3() (Unknown Source:0)
user32.dll!0000000077af8f8d() (Unknown Source:0)
duser.dll!000007fefbf314e6() (Unknown Source:0)
duser.dll!000007fefbf315ef() (Unknown Source:0)
duser.dll!000007fefbf31565() (Unknown Source:0)
user32.dll!0000000077af934e() (Unknown Source:0)
ntdll.dll!0000000077c4b5ef() (Unknown Source:0)
user32.dll!0000000077af932a() (Unknown Source:0)
user32.dll!0000000077b04bb4() (Unknown Source:0)
user32.dll!0000000077b04ed1() (Unknown Source:0)
user32.dll!0000000077b04f46() (Unknown Source:0)
user32.dll!0000000077b04f7c() (Unknown Source:0)
comctl32.dll!000007fefc5b1d6e() (Unknown Source:0)
comctl32.dll!000007fefc4ede29() (Unknown Source:0)
comctl32.dll!000007fefc4eebbe() (Unknown Source:0)
regsvr32.exe!00000000ff161bc8() (Unknown Source:0)
regsvr32.exe!00000000ff1624e6() (Unknown Source:0)
regsvr32.exe!00000000ff161028() (Unknown Source:0)
kernel32.dll!00000000779d59cd() (Unknown Source:0)
ntdll.dll!0000000077c3383d() (Unknown Source:0)

Debug Console:

-------------------------------------------------------------------
You may only use the C/C++ Extension for Visual Studio Code
with Visual Studio Code, Visual Studio or Visual Studio for Mac
software to help you develop and test your applications.
-------------------------------------------------------------------
Loaded 'C:\Windows\System32\regsvr32.exe'.
Loaded 'C:\Windows\System32\ntdll.dll'.
Loaded 'C:\Windows\System32\kernel32.dll'.
Loaded 'C:\Windows\System32\KernelBase.dll'.
Loaded 'C:\Windows\System32\advapi32.dll'.
Loaded 'C:\Windows\System32\msvcrt.dll'.
Loaded 'C:\Windows\System32\sechost.dll'.
Loaded 'C:\Windows\System32\rpcrt4.dll'.
Loaded 'C:\Windows\System32\user32.dll'.
Loaded 'C:\Windows\System32\gdi32.dll'.
Loaded 'C:\Windows\System32\lpk.dll'.
Loaded 'C:\Windows\System32\usp10.dll'.
Loaded 'C:\Windows\System32\ole32.dll'.
Loaded 'C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_fa3b1e3d17594757\comctl32.dll'.
Loaded 'C:\Windows\System32\shlwapi.dll'.
Loaded 'C:\Windows\System32\apphelp.dll'.
Loaded 'C:\Windows\AppPatch\AppPatch64\AcGenral.dll'.
Loaded 'C:\Windows\System32\sspicli.dll'.
Loaded 'C:\Windows\System32\shell32.dll'.
Loaded 'C:\Windows\System32\sfc.dll'.
Loaded 'C:\Windows\System32\sfc_os.dll'.
Loaded 'C:\Windows\System32\userenv.dll'.
Loaded 'C:\Windows\System32\profapi.dll'.
Loaded 'C:\Windows\System32\dwmapi.dll'.
Loaded 'C:\Windows\System32\mpr.dll'.
Loaded 'C:\Windows\System32\regsvr32.exe'.
Unloaded 'C:\Windows\System32\regsvr32.exe'.
Loaded 'C:\Windows\System32\imm32.dll'.
Loaded 'C:\Windows\System32\msctf.dll'.
Loaded 'C:\Program Files\Prio\prio32.dll'.
Unloaded 'C:\Program Files\Prio\prio32.dll'.
Loaded 'C:\Program Files\Prio\prio.dll'.
Loaded 'C:\Windows\System32\cryptbase.dll'.
Loaded 'C:\Windows\System32\uxtheme.dll'.
Loaded 'C:\Program Files (x86)\Moo0 TransparentMenu 1.20\TransparentMenuDll64.dll'.
Loaded 'C:\Windows\System32\winspool.drv'.
Loaded 'C:\Windows\System32\oleaut32.dll'.
Loaded 'O:\Ohjelmatiedostot\Ikkunanhallinta\snap_lib64.dll'. Module was built without symbols.
Loaded 'O:\Koodekit\AviSynth_Filter\master\debug\avisynth_filter_64.ax'. Symbols loaded.
Exception thrown at 0x0000000077CA8A08 (ntdll.dll) in regsvr32.exe: 0xC0000139: Entry Point Not Found.
Unloaded 'O:\Koodekit\AviSynth_Filter\master\debug\avisynth_filter_64.ax'.
Loaded 'C:\Windows\System32\duser.dll'.
Loaded 'C:\Windows\System32\xmllite.dll'.
Unloaded 'C:\Windows\System32\xmllite.dll'.
The program '[9268] regsvr32.exe' has exited with code 3 (0x3).

Perhaps a new compiler bug producing Win7 incompatible code?

CrendKing commented 2 years ago

Perhaps a new compiler bug producing Win7 incompatible code?

The old build artifacts have expired. I can't see what compiler version used. I reran the same jobs on your last working commit. It should use the exact same compiler as latest commits. If that can still work but latest can't, then surely it's not compiler related.

https://github.com/CrendKing/avisynth_filter/actions/runs/2178593452

Exception thrown at 0x0000000077CA8A08 (ntdll.dll) in regsvr32.exe: 0xC0000139: Entry Point Not Found.

Basically this says it can't find the DllRegisterServer function in the exported function table, but I can see it with any PE file viewer. I know you said depends shows no error, but it's old. Have you tried something like https://github.com/lucasg/Dependencies? I can see many external modules loaded (e.g. prio, TransparentMenuDll64, snap_lib64). They could interfere the loading.

Nuihc88 commented 2 years ago

...Forgot to include the attached error prompt i got from the debugger in my last post... RegSvr32 ...i noticed that in the last error, in part of the path under 'args', the backslashes had been replaced with forwardslashes, so i tried using double-backslashes to check whether formatting was preventing the file from being read properly; also disabled allSnap, TransparentMenu & Prio, then reran the debugger with newer 404c16b debug builds, getting essentially the same errors... RegSvr32_after_fix

Main Call Stack:

ntdll.dll!0000000076e69e5a() (Unknown Source:0)
KernelBase.dll!000007fefcdc1430() (Unknown Source:0)
kernel32.dll!0000000076c016e3() (Unknown Source:0)
user32.dll!0000000076d18f8d() (Unknown Source:0)
duser.dll!000007fefadf14e6() (Unknown Source:0)
duser.dll!000007fefadf15ef() (Unknown Source:0)
duser.dll!000007fefadf1565() (Unknown Source:0)
user32.dll!0000000076d1934e() (Unknown Source:0)
ntdll.dll!0000000076e6b5ef() (Unknown Source:0)
user32.dll!0000000076d1932a() (Unknown Source:0)
user32.dll!0000000076d24bb4() (Unknown Source:0)
user32.dll!0000000076d24ed1() (Unknown Source:0)
user32.dll!0000000076d24f46() (Unknown Source:0)
user32.dll!0000000076d24f7c() (Unknown Source:0)
comctl32.dll!000007fefb631d6e() (Unknown Source:0)
comctl32.dll!000007fefb56de29() (Unknown Source:0)
comctl32.dll!000007fefb56ebbe() (Unknown Source:0)
regsvr32.exe!00000000ffe21bc8() (Unknown Source:0)
regsvr32.exe!00000000ffe224e6() (Unknown Source:0)
regsvr32.exe!00000000ffe21028() (Unknown Source:0)
kernel32.dll!0000000076bf59cd() (Unknown Source:0)
ntdll.dll!0000000076e5383d() (Unknown Source:0)

Debug Console:

-------------------------------------------------------------------
You may only use the C/C++ Extension for Visual Studio Code
with Visual Studio Code, Visual Studio or Visual Studio for Mac
software to help you develop and test your applications.
-------------------------------------------------------------------
Loaded 'C:\Windows\System32\regsvr32.exe'.
Loaded 'C:\Windows\System32\ntdll.dll'.
Loaded 'C:\Windows\System32\kernel32.dll'.
Loaded 'C:\Windows\System32\KernelBase.dll'.
Loaded 'C:\Windows\System32\advapi32.dll'.
Loaded 'C:\Windows\System32\msvcrt.dll'.
Loaded 'C:\Windows\System32\sechost.dll'.
Loaded 'C:\Windows\System32\rpcrt4.dll'.
Loaded 'C:\Windows\System32\user32.dll'.
Loaded 'C:\Windows\System32\gdi32.dll'.
Loaded 'C:\Windows\System32\lpk.dll'.
Loaded 'C:\Windows\System32\usp10.dll'.
Loaded 'C:\Windows\System32\ole32.dll'.
Loaded 'C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_fa3b1e3d17594757\comctl32.dll'.
Loaded 'C:\Windows\System32\shlwapi.dll'.
Loaded 'C:\Windows\System32\apphelp.dll'.
Loaded 'C:\Windows\AppPatch\AppPatch64\AcGenral.dll'.
Loaded 'C:\Windows\System32\sspicli.dll'.
Loaded 'C:\Windows\System32\shell32.dll'.
Loaded 'C:\Windows\System32\sfc.dll'.
Loaded 'C:\Windows\System32\sfc_os.dll'.
Loaded 'C:\Windows\System32\userenv.dll'.
Loaded 'C:\Windows\System32\profapi.dll'.
Loaded 'C:\Windows\System32\dwmapi.dll'.
Loaded 'C:\Windows\System32\mpr.dll'.
Loaded 'C:\Windows\System32\regsvr32.exe'.
Unloaded 'C:\Windows\System32\regsvr32.exe'.
Loaded 'C:\Windows\System32\imm32.dll'.
Loaded 'C:\Windows\System32\msctf.dll'.
Loaded 'C:\Windows\System32\cryptbase.dll'.
Loaded 'C:\Windows\System32\uxtheme.dll'.
Loaded 'O:\Koodekit\AviSynth_Filter\good\debug\avisynth_filter_64.ax'. Symbols loaded.
Exception thrown at 0x0000000076EC8A08 (ntdll.dll) in regsvr32.exe: 0xC0000139: Entry Point Not Found.
Unloaded 'O:\Koodekit\AviSynth_Filter\good\debug\avisynth_filter_64.ax'.
Loaded 'C:\Windows\System32\duser.dll'.
Loaded 'C:\Windows\System32\xmllite.dll'.
Loaded 'C:\Windows\System32\oleaut32.dll'.
Unloaded 'C:\Windows\System32\xmllite.dll'.
The program '[4792] regsvr32.exe' has exited with code 3 (0x3).

However, i can confirm that the newer 404c16b release builds work fine in normal use, yet trying to register the 404c16b debug builds manually from the command line fails with essentially the same error-popup: RegSVR32_sanity_check ...so whatever is going on with the debug builds is likely a separate issue.

...to be continued later...

CrendKing commented 2 years ago

It could be a missing dependency. Make sure https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022 are installed.

newer 404c16b release builds work fine in normal use

So that version (release) is indeed working. Does latest commit's release build work?

Nuihc88 commented 2 years ago

It could be a missing dependency. Make sure https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022 are installed.

Done, didn't make a difference.

So that version (release) is indeed working. Does latest commit's release build work?

Nope.

Exception thrown at 0x0000000077CA8A08 (ntdll.dll) in regsvr32.exe: 0xC0000139: Entry Point Not Found.

Basically this says it can't find the DllRegisterServer function in the exported function table, but I can see it with any PE file viewer. I know you said depends shows no error, but it's old. Have you tried something like https://github.com/lucasg/Dependencies? I can see many external modules loaded (e.g. prio, TransparentMenuDll64, snap_lib64). They could interfere the loading.

I think i figured out what is going on with the debug builds at least. Way back in a very similar issue #8 this was fixed for Release builds, but apparently Debug builds still have the unsupported KERNEL32.DLL (SetThreadDescription) enabled; i missed it earlier due to being focused on Release builds at the time.

CrendKing commented 2 years ago

Here is a debug version that doesn't call SetThreadDescription (which indeed requires Windows 10). Try to use that to find out why the release version of it doesn't work for you.

Thanks for working with me.

Nuihc88 commented 2 years ago

Call Stack:

000007fedb332ef0() (Unknown Source:0)
ntdll.dll!00000000770bbcb4() (Unknown Source:0)
ntdll.dll!00000000770b74b9() (Unknown Source:0)
ntdll.dll!00000000770bc040() (Unknown Source:0)
msvcrt.dll!000007fefe0999e2() (Unknown Source:0)
regsvr32.exe!00000000ffe71042() (Unknown Source:0)
kernel32.dll!0000000076e759cd() (Unknown Source:0)
ntdll.dll!00000000770d383d() (Unknown Source:0)

Debug Console:

-------------------------------------------------------------------
You may only use the C/C++ Extension for Visual Studio Code
with Visual Studio Code, Visual Studio or Visual Studio for Mac
software to help you develop and test your applications.
-------------------------------------------------------------------
Loaded 'C:\Windows\System32\regsvr32.exe'.
Loaded 'C:\Windows\System32\ntdll.dll'.
Loaded 'C:\Windows\System32\kernel32.dll'.
Loaded 'C:\Windows\System32\KernelBase.dll'.
Loaded 'C:\Windows\System32\advapi32.dll'.
Loaded 'C:\Windows\System32\msvcrt.dll'.
Loaded 'C:\Windows\System32\sechost.dll'.
Loaded 'C:\Windows\System32\rpcrt4.dll'.
Loaded 'C:\Windows\System32\user32.dll'.
Loaded 'C:\Windows\System32\gdi32.dll'.
Loaded 'C:\Windows\System32\lpk.dll'.
Loaded 'C:\Windows\System32\usp10.dll'.
Loaded 'C:\Windows\System32\ole32.dll'.
Loaded 'C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_fa3b1e3d17594757\comctl32.dll'.
Loaded 'C:\Windows\System32\shlwapi.dll'.
Loaded 'C:\Windows\System32\apphelp.dll'.
Loaded 'C:\Windows\AppPatch\AppPatch64\AcGenral.dll'.
Loaded 'C:\Windows\System32\sspicli.dll'.
Loaded 'C:\Windows\System32\shell32.dll'.
Loaded 'C:\Windows\System32\sfc.dll'.
Loaded 'C:\Windows\System32\sfc_os.dll'.
Loaded 'C:\Windows\System32\userenv.dll'.
Loaded 'C:\Windows\System32\profapi.dll'.
Loaded 'C:\Windows\System32\dwmapi.dll'.
Loaded 'C:\Windows\System32\mpr.dll'.
Loaded 'C:\Windows\System32\regsvr32.exe'.
Unloaded 'C:\Windows\System32\regsvr32.exe'.
Loaded 'C:\Windows\System32\imm32.dll'.
Loaded 'C:\Windows\System32\msctf.dll'.
Loaded 'C:\Windows\System32\cryptbase.dll'.
Loaded 'C:\Windows\System32\uxtheme.dll'.
Loaded 'O:\Koodekit\AviSynth_Filter\good\debug\avisynth_filter_64.ax'. Symbols loaded.
Loaded 'C:\Windows\System32\comdlg32.dll'.
Loaded 'C:\Windows\System32\winmm.dll'.
Loaded 'C:\Windows\System32\oleaut32.dll'.
Loaded 'C:\Windows\System32\api-ms-win-core-synch-l1-2-0.dll'.
Exception thrown at 0x000007FEDB348C9C (avisynth_filter_64.ax) in regsvr32.exe: 0xC000001D: Illegal Instruction.
Unloaded 'O:\Koodekit\AviSynth_Filter\good\debug\avisynth_filter_64.ax'.
Unloaded 'C:\Windows\System32\oleaut32.dll'.
Unloaded 'C:\Windows\System32\winmm.dll'.
Unloaded 'C:\Windows\System32\comdlg32.dll'.
Exception thrown at 0x000007FEDB332EF0 in regsvr32.exe: 0xC0000005: Access violation executing location 0x000007FEDB332EF0.

Thanks for working with me.

No problem.

CrendKing commented 2 years ago

What's your CPU?

Nuihc88 commented 2 years ago

What's your CPU?

AMD Phenom II X4 940 BE - OC'd @ ~3.42Ghz (Fully Stable).

CrendKing commented 2 years ago

https://github.com/CrendKing/avisynth_filter/actions/runs/2219024584, the release version, since you can't use debug version due to SetThreadDescription. I can replace SetThreadDescription with a Windows 7 compatible implementation, but it's more verbose and hacky, and I don't want to maintain that hacky code. Hope you understand.

Let me know if it still has problem. Otherwise, close the ticket. Sorry for the regression.

Nuihc88 commented 2 years ago

Solving that one revealed some other regressions...

MPC-BE & PotPlayer (x32 & x64) can only show blank settings windows when registered as an external filter: MPC-BE_BlankSettings PotPlayer_BlankSettings ...while MPC-HC only shows these two errors one after another after trying to access settings: MPC-HC_Access_Violation MPC-HC_Unknown

Loading as a registered filter on PotPlayer after disabling most Input Formats, causes the video to indefinitely stall at start every time; P010 & P016 seem to work, although seem slow, while NV12 & YV12 won't (tested with MadVR & EVR); With MPC-HC & MPC-BE these only stall about half the time under same conditions, suggesting a race condition bug. PotPlayer_x32_StallAtStart PotPlayer_x32_StallStatusTab

CrendKing commented 2 years ago

For MPC-HC crash, it'd nice if you could give me the call stack and console thingy. To launch MPC-HC with debugger, you need to change launch.json:

For stall and performance issue in MPC, log would be nice. I'll take look at PotPlayer. I don't test PotPlayer during development because it is hall of shame software, and actively refuses debugger.

CrendKing commented 2 years ago

https://github.com/CrendKing/avisynth_filter/actions/runs/2220212053 should fix the stall issue.

Nuihc88 commented 2 years ago

I'll probably have to finish debugging some other day, not sure how much time i have left for today...

EDIT 1: Launch.json used:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "O:\\PortableTests\\MPC-HCPortable\\MPC-HCPortable.exe",
            "args": ["V:\\ExtremeRotationSample.mkv"],
            "cwd": "${workspaceFolder}",
            "sourceFileMap": {
                "O:/Koodekit/AviSynth_Filter/Fix2": "${workspaceFolder}"
            },
        }
    ]
}

MPC-HC Portable's Call Stack:

ntdll.dll!7725f901() (Unknown Source:0)
ntdll.dll![Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] (Unknown Source:0)
KernelBase.dll!763b15ce() (Unknown Source:0)
kernel32.dll!75381194() (Unknown Source:0)
kernel32.dll!75381148() (Unknown Source:0)
MPC-HCPortable.exe!0040228a() (Unknown Source:0)
MPC-HCPortable.exe!004013ba() (Unknown Source:0)
MPC-HCPortable.exe!0040166d() (Unknown Source:0)
MPC-HCPortable.exe!004013ba() (Unknown Source:0)
MPC-HCPortable.exe!004051f1() (Unknown Source:0)
MPC-HCPortable.exe!00405d72() (Unknown Source:0)
MPC-HCPortable.exe!00403c21() (Unknown Source:0)
kernel32.dll!7538343d() (Unknown Source:0)
ntdll.dll!77279832() (Unknown Source:0)
ntdll.dll!77279805() (Unknown Source:0)

Beginning of MPC-HC Portable's Debug Console:

-------------------------------------------------------------------
You may only use the C/C++ Extension for Visual Studio Code
with Visual Studio Code, Visual Studio or Visual Studio for Mac
software to help you develop and test your applications.
-------------------------------------------------------------------
Loaded 'O:\PortableTests\MPC-HCPortable\MPC-HCPortable.exe'. Module was built without symbols.
Loaded 'C:\Windows\SysWOW64\ntdll.dll'.
Loaded 'C:\Windows\SysWOW64\kernel32.dll'.
Loaded 'C:\Windows\SysWOW64\KernelBase.dll'.
Loaded 'C:\Windows\SysWOW64\user32.dll'.
Loaded 'C:\Windows\SysWOW64\gdi32.dll'.
Loaded 'C:\Windows\SysWOW64\lpk.dll'.
Loaded 'C:\Windows\SysWOW64\usp10.dll'.
Loaded 'C:\Windows\SysWOW64\msvcrt.dll'.
Loaded 'C:\Windows\SysWOW64\advapi32.dll'.
Loaded 'C:\Windows\SysWOW64\sechost.dll'.
Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'.
Loaded 'C:\Windows\SysWOW64\sspicli.dll'.
Loaded 'C:\Windows\SysWOW64\cryptbase.dll'.
Loaded 'C:\Windows\SysWOW64\shell32.dll'.
Loaded 'C:\Windows\SysWOW64\shlwapi.dll'.
Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll'.
Loaded 'C:\Windows\SysWOW64\ole32.dll'.
Loaded 'C:\Windows\SysWOW64\version.dll'.
Loaded 'C:\Windows\SysWOW64\imm32.dll'.
Loaded 'C:\Windows\SysWOW64\msctf.dll'.
Loaded 'C:\Windows\SysWOW64\uxtheme.dll'.
Loaded 'C:\Windows\SysWOW64\shfolder.dll'.
Loaded 'C:\Windows\SysWOW64\oleaut32.dll'.
Loaded 'C:\Windows\SysWOW64\setupapi.dll'.
Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'.
Loaded 'C:\Windows\SysWOW64\devobj.dll'.
Loaded 'C:\Windows\SysWOW64\clbcatq.dll'.
Loaded 'C:\Windows\SysWOW64\propsys.dll'.
Loaded 'C:\Windows\SysWOW64\ntmarta.dll'.
Loaded 'C:\Windows\SysWOW64\Wldap32.dll'.
Loaded 'C:\Windows\SysWOW64\profapi.dll'.
Loaded 'O:\Portable\Tekstinkäsittely\VSCode\data\tmp\nsw1C12.tmp\System.dll'. Module was built without symbols.
Loaded 'C:\Windows\SysWOW64\cryptsp.dll'.
Loaded 'C:\Windows\SysWOW64\rsaenh.dll'.
Loaded 'C:\Windows\SysWOW64\RpcRtRemote.dll'.
Loaded 'O:\Portable\Tekstinkäsittely\VSCode\data\tmp\nsw1C12.tmp\newtextreplace.dll'. Module was built without symbols.
Unloaded 'O:\Portable\Tekstinkäsittely\VSCode\data\tmp\nsw1C12.tmp\newtextreplace.dll'.
Loaded 'O:\Portable\Tekstinkäsittely\VSCode\data\tmp\nsw1C12.tmp\newtextreplace.dll'. Module was built without symbols.
Unloaded 'O:\Portable\Tekstinkäsittely\VSCode\data\tmp\nsw1C12.tmp\newtextreplace.dll'.
Loaded 'C:\Windows\SysWOW64\psapi.dll'.
Loaded 'C:\Windows\SysWOW64\apphelp.dll'.

----> Gives Errors Here. <----

Rest of MPC-HC Portable's Debug Console:

Loaded 'O:\Portable\Tekstinkäsittely\VSCode\data\tmp\nsw1C12.tmp\newadvsplash.dll'. Module was built without symbols.
Loaded 'C:\Windows\SysWOW64\winmm.dll'. 
Unloaded 'O:\Portable\Tekstinkäsittely\VSCode\data\tmp\nsw1C12.tmp\newadvsplash.dll'.
Unloaded 'C:\Windows\SysWOW64\winmm.dll'.
Unloaded 'O:\Portable\Tekstinkäsittely\VSCode\data\tmp\nsw1C12.tmp\System.dll'.
The program '[5432] MPC-HCPortable.exe' has exited with code 0 (0x0).

MPC-BE Portable's output seems to be a line by line match for the above if you click close after opening the broken settings window.

EDIT2: Nevermind, was testing the wrong build, had to retest all of above.

CrendKing commented 2 years ago

According to the call stack, something in ntdll crashed. I have no idea what that is, nor how is it related to the filter. That function is not called by AVSF, but by the player itself. There is way to know what is MPC-HCPortable.exe!0040228a() (Unknown Source:0), but it is way more complicated than the wiki mentioned.

BTW, I see you modified the sourceFileMap section of launch.json. Please keep the line as-is. Otherwise even AVSF's call stack will be "Unknown Source:0".

I just tried the x86 version myself. Both MPC players work fine.

Anyways, if the stall problem is fixed, just use the filter as registered, I guess?

Nuihc88 commented 2 years ago

BTW, I see you modified the sourceFileMap section of launch.json. Please keep the line as-is. Otherwise even AVSF's call stack will be "Unknown Source:0".

Ok, i thought that was just supposed to point to where the corresponding sources are extracted... ? (I have been keeping copies of old source and debug versions around in separate directories in case i need to check for regressions later.)

After double-checking to make sure i'm testing the right files, i have confirmed that there's hardly any difference in output regardless of what i put on the SourceFileMap line. Not sure if i'm doing something wrong or if that is just how it works.

Anyways, if the stall problem is fixed, just use the filter as registered, I guess?

EDIT: I was accidentally testing the wrong files for a while. The stalling issue is indeed fixed now for PotPlayer, MPC-HC & MPC-BE.

I'm no longer getting the Blank Configuration window issue in PotPlayer either. Portable MPC-HC & MPC-BE i have, are still having problems with that, which i guess semi-breaks portability for those players. However the versions i use are somewhat out of date, so not sure if that has been fixed on their end already. I'll probably check on that later after i get some sleep.

Nuihc88 commented 2 years ago

...been a busy day involving 3 hardware failures, so took longer than intended...

After configuring fresh 'installs' of MPC-HC Portable (v1.9.21.2) & MPC-BE Portable (v1.6.1.6845), both are now showing blank AVSF Settings windows (and no errors) when called from filter graph after being registered as an external filter. That would appear to be the only remaining problem right now and i have no idea how to debug it further.

CrendKing commented 2 years ago

Hi. Take your time, friend.

So the stall and performance regression is solved, right?

For blank settings, Does AVSF function at all if you edit registry/ini file? Can you upload the log? Also, in your mpc-be64.ini, you should be able to locate the filter registration section titled [ExternalFilters\<some integer>]. Find the one for AVSF. Show me here.

Nuihc88 commented 2 years ago

So the stall and performance regression is solved, right?

The stalling issue has indeed been resolved. As for performance, i can't know if it's slightly worse, normal or better until i can test an up to date non-debug build; however, the severe slowdowns i was seeing earlier seem to have been related to the stalling bug.

For blank settings, Does AVSF function at all if you edit registry/ini file?

Yes, editing Input formats and ScriptFile from the .ini-file works normally; this is a GUI only problem affecting only the first tab; also, there doesn't seem to be any differences in contents of the Status & Pin-Info tabs regardless of whether i load AVSF as registered filter or external filter.

Can you upload the log?

AVSF Logs for MPC-BE & MPC-HC at the points where the blank window is loaded: AviSynthFilter_Log_BE_Portable.txt AviSynthFilter_Log_HC_Portable.txt

Call Stack & Debug Console for both players are essentially the same as above, but here's a Call Stack for MPC-BE:

ntdll.dll!76f3f901() (Unknown Source:0)
ntdll.dll![Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] (Unknown Source:0)
KernelBase.dll!750315ce() (Unknown Source:0)
kernel32.dll!74c01194() (Unknown Source:0)
kernel32.dll!74c01148() (Unknown Source:0)
MPC-BEPortable.exe!0040228a() (Unknown Source:0)
MPC-BEPortable.exe!004013ba() (Unknown Source:0)
MPC-BEPortable.exe!0040166d() (Unknown Source:0)
MPC-BEPortable.exe!004013ba() (Unknown Source:0)
MPC-BEPortable.exe!004051f1() (Unknown Source:0)
MPC-BEPortable.exe!00405d72() (Unknown Source:0)
MPC-BEPortable.exe!00403c21() (Unknown Source:0)
kernel32.dll!74c0343d() (Unknown Source:0)
ntdll.dll!76f59832() (Unknown Source:0)
ntdll.dll!76f59805() (Unknown Source:0)

The Call Stack seems to be identical regardless of whether i open the Settings window at all, suggesting that the ntdll.dll stuff is probably unrelated.

Also, in your mpc-be64.ini, you should be able to locate the filter registration section titled [ExternalFilters\]. Find the one for AVSF. Show me here.

Here's for both MPC-BE & MPC-HC; the disabled first entry is from importing AVSF as registered filter, which is working normally, the enabled second entry is from importing AVSF as an external filter...

MPC-BE:

[ExternalFilters\000]
CLSID={E5E2C1A6-C90F-4247-8BF5-604FB180A932}
DisplayName=@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{E5E2C1A6-C90F-4247-8BF5-604FB180A932}
Enabled=0
LoadType=0
Merit=2097153
MT_000={73646976-0000-0010-8000-00AA00389B71}{3231564E-0000-0010-8000-00AA00389B71}
MT_001={73646976-0000-0010-8000-00AA00389B71}{32315659-0000-0010-8000-00AA00389B71}
MT_002={73646976-0000-0010-8000-00AA00389B71}{30323449-0000-0010-8000-00AA00389B71}
MT_003={73646976-0000-0010-8000-00AA00389B71}{56555949-0000-0010-8000-00AA00389B71}
MT_004={73646976-0000-0010-8000-00AA00389B71}{30313050-0000-0010-8000-00AA00389B71}
MT_005={73646976-0000-0010-8000-00AA00389B71}{36313050-0000-0010-8000-00AA00389B71}
MT_006={73646976-0000-0010-8000-00AA00389B71}{32595559-0000-0010-8000-00AA00389B71}
MT_007={73646976-0000-0010-8000-00AA00389B71}{30313250-0000-0010-8000-00AA00389B71}
MT_008={73646976-0000-0010-8000-00AA00389B71}{36313250-0000-0010-8000-00AA00389B71}
MT_009={73646976-0000-0010-8000-00AA00389B71}{34325659-0000-0010-8000-00AA00389B71}
MT_010={73646976-0000-0010-8000-00AA00389B71}{30313459-0000-0010-8000-00AA00389B71}
MT_011={73646976-0000-0010-8000-00AA00389B71}{36313459-0000-0010-8000-00AA00389B71}
MT_012={73646976-0000-0010-8000-00AA00389B71}{E436EB7D-524F-11CE-9F53-0020AF0BA770}
MT_013={73646976-0000-0010-8000-00AA00389B71}{E436EB7E-524F-11CE-9F53-0020AF0BA770}
Name=AviSynth Filter [Debug]
SourceType=0
[ExternalFilters\001]
CLSID={E5E2C1A6-C90F-4247-8BF5-604FB180A932}
Enabled=1
LoadType=0
Merit=2097153
MT_000={73646976-0000-0010-8000-00AA00389B71}{3231564E-0000-0010-8000-00AA00389B71}
MT_001={73646976-0000-0010-8000-00AA00389B71}{32315659-0000-0010-8000-00AA00389B71}
MT_002={73646976-0000-0010-8000-00AA00389B71}{30323449-0000-0010-8000-00AA00389B71}
MT_003={73646976-0000-0010-8000-00AA00389B71}{56555949-0000-0010-8000-00AA00389B71}
MT_004={73646976-0000-0010-8000-00AA00389B71}{30313050-0000-0010-8000-00AA00389B71}
MT_005={73646976-0000-0010-8000-00AA00389B71}{36313050-0000-0010-8000-00AA00389B71}
MT_006={73646976-0000-0010-8000-00AA00389B71}{32595559-0000-0010-8000-00AA00389B71}
MT_007={73646976-0000-0010-8000-00AA00389B71}{30313250-0000-0010-8000-00AA00389B71}
MT_008={73646976-0000-0010-8000-00AA00389B71}{36313250-0000-0010-8000-00AA00389B71}
MT_009={73646976-0000-0010-8000-00AA00389B71}{34325659-0000-0010-8000-00AA00389B71}
MT_010={73646976-0000-0010-8000-00AA00389B71}{30313459-0000-0010-8000-00AA00389B71}
MT_011={73646976-0000-0010-8000-00AA00389B71}{36313459-0000-0010-8000-00AA00389B71}
MT_012={73646976-0000-0010-8000-00AA00389B71}{E436EB7D-524F-11CE-9F53-0020AF0BA770}
MT_013={73646976-0000-0010-8000-00AA00389B71}{E436EB7E-524F-11CE-9F53-0020AF0BA770}
Name=AviSynth Filter [Debug]
Path=O:\testing\PlayerTesting\MPC-BE_Portable\App\MPC-BE\avisynth_filter.ax
SourceType=1

MPC-HC:

[Filters\x86\0000]
DisplayName=@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{E5E2C1A6-C90F-4247-8BF5-604FB180A932}
Enabled=0
LoadType=0
Merit=2097153
mod0000={73646976-0000-0010-8000-00AA00389B71}
mod0001={3231564E-0000-0010-8000-00AA00389B71}
mod0002={73646976-0000-0010-8000-00AA00389B71}
mod0003={32315659-0000-0010-8000-00AA00389B71}
mod0004={73646976-0000-0010-8000-00AA00389B71}
mod0005={30323449-0000-0010-8000-00AA00389B71}
mod0006={73646976-0000-0010-8000-00AA00389B71}
mod0007={56555949-0000-0010-8000-00AA00389B71}
mod0008={73646976-0000-0010-8000-00AA00389B71}
mod0009={30313050-0000-0010-8000-00AA00389B71}
mod0010={73646976-0000-0010-8000-00AA00389B71}
mod0011={36313050-0000-0010-8000-00AA00389B71}
mod0012={73646976-0000-0010-8000-00AA00389B71}
mod0013={32595559-0000-0010-8000-00AA00389B71}
mod0014={73646976-0000-0010-8000-00AA00389B71}
mod0015={30313250-0000-0010-8000-00AA00389B71}
mod0016={73646976-0000-0010-8000-00AA00389B71}
mod0017={36313250-0000-0010-8000-00AA00389B71}
mod0018={73646976-0000-0010-8000-00AA00389B71}
mod0019={34325659-0000-0010-8000-00AA00389B71}
mod0020={73646976-0000-0010-8000-00AA00389B71}
mod0021={30313459-0000-0010-8000-00AA00389B71}
mod0022={73646976-0000-0010-8000-00AA00389B71}
mod0023={36313459-0000-0010-8000-00AA00389B71}
mod0024={73646976-0000-0010-8000-00AA00389B71}
mod0025={E436EB7D-524F-11CE-9F53-0020AF0BA770}
mod0026={73646976-0000-0010-8000-00AA00389B71}
mod0027={E436EB7E-524F-11CE-9F53-0020AF0BA770}
Name=AviSynth Filter [Debug]
org0000={73646976-0000-0010-8000-00AA00389B71}
org0001={3231564E-0000-0010-8000-00AA00389B71}
org0002={73646976-0000-0010-8000-00AA00389B71}
org0003={32315659-0000-0010-8000-00AA00389B71}
org0004={73646976-0000-0010-8000-00AA00389B71}
org0005={30323449-0000-0010-8000-00AA00389B71}
org0006={73646976-0000-0010-8000-00AA00389B71}
org0007={56555949-0000-0010-8000-00AA00389B71}
org0008={73646976-0000-0010-8000-00AA00389B71}
org0009={30313050-0000-0010-8000-00AA00389B71}
org0010={73646976-0000-0010-8000-00AA00389B71}
org0011={36313050-0000-0010-8000-00AA00389B71}
org0012={73646976-0000-0010-8000-00AA00389B71}
org0013={32595559-0000-0010-8000-00AA00389B71}
org0014={73646976-0000-0010-8000-00AA00389B71}
org0015={30313250-0000-0010-8000-00AA00389B71}
org0016={73646976-0000-0010-8000-00AA00389B71}
org0017={36313250-0000-0010-8000-00AA00389B71}
org0018={73646976-0000-0010-8000-00AA00389B71}
org0019={34325659-0000-0010-8000-00AA00389B71}
org0020={73646976-0000-0010-8000-00AA00389B71}
org0021={30313459-0000-0010-8000-00AA00389B71}
org0022={73646976-0000-0010-8000-00AA00389B71}
org0023={36313459-0000-0010-8000-00AA00389B71}
org0024={73646976-0000-0010-8000-00AA00389B71}
org0025={E436EB7D-524F-11CE-9F53-0020AF0BA770}
org0026={73646976-0000-0010-8000-00AA00389B71}
org0027={E436EB7E-524F-11CE-9F53-0020AF0BA770}
SourceType=0
[Filters\x86\0001]
CLSID={E5E2C1A6-C90F-4247-8BF5-604FB180A932}
Enabled=1
LoadType=0
Merit=2097153
mod0000={73646976-0000-0010-8000-00AA00389B71}
mod0001={3231564E-0000-0010-8000-00AA00389B71}
mod0002={73646976-0000-0010-8000-00AA00389B71}
mod0003={32315659-0000-0010-8000-00AA00389B71}
mod0004={73646976-0000-0010-8000-00AA00389B71}
mod0005={30323449-0000-0010-8000-00AA00389B71}
mod0006={73646976-0000-0010-8000-00AA00389B71}
mod0007={56555949-0000-0010-8000-00AA00389B71}
mod0008={73646976-0000-0010-8000-00AA00389B71}
mod0009={30313050-0000-0010-8000-00AA00389B71}
mod0010={73646976-0000-0010-8000-00AA00389B71}
mod0011={36313050-0000-0010-8000-00AA00389B71}
mod0012={73646976-0000-0010-8000-00AA00389B71}
mod0013={32595559-0000-0010-8000-00AA00389B71}
mod0014={73646976-0000-0010-8000-00AA00389B71}
mod0015={30313250-0000-0010-8000-00AA00389B71}
mod0016={73646976-0000-0010-8000-00AA00389B71}
mod0017={36313250-0000-0010-8000-00AA00389B71}
mod0018={73646976-0000-0010-8000-00AA00389B71}
mod0019={34325659-0000-0010-8000-00AA00389B71}
mod0020={73646976-0000-0010-8000-00AA00389B71}
mod0021={30313459-0000-0010-8000-00AA00389B71}
mod0022={73646976-0000-0010-8000-00AA00389B71}
mod0023={36313459-0000-0010-8000-00AA00389B71}
mod0024={73646976-0000-0010-8000-00AA00389B71}
mod0025={E436EB7D-524F-11CE-9F53-0020AF0BA770}
mod0026={73646976-0000-0010-8000-00AA00389B71}
mod0027={E436EB7E-524F-11CE-9F53-0020AF0BA770}
Name=AviSynth Filter [Debug]
org0000={73646976-0000-0010-8000-00AA00389B71}
org0001={3231564E-0000-0010-8000-00AA00389B71}
org0002={73646976-0000-0010-8000-00AA00389B71}
org0003={32315659-0000-0010-8000-00AA00389B71}
org0004={73646976-0000-0010-8000-00AA00389B71}
org0005={30323449-0000-0010-8000-00AA00389B71}
org0006={73646976-0000-0010-8000-00AA00389B71}
org0007={56555949-0000-0010-8000-00AA00389B71}
org0008={73646976-0000-0010-8000-00AA00389B71}
org0009={30313050-0000-0010-8000-00AA00389B71}
org0010={73646976-0000-0010-8000-00AA00389B71}
org0011={36313050-0000-0010-8000-00AA00389B71}
org0012={73646976-0000-0010-8000-00AA00389B71}
org0013={32595559-0000-0010-8000-00AA00389B71}
org0014={73646976-0000-0010-8000-00AA00389B71}
org0015={30313250-0000-0010-8000-00AA00389B71}
org0016={73646976-0000-0010-8000-00AA00389B71}
org0017={36313250-0000-0010-8000-00AA00389B71}
org0018={73646976-0000-0010-8000-00AA00389B71}
org0019={34325659-0000-0010-8000-00AA00389B71}
org0020={73646976-0000-0010-8000-00AA00389B71}
org0021={30313459-0000-0010-8000-00AA00389B71}
org0022={73646976-0000-0010-8000-00AA00389B71}
org0023={36313459-0000-0010-8000-00AA00389B71}
org0024={73646976-0000-0010-8000-00AA00389B71}
org0025={E436EB7D-524F-11CE-9F53-0020AF0BA770}
org0026={73646976-0000-0010-8000-00AA00389B71}
org0027={E436EB7E-524F-11CE-9F53-0020AF0BA770}
Path=O:\testing\PlayerTesting\MPC-HC_Portable\App\MPC-HC\avisynth_filter.ax
SourceType=1

The path can be manually changed to: Path=avisynth_filter.ax without altering the behavior.

Given that the problem also appeared on PotPlayer during the stall issue, but disappeared after it was fixed and only affects the first tab, all would suggest that the issue is most likely another race-condition bug.

PS. While testing, i also kept encountering a rare hang issue in PotPlayer that happens sometimes while repeatedly loading different files from a playlist; i think it's a pre-existing issue, as it has happened occasionally before, however with debug-builds it occurred more frequently. Pretty sure a similar, but more frequent issue like this has been fixed before. I'll post a AVSF Log next time i encounter it again.

CrendKing commented 2 years ago

Still unable to reproduce the issue. It could be Windows 7 specific. One more question, are your player downloaded from portableapps.com, judging from the executable file name? If so, do you know you just need the same named ini be in the same directory to be portable?

CrendKing commented 2 years ago

https://github.com/CrendKing/avisynth_filter/actions/runs/2236339649 the latest release build

Nuihc88 commented 2 years ago

After a quick look, my first impression of the new build is that the filter performance is likely either the same or slightly better than before, with higher probability for the latter. EDIT: Performance seems have the same peak fps output, but with less fluctuations, resulting in less dropped frames than before.

Still unable to reproduce the issue. It could be Windows 7 specific. One more question, are your player downloaded from portableapps.com, judging from the executable file name? If so, do you know you just need the same named ini be in the same directory to be portable?

I knew there was a way to make them portable without the PortableApps interface, but didn't bother looking into it for setting up what are essentially test environments for me. I did discover something just now while testing the native portability approach though; only x32 versions are affected; x64 versions of MPC-HC & MPC-BE load the window normally.

CrendKing commented 2 years ago

I went to install Windows 7 in virtual machine, download MPC-HC x32 and AviSynth+ x32, download AVSF test build, install C++ runtime and the settings show up. So it's probably specific to your environment. Since there is no blocking issue for you, I'm closing this. Reopen if needed.

Clipboard 3

Nuihc88 commented 2 years ago

@CrendKing Ok, but just to make sure there hasn't been a miscommunication...

Here are the exact steps i used to reproduce the issue:

  1. Launch MPC-HC (32bit)
  2. Navigate to 'Right-Click'-menu -> 'Options...' -> 'External Filters'.
  3. Select from: 'Add Filter...' - > 'Browse...' -> 'avisynth-filter_32.dll'.
  4. Set 'Prefer' & Click 'Apply' & 'OK'.
  5. Load & Pause any Video.
  6. Navigate to 'Right-Click'-menu -> 'Filters' -> 'AviSynth Filter'.
CrendKing commented 2 years ago

Clipboard 2

Nuihc88 commented 2 years ago

I think i've figured out the cause of the blank windows issue, sort of...

I tried creating a new hardlink to the same filter version and the window started working, after that i confirmed that the file hashes were indeed the same for old and new hardlinks; yet old hardlinks still have the issue while new ones don't.

So it was either a NTFS filesystem or Windows Cache Management issue resulting from updating filters through hardlinks.

CrendKing commented 2 years ago

Glad you figured out.

Nuihc88 commented 2 years ago

After fixing the issue for MPC-HC (x32) & MPC-BE (x32) by replacing all old hardlinks, the issue then suddenly reappeared for PotPlayer x32 & x64. Also doesn't seem to require the use of hardlinks, meaning it's definitely a Windows Cache Management issue of some kind. I was unable to find out what the exact steps for resolving it are, but it involved placing all copies of the filter to recycle bin and emptying it, then trying to load the deleted filters with the affected player before putting new ones in.