Bug 442132 - 4k videos are choppy on Wayland
Summary: 4k videos are choppy on Wayland
Status: RESOLVED FIXED
Alias: None
Product: Haruna
Classification: Applications
Component: generic (other bugs)
Version First Reported In: 0.7.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: george fb
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2021-09-07 15:07 UTC by Thiago Sueto
Modified: 2023-05-14 14:31 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Sueto 2021-09-07 15:07:17 UTC
SUMMARY
4K videos on X11 play perfectly fluid, Full HD videos on Wayland play perfectly well too, but 4K videos on Wayland get choppy, especially when maximized/fullscreen.

Forcing hwdec with vaapi improves this a bit, but it's still choppy.

This was tested on both Plasma Wayland and GNOME Wayland.

STEPS TO REPRODUCE
1. Download Big Buck Bunny in Full HD and 4K (http://bbb3d.renderfarming.net/download.html)
2. Compare how fluidly Full HD plays on Haruna compared to 4K
3. Compare how fluidly 4K plays on Haruna compared to VLC or MPV

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20210904
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.13.13-1-default (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i7-5500U CPU @ 2.40GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 5500

ADDITIONAL INFORMATION
# FFMPEG

ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (SUSE Linux)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --optflags='-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --enable-version3 --enable-libsmbclient --disable-openssl --enable-avresample --enable-gnutls --enable-ladspa --enable-vulkan --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcelt --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libdc1394 --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librav1e --enable-librubberband --enable-libsvtav1 --enable-libsoxr --enable-libspeex --enable-libssh --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lto --enable-lv2 --enable-libmfx --enable-vaapi --enable-vdpau --enable-version3 --enable-libfdk-aac-dlopen --enable-nonfree --enable-libvo-amrwbenc --enable-libx264 --enable-libx265 --enable-librtmp --enable-libxvid
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100

# libmpv

0.33.1+git.20210630T163736.f2afae55e9-1.2
Comment 1 george fb 2021-09-23 12:45:17 UTC
I have an Nvidia GPU so Wayland is very unstable for me, lots of flickering and windows turning to black rectangles.

Playback was bad for me too with Haruna.
VLC played it smoothly, mpv only gave me a black window with audio and SMPlayer wouldn't open the file at all. So I couldn't compare with another mpv based player.
Setting the scaling back to 100% improved playback a little.

The above is for my 2560x1440 screen, on my 1920x1080 it was better, but still choppy.
Comment 2 george fb 2022-02-07 20:56:33 UTC
I have been testing this on an older and lower end PC and it doesn't look like something I can solve.
Here's a bug on mpv's issue tracker I opened on the subject, but so far got no response https://github.com/mpv-player/mpv/issues/9417
I also asked on kde mailing list, but got nothing helpful.
Comment 3 Thiago Sueto 2022-02-08 05:07:47 UTC
Hmm, after taking a look at the VLC comment 

https://github.com/mpv-player/mpv/issues/9417#issuecomment-963132782

it seemed to me like it might be a Qt issue, and I found this:

Suboptimal playback performance with 4K@60fps when using QML MediaPlayer + VAAPI HW decoding

https://bugreports.qt.io/browse/QTBUG-79301 , closed without any comments. It's awfully similar, but I'm not sure it's relevant, Haruna doesn't seem to use QtMultimedia/MediaPlayer.
Comment 4 george fb 2023-04-28 14:27:52 UTC
Try with the latest changes.
If you can't compile it yourself use the flatpak from the kde remote https://userbase.kde.org/Tutorials/Flatpak#Nightly_KDE_Apps