Bug with mvp player add-on

Hello,
I received a notification from Anki, that in order to play audio on my Anki desktop app I need to use an mvp or another player. I installed an add-on which worked perfectly. When I wanted to close Anki, information about a bug appeared (I am attaching it below). Unfortunately, after I clicked the “close” button, the window with information about the bug started to appear multiple times (like thousands) causing my computer to be completely blocked. No way to Force Quit or Restart the computer. Anki blocked the possibility of switching off my Mac. I needed to Hard switch off. After I uninstalled the add-on, the problem disappeared.

Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.5.0 PyQt 6.5.0
Platform: macOS-12.6.8-x86_64-i386-64bit Intel
Flags: frz=True ao=True sv=?
Add-ons, last update check: 2023-09-09 21:30:08
Advanced MPV Player⁩

Caught exception:
Traceback (most recent call last):
File “aqt.progress”, line 118, in handler
File “aqt.mediasync”, line 134, in check_finished
File “aqt.main”, line 628, in after_media_sync
File “aqt.main”, line 507, in callback
File “aqt.main”, line 514, in _unloadProfile
File “aqt.main”, line 563, in cleanup_sound
File “aqt.sound”, line 882, in cleanup_audio
File “aqt.sound”, line 187, in shutdown
File “/Users/zofiamroz/Library/Application Support/Anki2/addons21/924111087/init.py”, line 231, in shutdown
saveGeometry()
File “/Users/zofiamroz/Library/Application Support/Anki2/addons21/924111087/init.py”, line 70, in saveGeometry
FindWindow = ctypes.windll.user32.FindWindowW
AttributeError: module ‘ctypes’ has no attribute ‘windll’

I just wanted to let you know.
Cheers,
Zosia

It looks like the author of the add-on is aware of the issue and provided a workaround in the reply to one of AnkiWeb reviews.

You are using in macOS and this add-on only test at windows system, and you can avoid this error message by diable the config of “restore_last_on_off”: from tools-Advanced MPV Player->restore_last_on_off or chage the config file from Add-ons dialog.

But you don’t need to install it to just be able to play audio as Anki already ships with mpv on Mac and audio should work just fine out-of-the-box. The error message is usually only relevant on Linux where mpv isn’t packaged with Anki and needs to be installed separately.

It’s strange that you receive this error message on Mac. If you install the latest Anki version (2.1.66) and run Anki with all the add-ons disabled, the audio should play just fine.

If you’re still receiving the same error message, maybe mpv (that is packaged with Anki) fails to start for some reason. To check it, maybe open the Terminal app and run /Applications/Anki.app/Contents/Resources/mpv or use Debug Console in Anki with the following code to check that mpv was started successfully by printing its version.

from aqt.sound import mpvManager
print(mpvManager.get_property("mpv-version"))
3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.