Posts by stpf99

    For devices with low ram </=512 but with EMMC storage LibreElec should have available some tunning options included:

    1.CMA value if possible should be configurable by config file if 128mb is not enought / 256mb is too much.

    but manipulating this value is probably not neccesary if:

    2.should have option to disable devtmpfs tmpfs creation in ram ,systemd service exist for that but must be preconfigured .

    3 have option to image be on ram /dev/loop0 or unsquashed on emmc storage by pivot_root /need to be enabled/included (linux-utils) before compilaton.

    4. zram with higher prio zswap with lower prio enabled

    this will recover about:

    devtmpfs >>145.4M<< 4.0K 145.4M 0% /dev

    /dev/loop0 >>95.0M<< 95.0M 0 100% /

    {

    tmpfs 212.5M 0 212.5M 0% /dev/shm

    tmpfs 212.5M 7.5M 205.1M 4% /run

    tmpfs 212.5M 0 212.5M 0% /sys/fs/cgroup

    tmpfs 212.5M 2.5M 210.0M 1% /var

    tmpfs 212.5M 0 212.5M 0% /tmp

    }

    >>212.5M<<

    145.4 + 95 + 212.5 = 453 M ram / reserved but with idle use

    + system will have more for decoding 4k hevc format

    - system will be slower in operation /emmc spped dependent

    whole infrastructure not need to be reingenered , this proposition is something like "tuning options" and user should have option to enable/disable above tunning steps...

    pivot_root: change the root filesystem - Linux Man Pages (8)

    i'm trying to use pivot_root for squashfs mounted on /dev/loop0 to recover ram amount but:

    LibreELEC:~/new_root # pivot_root . /

    -sh: pivot_root: not found

    it is in package util-linux but is not anabled in package.mk by default in current amlogic-master

    i don't know also is this command is correct

    Code
    mkdir /storage/root
    mount /dev/loop0 /storage/root
    cd /storage/root
    pivot_root . /
    exec chroot . sh <dev/console >dev/console 2>&1
    umount /dev/loop0

    1720x720p tos-1720x720-cfg01.mkv ok in sw

    1080p jellyfish-3-mbps-hd-hevc.mkv not ok

    4K tos-4096x1720-tiles.mkv crash

    i try to incrase cma to 160mb 128+32

    How to disable loading Libreelec to RAM as ramdisk, it is possible without recompiling??? what to change??

    LibreELEC:~ # df -kh

    Filesystem Size Used Available Use% Mounted on

    devtmpfs 145.4M 4.0K 145.4M 0% /dev

    /dev/mmcblk0p1 511.7M 104.6M 407.1M 20% /flash

    /dev/loop0 95.0M 95.0M 0 100% /

    /dev/mmcblk0p2 13.7G 352.3M 13.4G 3% /storage

    tmpfs 212.5M 0 212.5M 0% /dev/shm

    tmpfs 212.5M 7.5M 205.1M 4% /run

    tmpfs 212.5M 0 212.5M 0% /sys/fs/cgroup

    tmpfs 212.5M 2.5M 210.0M 1% /var

    tmpfs 212.5M 0 212.5M 0% /tmp

    LibreELEC:~ # blkid

    /dev/mmcblk0p1: SEC_TYPE="msdos" LABEL_FATBOOT="LIBREELEC" LABEL="LIBREELEC" UUID="0204-3742" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="ad19b95a-01"

    /dev/mmcblk0p2: LABEL="STORAGE" UUID="351f72ac-2178-41f8-a206-1678ffac25d1" BLOCK_SIZE="1024" TYPE="ext4" PARTUUID="ad19b95a-02"

    /dev/loop0: TYPE="squashfs"


    LibreELEC:~ # free

    total used free shared buff/cache available

    Mem: 435292 261904 47464 4240 125924 114876

    Swap: 217644 9472 208172

    LibreELEC:~ # swapon

    NAME TYPE SIZE USED PRIO

    /dev/zram0 partition 212.6M 9.3M 100

    LibreELEC:~ # cat /proc/mounts

    devtmpfs /dev devtmpfs rw,relatime,size=148908k,nr_inodes=37227,mode=755 0 0

    proc /proc proc rw,relatime 0 0

    sysfs /sys sysfs rw,relatime 0 0

    /dev/mmcblk0p1 /flash vfat ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0

    /dev/loop0 / squashfs ro,relatime 0 0

    /dev/mmcblk0p2 /storage ext4 rw,noatime 0 0

    tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0

    devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0

    tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0

    tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0

    cgroup2 /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0

    cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0

    none /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0

    cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0

    cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0

    cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0

    cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0

    cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0

    cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0

    cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0

    cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0

    cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0

    tmpfs /var tmpfs rw,relatime 0 0

    mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0

    debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0

    tmpfs /tmp tmpfs rw,nosuid,nodev 0 0

    configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0

    LibreELEC:~ #

    grep zram /proc/mounts

    hm nothing here


    is it posible to rmount all tmps mounts to zram pool ?

    i found "systemd-remount-fs.service" but i don't know how to invoke

    to be remounted to zram all non physical mount points ???

    Thank's for Your help chewitt !

    LaFrite 512mb finally booting:

    LaFrite Mali – Google Drive

    build with:

    mali+ kernel 5.6.0-rc6 /zram as module included

    and memory changes /parametr CMA 256>128

    h264 sd ok /no deinterlacer/ change to egl solve problem

    h264> ok

    hevc4k> not ok / enable zram might help/ not tested

    hevc1080p >not tested

    lan > ok

    builtin audio hdmi out > ok


    for enable zram

    autostart.sh put to /storage/.config/

    >>>>>>>>>>>>>>>>>>>

    #!/bin/bash

    (

    modprobe zram

    swapoff -a

    totalmem=`free | grep -e "^Mem:" | awk '{print $2}'`

    mem=$(( $totalmem * 512))

    echo $mem > /sys/block/zram0/disksize

    mkswap /dev/zram0

    swapon -p 100 /dev/zram0

    ) &

    >>>>>>>>>>>>>>>>>>>

    for stability issues Edit extlinux/extlinux.conf by simply delete additional boot parametrs /not neccesary but error related


    Code
    LABEL LibreELEC
    
    LINUX /KERNEL
    
    FDT /meson-gxl-s805x-libretech-ac.dtb
    
    APPEND boot=LABEL=LIBREELEC disk=LABEL=STORAGE

    I have one error when compillling image , package mali-utgard fails on buildnig for mali 450 , found fix for 5.6 about previous error but not for this...

    fix for mali-utgart 5.6-rc6 @file mali_osc_time.c

    0.git clone --depth=1 GitHub - chewitt/LibreELEC.tv: Just enough OS for KODI --branch amlogic-master

    cd ~/LibreELEC.tv

    1.PROJECT=Amlogic DEVICE=AMLGX ARCH=arm tools/download-tool

    2.rm packages/linux/patches/amlogic/amlogic-0081-HACK-set-meson-gx-cma-pool-to-896MB.patch

    3.Edit LibreELEC.tv/linux.aarch64.conf at amlogic-master · chewitt/LibreELEC.tv · GitHub

    change locally the CMA fall-back value from 256 > 128 in /projects/Amlogic/linux/linux.aarch64.conf (line 5817)

    apt install docker docker-compose

    docker build --pull -t libreelec tools/docker/bionic

    docker run -v ~/:/home/docker -h libreelec -it libreelec

    cd ~/LibreELEC.tv
    5.PROJECT=Amlogic DEVICE=AMLGX ARCH=arm UBOOT_SYSTEM=lafrite make image

    i will be building for "mali" lafrite 512mb this time for more stable experience / this changed also: projects/Amlogic/devices/AMLGX/options

    + zram as module

    ################################################################################

    # setup device defaults

    ################################################################################

    # The TARGET_CPU variable controls which processor should be targeted for

    # generated code.

    case $TARGET_ARCH in

    aarch64)

    TARGET_CPU="cortex-a53"

    TARGET_CPU_FLAGS="+crc+fp+simd"

    TARGET_FEATURES="64bit"

    ;;

    arm)

    TARGET_KERNEL_ARCH="arm64"

    TARGET_PATCH_ARCH="aarch64"

    TARGET_FLOAT=hard

    TARGET_CPU="cortex-a53"

    TARGET_CPU_FLAGS="+crc"

    TARGET_FPU="neon-fp-armv8"

    TARGET_FEATURES="32bit"

    ;;

    esac

    # OpenGL-ES implementation to use

    OPENGLES="libmali"

    # Graphic drivers to use

    GRAPHIC_DRIVERS="mali"

    # KODI Player implementation to use

    KODIPLAYER_DRIVER="$OPENGLES"

    # Mali GPU family

    MALI_FAMILY="450"


    autostart.sh

    #!/bin/bash

    (

    modprobe zram

    swapoff -a

    totalmem=`free | grep -e "^Mem:" | awk '{print $2}'`

    mem=$(( $totalmem * 512))

    echo $mem > /sys/block/zram0/disksize

    mkswap /dev/zram0

    swapon -p 100 /dev/zram0

    ) &

    There is a whole lot of stuff about these three systems but none of it makes simple comparison between them let alone explain them well. I tried to make sense of it but my head exploded. Then I thought I had got it so I tried writing it down and my head exploded again. (see summary of implementations) I thought it will be useful to post this here as there were many stackexchange questions asking about pairwise comparisons between them.

    Summary of what to use when:

    1. ZRAM if you have no swap device on HDD/SSD.
    2. ZSWAP if you do have a swap device on HDD/SSD.
    3. ZCACHE: It does what ZSWAP does and ALSO compresses and speeds the filesystem page cache. (It is internally much more complicated and is not in the mainline kernel as it is still under development).

    Summary of their implementations:

    1. ZRAM is a compressed RAM based swap device
    2. ZSWAP is a compressed Cache if you already have a swap.
    3. ZCache is a backend for a special type of Virtual RAM thingy (Transcendent memory) that can be used to cache filesystem pages or swap data.

    Details:

    • ZRAM: Makes a swap device in the RAM. Pages sent here are compressed as they are stored. It has a higher priority than other swap devices: pages that are swapped out are preferentially sent to the zram device till it is full, only then are any other swap devices used.
      • Benefits: Independent of other (physical) swap devices. It can be used when there is no swap partition to expand the available memory.
      • Disadvantages: If other swap devices (HDD/SSD) are present they are not used optimally. As the zram device is an independent swap device, once it is full, any new pages that need to be swapped out are sent to next swap device directly, hence:
        1. There is a real chance of LRU (least recently used) inversion: It will be the most recently swapped data that goes to the slow disk, while inactive pages that were swapped out long ago will remain in the fast ZRAM
        2. The data sent to and read from the disk will consume a lot of bandwidth as it is uncompressed.
      • Status: Merged into the mainline kernel 3.14. Once enabled on a system, it requires some userspace configuration to set up the swap devices and use them.
    • ZSWAP: The frontswap system hooks attempts to swap out pages and uses zswap as write-back-cache for a HDD/SSD swap device: An attempt is made to compress the page and if it contains poorly compressible data it is directly written to the disk. If the data is compressed, it is stored in the pool of zswap memory. If pages are swapped out of memory when the total compressed pages in RAM exceeds a certain size, the Least Recently Used (LRU) compressed page is written to the disk as it is unlikely to be required soon.
      • Benefits: Very efficient use RAM and disk based swap. Minimizes Disk I/O by both reducing the number of writes and reads required (data is compressed and held in RAM) and by reducing the bandwidth of these I/O operations as the data is in a compressed form.
      • Limitations: It is an enhancement of disk based swap systems and hence depends on a swap partition on the hard disk.
      • Status: Merged into the 3.11 mainline linux kernel.
    • ZCache: It is a backend for the Transcendent memory system. Transcendent memory provides a RAM-like memory that can only be accessed a page at a time by using put and get calls. This is unlike normal memory that can be accessed a byte at a time. The frontswap and cleancache systems hook attempts to swap and reclaim file-system page caches respectively and send them to the transcendent memory backends. When zcache is used as a backend, the data is compressed and stored in the RAM. When it fills up, compressed pages are evicted to the swap. (an alternate backend is RAMster which shares a pool of RAM across networked computers). Using only the frontswap frontend with the zcache backend works just like zswap. (In fact zswap is a simplified subset of zcache)
      • Benefits Provides compressed caching both for swap and for filesystem caches.
      • Status: Still not mainlined as it is very complicated and is being worked on.

    I think enabling zRAM will be enought solution for libreelec. Otherwise if it is possible to enable zRAM with in pair with zSWAP with swapfile on disk i think this will also be solution /more complex but if it's only possible /zRAM+zSWAP....

    The zram driver creates a compressed block device in ram. That block device can then be used for swap or general purpose ram disk. The two most popular uses for it are swap to extend the available amount of ram to processes and /tmp. The ram used for the block device is dynamically obtained and released up to it's predefined uncompressed maximum size. The way it extends the amount of available ram to a system is by using a portion of the ram as compressed swap. It can therefore hold more pages of memory in the compressed swap than the amount of actual memory used. Typically it compresses to a 3:1 ratio. So, 1G of swap uses only 333MB of ram on average. The compression ratio including memory used for disk overhead varies depending on the % maximum space used. I found it to vary from 1.5:1 for a 1.5G disk with only 5% space used, to over 3:1 when nearly full. It also is much faster at swapping pages than typical hard disk swap

    with proper zRAM configuration on this 512mb boards you can incrase amount available amount memory for consumption by system, for example if you declare 333mb as zRAM from 512MB overall you have (512-333) + (333x3) = 179 + 999 = 1178 mb to compsuption by system you can also enable zSWAP for SWAP

    for zRAM changes this README explains wat is needed libretech-linux/README at 6d100c1d7b6ffe40c4bfeab3c8b51bfd11c382d3 · libre-computer-project/libretech-linux · GitHub

    for zSWAP changes this commit explains wat is needed enable zswap, set compressor to lz4, set z3fold as allocator · libre-computer-project/libretech-linux@d3fd803 · GitHub

    Hi , I have question about tvh capabilites.

    I found that info about possible use sat>IP server with 4 lnb input (configurable for quatro or quad lnb in firmware settings page) as virtual FBC Heads with multiple outputs = multiple transport streams. Not only 4, but this is probably possible trought some bridge configuration:

    1. Hardware sat>ip server/configured for quatro >>

    2. minisatip /with satip input/ configured as FBC head for one sat position >>

    3. tvheadend /8 sat ip inputs /in current config restrictions /this is 1gbit lan related (8 x 100 mbit) but for fbc setup should be bandwich related.

    USB DVB Tuners and Odroid N2 - Odroid N2 - CoreELEC Forums

    Anyone have this "sat axe" firmware capable server and can confirm if this work that way i'm described ?

    Tv is SHARP AQUOS 32" 1080p,tested and works with LaFrite 512 on debian/ubuntu images 3.19 mali, 5.4 lima from github page LibreComputer GitHub - libre-computer-project/libretech-linux: Mainline Linux Fork for Libre Computer

    I also think KODI gui changes pushed some time ago to LibreElec code base for 4k may be also problem for better support on LaFrite /512MB...

    Maybe without this changes about CME value increased to better handle 4k format and KODI 4K gui changes LaFrite will be booting normal but i don't know where to clone most updated branch. On kickstarter campaign page device support have description to support 1080p output to tv and even 4k format proper decoding.

    I have compile error with branch amlogic-master from chewitt , log included.

    sudo pacman -Syu pv pigz pastebinit gperf lzop lsdif patchutils perl-xml-parser perl-json autoconf aclocal automake autoconf-archive

    Edit:

    I found solution by downgrading texinfo package to 6.6.1 ver

    1

    wget texinfo-6.6-1-x86_64.pkg.tar.xz

    sudo pacman -U texinfo-6.6-1-x86_64.pkg.tar.xz

    2

    cd build.LibreELEC-AMLGX.arm-9.80-devel/build/sed-4.8/

    autoreconf

    3

    cd build.LibreELEC-AMLGX.arm-9.80-devel/build/gettext-0.20.1/gettext-tools/

    autoreconf

    aclocal
    autoconf
    autoheader
    automake --add-missing

    Ok , i will try delete this related patch and compile libreelec for myself and if ok i will post public link for people , but i don't know which repository and branch for lafrite 512 mb will be most stable: Libreelec official master or chewitt master or some other placed... ?


    Update... I will try this way. Correct me if something im missed:

    Code
    pacman -Syu gcc make git unzip wget xz
    git clone --depth=1 https://github.com/chewitt/LibreELEC.tv.git --branch amlogic-master
    cd ~/LibreELEC.tv
    rm packages/linux/patches/amlogic/amlogic-0081-HACK-set-meson-gx-cma-pool-to-896MB.patch
    PROJECT=Amlogic DEVICE=AMLGX ARCH=arm UBOOT_SYSTEM=lafrite BUILDER_NAME=stpf99 BUILDER_VERSION=1 make image
    PROJECT=Amlogic DEVICE=AMLGX ARCH=arm scripts/create_addon tvheadend42 pvr.hts oscam