Jump to content

Efforts to improve video performance on meson64 based TV boxes


lgranie

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 comment
Share on other sites

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 comment
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 comment
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 comment
Share on other sites

I came back to kernel 5.9.0 from balbes image but I got this error with mpv after few seconds :

DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory

To avoid this message and enjoy beautiful video playback, I haved to  install the following packages (dtb and image, not the headers):
https://us.mirrors.fossho.st/armbian/apt/pool/main/l/linux-5.9.14-meson64/

Link to comment
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 comment
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.

 

Regards,

Laurent.

mpv.conf

Link to comment
Share on other sites

Thanks for the tip . Could you please tell me how to use wayland/weston  ?  Currently I installed armbian ( kernel 5.7.16 ) built by balbes  and I would like to try the improvements you mentioned.  Regards ! 

Link to comment
Share on other sites

@lgranie thakns for the efforts

i have x96 with s905w and would like to use hardware decode only for H264 720p videos (sw decoding was bad for my cpu)

i'm using balbes Armbian_20.10_Arm-64_focal_current_5.9.0_desktop

thank you

Link to comment
Share on other sites

@ning

can you please explain as i'm not really good at this

i'm on ubuntu and i try mpv --vo=gpu --hwdec=v4l2m2m-copy --hwdec=auto videofile

but mpv say no video card was found

even meson/vdec firmware files are not installed

Edited by youns
Link to comment
Share on other sites

On 8/10/2022 at 5:31 AM, youns said:

@lgranie thakns for the efforts

i have x96 with s905w and would like to use hardware decode only for H264 720p videos (sw decoding was bad for my cpu)

i'm using balbes Armbian_20.10_Arm-64_focal_current_5.9.0_desktop

thank you

As this thread describes the balbes150 builds are not capable of hardware accellerated video.  lgranie was using newer kernels to experiment. 

 

Also as the TV Box FAQ mentions, do not expect to be successful using TV Boxes with video - generally only expect good performance for non-gui (i.e. server) use cases.

 

Finally, please don't post the same question in multiple threads as you did yesterday.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines