Orange Pi Lite image

  • Hello.

    I compiled LibreELEC 10.0.1 (from upgradable libreelec-10.0 branch) for Orange Pi Lite

    For those who are interested, attached.


    Work done:

    1. I fixed the sleep mode due to the WiFi feature on board.

    2. Patched SDIO interface due to which wifi hangs from time to time.

    2. Disabled DEBUG extra output in dmesg in the WiFi adapter module - now it doesn't spam in the kernel log.

    3. Also, as a useless red indicator, a "heartbeat" is made, the status of reading a memory card, it regularly writes/reads something about once a second - if it freezes, it simply will stop blinking.

    4. MicroUSB OTG connector is used as a host and now it can be used just as another additional USB connector.

    5. Added zram service that provides dynamic compression of data in memory (why it is needed, it is written below), by default 25% of RAM is used as zram0 swap partition if it is enabled.

    6. Libreelec console for UART port is turned on.

    In general, nothing has been added or changed, the images are like on the page https://libreelec.tv/downloads/allwinner/ only for the features of this subject.


    Of the features that I noticed compared to version 8.0 and 9.0, hardware decoding works fully up to [email protected] (but with 60 frames does not work), Wifi also works without problems.


    Please note that you need a high-quality power supply for this device and a good memory card (above class 10, for example U3).

    I myself encountered problems: regular freezes, write errors to the memory card - and all because of a bad memory card, the card is equal of class 10!


    Now about zram, keep in mind that there are two types of Orange Pi Lite: this is the 515MB version (main) and the version with 1GB RAM.

    I tested zram on the 1GB version, and I don't know how it will behave on the 512MB version.

    Libreelec's default settings have a setting that reserves 320MB of RAM for the graphics core.

    I made sure from experience that if you reduce this parameter, then the video will slow down, this is the optimal value, it makes no sense to reduce it, at least for the mesa+lima driver.

    This means that there will be less free RAM available, which is why we came up with the idea of using either a swap partition (to disk) or if it is very critical (slow write speed and some kind of freeze), you can use zram - here it’s your choice and for specific tasks, and two methods can be used at once.

    For example, I used the PVR IPTV Simple Client add-on with about 2000 channels with an Archive for 4 days, and what is important, this is an EPG from the site https://epg.it999.ru/.

    Please note that without using swap or zram, updating the EPG is not possible. the memory will immediately run out and the device will reboot cyclically.

    In my experience, for such a bundle of 2000 channels + EPG + Channel Logos, it is necessary to allocate 50-60% of 1GB of RAM for zram. Or this way: zram 25% and parallel swap 512MB on disk.

    This is done very simply (following the swap example), you need to connect to OPi via ssh or sftp and copy the /etc/zramswap.conf file to /storage/.config/zramswap.conf and edit the RAM_PERCENT and ZRAM_MAX_PERCENT parameters there by say 50 percent and enable ZRAM_ENABLED="yes" .

    It's important not to go over the above mentioned 320MB of kernel graph reserve, otherwise it will try to compress this data once again...


    For the 512MB version of OPi, zram is not enough and you will most likely have to include the swap file separately or in addition to zram. It is important to use an external drive for the swap file and not a memory card, otherwise you will slow down everything.


    Code
    4c90124c761c66709191e7635b3c10d5c5c1ab6a4857b377114f049da9e5bfc2  LibreELEC-H3.arm-10.0-devel-20220223213643-9b33376-orangepi-lite.img.gz


  • I'm curious why did you add mali utgard driver patches? That's not used by mesa at all. Also, why did you change DEBUG_TTY="/dev/console" to DEBUG_TTY="/dev/ttyS0"? Serial console works without this change.


    EDIT:

    Libreelec's default settings have a setting that reserves 320MB of RAM for the graphics core.

    This is not exactly true. CMA memory can be used by any core requiring continuous memory region. Kernel can even assign it for normal use (user space processes), with some limitations. So making this number bigger is not that problematic. By far heaviest user of CMA is VPU (video decoding) which is distinct from GPU.

  • I'm curious why did you add mali utgard driver patches?That's not used by mesa at all. Also, why did you change DEBUG_TTY="/dev/console" to DEBUG_TTY="/dev/ttyS0"? Serial console works without this change.


    I've tried using mali utgard instead of mesa with no success. Therefore, these changes remained in the patch. I made a patch from my local git and didn't clean it up, so sorry.


    By default, the console does not work via UART - there is silence. I had to do this following the example of the Samsung profile and the console now worked well.


    Maybe only this parameter turn on console in UART: systemd.debug_shell=ttyS0


    But as I said, the console did not work for me until I did it following the example of a Samsung device.

  • I've tried using mali utgard instead of mesa with no success. Therefore, these changes remained in the patch. I made a patch from my local git and didn't clean it up, so sorry.

    No need to apologize, just curious. Why would you want to use binary driver? mesa should be better in all aspects.


    By default, the console does not work via UART - there is silence. I had to do this following the example of the Samsung profile and the console now worked well.


    Maybe only this parameter turn on console in UART: systemd.debug_shell=ttyS0

    it's systemd.debug-shell=ttyS0 Note the hypen instead of underscore. I also usually add it at the end of the command line, but that shouldn't change anything.


    Note that you also don't need to remove all other H3 boards, you can use UBOOT_SYSTEM=orangepi-lite to limit builds to this particular board.

  • Hello.
    Thank you for this work, it could resurrect my 512MB OPiLite!
    It seems to work fine to me, but the RAM memory will soon fill up.
    I have a problem using an external drive for the swap file.
    Following the guide I tried all ways to replace the swap file location by editing /storage/.config/swap.conf without success.
    I don't know how to change the SWAPFILE="$HOME/.cache/swapfile" entry so that it creates the file on a USB drive connected to the OPi.
    Can anyone help me find where I'm wrong?