Posts by ghtester

    OK - so now I can see how it works when Timeshift in Tvheadend backend service is configured to use files and when the Timeshift is active:

    There's created folder named buffer, inside appears a subfolder with buffer files (every minute a new file is created until their total size match the Timeshift Maximum size configuration).

    This subfolder's name is a number - starting from 0, as soon as I switch the channel, the folder with buffer files is deleted and a new folder with incremented number is created and a new buffer files are generated. Everything looks working fine...

    Now what happens - sometimes - usually when I try to move the Timeshift pointer in Kodi (with left - right arrows on RC), usually backwards to see the part of the Live stream again:

    - The Timeshift pointer in Kodi does not jump as expected and it's position is lost, then jumps to left border of Timeshift bar (which represents the Timeshift buffer recorded size)

    - The Timeshift feature stops - the buffer data files stays there and it's possible to play them again but it looks at some further point are corrupted

    - TheTimeshift offset can't be moved to zero anymore with Timeshift running (until the channel is switched to another or stopped / started again). But when I try to move the Timeshift pointer to right Timeshift bar's border (keeping right arrow pressed) until the Seeking offset is >= negative Timeshift offset, it switches to Live stream (but it does not record to Timeshift buffer anymore). In this state any left-right arrow push starts playing the Timeshift buffer from begin.

    Don't know if anyone can ever read this and understand what I mean - better try. But it's a real nightmare, how this feature (not)work. :(

    When I tried the same with Timeshift to RAM only, it was even worse because the buffer data were immediately discarded when the Timeshift pointer was lost so there was nothing to analyze.

    I don't know how it works together, if Tvheadend backend (4.3) has a bug or if that's Kodi but it looks more likely that Kodi can't work properly with Timeshift / Timeshift buffer data.

    Also it looks the critical moment is when the Timeshift buffer gets full (so a circle write must start).

    I think there are more important tasks to do but perhaps somebody from developer team will comment it better.

    Perhaps better decoding of VC-1 in future could be a side effect - AFAIK the video drivers on RPi 4B are not yet finished in general and it's still in progress. But it's hard to say how long it could take.

    Thanks for a comment. I still don't understand why Kodi shows such an unusually high value of free memory.

    It was always strange but as soon as I have created a tmpfs filesystem in RAM which is now occupied by about 800 MB of Timeshift buffer data, the Kodi's report regarding to Free memory is now absolutely nonsense on my RPi 4B / 2GB RAM.

    That's why I am asking if developers (who can better than me understand how things work) are considering it as OK... Maybe it's not just a GUI info message - if the same value is used somewhere in Kodi's background, it could perhaps sometimes lead to memory overflow etc (and the oom killer sometimes appears...)...


    FYI the current values:

    Kodi Free memory: 1424MB

    top - 10:39:55 up 17:22, 3 users, load average: 1.26, 1.43, 1.45

    Tasks: 148 total, 1 running, 147 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 8.6 us, 3.5 sy, 0.1 ni, 87.3 id, 0.0 wa, 0.0 hi, 0.5 si, 0.0 st

    MiB Mem : 1863.3 total, 386.9 free, 438.9 used, 1037.5 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 529.9 avail Mem

    # cat /proc/meminfo

    MemTotal: 1908012 kB

    MemFree: 395616 kB

    MemAvailable: 542032 kB

    Buffers: 45152 kB

    Cached: 990108 kB

    SwapCached: 0 kB

    Active: 791468 kB

    Inactive: 486616 kB

    Active(anon): 634920 kB

    Inactive(anon): 405900 kB

    Active(file): 156548 kB

    Inactive(file): 80716 kB

    Unevictable: 45036 kB

    Mlocked: 0 kB

    HighTotal: 1231872 kB

    HighFree: 30896 kB

    LowTotal: 676140 kB

    LowFree: 364720 kB

    SwapTotal: 0 kB

    SwapFree: 0 kB

    Dirty: 0 kB

    Writeback: 0 kB

    AnonPages: 288024 kB

    Mapped: 108004 kB

    Shmem: 797996 kB

    KReclaimable: 27780 kB

    Slab: 59440 kB

    SReclaimable: 27780 kB

    SUnreclaim: 31660 kB

    KernelStack: 1888 kB

    PageTables: 3128 kB

    NFS_Unstable: 0 kB

    Bounce: 0 kB

    WritebackTmp: 0 kB

    CommitLimit: 954004 kB

    Committed_AS: 1548760 kB

    VmallocTotal: 245760 kB

    VmallocUsed: 12216 kB

    VmallocChunk: 0 kB

    Percpu: 512 kB

    CmaTotal: 524288 kB

    CmaFree: 320136 kB

    As there's no feedback or comment from developers and it seems the Timeshift issue is more worse than better in latest LE 10 Nightly on my RPi / 2GB, I decided to try a different Timeshift configuration.

    As I had no idea what's happening in memory with Timeshift data / how it works, I created a tmpfs mount and instead of RAM Only, I changed the Timeshift configuration in Tvheadend backend to use /tmp/ramdisk with 800 MB size and currently I am testing how this works... At least I can see how the buffer files are created and when are discarded.

    So far it looks that Kodi is sometimes loosing a pointer in Timeshift data (and gets messed) even in this configuration but the Plus is the files are not discarded immediately when this happens. But it's too early to say that's fact - it needs more thorough testing in my environment.

    Nobody commented it so far but I would like to know if it's really OK how the Free memory in Kodi is reported?

    It's still the same in latest LE 10 Nightly and to me it looks confusing.

    For instance:

    1)

    Kodi - System info - Summary

    Free memory: 1360MB

    top in SSH console:

    top - 21:29:55 up 4:12, 1 user, load average: 1.17, 1.36, 1.42

    Tasks: 144 total, 1 running, 143 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 9.2 us, 4.1 sy, 0.3 ni, 85.3 id, 0.0 wa, 0.0 hi, 1.1 si, 0.0 st

    MiB Mem : 1863.3 total, 462.7 free, 503.5 used, 897.0 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 614.3 avail Mem

    2)

    Kodi - System info - Summary

    Free memory: 1303MB

    top in SSH console:

    top - 22:32:01 up 5:14, 3 users, load average: 1.44, 1.38, 1.39

    Tasks: 148 total, 1 running, 147 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 6.9 us, 4.0 sy, 0.3 ni, 87.7 id, 0.0 wa, 0.0 hi, 1.1 si, 0.0 st

    MiB Mem : 1863.3 total, 225.1 free, 553.4 used, 1084.8 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 348.5 avail Mem

    It's also important to keep the bootloader updated as there're several fixes regarding to SD card.

    rpi-eeprom/release-notes.md at master · raspberrypi/rpi-eeprom · GitHub

    There's an example how to easily upgrade the bootloader to latest one:

    RE: Is it possible already to set up a rpi4 with kernel 5.4?

    Also make sure you don't use any suspicious / banned add-ons which seems to be the quite often reason of such issues.

    See here: Official:Forum rules/Banned add-ons - Official Kodi Wiki

    Edit - Arghh, sorry - I have overlooked it's RPi 2B so my post is a bit irrelevant regarding to bootloader update (which is valid for RPi 4B)... :(

    I have to confirm this issue after more intensive testing through several past days and it is really a nightmare. :(

    It does not matter which Tvheadend backend is used, the same issue happens on both 4.2 and 4.3 Alpha, quite often during seek operations but randomly. The same issue on 2 different RPi 4B devices (2 GB, 1 GB), latest several LE 10 Nightly builds (currently 20210321).

    So far I was not able to reproduce it with any specific tasks that I could describe but it seems to be related to this common error message in the log:

    LibreELEC tvheadend[1677]: htsp: 127.0.0.1 [ | Kodi Media Center ]: Disconnected

    In the same second it's reconnected again but the Timeshift data are lost.

    If I am not mistaken, this means the Tvheadend client (8.2.3.1) is losing the connection to Tvheadend backend so the itself Client could be the reason of the issue? I have tried to increase the Connection / Response timeouts from defaults 10 / 5s to 20 / 15s but it did not help.