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

mpv.conf

 

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

msg-level=all=v

 

# video output ( wayland )
vo=gpu
gpu-context=wayland

drm-connector=HDMI-A-1
fs=yes

 

# hardware decoding ( nothing to do with rendering, uncomment to test )
#hwdec=auto
#hwdec=v4l2m2m-copy
hwdec-codecs=all

 

# Personnal preferences
sub-font='FreeSerifBold'
sub-file-paths=Subs:Sub:subs:sub
slang=en,eng
alang=en,eng

Link to post
Share on other sites