H.265 codec video issue in LibreElec 11 running on Wetek Play 2 device (fast forward freeze) workaround

Written by - 0 comments

Published on - last updated on February 28th 2024 - Listed in Kodi Multimedia

For many years I've been a happy user of LibreElec running on Wetek devices. The first device I bought was a Wetek OpenElec box (also known as Wetek Play 1) back in 2016. And when the Wetek Play 2 with increased performance came out, I ordered this one at the end of 2016. It became my main media center device in the living room for the next few years.

Although the device itself running on LibreElec 9 was pretty smooth, there were a couple of disappointments in the past years. First of all, Wetek, the company, stopped creating, shipping, selling and maintaining their devices - basically over night. Community forums, Wiki, downloads - everything gone. And then came the release of LibreElec 10 - which was not published for my Wetek devices. I was able to install a community maintained LibreElec 9.2.x on the Wetek Play 1, but the Play 2 was left off and continued to run on an outdated LibreElec and Kodi (including more and more broken add-ons).

Fast forward to 2023: LibreElec 11.0 (with Kodi Nexus) was released and !SURPRISE! the Wetek Play 2 is mentioned as supported device! I jumped the ship and immediately updated my Wetek Play 2 with the new LE version.

H.265 video freezes in LibreELEC 11

But I soon became to regret the decision to install LibreElec 11 on the Wetek Play 2. In the meantime more and more videos with the newer H.265 codec (a.k.a. HEVC) were released. And these videos often caused issues.

One issue, that could be reproduced every time, was the fast-forwarding problem. As soon as I fast-forwarded or better said jumped/skipped/seeked forward in the video, the video and LibreElec would freeze. In most cases only a reboot of the device would help bring the device into normal conditions again.

Another, only randomly happening, issue was watching a H.265 video. If I was lucky, I could watch the whole video from beginning until the end (as long as I didn't fast forward or skip anything). But sometimes, in the middle of playing the video, LibreElec completely froze. Only a power disconnect could help in these situations.

Frustrated with this situation I decided to switch to OSMC and ordered a Vero V at the end of 2023 (maybe I'll write about this in a separate blog post in the future). I disconnected my Wetek Play 2 device and moved it into a closet - until the latest OSMC update (2024.02) led me to take it out again.

Hardware acceleration issues

As mentioned, the Vero V started to run into troubles since the last update in February 2024 and I wanted to compare the troublesome videos with LibreElec on the Wetek Play 2. Maybe the videos themselves weren't encoded correctly and this would in general cause problems?

But to my surprise, the videos played fine on LibreElec 11 on the Wetek Play 2 device. Except, I ran into the H.265 problems again. Anyway, this caused me to look again for a possible solution and stumbled across a thread in the LibreElec forums, mentioning fast forward freezes - however for the Raspberry Pi 4 and not for an AMLogic device. The issue sounded similar though:

I was having a display freeze problem when I used fast forward during video playback. The whole display would lock up but I could still access the system with SSH. Still required a reboot to get control through the user interface.

And then followed by:

I turned off Allow Hardware acceleration MMAL and then fast forwarding worked just fine.

Huh? Could the same problem also happen on the Wetek Play 2?

I check in the Kodi Settings -> Player -> Videos and (with Expert level enabled) saw the option "Allow hardware acceleration with DRM PRIME", which was by default enabled.

As soon as I disabled "Allow hardware acceleration with DRM PRIME", I was able to do fast-forward/frame skipping in H.265 videos! No freeze, no crash - it just works! YAY! Immediately followed by thoughts: Why didn't I find that information earlier...

Possible reason: Old hardware, not fully supported

But why would LibreELEC 11 have issues with the Wetek Play 2 device (which is an AMLogic S905 device) yet the older LibreELEC 9 worked fine?

According to the LibreELEC 11 release notes, the AMLogic devices are only partially supported. The notes also mention what works and where potential problems are:

Support for Amlogic S905, S905X/D, and S912 devices resumes. H264 playback and seeking is solid. HEVC playback is okay and seeking recently improved from 2/10 to maybe 7/10. HDR works with HEVC/VP9 media on S905X/D and S912 devices. Multi-Channel PCM and Pass-Through audio works on HDMI up to 7.1 channels. With typical 1080p oriented media collections the AMLGX image is quite usable and provides access to the latest Kodi release and compatible add-ons. To be crystal clear: the AMLGX image is not perfect, but cost-of-living is high and $0 updates to old hardware are more appealing to users than $150+ purchases of new hardware. If we resume support (with caveats) fewer old boxes end up in landfill. There’s also an increased chance of people contributing improvements to smooth the rough edges that exist.

Here we have it; the release notes actually mentioned it from the very beginning: H264 videos play fine, always have, but HEVC (H.265) videos could cause issues with seeking (fast-forward/skipping).

And I agree with the LibreELEC maintainers: I prefer to have an updated box, even though there might be some caveats. Or at least have the choice whether to update or not.

Also mentioned in the notes:

The reason for not formally supporting newer hardware generations is all about hardware decode drivers and user expectations. Amlogic hardware video decoding requires the “VDEC” driver for older GXBB/GXL/GXM hardware and “HEVC” driver (driver, not codec) for newer G12A/G12B/SM1 hardware, and both generations prefer a later iteration of “multi” decoder firmware. The current upstream driver code attempts to mix both drivers in a common codebase with partial success and does not support multi firmware blobs. As a result, the current drivers work well on older hardware, but bugs prevent 10-bit and 4K output on newer hardware, and users with newer and (on paper) more capable hardware generally have higher expectations and more demanding media. To avoid negative feedback and user frustration; if you have newer Amlogic hardware our recommendation is to run Kodi on the Android install that shipped with the box. If you choose to run AMLGX images on newer hardware; expect 1080p maximum output, and minimum interest from developers if you post known issues in the forums.

Right now I can live with that just fine. Especially since I can switch between the LibreElec Wetek Play 2 and the OSMC Vero V and figure out what works best in which case.

Update: The workaround works "somewhat"

While I was excited to see seeking worked fine on a H265 encoded video, a few days later I ran into another issue. Another H265 video (1080p) was opened and it stuttered (some call it jitter) extremely, it was unwatchable! After having enabled DRM PRIME hardware acceleration again, the video now worked without a problem.

After comparing the two H265 videos, the difference seems to be video size:

  • H265 video, SD 480p: Hardware acceleration disabled: video play and seeking works fine
  • H265 video, HD 1080p: Hardware acceleration disabled: video play stutters, seeking not tested
  • H265 video, HD 1080p, Hardware acceleration enabled: video plays fine, seeking not tested
According to a comment on Twitter, the newest LibreELEC 11 nightly should bring improvements for seeking... we'll see.

Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder