Posts by elim_garak

    elim_garak I'm normally loathe to suggest it, but have you tried overclocking the board?

    It seems one of the causes for the poor performance is "local warming" despite being winter season.
    My rpi4 has an idle temperature of 55'C. By playing the AV1 file the rpi4 reaches 85'C and gets throttled with both Arm frequency capped and Soft temperature limit active.
    I discovered this as I went to overclock it; which I still did. But as expected the same thing happened. At first it seemed the playthrough was smoother but then the rpi4 started making noises I've never heard before. And I don't even have a fan. Nor heatsink. Just using the official case with the top off.
    FWIW these were my settings:
    over_voltage=6
    arm_freq=2000
    gpu_freq=700
    I've been looking into a case and will probably go with the Argon One which is both a massive heatsink and includes a configurable fan. I'll have to endure the fan for AV1 playback. Hopefully it won't be too annoying.
    OTOH maybe the smarter alternative would be just to invest in a rpi5 instead of burning 25£ on an additional case.


    Your bootloader version does pre-date automatic NUMA settings and SDRAM_BANKLOW will be ignored.

    However looks like you are on a Pi4, so SDRAM_BANKLOW=3 was the default so it may not be critical, but it may be worth updating that to be sure.

    I'm using PINN with Raspbian and LE. But I haven't updated Raspbian to Bookworm.

    But when booting to LE isn't the bootloader firmware tied to the LE version? I'm not sure how to update it since that is the latest version shown to me.

    It might be best to try and find a file that plays well on one of the systems but not the other (something where you can check a/v sync is accurate throughout). If the answer is "struggles on both", then it might just be slightly different thresholds in kodi makes one appear better (but really you can't easily judge which is better when both fail to keep up).

    After discovering my rpi4 is being throttled I'm wondering if the effect of one player better than the other wasn't just chance due to throttling effects.

    TLDR:

    LE 12 nightly-20250116-37e4458 - dav1d 1.4.1, Kodi 21 --> played fine on slow scenes, some "lag/drops" on fast paced scenes
    LE 13 nightly-20250205-562de9e - dav1d 1.5.1, Kodi 22, NUMA --> playback keeps jumping every 4 seconds


    I've now updated LE from LE 12 nightly-20250116-37e4458 to LE 13 nightly-20250205-562de9e and enabled NUMA but AV1 media playback got way worse.
    I suspect this is either a regression in dav1d or some (internal?) LE/kodi config or kodi 22 Piers itself.
    I don't think it's caused by the bootloader or NUMA setting because I first updated to the LE 13 nightly and playback was as bad as after the bootloader and numa changes.

    Previously with LE 12 nightly version the playback of my AV1 file was almost perfect. There was lagging in fast paced scenes and frame drops/skips but it was "tolerable".

    What happens now during playback of my AV1 video file playback starts lagging and then it skips/jumps forward a few seconds.
    From the Player Debug Info I can see the vq is saturated at 99% at 4 seconds. But the Player a/v keeps increasing from 0 to 4 seconds and when that happens the video jumps forward to catch up and this value is reset to 0. The forward caching increases if I pause the video, reaching up to 60%, but doesn't seem to make any difference when I resume playback.
    If I pause the video and wait a few seconds I get something like:

    Code
    aq: 16% 0.620s, Kb/s:113, a/v corrections (50ms): 0
    vq: 99% 3.9s, Mb/s:0.88, fr: 23.9, drop:0, skip:0, pc:none
    Player: a/v:-0.03, forward: 150 MB / 39% / 214.123s / 47%
    VsyncOff: 0.0 latency 0.166

    Weirdly enough I can see drop: 0, skip: 0, pc: none. Shouldn't this behavior reflect in frame skips or drops?
    My video file is yuv420p10le. As for CPU it's always 80%+ but seems to vary a lot.
    ffmpeg says:
       Stream #0:0: Video: av1 (Main), yuv420p10le(tv, bt709), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)


    With the netflix sample file , which is also yuv420p10le it plays "fine" although there are quite a few frame drops/skips. Strangely enough this number can vary wildly per play through. As for CPU it varies a lot from 50% to 95%.
    ffmpeg says:
       Stream #0:0(und): Video: av1 (Main) (av01 / 0x31307661), yuv420p10le(tv), 1920x1080, 914 kb/s, 25 fps, 25 tbr, 25k tbn, 25k tbc (default)


    Just to be clear all these files are in a disk connected over USB. No networking involved.


    My configs:


    Any suggestions?

    I'm wondering is there any way to increase that "4 seconds" buffer that kodi uses? My RAM usage is underutilized at only 15%. Does kodi supports any form of video decoding cache like mpv?

    Thanks


    EDIT:

    Ok now I understand better what's happening: it's the aq (audio queue) that gets depleted to 0 and when it happens the media file playback jumps forward. I'm guessing that happens because the video decoding threads get priority and because the CPU is getting hammered the thread(s) for decoding audio are not getting CPU time. Nonetheless my original points and questions still stand.

    heitbaum sorry to tag you but given this thread and your commit https://github.com/LibreELEC/Libr…04e39578a4fbe07 you're probably the right person to ask.

    More details at RE: AV1 capabilities in Raspberry Pi 4 - anyone on nightly LE 12 ?

    But the tldr is:

    You have updated dav1d dependency to 1.5.1 but the latest LE12 nightly is still using dav1d 1.4.1 which is almost one year old. Can we expect to see dav1d updated in LE12? Or raspberry pi users are better off to move to LE13?

    And latest changes to dav1d, based on the changelog, seem to make a big difference to AV1 performance on the Pi

    Thanks for your work and help.

    Thank you for the replies.

    I've upgraded to the latest LE12 daily https://test.libreelec.tv/12.0/RPi/RPi4/…-37e4458.img.gz and performance has definitely improved. Only getting a few frame drop/skips now. Difference between night and day but still not 100% smooth.


    I can see that this daily uses dav1d 1.4.1 https://github.com/LibreELEC/Libr…av1d/package.mk

    But I can also see that in the past few days HEAD now has dav1d 1.5.1 and kodi 21 omega has had a minor update too (not affecting AV1 mind you but still nice to have fixes).

    Can we expect a LE12 daily to include these updates? Or should I give up and move on to LE13?

    I'm trying to avoid upgrading to LE13 due to my current theme not being available to kodi 22 piers yet.

    EDIT: ok I found this thread explaining the nightly builds Nightly Builds So hopefully a new build should be out in next days.


    However something doesn't add up. Because even though the above linked LE12 nightly is one week old it is still using dav1d 1.4.1 which is almost one year old. But meanwhile other versions have been released before but have not been included https://github.com/LibreELEC/Libr…av1d/package.mk

    I guess I was expecting a github dependabot type of thing but maybe these are manually updated. I've gone full circle and back to my original question :)

    Can we expect a LE12 daily to include an update to dav1d? Or should I give up and move on to LE13?

    Thanks

    I've read comments from people saying they can play AV1 media on their rpi4 (no LE, just raspbian) while others say they are choppy.

    I'm using LE 11 and I'm one of the later ones. On slow scenes you can see it drags, while on fast action scenes you can definitely see the jumps.

    I've noticed that there have been recent improvements in the AV1 decoder dav1d with latest 1.5.0 even saying "Optimize Armv8.0 NEON"

    And LE HEAD has been updated to use that latest version https://github.com/LibreELEC/Libr…av1d/package.mk


    What I'd like to know is if anyone running nightly LE12 (note LE 12.0.1 doesn't have latest dav1d) can play 1080p AV1 smoothly?

    Is there hope for the RPi4 or should I just stop dreaming and move on to the RPi5?


    For AV1 video samples:

    http://download.opencontent.netflix.com.s3.amazonaws.com/AV1/Sparks/Spa…80-2194kbps.mp4 (slow scene)

    https://test-videos.co.uk/vids/sintel/mp…080_10s_2MB.mp4 (fast scene)

    https://test-videos.co.uk/vids/sintel/mp…080_10s_5MB.mp4 (fast scene)

    more bitrates on https://test-videos.co.uk/sintel/mp4-av1


    Thanks

    10 / 12 bit deinterlacing is a know issue. As a workaround, disable deinterlacing at playback menu (gear icon).

    I tried that but it didn't make a difference.

    Can you try a nightly build? That has improvements for handling unusual pixel formats (like more than 8-bits/pixel).

    I've downloaded LibreELEC-RPi4.arm-11.0-nightly-20230809-ecf5de7.img.gz and will give it a go in the next few days.

    Thanks for the help.

    Hi

    I'm having image corruption in the form of blocks of pixels when playing 10bit videos on RPi4 LE11

    Playback works fine in Kodi on my laptop, so it's not the video file nor kodi.

    On RPi4 LE11 this plays without any issues:

    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709/unknown/unknown, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc

    On RPi4 LE11 this plays with corrupted pixel blocks:

    Stream #0:0: Video: h264 (High 10), yuv420p10le(progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc

    There is no slowdown or lag or anything. It's just that the image decoding gets corrupted.

    Thank you for any help.

    Found this thread by chance and got genuinely curious,

    Which use cases do you see for Docker here?

    I mean LE is aimed at running kodi. It's its sole purpose.

    The only thing I can think of is a torrent client, but then you have kodi competing for CPU and maybe not getting enough.

    Hi

    I'm new to the Pi way of life and just installed LibreElec on a brand new Pi 4 with 4 GB of RAM.

    I'm experiencing some mild stuttering and time slowdown effect when playing some more demanding files.

    From Kodi's OSD codec info I could see the following:

    - for a 1080p 60fps x264 encoded video I'm getting around 10 frame skips per minute. Example http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_…0fps_normal.mp4

    - for a 2160p 60fps x265 encoded video I'm getting hundreds of frame drops per minute. Example http://jell.yfish.us/media/jellyfis…-hevc-10bit.mkv

    (I removed the http:// from the links to avoid embedding)

    The CPU load always stays under 20%

    I'm running LibreElec 9.2.5 with Pi Firmware 2020.09.03

    Is this normal or do I need to tweak anything?

    The other issue is that I'm not 100% sure Kodi is playing the videos at 60Hz.

    I've updated my `config.txt` to include the line `hdmi_enable_4kp60=1` and I can choose a 4k resolution with a 60hz refresh rate from the settings in Raspbian.

    When I boot to LibreElec I'm only able to select 4k at 30hz. But I believe that only applies to the UI.

    If I ssh to LE while playing a video I can see that the preferred mode is still 4k60p by running `tvservice -d /tmp/eid.dat && edidparser /tmp/eid.dat`

    > HDMI0:EDID preferred mode remained as CEA (97) 3840x2160p @ 60 Hz

    But `tvservice -s` will say

    > state 0xa [HDMI CUSTOM RGB lim 16:9], 3840x2160 @ 30.00Hz, progressive

    So I'm not 100% sure video playback is happening at 60Hz.

    Thanks