Daniel_Laixer - 2023-08-14

OK, after using the application for several days I've arrived to the conclusion that it just likes to crash randomly for no clear reason. I feel stupid for all my troubleshooting and "research".

My brute-force workaround was creating a batch file that checks every 1 second if Virtual Controller is running and starts it if it's not:

cd "C:\Program Files\Virtual Controller"

:loop
FOR /F "tokens=1 USEBACKQ" %%T IN (`tasklist /fi "ImageName eq VirtualController.exe" ^| findstr VirtualController.exe ^| findstr/n ^^^^ ^| findstr 1:`) DO (set Process=%%T)

IF "%Process%"=="" (
    VirtualController.exe /run
) else (
    timeout 1 > nul
)

goto loop

Things to take into account:
* Paste this into a Notepad or Notepad++ window and save it as a .bat or .cmd file with a name of your choice. Check if your Windows file explorer is set to not show file name extensions, as you may inadvertently save the file as Filename.bat.txt instead of Filename.bat
* "C:\Program Files\Virtual Controller" must be the path (folder) where VirtualController.exe is present. Change it accordingly if you installed the application on a custom location.
* You can add @echo off as the very first line of the file to hide the cmd output.
* To use the script, simply double click on it. The /run parameter automatically enables the virtual controller on startup.


Summary: add the application's installation folder to Windows Defender's (aka Windows Security) exclusions, even if Defender doesn't detect any threat regarding Virtual Controller


So yesterday I installed Virtual Controller 1.0.7.2 to use it with Xenia XBOX 360 Emulator.

It worked fine while I was doing multiple tests and tweaks until it suddenly started crashing in less than a minute after startup.

Even viewer showed these errors:

Aplicación: VirtualController.exe
Versión de Framework: v4.0.30319
Descripción: el proceso terminó debido a una excepción no controlada.
Información de la excepción: System.NullReferenceException
   en VirtualController.InternalController.IOButtonHandler(ButtonState, Boolean)
   en VirtualController.InternalController.SetButton(ButtonState, Boolean)
   en VirtualController.IO.Physical.Keyboard.KeyboardLLHook_KeyUp(System.Object, WindowsHookLib.KeyboardEventArgs)
   en WindowsHookLib.KeyboardHook.OnKeyUp(WindowsHookLib.KeyboardEventArgs)
   en WindowsHookLib.KeyboardHook.KeyboardProc(Int32, IntPtr, KeyboardData ByRef)
Nombre de la aplicación con errores: VirtualController.exe, versión: 1.0.7.2, marca de tiempo: 0x5f3e5169
Nombre del módulo con errores: unknown, versión: 0.0.0.0, marca de tiempo: 0x00000000
Código de excepción: 0xc0000005
Desplazamiento de errores: 0x00007ffe0f31e240
Identificador del proceso con errores: 0x2a38
Hora de inicio de la aplicación con errores: 0x01d9ceab8bb35ab4
Ruta de acceso de la aplicación con errores: C:\Program Files\Virtual Controller\VirtualController.exe
Ruta de acceso del módulo con errores: unknown
Identificador del informe: 8c833831-ffb7-419e-82ed-252ca94662aa
Nombre completo del paquete con errores: 
Identificador de aplicación relativa del paquete con errores: 
Nombre de la aplicación con errores: VirtualController.exe, versión: 1.0.7.2, marca de tiempo: 0x5f3e5169
Nombre del módulo con errores: KERNELBASE.dll, versión: 10.0.19041.3324, marca de tiempo: 0x6967c799
Código de excepción: 0xc000041d
Desplazamiento de errores: 0x000000000002cf19
Identificador del proceso con errores: 0x2a38
Hora de inicio de la aplicación con errores: 0x01d9ceab8bb35ab4
Ruta de acceso de la aplicación con errores: C:\Program Files\Virtual Controller\VirtualController.exe
Ruta de acceso del módulo con errores: C:\Windows\System32\KERNELBASE.dll
Identificador del informe: b8024666-b2be-46d3-be54-14c6c6b879b9
Nombre completo del paquete con errores: 
Identificador de aplicación relativa del paquete con errores: 

I reinstalled the application multiple times, rebooting, checked my system and filesystem consistency, installed updates, tried different input methods, add keybinding progressively... and nothing worked.

As I indicated at the beginning, I decided to add the installation path ("C:\Program Files\Virtual Controller") to Windows Security's exceptions and suddenly Virtual Controller stopped crashing.

Now, Windows Security wasn't reporting any threat regarding this software and what's even more strange: I removed the security exception afterwards and VC still worked fine. I re-added it, just in case.

My guess here is that some Windows Security monitoring was interfering with VC causing it to crash, but I have no evidence.

Update 1: it happened again, although this time rebooting solved the issue. It seems Xenia doesn't like "controllers" being changed while it's running.

Update 2: holy cow... issue came back again and prior solutions didn't work. I checked Task Manager's process details to see if some process could be the issue. I found a cmd.exe process with an invisible window, the full command line process was:
"C:\Windows\system32\cmd.exe" /C "C:\Program Files\AMD\CNext\CNext\AMDRSServ.exe"

VC kinda started working for a couple of minutes, then it broke again and fixed itself after relaunching the application several times...

Regarding the AMDRSServ.exe process, it seems to interfere sometimes only.

 

Last edit: Daniel_Laixer 2023-08-17