Anki 2.1.48 only starting atfter kill and second run

Hi there,
I am trying to use Anki 2.1.48 on Windows 10, unfortunately I have to kill the anki.exe and launch it a second time in order to get it up running.
Starting anki from the console I get mpv timed out, restarting, which keeps coming up again and again, despite the mpv process being visible in the task manager (strangely, the service host Windows font caching engine starts showing high CPU usage).
After killing Anki via task manager and relaunching it opens just fine.
Although manageable, it is tedious and I wondered if somebody knew of a fix.
Thank you for any suggestions.

C:\Program Files\Anki>anki-console
[3908] PyInstaller Bootloader 3.x
[3908] LOADER: executable is C:\Program Files\Anki\anki-console.exe
[3908] LOADER: homepath is C:\Program Files\Anki
[3908] LOADER: _MEIPASS2 is NULL
[3908] LOADER: archivename is C:\Program Files\Anki\anki-console.exe
[3908] LOADER: C:\Program Files\Anki\anki-console.exe contains a digital signature
[3908] LOADER: No need to extract files to run; setting extractionpath to homepath
[3908] LOADER: SetDllDirectory(C:\Program Files\Anki)
[3908] LOADER: Already in the child - running user's code.
[3908] LOADER: Python library: C:\Program Files\Anki\python38.dll
[3908] LOADER: Loaded functions from Python library.
[3908] LOADER: Manipulating environment (sys.path, sys.prefix)
[3908] LOADER: sys.prefix is C:\Program Files\Anki
[3908] LOADER: Pre-init sys.path is C:\Program Files\Anki\base_library.zip;C:\Program Files\Anki
[3908] LOADER: Setting runtime options
[3908] LOADER: Initializing python
[3908] LOADER: Overriding Python's sys.path
[3908] LOADER: Post-init sys.path is C:\Program Files\Anki\base_library.zip;C:\Program Files\Anki
[3908] LOADER: Setting sys.argv
[3908] LOADER: setting sys._MEIPASS
[3908] LOADER: importing modules from CArchive
[3908] LOADER: extracted struct
[3908] LOADER: callfunction returned...
[3908] LOADER: extracted pyimod01_os_path
[3908] LOADER: callfunction returned...
[3908] LOADER: extracted pyimod02_archive
[3908] LOADER: callfunction returned...
[3908] LOADER: extracted pyimod03_importers
[3908] LOADER: callfunction returned...
[3908] LOADER: Installing PYZ archive with Python modules.
[3908] LOADER: PYZ archive: PYZ-00.pyz
[3908] LOADER: Running pyiboot01_bootstrap.py
[3908] LOADER: Running pyi_rth_win32comgenpy.py
[3908] LOADER: Running pyi_rth_multiprocessing.py
[3908] LOADER: Running pyi_rth_certifi.py
[3908] LOADER: Running pyi_rth_pyqt5.py
[3908] LOADER: Running pyi_rth_pkgres.py
[3908] LOADER: Running pyi_rth_pyqt5webengine.py
[3908] LOADER: Running runanki.py
mpv timed out, restarting

Try updating mpv to the latest version by downloading it from https://sourceforge.net/projects/mpv-player-windows/files/64bit/, unzipping with https://www.7-zip.org/ and copying mpv.exe and d3dcompiler_43.dll (and maybe mpv.com) to C:\Program Files\Anki.

the service host Windows font caching engine starts showing high CPU usage

This is probably the same issue that was closed this year and the latest mpv version should contain the fix.

Actually, old mpv version from Anki should be fixed too, a bit differently, but maybe it didn’t work on your PC for some reason.

If it doesn’t work, create mpv.conf in %APPDATA%\Anki2 with this line and replace <username> with the correct value.

log-file=C:\Users<username>\AppData\Roaming\Anki2\mpv.debug.log.txt

Then start anki-console.exe and once you see the message, “mpv timed out, restarting”, press Ctrl+C twice to stop Anki and open mpv.debug.log.txt in the text editor. Theoretically, mpv won’t be restarted immediately, the log file will be intact and the last few lines might contain some useful information.

Alternatively, to do something similar, start mpv from cmd using mpv.com (after updating mpv) and this command.

"C:\Program Files\Anki\mpv.com" -v --idle --force-window=yes --audio-display=no --keep-open=no --autoload-files=no --gapless-audio=no --input-media-keys=no --input-ipc-server=ankimpv

There should be no visible delay for mpv window to appear. If it’s being delayed with the last message in the console output to be

[osd/libass] Setting up fonts…

try adding --sub-font-provider=none to the list of command line options.

https://mpv.io/manual/master/#options-sub-font-provider

2 Likes

Thank you for your time, @kelciour! Replacing the mpv files and the dll did indeed solve the problem.

1 Like