Efforts to improve video performance on meson64 based TV boxes

Recommended Posts

It is now 2 weeks I run linux-image-current-meson64 with no problems.

I manage to get rid of tearing while playing video with vlc by using wayland/weston instead of X11/openbox (picom did not help).

While playing video cpu goes from around 40% in X11 to 20% with weston \o/.


You can find vlcd.service, scripts and config files in attached files.


TODO list :
  - Move vlcd.service to weston.service and try to replace vlc-xxxx.sh scripts with ~/.config/systemd/vlcd.service

  - format /boot in ext4

vlcd.service vlcd-start.sh vlcd-stop.sh weston.ini vlcrc.wl

Link to post
Share on other sites
Armbian is a community driven open source project. Do you like to contribute your code?

ok it is not perfect with vlc : if video is not the size of screen the video is cropped and moved up...
with mpv it is perfect : you can ssh to your machine, sudo su - vlcd, export XDG_RUNTIME_DIR=/run/user/109 and launch mpv



or aliases :

function play_movie {
  sudo su -P -s /bin/bash -c "export XDG_RUNTIME_DIR=/run/user/109 && mpv --sub-auto=all --sub-file-paths=Subs $1" vlcd

function play_serie {
  sudo su -P -s /bin/bash -c "export XDG_RUNTIME_DIR=/run/user/109 && mpv --sub-auto=exact $1" vlcd

Link to post
Share on other sites

This thread originally started under a topic about upgrading the kernel from a balbes image kernel to an armbian standard meson64 kernel.  The goal of @lgranie in that topic was to be able to access more current kernels to take advantage of improvements. The balbes images stopped supporting amlogic devices on 2020-10-14 at kernel version 5.9.0 and he was looking for an upgrade path.

Link to post
Share on other sites

Hi everyone,


I made some new tests this last weekend and realized what I said was not really true.


If you want to use hardware accelerated decoding you need to install armbian-firmware-all (package I just discovered). This package contains the firmware files needed by mpv in /lib/firmware/meson/vdec. Combined with mpv options hwdec-codecs=all and hwdec=auto ( or just v4l2m2m-copy ), cpu usage really drops from 50% to 20% ( and cpu temp from 70c to just over 50c ). But it is a little bugged : no seek forward or backward, and I've got a crach after one hour of movie (just when the bus fly the highway gap in "Speed", damned!).


I imagine that the improvements of video playback quality ( no more little tearing ) I experimented last week was due to weston using GL for render what I was not able to do with X11/picom before.


You do not really need hardware decoding : the  s905x2 is really capable to decode x264 without any problems.


Here the commented containt of my mpv.conf file :

# very usefull to understand what mpv is doing



# video output ( wayland )



# hardware decoding ( nothing to do with rendering, uncomment to test )


# Personnal preferences

Link to post
Share on other sites

Hi lgranie!


I'm trying to get mpv to work w/ meson vpu acceleration under Wayland on my X96 Air Q1000 (S905X3) running Manjaro ARM unstable.


Have you had any success in getting 4K h264 videos to play smoothly on a 4K display under KDE or GNOME wayland? Have you only got meson decoding to work with mpv under Weston? Have you tried recent versions of KDE or GNOME with this?


I'm using your mpv settings but I've not been able to get any videos to play smoothly yet. I should try some 1080p videos too to see if its just 4K vids that are the problem.

Link to post
Share on other sites

Hi Dan,

I can not help you so much : I do not have a s905x3 nor 4k monitor.

I can only share with you that I disable hwdec (v4l2m2m-copy) in my mpv config for better results in h264.
I did not mange yet to upgrade my kernel up to 5.9.14.





Link to post
Share on other sites