Audio issue after Windows update

2024_12_07

tldr; I suspect a problem between windows and its handling of utf-8 (Thai alphabet) file names and Anki’s mpv.exe sound player but I’m not computer savvy enough to be sure, much less savvy enough to fix it.

Anki PC
Version ⁨24.04.1 (ccd9ca1a)⁩
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
mpv.exe (updated manually today to x86_64-20241124)

Last night:
Updated/upgraded Windows 10 → 11 (10.0.26100 B26100)

Today:
Audio files named .mp3 not playing. (Anki phone/android still working fine.)
Re-linking to local original audio files doesn’t solve it.

Anki reports no missing files, and I can see them in local collection.media folder.
Drag and drop to mpv.exe doesn’t work for files named “utf-8”.mp3. It appears to play/process it, but no sound is produced. Plays “ascii”.mp3 named files fine. This behavior occurs both inside and out of the collections.media folder. VLC doesn’t have this issue, plays both naming conventions as expected.

So as near as I can tell, it’s a problem with mpv.exe rather than Anki itself. Anki seems to be pointing at the files just fine, but the player isn’t playing them correctly.

(For the record: I blame Microsoft. It’s definitely the Windows update that did it, and they’ve handled utf-8 awkwardly since forever.)

2 Likes

One possible thing you could try, from some Googling:

Windows Settings > Time & language > Language & region > Administrative language settings > Change system locale , and check Beta: Use Unicode UTF-8 for worldwide language support . Then reboot the PC for the change to take effect.

1 Like

Yeah tried that already but thanks.

After further messing about I’m becoming more and more suspicious of mpv.exe itself, although I’ve not given up blaming Microsoft. :wink: Why it was working before and not after is a bit mysterious (Windows update changed $path or something??), but it seems that mpv suddenly isn’t rendering low bitrate mp3s properly. Still testing.

There are a fair few users on Windows 11 at this point, so I’d be a bit surprised if this was affecting all Windows 11 users. Which version are you on @abdo?

Anki ⁨24.11 (87ccd24e)⁩
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Win 11 Pro 24H2 - 26100.2454
mpv-0.39.0

I’m still on Windows 10. I have the UTF-8 support option enabled and couldn’t reproduce the issue.

1 Like

Maybe try to enable mpv logging using the following code in the debug console, review a card with sound, click once or twice on the audio replay button, wait a few seconds and open the “f.txt” file on your Desktop in the text editor, maybe the last few lines will contain something helpful.

https://docs.ankiweb.net/misc.html#debug-console

import os
from aqt.sound import mpvManager
logfile = os.path.expanduser("~/Desktop/f.txt")
mpvManager.set_property("log-file", logfile)
print(mpvManager.get_property("log-file"))

The last lines should look something similar to this one.

[3269.419][d][cplayer] Run command: loadfile, flags=64, args=[url="C:\\Users\\...\\AppData\\Roaming\\Anki2\\User 1\\collection.media\\audio-file.mp3", flags="replace", options=""]
...
[3269.463][v][cplayer] starting audio playback
...
[3279.762][v][cplayer] finished playback, success (reason 0)
1 Like

I’ll try this since I upgraded to Windows 11 LTSC, and will update to 24.04. I’ll try debugging it as well.

Update -

Works well, and I use all Korean words in the mp3 files. Even the built-in TTS

1 Like

I’m pretty sure it’s down to some problem with mpv.exe and low quality .mp3’s (TTS generated files).

Logging from Anki looks like everything is working fine, just no sound is produced.

# fail
[  22.579][v][cplayer] audio ready
[  22.579][v][cplayer] starting audio playback
...
[  24.262][v][cplayer] finished playback, success (reason 0)

Same as a card/audio file from a different deck that is working.

# success
[  14.793][v][cplayer] audio ready
[  14.793][v][cplayer] starting audio playback
...
[  18.417][v][cplayer] finished playback, success (reason 0)

In order to eliminate a few more variables, I took a copy of an .mp3 from the non-working deck and ‘upsampled’ it in Kdenlive. Then I ran both files through mpv directly from a terminal (that is, not in an Anki wrapper). In both cases the mpv window pops open, appears to play/process the file, and closes. Log files read same as above, ‘success (reason 0),’ but the original file produces nothing at the speakers. Upsampled version works fine.

Again, all decks were working fine before I caved to Windows upgrade spam. So no matter how it works out I’m going to blame Microsoft. :smiling_face_with_tear:

So in conclusion, I was right to blame Microsoft. The Windows upgrade borked the sound card driver, but only enough to break low bitrate files. Everything else played just fine but the low-grade TTS files failed. Go figure.

Seems to be the 24H2 version that’s giving everyone audio driver trouble.

Anyway, problem solved and it wasn’t an Anki problem.

1 Like

How were you able to solve it in Windows? I’m asking because we’ve had reports of other issues that seem related to 24H2 build 26100.2605 – your experience might help!

https://www.reddit.com/r/Anki/comments/1hfggc3/anki_crashing_on_opening_with_internet_connection/

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