mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.65k stars 2.83k forks source link

'Audio device underrun detected' leading to stuttering (and eventually pausing) #14378

Open cyberme0w opened 1 week ago

cyberme0w commented 1 week ago

mpv Information

mpv 0.38.0 Copyright _ 2000-2024 mpv/MPlayer/mplayer2 projects
libplacebo version: v6.338.2
FFmpeg version: 6.1.1-4+b3
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

Other Information

Reproduction Steps

  1. Download any test file (in my case, I used yt-dlp https://youtu.be/T0U9ou0HOgY).
  2. Play it with --no-config and provide --audio-device=alsa/plughw:CARD=HDMI,DEV=3 (HDMI output to TV)
  3. Play it with the same options as in 2. but enable hardware decoding with --hwdec.

Expected Behavior

MPV plays the file without issues.

Actual Behavior

The video starts playing, but the audio seems to be 'dropping frames', in that it's very choppy and tends to get worse over time.

The 'choppiness' is also not constant - sometimes it's almost entirely gone, and other times the audio is barely understandable.

Sometimes, the video ends up freezing (once again, not always, but more common when not using --hwdec) as if the 'pause' button had been pressed. Checking the console log, there's always an entry with 'Audio device underrun detected' after this happens. However, I have noticed it is possible for those entries to appear without the video freezing, too.

Log File

Without --hwdec (file played until the end): output-without-hwdec.txt

With --hwdec (file paused and I quit mpv manually with 'q'): output-with-hwdec.txt

Sample Files

I have downloaded this Numberphile video and cut it down to 30 seconds (to be able to upload it) with:

yt-dlp https://www.youtube.com/watch?v=T0U9ou0HOgY
ffmpeg -i {the-file} -to 0:00:30 -c copy parker.mp4

This results in the following file: https://github.com/mpv-player/mpv/assets/59916540/25415712-cbcd-4310-b26b-da64b98d0cf0

This is the file I have used to generate the logs above.

I carefully read all instruction and confirm that I did the following: