mpv-player / mpv

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

4k HEVC stutters on AMD Kaveri Ubuntu 22.04 #12737

Closed rijnhard closed 1 year ago

rijnhard commented 1 year ago

Important Information

If you're not using git master or the latest release, update. Releases are listed here: https://github.com/mpv-player/mpv/releases

Reproduction steps

Think it's hardware or radeonsi specific, possibly

Reproducible with ubuntu version 0.33 or flatpak 0.36.0. Only affects HEVC 4k (which Kaveri doesn't have VAAPI support for). Attempted with all of the following configurations:

I also had to export LIBVA_DRIVER_NAME=radeonsi to get vaapi to work correctly in the first place.

Expected behavior

No stutters.

Actual behavior

Log file

Make a log file made with -v -v or --log-file=output.txt, paste it to https://0x0.st/ or attach it to the github issue, and replace this text with a link to it.

rijnhard commented 1 year ago
[cplayer] Command line options: '-v' '--ao=pulse' 'http://127.0.0.1:11470/77bc85ff0793c82741101b3f5f1c18297f390419/2'
[cplayer] mpv 0.36.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on UNKNOWN
[cplayer] libplacebo version: v6.292.1
[cplayer] FFmpeg version: n6.0
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100
[cplayer]    libavcodec      60.3.100
[cplayer]    libavformat     60.3.100
[cplayer]    libswscale      7.1.100
[cplayer]    libavfilter     9.3.100
[cplayer]    libswresample   4.10.100
[cplayer] 
[cplayer] Configuration: meson configure build -Dprefix=/app -Dbuildtype=debugoptimized -Doptimization=2
[cplayer] List of enabled features: alsa av-channel-layout avif_muxer cdda cplugins cuda-hwaccel cuda-interop debug dmabuf-interop-gl dmabuf-interop-pl dmabuf-wayland drm drm-is-kms dvbin dvdnav egl egl-drm egl-helpers egl-x11 ffmpeg ffnvcodec gbm gl gl-wayland glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg jpegxl lcms2 libarchive libass libavdevice libbluray libdl libm libplacebo libplacebo-next librt linux-fstatfs luajit memfd_create noexecstack pipewire posix posix_shm pulse rubberband rubberband-3 sdl2 sdl2-audio sdl2-gamepad sdl2-video shaderc sixel stdatomic threads uchardet vaapi vaapi-drm vaapi-egl vaapi-libplacebo vaapi-wayland vaapi-x-egl vaapi-x11 vapoursynth vdpau vector vk_khr_display vt.h vulkan wayland wayland_protocols_1_27 wayland_protocols_1_31 wayland_protocols_1_32 x11 xv zimg zimg-st428 zlib
[cplayer] Reading config file /app/etc/mpv/encoding-profiles.conf
[ifo_dvdnav] Opening /app/etc/mpv/encoding-profiles.conf
[bdmv/bluray] Opening /app/etc/mpv/encoding-profiles.conf
[file] Opening /app/etc/mpv/encoding-profiles.conf
[cplayer] Applying profile 'default'...
[cplayer] Reading config file /app/etc/mpv/mpv.conf
[ifo_dvdnav] Opening /app/etc/mpv/mpv.conf
[bdmv/bluray] Opening /app/etc/mpv/mpv.conf
[file] Opening /app/etc/mpv/mpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'screenshot-directory' = '~/.var/app/io.mpv.Mpv/Pictures/mpv' (flags = 4)
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'ao' = 'pulse' (flags = 8)
[cplayer] Waiting for scripts...
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: user-data/osc/visibility="auto" -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: user-data/osc/margins={"b":0,"t":0,"r":0,"l":0} -> 1
[osd/libass] libass API version: 0x1701000
[osd/libass] libass source: commit: 0.17.1-0-ge8ad72accd3a84268275a9385beb701c9284e5b3
[osd/libass] Shaper: FriBidi 1.0.12 (SIMPLE) HarfBuzz-ng 5.2.0 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: user-data/osc/margins={"b":0,"t":0,"r":0,"l":0} -> 1
[osd/libass] libass API version: 0x1701000
[osd/libass] libass source: commit: 0.17.1-0-ge8ad72accd3a84268275a9385beb701c9284e5b3
[osd/libass] Shaper: FriBidi 1.0.12 (SIMPLE) HarfBuzz-ng 5.2.0 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Done loading scripts.
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook 
[ytdl_hook] not a ytdl:// url 
[cplayer] Set property: shared-script-properties -> 1
[ffmpeg] Opening http://127.0.0.1:11470/77bc85ff0793c82741101b3f5f1c18297f390419/2
[cplayer] Set property: user-data/osc/margins={"b":0,"t":0,"r":0,"l":0} -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: user-data/osc/margins={"b":0,"t":0,"r":0,"l":0} -> 1
[ffmpeg] Could not set AVOption tls_verify='0'
[ffmpeg] Mime-type: 'video/x-matroska'
[demux] Trying demuxers for level=normal.
[mkv] Seeking to 2378881530 to read header element 0x1c53bb6b.
[ffmpeg] stream level seek from 40569 to 2378881530
[mkv] Parsing cues...
[mkv] Seeking to 2378933492 to read header element 0x1254c367.
[ffmpeg] stream level seek from 2378934825 to 8006
[mkv] All headers are parsed!
[demux] Detected file format: Matroska
[cplayer] Opening done: http://127.0.0.1:11470/77bc85ff0793c82741101b3f5f1c18297f390419/2
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: user-data/osc/margins={"b":0,"t":0,"r":0,"l":0} -> 1
[cplayer] Running hook: ytdl_hook/on_preloaded
[mkv] select track 0
[mkv] select track 1
[cplayer]  (+) Video --vid=1 (*) (hevc 3840x1600 23.976fps)
[cplayer]  (+) Audio --aid=1 --alang=eng (eac3 6ch 48000Hz)
[cplayer]      Subs  --sid=1 --slang=eng (subrip)
[cplayer]      Subs  --sid=2 --slang=eng 'English (SDH)' (subrip)
[vo/gpu] Probing for best GPU context.
[vo/gpu/opengl] Initializing GPU context 'wayland'
[vo/gpu/wayland] Registered for protocol wl_compositor
[vo/gpu/wayland] Registered for protocol wl_shm
[vo/gpu/wayland] Registered for protocol wl_output
[vo/gpu/wayland] Registered for protocol wl_data_device_manager
[vo/gpu/wayland] Registered for protocol wl_subcompositor
[vo/gpu/wayland] Registered for protocol xdg_wm_base
[vo/gpu/wayland] Registered for protocol wp_viewporter
[vo/gpu/wayland] Registered for protocol wl_seat
[vo/gpu/wayland] Registered for protocol zwp_linux_dmabuf_v1
[vo/gpu/wayland] Registered for protocol wp_presentation
[vo/gpu/wayland] Compositor doesn't support the wp_content_type_manager_v1 protocol!
[vo/gpu/wayland] Compositor doesn't support the wp_single_pixel_buffer_manager_v1 protocol!
[vo/gpu/wayland] Compositor doesn't support the wp_fractional_scale_manager_v1 protocol!
[vo/gpu/wayland] Compositor doesn't support the zxdg_decoration_manager_v1 protocol!
[vo/gpu/wayland] Compositor doesn't support the zwp_idle_inhibit_manager_v1 protocol!
[vo/gpu/wayland] GNOME's wayland compositor lacks support for the idle inhibit protocol. This means the screen can blank during playback.
[vo/gpu/wayland] Registered output HEC HISENSE (0x4):
[vo/gpu/wayland]    x: 0px, y: 0px
[vo/gpu/wayland]    w: 3840px (1150mm), h: 2160px (650mm)
[vo/gpu/wayland]    scale: 2
[vo/gpu/wayland]    Hz: 30.000000
[vo/gpu/opengl] EGL_VERSION=1.5
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES 
[vo/gpu/opengl] Trying to create Desktop OpenGL context.
[vo/gpu/wayland] GL_VERSION='4.6 (Core Profile) Mesa 23.1.9 (git-acb5ee278a)'
[vo/gpu/wayland] Detected desktop OpenGL 4.6.
[vo/gpu/wayland] GL_VENDOR='AMD'
[vo/gpu/wayland] GL_RENDERER='AMD Radeon R7 Graphics (kaveri, LLVM 15.0.7, DRM 3.42, 5.15.0-87-generic)'
[vo/gpu/wayland] GL_SHADING_LANGUAGE_VERSION='4.60'
[vo/gpu/wayland] Loaded extension GL_NV_vdpau_interop.
[vo/gpu/wayland] Loaded extension GL_KHR_debug.
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Resize: 0x0
[vd] Container reported FPS: 23.976024
[vd] Codec list:
[vd]     hevc - HEVC (High Efficiency Video Coding)
[vd]     hevc_v4l2m2m (hevc) - V4L2 mem2mem HEVC decoder wrapper
[vd]     hevc_cuvid (hevc) - Nvidia CUVID HEVC decoder
[vd] Opening decoder hevc
[vd] No hardware decoding requested.
[vd] Using software decoding.
[vd] Detected 4 logical cores.
[vd] Requesting 5 threads for decoding.
[vd] Selected codec: hevc (HEVC (High Efficiency Video Coding))
[vf] User filter list:
[vf]   (empty)
[ad] Codec list:
[ad]     eac3 - ATSC A/52B (AC-3, E-AC-3)
[ad] Opening decoder eac3
[ad] Requesting 1 threads for decoding.
[ad] Selected codec: eac3 (ATSC A/52B (AC-3, E-AC-3))
[af] User filter list:
[af]   (empty)
[cplayer] Starting playback...
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: user-data/osc/margins={"b":0,"t":0,"r":0,"l":0} -> 1
[vd] Using software decoding.
[vd] Decoder format: 3840x1600 [0:1] yuv420p10 bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264
[vd] Using container aspect ratio.
[vf] [in] 3840x1600 yuv420p10 bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] 3840x1600 yuv420p10 bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] (disabled)
[vf] [autorotate] 3840x1600 yuv420p10 bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [autorotate] (disabled)
[vf] [convert] 3840x1600 yuv420p10 bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [convert] (disabled)
[vf] [out] 3840x1600 yuv420p10 bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[af] [in] 48000Hz 5.1(side) 6ch floatp
[af] [userspeed] 48000Hz 5.1(side) 6ch floatp
[af] [userspeed] (disabled)
[af] [convert] 48000Hz 5.1(side) 6ch floatp
[ao] Trying audio driver 'pulse'
[ao/pulse] requested format: 48000 Hz, 5.1(side) channels, floatp
[ao/pulse] Library version: 16.0.0
[ao/pulse] Proto: 35
[ao/pulse] Server proto: 4294967295
[ao/pulse] Channel layouts:
[ao/pulse]  - #fl
[ao/pulse]  - #fr
[ao/pulse]  - #fc
[ao/pulse]  - #lfe
[ao/pulse]  - #bl
[ao/pulse]  - #br
[ao/pulse]  - #flc
[ao/pulse]  - #frc
[ao/pulse]  - #bc
[ao/pulse]  - #sl
[ao/pulse]  - #sr
[ao/pulse]  - #tc
[ao/pulse]  - #tfl
[ao/pulse]  - #tfc
[ao/pulse]  - #tfr
[ao/pulse]  - #tbl
[ao/pulse]  - #tbc
[ao/pulse]  - #tbr
[ao/pulse] result: 5.1(side)
[ao/pulse] device buffer: 4800 samples.
[ao/pulse] using soft-buffer of 9600 samples.
[cplayer] AO: [pulse] 48000Hz 5.1(side) 6ch float
[cplayer] AO: Description: PulseAudio audio output
[autoconvert] inserting resampler
[swresample] format change, reinitializing resampler
[swresample] 48000Hz 5.1(side) floatp -> 48000Hz 5.1(side) float
[af] [out] 48000Hz 5.1(side) 6ch float
[cplayer] VO: [gpu] 3840x1600 yuv420p10
[cplayer] VO: Description: Shader-based GPU Renderer
[vo/gpu] reconfig to 3840x1600 yuv420p10 bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vo/gpu/wayland] Reconfiguring!
[vo/gpu] Resize: 7680x3200
[vo/gpu] Window size: 7680x3200 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x1600 (1:1)
[vo/gpu] Video display: (0, 0) 3840x1600 -> (0, 0) 7680x3200
[vo/gpu] Video scale: 2.000000/2.000000
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Texture for plane 0: 3840x1600
[vo/gpu] Texture for plane 1: 1920x800
[vo/gpu] Texture for plane 2: 1920x800
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu/wayland] Handling resize on the egl side
[vo/gpu] Resize: 3840x2160
[vo/gpu] Window size: 3840x2160 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x1600 (1:1)
[vo/gpu] Video display: (0, 0) 3840x1600 -> (0, 280) 3840x1600
[vo/gpu] Video scale: 1.000000/1.000000
[vo/gpu] OSD borders: l=0 t=280 r=0 b=280
[vo/gpu] Video borders: l=0 t=280 r=0 b=280
[vo/gpu] Reported display depth: 10
[vo/gpu] DR enabled: yes
[cplayer] first video frame after restart shown
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: user-data/osc/margins={"b":0,"t":0,"r":0,"l":0} -> 1
[vo/gpu/wayland] Given DND offer with mime type text/plain
[vo/gpu/wayland] Given DND offer with mime type text/plain;charset=utf-8
[vo/gpu/wayland] Received a new DND offer. Releasing the previous offer.
[vo/gpu/wayland] Surface entered output HEC HISENSE (0x4), scale = 2.000000, refresh rate = 30.000000 Hz
[vo/gpu] Resize: 3840x2160
[vo/gpu] Window size: 3840x2160 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x1600 (1:1)
[vo/gpu] Video display: (0, 0) 3840x1600 -> (0, 280) 3840x1600
[vo/gpu] Video scale: 1.000000/1.000000
[vo/gpu] OSD borders: l=0 t=280 r=0 b=280
[vo/gpu] Video borders: l=0 t=280 r=0 b=280
[vo/gpu] Reported display depth: 10
[vo/gpu] Assuming 30.000000 FPS for display sync.
[cplayer] audio ready
[cplayer] starting audio playback
[cplayer] playback restart complete @ 0.000000, audio=playing, video=playing
[ao/pulse] starting AO
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: user-data/osc/margins={"b":0,"t":0,"r":0,"l":0} -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: user-data/osc/margins={"b":0,"t":0,"r":0,"l":0} -> 1
[cplayer] 
[cplayer] Audio/Video desynchronisation detected! Possible reasons include too slow
[cplayer] hardware, temporary CPU spikes, broken drivers, and broken files. Audio
[cplayer] position will not match to the video (see A-V status field).
[cplayer] 
[vo/gpu/wayland] Surface entered output HEC HISENSE (0x4), scale = 2.000000, refresh rate = 30.000000 Hz
[cplayer] EOF code: 5  
[cplayer] finished playback, success (reason 3)
[cplayer] 
[cplayer] Exiting... (Quit)
[cplayer] Set property: shared-script-properties -> 1
[vo/gpu/wayland] Deregistering output HEC HISENSE (0x4)
qyot27 commented 1 year ago

4K 10-bit HEVC on a nearly 10-year-old CPU that lacks AVX2 instructions and using only software decoding (because UVD 4.2 doesn't support HEVC at all) to do it? I'd be surprised if it didn't drop frames.

You could convert the file down to a resolution/format the GPU does support (read: 1080p 8-bit H.264), or buy a cheap modern graphics card.

Jules-A commented 1 year ago

Does it occur with --profile=fast ? gpu-hq requirements got significantly raised not too long ago.

EDIT: Whoops, didn't see your versions tested.

Dudemanguy commented 1 year ago

He's using 0.36.0. The hardware is just too weak period.

rijnhard commented 1 year ago

He's using 0.36.0. The hardware is just too weak period.

Well... I'll accept that, but just humour my next silly question please. I have hidpi scaling set to 2x because this is my htpc.

It doesn't have anything to do with this in the logs? Because it's only a 4k screen.

[vo/gpu] Resize: 7680x3200
[vo/gpu] Window size: 7680x3200 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x1600 (1:1)
Dudemanguy commented 1 year ago

It resizes itself back down later in the log.

[vo/gpu] Resize: 3840x2160 [vo/gpu] Window size: 3840x2160 (Borders: l=0 t=0 r=0 b=0) [vo/gpu] Video source: 3840x1600 (1:1)

The initial "oversize" is because you're using hidpi scaling and the window happens to be bigger than the monitor. The compositor applies configure bounds to it to resize it back down which mpv obeys by default.