mpv
mpv copied to clipboard
mpv loses audio/sub sync (and laggy video) when pause/resume the video
Important Information
Provide following Information:
- mpv version: mpv (1:0.34.1-5)
- Linux Distribution and Version: Arch Linux (all software up to date)
- Source of the mpv binary: Arch Linux Community Repository
- If known which version of mpv introduced the problem: I don't know but I have this problem for 2-3 months
- Window Manager and version: Xfwm4 (XFCE)
- GPU driver and version: NVIDIA 520.56.06 (dkms package)
- Possible screenshot or video of visual glitches: it's an audio/subtitle problem
The problem is seems not OS related because if I use another OS or if I open the same video but using VLC player, the problem doesn't show up
Reproduction steps
Reproducing the issue isn't deterministic, it seems a buffer related problem. Anyway:
- open a video and watch for 10-20min
- pause and play the video again.
Expected behavior
The video should play as was before
Actual behavior
After playing again the video, its audio/subtitles will be be out of sync and the video will be laggy. After about 10-15s the video returns normal.
Log file
I played the file until 2m:30s than I pause the video and after playing again it got desynced. Then after around 10s it returns synced. Log: https://bin.disroot.org/?047d12929996d5a1#2Febx6DaqaDp5HGaGEuRUT2qYWLBRpF5h8e371j4etSS
Sample files
I don't know, every file has this problem. It seems that very small files (maybe video of a few megabytes) have this problem more rarely or don't have the problem at all.
I'm having a very similar problem, and had it for a long time.
Except the a/v lag is easier to trigger, and seems to fix itself after a few seconds.
Also Arch Linux.
All videos (network and local) are affected.
Try
ao=alsa
It seems to have fixed it. And even though I'm using pulseaudio, everything is still working, bluetooth speakers etc.
Stock Ubuntu 22.04 did this (or at least something very similar) to me before I took steps to switch it to using pipewire. Since pipewire is now the default on 22.10, I've not had to do the same. So I mean, it's not out of the question that something within the last year broke pulse's handling of this sort of thing.
I'm getting it too in Ubuntu 22.04, what steps did you take? What I found so far is a guide here:
https://askubuntu.com/questions/1333404/how-to-replace-pulseaudio-with-pipewire-on-ubuntu-21-04
Hopefully I won't do something wrong and create an even bigger issue, my Linux experience isn't more than a couple of weeks.
Edit:
It works now after trying a bunch of things without really knowing what I'm doing.
I'd followed https://ubuntuhandbook.org/index.php/2022/04/pipewire-replace-pulseaudio-ubuntu-2204/
I had tried the accepted answer at the askubuntu thread, which did not work, the answer below suggested the project which worked:
https://github.com/pipewire-debian/pipewire-debian/
I'm having a very similar problem, and had it for a long time. Except the a/v lag is easier to trigger, and seems to fix itself after a few seconds. Also Arch Linux. All videos (network and local) are affected.
Try
ao=alsaIt seems to have fixed it. And even though I'm using pulseaudio, everything is still working, bluetooth speakers etc.
this mpv config seems to fix the problem
I'm having a very similar problem, and had it for a long time. Except the a/v lag is easier to trigger, and seems to fix itself after a few seconds. Also Arch Linux. All videos (network and local) are affected.
Try
ao=alsaIt seems to have fixed it. And even though I'm using pulseaudio, everything is still working, bluetooth speakers etc.
update: this config doesn't solve the problem, it fixes audio desync but lag after play/pause of the video is still present. Do you think the problem is related to pulseaudio?
ao=alsa is already removed from MPV until release 0.23.0
problem exist in Arch linux but I check it on win 10 there is no any problem like that on it.
I can confirm too that the latest version of mpv in archlinux (updated to today) still has this problem and there isn't any temporary fix that I know
I can confirm too that the latest version of mpv in archlinux (updated to today) still has this problem and there isn't any temporary fix that I know
actually I fixed this with someone's config file on Github I'll share it with your and I hope This work for your system too.
This is the github DotFiles : https://github.com/Pakrohk-DotFiles/MPV.git
so you can clone all config with This : git clone --depth 1 https://github.com/Pakrohk-DotFiles/MPV.git ~/.config/mpv
If anyone has this problem, it's because of pulseaudio. You can workaround it with --pulse-latency-hacks or use another ao.