Audio in Anki stops working randomly. I’m able to get audio from maybe 1 card in 10, with no rhyme or reason. Cards that played audio yesterday won’t play audio today.
I’m on Anki 25.02 and had been using MPV 0.39.0-4 when the problem suddenly came up two days ago. In an attempt to fix it, I changed to mpv-full-built-git in the AUR. I thought this solved the problem when the first 3 cards played audio correctly, but then it went back to not playing audio at all.
Occasionally the program will play short bursts of static.
I attempted to use an addon I found on GitHub to force Anki to use MPlayer instead of MPV, but this didn’t work.
All other programs can use audio correctly on my machine. Anki is the only one with a problem, and I can’t figure out why.
Does anybody have any suggestions or recommendations?
I’m aware that there was a post back in 2020 on Anki 2.1.33 with a similar issue. Unfortunately, the addon that user was recommended to install (No Sound Fix 1) is obsolete and not compatible with Anki 25.02.
I’ve temporarily solved the problem by switching over to Flatpak (using Discover in KDE). The Flatpak version of Anki is 24.11. Either the downgrade or the sandboxed aspect of Flatpak solved the problem; I’m not sure which it was.
Anyway, I’ll have to run Anki like this for the time being. It’s not ideal, and I don’t like the downgrade, but at least it works.
I still wish I knew what caused the original problem, though.
I also encountered this issue. I fixed it without uninstalling mpv by using the following plugin.
(space after github 'cause I can’t post links for some reason)
gist.github .com/kelciour/bfbf0a48f3e63296352dad94abebb6bb
(To install the plugin, create a folder inside ~/.local/share/Anki2/addons21. I called mine nompv. Then, inside this folder, create a file named init.py and paste the code mentioned above into this file. If done correctly, you should see a new plugin under Tools/Plugins, and audio should work assuming mplayer is installed.)
Maybe try installing anki from the tarball file from github. I had an issue with the version from the repos one time and installing the tarball file solved it.
I can confirm I am having the same issue with the standard package. After screwing around with mplayer and AUR packages, I installed the flatpak and redownloaded all my content from anki web and now it works. This is obviously not ideal for me or for anki web bandwidth. Has an issue been raised in the appropriate issue tracker?
This is actually a bug in pipewire causing mpv to crash that’s causing all this, a fix is already in and Arch is in the process of backporting it now. (currently sitting in testing)
Pipewire is a pain to update straight from testing because of all the dependencies wanting to match versions so if you just wait a little bit until it’s out of testing it will probably be easier.
See these bugs for the issue:
mpv crashing on certain mp3s: https:/ /github .com/mpv-player/mpv/issues/16028
pipewire causing crashes in mpv: https:/ /gitlab.freedesktop .org/pipewire/pipewire/-/issues/4595
fix in pipewire: https:/ /gitlab.freedesktop .org/pipewire/pipewire/-/commit/d43fb09ea1177df1dced04b6bafdca96dd73bf30