Posts by chewitt

    So if it set only a few second to wait, when expired, the LE will continue to boot even without network connection.

    That's normally true, but when you enable the wireguard.service you add hard "after ntp" and "before kodi" dependencies to the boot sequence and because there is no valid network connection the ntp check never completes and thus the Kodi service which makes the wait-for-network check is never reached.

    The only way I think you can workaround this, is to stop/disable/mask the embedded Kodi startup systemd service (which runs an embedded shell script) and replace it with a modified service and script that's enabled/run from from somewhere on /storage; with the modified script containing logic to start wireguard before Kodi only when a valid network connection has been established. You basically need to extend the wait-for-network logic to include wireguard.

    You're over-thinking the problem. Trying to write the .img to disk again is only going to cause problems because the .img format we use for releases is designed only for overwriting an entire disk. Make a one-time manual install of the partitions and filesystems, and then 'update' to newer versions as required. An update replaces the entire embedded portion of the OS (via KERNEL/SYSTEM) and if you need to wipe the Kodi config all you need to do is stop Kodi and rename /storage/.kodi to /storage/.kodi-old and reboot. On restart you have a completely clean Kodi config. Config items also exist in /storage/.config or /storage/.cache, but it's unlikely that you need to touch anything there.

    WireGuard uses symetric keys for encryption but other elements of the protocol like handshaking and key-rotation that are essential for perfect-forward secrecy are time-based: thus the host needs to have correct time before starting, and on most LE devices correct time is obtained via NTP, so removing the time-sync.target dependency would be wrong.

    If "when my wifi connection changes" means you have a poor wifi signal resulting in disconnects or failure to connect? the correct solution is always going to be fixing the poor signal.

    If Android is installed on eMMC you need to perform recovery boot with the AMLGX "box" image so s905_autoscript or boot.scr can be found in the boot partition. The vendor u-boot looks for these files and loads them; and they reconfigure u-boot to find/boot the LE kernel and device-tree files first (if present) else continue to Android. Once you've booted into LE this way you can either erase/zero emmc using emmctool so the device runs u-boot from SD, or you can download the AMLGX "bananapi-m5.img.gz" image file to /storage and write the image to emmc (again using emmctool). Then the device is booting upstream u-boot from eMMC, but this will look for the .conf on SD before eMMC to make testing from SD easier, else run the image from eMMC which is faster.

    On ARM SoC devices that support multiple output planes and where the GPU (2D/3D) is separate from DRM (rendering/compositing) the active planes are processed individually and then composited for HDMI output. There is normally a dedicated OSD plane, and on Amlogic hardware (at least the older generations that LE supports) the OSD plane is limited to 1080p resolution while video planes can handle 4K. The Amlogic vendor kernel does some internal hardware juju to scale the 1080p OSD plane to 4K at a later point in the display pipeline but the visual results of that forced scaling (scaling is always a lossy process) often result in visual artefacts and the output can be visually better when you leave the OSD plane at its native 1080p. I have zero code knowledge of what CE are doing but it sounds like they implemented some settings to fiddle with the kernel and stop the OSD scaling from happening. Other ARM SoC types, e.g. RPi, Rockchip, support 4K on all planes which must be better, right?

    The problem is that rendering the Kodi interface always requires scaling of 2D/3D elements (can be accelerated on the GPU) to be combined with bitmap elements; artwork in the skin, artwork from thumbs and scraping (cannot be accelerated, so must be scaled on-the-fly, on the CPU). And as most (all?) Kodi skins are currently designed for 720p or 1080p output, running the 'desktop' at 4K means most of the time you must scale a bunch of things from 720p/1080p to 4K and this has a significant compute impact on the HTPC device. Even if you have "4K native" skins, thumbs and artwork are still scaled, and still generate compute load.

    The TV also has its own scaling capabilities for handling SD/HD signals. The TV's capabilities are normally visually better, due to having fancier scaling algorithms, and scaling on the TV has zero compute impact on the HTPC. This means most of the time and even on more compute-capable x86_64 hardware; you have a better overall Kodi experience (fewer visual artifacts from scaling and snappier navigation) when you leave the Kodi GUI at 1080p, not 4K, and only switch to 4K output when playing video. Some users are obsessed with 4K settings though /shrug

    RPi5 is faster than RPi4 but since you already have an RPi4 you might as experiment before investing more in upgrades. Amazon shows lots of inexpensive BT or 'USB air mouse' wireless remote options. Or a USB flirc receiver allows you to reuse an existing IR remote that you might have? - RPi4 also supports HDMI-CEC which lots of people seem to use.