RPI4 on Libreelec 9.1.502 thumbnail/pictures problems

  • Can you try adding cma=128M to the end of /flash/cmdline.txt (with a space between "quiet" and "cma...")? You can also try with cma=64M.

    This, in combination with gpu_mem=192 allowed me to view the 60Mpix file on a RPi4 with 1GB total_mem.

    Software decode seems to work fine, but it needs quite a lot of memory (I saw kodi jumping up to almost 400MB resident size during image loading (but then it quickly dropped back to saner levels).

    so long,


  • CMA=64M seem to work just fine with GPU_MEM=192M. (CMA=128M crashed)

    Also with the test picture and my "real" pictures.

    I'll keep my setup running and update here on any findings.

    Thanks for the efforts.:)

  • Just an update.

    No problems since i set CMA=64M on cmdline.txt

    I also tried the default GPU_MEM=320 and its works fine also.

    So sum things up in order to fix the problem on default setup is just add CMA=64M on cmdline.txt file (under /flash/)

  • Hey thanks for your update, but it is not fixing my problem, still freeze after boot or if iam entering movies and he loads the library...

  • hagaygo thanks for reporting back!

    I've had a chat with the RPi devs and the CMA issue is quite an odd thing - in theory the CMA size shouldn't matter at all, but your and our tests showed otherwise. Could be a linux kernel issue or we are missing some subtle thing.

    Anyways, using cma=64M (or even cma=48M) should be safe with Kodi 18 (with Kodi 19 probably not). Even 32M could work on a HD (1920x1080) screen, though that's very marginal (checked here with a 1920x1200 screen and it was a tad too low and kodi didn't start).

    Other than that: reducing gpu_mem (to 256 or 192 - though that'll probably cause issues when trying to play 4k videos) or adding a bit of swap (256MB or so) should also help on 1GB RPi4 models.

    so long,


  • Thanks so much for this, I wasted half a day working on this. Two questions: is the default libreelec pi4 image set up with this now by default? And, if I'm looking at buying units for my other TV's do I need to be buying 2gb units to be future proof for Kodi 19?


  • The default RPi4 image has not been changed, reducing CMA memory is a bit risky (it could break "heavier" skins that otherwise work fine on the 2 and 4 GB models), so if you are affected by that issue please reduce CMA memory manually for now.

    To be future proof I'd definitely recommend getting a 2GB (or 4GB) model.

    so long,


  • Just a little update from me, reducing GPU and CMA (64m) helped, but overall reliability was still far from good. I use Aura skin, which I'm guessing is fairly heavy because of all the widgets it has. I've now reduced to CMA 48 and GPU 144, and I'm going to try to add some swap to see if I can get this to be as stable as my pi2b :/

  • So my pi is stable at 144/48 and with swap. But I worry a little about my SD card, I found some talk about using zram, but I'm afraid I'm too much of a newb to understand exactly what to do. If you feel like giving a pointer that would be so helpful? Zram/Zswap is possible in LibreELEC/benefits?


  • What you'd probably want is zswap, not zram, and I'm not too keen on enabling it.

    zswap is still marked as experimental in the Kernel config and the info states it's not fully tested and can cause issues. Also the reports of people who tried it are rather mixed (including actual issues). As the stuff occupying RAM in this case is mainly uncompressed JPEG images I also have doubts how much it can be compressed by LZO/RLE.

    LibreELEC 10 will swtich to the vc4-kms driver and V4L2 decoders where only a bit of gpu_mem is needed for H264 decoding but a lot of cma memory (curently testing with gpu_mem=76 and cma=256M/512M - 512M cma needed for 4k video playback) so things are going to change quite a bit. If there are issues with cma they'll need to be resolved anyways.

    so long,