Thanks for the thoughtful perspective - keeping the barrier to entry low for hobbyist contributors is a completely valid reason to avoid Yocto's steep learning curve. Since this was just a personal playground to stress-test Claude Code, I’m happy with how it turned out. The repo is there if anyone ever wants to see how the toolchain isolation or dependency mapping looked.
Posts by adam.h.
-
-
I think there is a fundamental misunderstanding here of what Yocto actually is.
Yocto is not a pre-built operating system or a standard Linux distribution where you just 'add a few missing media packages' on top. Yocto is an empty build engine framework. It provides the toolchain and the build mechanics, but it contains zero software packages of its own.
To build any functional operating system with Yocto - let alone one as specific as LibreELEC - you have to write or port BitBake recipes for every single component, from systemd and the kernel configuration down to Kodi and its dependencies.
Suggesting to 'start with Yocto and add only missing things' implies Yocto provides the rest out of the box. It doesn't. Porting the LibreELEC package set into Yocto recipes is exactly how a Yocto-based distribution is built from scratch.
My experiment was a proof-of-concept showing how LibreELEC’s existing infrastructure could be translated into that framework. It wasn't about changing the software inside the distro - it was about changing the engine that compiles it.
-
The point of the project was simple: it started as a personal exercise to test the limits of Claude Code on a large, complex codebase. I chose LibreELEC precisely because its current build system is mature and contains over 5,000 recipes, making it an excellent real-world stress test.
To answer your question: No, the goal wasn't to fork the distro or create a 'fake' LibreELEC. The goal was to see what LibreELEC’s exact package set, configurations, and architecture would look like if they were driven by a modern, industry-standard build system (Yocto/BitBake) instead of the current custom shell-and-stamp system.
As for the name, calling the repository 'LibreELEC.new' was just a standard way to label a structural experiment on a LibreELEC codebase. It’s a proof-of-concept, not a rebranding campaign.
Whether migrating the build pipeline to Yocto brings actual value to the LE community - via better host isolation, declarative feature toggles, or cleaner BSP layers - isn't for me to decide. I listed the theoretical technical benefits in my post, but it is entirely up to the core team and community to decide if those benefits are worth the massive migration cost.
I’m just sharing the data and the code from the experiment in case anyone finds it useful.
-
Hey all,
I wanted to share a personal experiment I've been running: an exploratory migration of the LibreELEC build pipeline to a Yocto/BitBake-based system.
Repository: https://github.com/adam-aph/LibreELEC.new-30-March-2026.git
The branch is based on the master libreelec.tv cut from March 30. This started as a private experiment - my excuse to work with Claude Code on a larger, real-world codebase - so temper expectations accordingly.
🔧 WHY BOTHER?
For those curious whether there's any genuine technical merit here (beyond "Yocto is what the cool kids use"), here's what actually changes for a codebase like LibreELEC:
- Cryptographic task signatures replace fragile .stamp_* files
Changing an ffmpeg configure option, patch, or dependency in package.mk triggers precisely the affected downstream packages (Kodi, gstreamer plugins, etc.) - no more volunteers reaching for rm -rf build.* to restore correctness, and no more PKG_NEED_UNPACK hacks. - sstate-cache gives reliable task-level binary reuse across machines and CI
Tweaking one kernel config or driver only rebuilds the delta, instead of re-executing large chunks of the 5000+ recipe tree that the current linear stamp logic often invalidates unnecessarily. - Task-level DAG dependency modeling eliminates build races
PKG_DEPENDS_TARGET + make -jN has inherent race conditions when multiple packages populate sysroot headers/libraries concurrently. BitBake replaces shell sequencing with mathematically enforced ordering, down to do_populate_sysroot vs do_configure. - Isolated native (-native) sysroots hermetically seal the toolchain and host tools
cmake, pkg-config, sed, gawk, Python - all of it. This removes the occasional host contamination that leaks through the current packages/toolchain/ wrapper across varied volunteer distros (Arch, Ubuntu, NixOS, etc.). - Layer + bbappend architecture cleanly separates BSP/vendor specifics
Device trees, kernel patches (RPi, Rockchip, Amlogic) and conditional logic move out of core packages/linux/ and packages/mesa/ into isolated vendor layers. Dropping an old SoC becomes a layer deletion rather than untangling shell if [ "$PROJECT" = ... ] blocks scattered across hundreds of package.mk files. - PACKAGECONFIG provides declarative, graph-aware feature toggles
Global flags like pulseaudio, lirc, various codecs are automatically wired with their dependencies and configure flags across recipes - replacing the current manual threading of SUPPORT_*=yes through per-package shell conditionals in make_target() and options files. - module.bbclass and kernel-devsrc formalize out-of-tree driver builds
Correct kernel tree preparation, KDIR, headers, and module packaging/stripping for WiFi dongles and proprietary drivers - instead of fragile sequencing scripts in packages/linux-drivers/ that depend on exact prior kernel unpack/configure timing. - Reproducible builds become an auditable property, not volunteer discipline
sstate + the dependency graph make it easier to verify bit-identical images across machines without relying on stamp + shell environment assumptions.
These are codebase-specific wins. That said - for a small volunteer team where the shell system is already well-understood, highly optimized for Kodi-centric embedded use, and operationally successful, the migration cost is massive. The strongest drivers are incremental correctness, host isolation, and long-term BSP maintainability as hardware targets grow.
⚠️ CURRENT STATE & CAVEATS
• Converted 42 arch-variants across 28 PROJECT/DEVICE combinations.
• Clean build achieved: libreelec-generic-x86-64 only
• Not tested on any physical device (it will very likely fail)
• Getting to a clean x86_64 build took roughly 100 hours working with Claude Code - this is not a weekend project🤔 IS THERE INTEREST?
Honestly, I'm not sure this brings value for you - maybe it does. I'm sharing it in case someone sees potential here, or wants to pick it up.
Realistically, continuing this properly would mean sponsored API tokens, access to physical hardware for testing, and significant time investment. That's essentially a part-time (or full-time) job, which isn't where I am right now.
That said, I'm happy to discuss it. If you see value in this direction, think it's worth pursuing, or have thoughts on what "continued" would even look like in practice - feel free to DM me. No promises, but I'm not closing the door either.
Cheers!
Build:
Code
Display More$ time kas build kas/machines/libreelec-generic-x86-64.yml --target libreelec-image 2>&1 | tee /tmp/libreelec-image-build.log 2026-05-22 10:58:11 - INFO - kas 5.2 started on Ubuntu 24.04 2026-05-22 10:58:11 - INFO - Cloning repository poky 2026-05-22 10:58:11 - INFO - Cloning repository meta-openembedded 2026-05-22 10:58:33 - INFO - Repository meta-openembedded already contains 1ad0d777d1de1769e5995eb806f7ae5c15d0be54 as commit 2026-05-22 10:59:11 - INFO - Repository poky already contains 8643f911602949518c5c5474726b49f943e36b83 as commit 2026-05-22 10:59:11 - INFO - Repository poky checked out to 8643f911602949518c5c5474726b49f943e36b83 2026-05-22 10:59:12 - INFO - Repository meta-openembedded checked out to 1ad0d777d1de1769e5995eb806f7ae5c15d0be54 2026-05-22 10:59:14 - INFO - Loading cache...done. ... 2026-05-22 10:59:55 - INFO - done. 2026-05-22 10:59:56 - INFO - Parsing of 3338 .bb files complete (0 cached, 3338 parsed). 5229 targets, 599 skipped, 214 masked, 0 errors. 2026-05-22 10:59:56 - INFO - NOTE: Resolving any missing task queue dependencies 2026-05-22 10:59:56 - INFO - NOTE: Multiple providers are available for runtime busybox (busybox, busybox-init) 2026-05-22 10:59:56 - INFO - Consider defining a PREFERRED_RPROVIDER entry to match busybox 2026-05-22 10:59:58 - INFO - 2026-05-22 10:59:58 - INFO - Build Configuration: 2026-05-22 10:59:58 - INFO - BB_VERSION = "2.8.1" 2026-05-22 10:59:58 - INFO - BUILD_SYS = "x86_64-linux" 2026-05-22 10:59:58 - INFO - NATIVELSBSTRING = "ubuntu-24.04" 2026-05-22 10:59:58 - INFO - TARGET_SYS = "x86_64-oe-linux" 2026-05-22 10:59:58 - INFO - MACHINE = "libreelec-generic-x86-64" 2026-05-22 10:59:58 - INFO - DISTRO = "libreelec" 2026-05-22 10:59:58 - INFO - DISTRO_VERSION = "12.0" 2026-05-22 10:59:58 - INFO - TUNE_FEATURES = "m64" 2026-05-22 10:59:58 - INFO - TARGET_FPU = "" 2026-05-22 10:59:58 - INFO - meta-libreelec-bsp 2026-05-22 10:59:58 - INFO - meta-libreelec-distro 2026-05-22 10:59:58 - INFO - meta-libreelec-kodi = "<unknown>:<unknown>" 2026-05-22 10:59:58 - INFO - meta-filesystems 2026-05-22 10:59:58 - INFO - meta-multimedia 2026-05-22 10:59:58 - INFO - meta-networking 2026-05-22 10:59:58 - INFO - meta-oe 2026-05-22 10:59:58 - INFO - meta-python = "scarthgap:1ad0d777d1de1769e5995eb806f7ae5c15d0be54" 2026-05-22 10:59:58 - INFO - meta 2026-05-22 10:59:58 - INFO - meta-poky = "scarthgap:8643f911602949518c5c5474726b49f943e36b83" 2026-05-22 10:59:58 - INFO - 2026-05-22 10:59:59 - INFO - Initialising tasks...Sstate summary: Wanted 2037 Local 0 Mirrors 0 Missed 2037 Current 0 (0% match, 0% complete) 2026-05-22 11:00:00 - INFO - done. 2026-05-22 11:00:00 - INFO - NOTE: Executing Tasks 2026-05-22 11:00:00 - INFO - NOTE: Running task 1 of 4469 (/home/adamh/cc-le-conv/LibreELEC.new/build/../poky/meta/recipes-devtools/quilt/quilt-native_0.67.bb:do_recipe_qa) 2026-05-22 11:00:00 - INFO - NOTE: Running task 2 of 4469 (virtual:native:/home/adamh/cc-le-conv/LibreELEC.new/build/../poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb:do_recipe_qa) 2026-05-22 11:00:00 - INFO - NOTE: Running task 3 of 4469 (/home/adamh/cc-le-conv/LibreELEC.new/build/../poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb:do_recipe_qa) 2026-05-22 11:00:00 - INFO - NOTE: Running task 4 of 4469 (/home/adamh/cc-le-conv/LibreELEC.new/build/../poky/meta/recipes-core/gettext/gettext-minimal-native_0.22.5.bb:do_recipe_qa) 2026-05-22 11:00:00 - INFO - NOTE: Running task 5 of 4469 (/home/adamh/cc-le-conv/LibreELEC.new/build/../poky/meta/recipes-devtools/m4/m4-native_1.4.19.bb:do_recipe_qa) 2026-05-22 11:00:00 - INFO - NOTE: Running task 6 of 4469 (virtual:native:/home/adamh/cc-le-conv/LibreELEC.new/build/../poky/meta/recipes-devtools/autoconf/autoconf_2.72e.bb:do_recipe_qa) 2026-05-22 11:00:00 - INFO - NOTE: Running task 7 of 4469 (virtual:native:/home/adamh/cc-le-conv/LibreELEC.new/build/../poky/meta/recipes-devtools/automake/automake_1.16.5.bb:do_recipe_qa) 2026-05-22 11:00:00 - INFO - NOTE: Running task 8 of 4469 (/home/adamh/cc-le-conv/LibreELEC.new/build/../poky/meta/recipes-devtools/libtool/libtool-native_2.4.7.bb:do_recipe_qa) ... 2026-05-22 14:30:22 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_image_squashfs: Started 2026-05-22 14:30:22 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_rootfs_wicenv: Started 2026-05-22 14:30:22 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_rootfs_wicenv: Succeeded 2026-05-22 14:30:39 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_image_squashfs: Succeeded 2026-05-22 14:30:39 - INFO - NOTE: Running task 4466 of 4469 (/home/adamh/cc-le-conv/LibreELEC.new/build/../meta-libreelec-distro/recipes-images/libreelec-image.bb:do_image_wic) 2026-05-22 14:30:40 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_image_wic: Started 2026-05-22 14:30:54 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_image_wic: Succeeded 2026-05-22 14:30:54 - INFO - NOTE: Running task 4467 of 4469 (/home/adamh/cc-le-conv/LibreELEC.new/build/../meta-libreelec-distro/recipes-images/libreelec-image.bb:do_image_complete) 2026-05-22 14:30:55 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_image_complete: Started 2026-05-22 14:30:56 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_image_complete: Succeeded 2026-05-22 14:30:56 - INFO - NOTE: Running task 4468 of 4469 (/home/adamh/cc-le-conv/LibreELEC.new/build/../meta-libreelec-distro/recipes-images/libreelec-image.bb:do_populate_lic_deploy) 2026-05-22 14:30:57 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_populate_lic_deploy: Started 2026-05-22 14:30:57 - INFO - NOTE: recipe libreelec-image-1.0-r0: task do_populate_lic_deploy: Succeeded 2026-05-22 14:30:57 - INFO - NOTE: Running noexec task 4469 of 4469 (/home/adamh/cc-le-conv/LibreELEC.new/build/../meta-libreelec-distro/recipes-images/libreelec-image.bb:do_build) 2026-05-22 14:30:58 - INFO - NOTE: Tasks Summary: Attempted 4469 tasks of which 0 didn't need to be rerun and all succeeded. 2026-05-22 14:30:58 - INFO - 2026-05-22 14:30:58 - INFO - Summary: There were 483 WARNING messages. real 212m47.967s user 1m5.970s sys 0m13.694sResult:
Code303M May 22 14:30 LibreELEC-Generic.x86_64-12.0.img.gz 1M May 22 14:30 LibreELEC-Generic.x86_64-12.0.img.gz.sha256 1M May 22 14:30 LibreELEC-Generic.x86_64-12.0.manifest 275M May 22 14:30 LibreELEC-Generic.x86_64-12.0.squashfs 1M May 22 14:30 LibreELEC-Generic.x86_64-12.0.testdata.json 549M May 22 14:30 LibreELEC-Generic.x86_64-12.0.wic 303M May 22 14:30 LibreELEC-Generic.x86_64-12.0.wic.gz 1M May 22 14:30 libreelec-image.envComplete Target Matrix - 42 arch-variants across 28 PROJECT/DEVICE combinations:
PROJECT DEVICE ARCH KERNEL BOOTLOADER DISPLAYSERVER GRAPHIC_DRIVERS patch_arch Notes Generic Generic x86_64 default syslinux no crocus i915 iris r300 r600 radeonsi vmware virtio x86 GBM/DRM; OpenGL=mesa Generic Generic-legacy x86_64 default syslinux x11 crocus i915 iris radeonsi nvidia vmware virtio x86 X11/Fluxbox; OpenGL=mesa Generic gbm x86_64 default syslinux no crocus i915 iris r300 r600 radeonsi vmware virtio x86 GBM/DRM (same as Generic) Generic wayland x86_64 default syslinux wl crocus i915 iris nvidia-ng r300 r600 radeonsi vmware virtio x86 Wayland/Sway; OpenGLES=mesa Generic x11 x86_64 default syslinux x11 crocus i915 iris radeonsi nvidia vmware virtio x86 X11/Fluxbox; OpenGL=mesa RPi RPi arm raspberrypi bcm2835-bootloader no vc4 arm RPi 1/Zero; arm1176jzf-s; KERNEL_TARGET=zImage RPi RPi2 arm raspberrypi bcm2835-bootloader no vc4 arm RPi 2/3; cortex-a7; KERNEL_TARGET=zImage RPi RPi4 aarch64 raspberrypi bcm2835-bootloader no vc4 aarch64 cortex-a72; KERNEL_TARGET=Image RPi RPi4 arm raspberrypi bcm2835-bootloader no vc4 aarch64 arm32 on arm64 kernel; cortex-a53; TARGET_KERNEL_PATCH_ARCH=aarch64 RPi RPi5 aarch64 raspberrypi bcm2835-bootloader no vc4 aarch64 cortex-a76; KERNEL_TARGET=Image RPi RPi5 arm raspberrypi bcm2835-bootloader no vc4 aarch64 arm32 on arm64 kernel; cortex-a53; TARGET_KERNEL_PATCH_ARCH=aarch64 Amlogic AMLGX aarch64 amlogic u-boot no lima panfrost aarch64 cortex-a53; OPENGLES=mesa Amlogic AMLGX arm amlogic u-boot no lima panfrost aarch64 arm32 on arm64 kernel; cortex-a53 Rockchip RK3288 arm default u-boot no panfrost arm cortex-a17; arm-only SoC Rockchip RK3328 aarch64 default u-boot no lima aarch64 cortex-a53; ATF Rockchip RK3328 arm default u-boot no lima aarch64 arm32 on arm64 kernel; cortex-a53 Rockchip RK3399 aarch64 default u-boot no panfrost aarch64 cortex-a72.cortex-a53; ATF Rockchip RK3399 arm default u-boot no panfrost aarch64 arm32 on arm64 kernel; cortex-a72.cortex-a53 Rockchip RK356X aarch64 rockchip u-boot no panfrost aarch64 cortex-a55; LINUX=rockchip Rockchip RK356X arm rockchip u-boot no panfrost aarch64 arm32 on arm64 kernel; cortex-a55 Rockchip RK3576 aarch64 rockchip u-boot no panfrost aarch64 cortex-a72.cortex-a53; LINUX=rockchip Rockchip RK3576 arm rockchip u-boot no panfrost aarch64 arm32 on arm64 kernel Rockchip RK3588 aarch64 rockchip u-boot no panfrost aarch64 cortex-a76.cortex-a55; LINUX=rockchip Rockchip RK3588 arm rockchip u-boot no panfrost aarch64 arm32 on arm64 kernel Allwinner A64 aarch64 default u-boot no (mesa via OPENGLES) aarch64 cortex-a53; ATF+crust Allwinner A64 arm default u-boot no (mesa via OPENGLES) aarch64 arm32 on arm64 kernel; cortex-a53 Allwinner H2-plus arm default u-boot no (mesa via OPENGLES) arm cortex-a7; arm-only; UBOOT_FIRMWARE=crust Allwinner H3 arm default u-boot no (mesa via OPENGLES) arm cortex-a7; arm-only; UBOOT_FIRMWARE=crust Allwinner H5 aarch64 default u-boot no (mesa via OPENGLES) aarch64 cortex-a53; ATF+crust Allwinner H5 arm default u-boot no (mesa via OPENGLES) aarch64 arm32 on arm64 kernel; cortex-a53 Allwinner H6 aarch64 default u-boot no (mesa via OPENGLES) aarch64 cortex-a53; ATF+crust (sun50i_h6) Allwinner H6 arm default u-boot no (mesa via OPENGLES) aarch64 arm32 on arm64 kernel; cortex-a53 Allwinner R40 arm default u-boot no (mesa via OPENGLES) arm cortex-a7; arm-only; no ATF NXP iMX6 arm default u-boot no etnaviv arm cortex-a9; arm-only NXP iMX8 aarch64 default u-boot no etnaviv aarch64 cortex-a53; ATF+firmware-imx NXP iMX8 arm default u-boot no etnaviv aarch64 arm32 on arm64 kernel; cortex-a53 Qualcomm Dragonboard aarch64 default u-boot no freedreno aarch64 cortex-a53; mkbootimg host tool Qualcomm Dragonboard arm default u-boot no freedreno aarch64 arm32 on arm64 kernel; cortex-a53 ARM ARMv7 arm default u-boot no lima arm Generic ARMv7 reference; cortex-a8 ARM ARMv8 aarch64 default u-boot no lima aarch64 Generic ARMv8 reference; cortex-a53 ARM ARMv8 arm default u-boot no lima aarch64 Generic ARMv8 reference; arm32 on arm64 kernel Samsung Exynos arm samsung u-boot no panfrost arm cortex-a15.cortex-a7; LINUX=samsung - Cryptographic task signatures replace fragile .stamp_* files
-
Start with logs, Duncan - because blind guessing is for amateurs, and you've got a Pi that's playing hard to get.
Enable debug logging in Kodi: Settings > LibreELEC > System > Logging > Toggle it on, then reboot and reproduce the WiFi flop.
SSH in (root/libreelec) and run journalctl -u connman for network manager moans - look for DHCP fails, disconnections, or beacon losses.
Peek at dmesg | grep brcmfmac for WiFi driver drama; signal issues or power-saving quirks often lurk there.
If it's the passphrase loop, check signal strength in Connections settings - weak sauce triggers that nonsense.
Router side: Log in, tweak channels to 1,6,11, and reboot it - interference is a sneaky bastard.
Disable WiFi power save: SSH echo "options brcmfmac power_save=0" > /storage/.config/modprobe.d/disable-wifi-powersave.conf and reboot.
Bump 'Wait for Network' to 30-60s in Services to give it breathing room.
If logs scream hardware, ditch onboard WiFi for a USB dongle - Pi's antenna is about as reliable as a chocolate teapot.
Forums with your logs if stuck; now go fix it before your Pi ghosts you permanently.
-
Grok provides a few clues - and perhaps not all of them are pure nonsense:
Diagnose via Logs and ALSA Status (Quick Root Cause Identification):- Run dmesg | grep -iE 'snd|alsa|audio|codec|i2s|underrun|overrun|error' and check your Kodi log (grep -i audio elegant-marmot.log).
- Enable xrun debug: echo 1 > /proc/asound/card0/pcm0p/xrun_debug, play audio, then cat /proc/asound/card0/pcm0p/xrun_debug to confirm underruns (common for periodic glitches).
- Test basic playback: speaker-test -c2 -r48000 -fS16_LE -Dhw:0,0—note if glitches align with 4s intervals or CPU spikes (top in parallel).
- Verify and Adjust ALSA Devices/Volumes (Fix Mismatches):
- List devices: aplay -l (ensure your Slice card shows up).
- Use alsamixer -c0 to unmute/adjust volumes (e.g., DAC controls); test formats/rates with speaker-test variants (e.g., -r44100 if 48kHz distorts).
- In Kodi settings: Set audio device to "ALSA: hw:0,0" and disable passthrough if enabled.
- Tweak Boot Config and Reload Driver (Address Hardware/Timing):
- Edit /flash/config.txt (remount rw): Add dtparam=i2s=on, hdmi_force_edid_audio=1 (if HDMI-related), and your overlay (dtoverlay=slice-audio or from repo).
- Reload module: rmmod <your_module e.g. snd_soc_slice> && modprobe <your_module>.
- Reboot and retest; if periodic, add audio_pwm_mode=0 to config.txt for PWM cleanup.
- Increase Buffers in Driver Source (Target Underruns/Periodic Glitches):
- In your driver code (slice-drivers/sound/soc/...), bump snd_pcm_hardware values: Set buffer_bytes_max = 256 * 1024; and period_bytes_min = 8192;.
- Recompile/install the module, reload, and test playback. Add debug prints in hw_params to log rates/channels via pr_info.
- If clock-related, update DT overlay clocks (e.g., clock-frequency = 12288000; for 48kHz), recompile DTBO, apply.
- Hardware/Power Check and Fallback Test (Rule Out Environmentals):
- Monitor voltage: vcgencmd measure_volts during playback—ensure stable 5V; swap PSU if dips.
- Test on kernel 5.x stock image to isolate v6 porting bugs; if persists, probe I2S pins if hardware access allows.
If these don't resolve, the issue may need kernel rebuild with SND_DEBUG_VERBOSE or forum help with logs/code snippets.
but wait, chatGPT has its opinion as well

1. Quick confirm: xrun / underrun checkCode# as root echo 1 > /proc/asound/card0/pcm0p/xrun_debug # reproduce the glitch, then: cat /proc/asound/card0/pcm0p/xrun_debug dmesg | grep -iE 'snd|alsa|audio|i2s|underrun|xrun|error'If xruns or pointer/avail errors show → underrun / pointer problem (go to step 3). If nothing shows → skip to step 4 (clocks).
2. Quick behavior probe: speaker-test with bigger buffers
Codespeaker-test -c2 -r48000 -fS16_LE -D hw:0,0 # default speaker-test -c2 -r48000 -fS16_LE -D hw:0,0 -p 8 -n 4 # larger periods/buffer speaker-test -c2 -r44100 -fS16_LE -D hw:0,0 # try 44.1kIf large buffers remove the glitch → it's an underrun/period-size alignment issue. Proceed to step 3.
3. Fast driver fixes that often cure periodic glitches
- Increase safe defaults in struct snd_pcm_hardware (temporary test):
Code.buffer_bytes_max = 256*1024, .period_bytes_min = 8192, .period_bytes_max = 64*1024, .periods_min = 2, .periods_max = 8,- Force period alignment to frame size when computing period bytes:
Code/* ensure period_bytes is multiple of bytes_per_frame */ period_bytes = frames * bytes_per_frame; period_bytes = ALIGN(period_bytes, bytes_per_frame);Rebuild & test. If fixed, reduce sizes until minimal stable values.
4. If xruns NOT present — verify clocks / DT overlay
- Inspect device tree and confirm MCLK / clock-frequency exists for the codec.
Code# inspect DT grep -R "sound" -n /proc/device-tree || true dtc -I fs -o - /proc/device-tree | less dmesg | grep -i clockIf MCLK or clock-frequency is wrong/missing → fix overlay to supply correct clock phandle/rate (e.g. 12.288 MHz for 48k×256 or the codec’s expected MCLK).
5. Instrument pointer & hw_params for precise diagnosis
Insert compact logs in hw_params() and pointer():Codepr_info("slice: hw_params rate=%u ch=%u frame=%u buf=%lu per=%lu\n", params_rate(r), params_channels(r), bytes_per_frame, r->buffer_size, r->period_size); pr_info("slice: pointer dma_pos=%llu\n", (unsigned long long)dma_hw_ptr);Rebuild, run, and watch dmesg for pointer jumps or negative avail — that points to DMA position read / 64-bit type bug.
6. Search/patch common porting gotchas (aarch64 / kernel-6)
- Make sure DMA position and counters use u64/dma_addr_t properly (no implicit 32-bit truncation).
- Use proper register reads (readl() / ioread32() as appropriate).
- If codec probe fails for clocks, return -EPROBE_DEFER rather than continuing.
7. If still failing — rapid triage steps
- Try older kernel (5.x) image to confirm regression from kernel-6 port.
- Paste pointer(), trigger(), and hw_params() here and I’ll mark exact lines to change.
Short diagnosis summary
If large buffer sizes fix it → underrun/period alignment; if no xruns and logging shows pointer discontinuities → DMA pointer / 64-bit type bug; if no pointer issues but glitch remains → clock/MCLK.
and here comes the Gemini

The root cause of the regular 4-second audio glitch is a hardcoded Master Clock (MCLK) in your driver. It's correctly configured for audio at $44.1 \, \text{kHz}$ but is incorrect for the very common $48 \, \text{kHz}$ rate, causing a predictable clock drift that the system violently corrects every few seconds.Here's the direct path to fixing it.
Step 1: Confirm the Diagnosis (2-Minute Test)
Force Kodi to resample all audio to the one rate your driver handles correctly: $44.1 \, \text{kHz}$. This requires no recompiling.
- SSH into your LibreELEC box.
- Create or edit the file /storage/.kodi/userdata/advancedsettings.xml.
Add the following content:
- Reboot the system (reboot).
Play some audio, especially UI sounds or video files that are likely $48 \, \text{kHz}$. If the distortion and periodic glitches are gone, this confirms the MCLK is the problem. You can now proceed to the permanent fix.
Step 2: Implement the Permanent Fix (Code Change) ✅
Modify the driver to calculate the MCLK dynamically based on the requested sample rate instead of using a hardcoded value.
- Open your driver source file: sound/soc/bcm/slice.c.
- Navigate to the slice_hw_params function.
- Replace the hardcoded MCLK logic with a dynamic calculation.
Change this section:
Code/* Set the codec system clock */ err = snd_soc_dai_set_sysclk(codec_dai, WM5102_SYSCLK_MCLK1, MCLK_RATE, SND_SOC_CLOCK_IN);To this:
Code
Display Moreunsigned int mclk_rate; /* * Dynamically calculate the MCLK based on the requested sample rate (fs). * The WM5102 codec works well with an MCLK of 256 * fs. */ mclk_rate = params_rate(params) * 256; /* Set the codec system clock */ err = snd_soc_dai_set_sysclk(codec_dai, WM5102_SYSCLK_MCLK1, mclk_rate, SND_SOC_CLOCK_IN);- Recompile your driver and the kernel, create the new image, and deploy it.
- (Optional but recommended) Remove the advancedsettings.xml file you created in Step 1.
This code change has a very high probability of permanently resolving the audio issue for all standard sample rates.
-
Grok4 went and got itself some extra neurons, so here’s its hot takes. Might not be complete trash, who knows?

Grok4:
From the system details you provided (which appear to be from a Ubuntu-like distro, not LibreELEC, based on the kernel version and module list), the hardware is detected:
- Touchscreen: Goodix capacitive over I2C (driver: goodix_ts.ko).
- Accelerometer: MXC4005 (driver: mxc4005.ko).
- Both modules are loaded in your current setup, but if they're not functioning (e.g., no input events), it could be due to missing firmware, I2C bus probing issues, or calibration.
LibreELEC's filesystem is read-only (squashfs), so you can't simply "install" drivers like in a full distro. Instead, you'll need to build a custom LibreELEC image with the drivers enabled in the kernel. This is straightforward if you follow the steps below. I'll assume you're starting from a clean LibreELEC install on your device (download the Generic-x86_64 image from libreelec.tv/downloads and boot/install via USB). If you're currently on Ubuntu, switch to LibreELEC first for testing.
Step 1: Verify Hardware Detection in Stock LibreELEC
Before building custom, test if the drivers are partially working in a standard LibreELEC install:- Install LibreELEC 12.x (or latest nightly) Generic x86_64 on a USB drive or your internal storage (eMMC via /dev/mmcblk0).
- Boot into LibreELEC and enable SSH (Settings > LibreELEC > Services > SSH).
- SSH in (default user: root, password: libreelec).
- Check for devices:
-
(for touchscreen).
-
(for accelerometer).
-
and
for load errors.
-
to list input devices and test touch/accel events (if evtest isn't available, it's because these modules aren't in the stock image).
-
to list I2C buses; then
(try buses 0-3 based on your serial controllers) to see if the Goodix (usually at address 0x5d) or MXC4005 (address 0x15) shows up.
If the modules aren't present (likely), proceed to custom build.
Step 2: Build Custom LibreELEC with Drivers Enabled
You'll need a Linux build host (e.g., Ubuntu 22.04+ VM with at least 4 cores, 8GB RAM, 50GB free space). This enables the drivers as kernel modules.- Set Up Build Environment:
- Install dependencies: Code
sudo apt update && sudo apt install git gcc g++ make ncurses-dev bc lzop libssl-dev flex bison qemu-utils java-runtime-headless dosfstools.
- Clone LibreELEC repo:
.
- Checkout the branch for your version (e.g.,
for stable, or master for nightly).
- Enable the Drivers in Kernel Config:
- The kernel config is in
(for Generic x86_64).
- Edit
to add a patch for config changes.
- Create a patch file
with contents:
Diff
Display More--- a/.config +++ b/.config @@ -XXXX +XXXX @@ # Find the IIO/INPUT sections via `grep` in the config # CONFIG_TOUCHSCREEN_GOODIX is not set +CONFIG_TOUCHSCREEN_GOODIX=m # CONFIG_MXC4005 is not set +CONFIG_MXC4005=m # Ensure dependencies: +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_IIO=y +CONFIG_IIO_BUFFER=y +CONFIG_IIO_TRIGGER=y +CONFIG_I2C_HID=y # For Goodix HID mode if needed- Replace
with actual line numbers—extract the default config first by running a partial build (see below) and checking
.
- Build the Image:
- Run:
.
- This takes 1-2 hours. Output is in
(e.g., LibreELEC-Generic.x86_64-12.0.0.img.gz).
- Write the .img to USB:
(replace /dev/sdX with your USB device).
- Install and Test:
- Boot the custom image on your GOLE2 Pro.
- SSH in and load modules if not auto-loaded:
and
.
- Check
for errors. If Goodix fails with firmware issues, it may need a binary firmware blob—copy from your Ubuntu setup (
) to
in LibreELEC and reboot (per LibreELEC wiki).
- Test touch:
(find the Goodix event).
- Test accel:
or
(adjust device number).
Step 3: Enable Touch in Kodi
- Kodi supports touch natively, but ensure:
- Settings > Interface > Skin > Configure skin > Enable touchscreen mode.
- If calibration is off, use
(if available) or edit
for touch params.
- For multi-touch gestures, it should work once the driver is loaded.
Step 4: Enable Auto-Rotation (Flip)
- Accelerometer provides orientation data via IIO.
- LibreELEC/Kodi doesn't auto-rotate by default (no desktop manager like GNOME).
- Install the "Screen Orientation" addon from Kodi repo (if available) or script it:
- SSH in, install Python if needed (via unofficial addons or custom build).
- Create a script
:
Code
Display Moreimport xbmc import subprocess import time while True: try: with open('/sys/bus/iio/devices/iio:device0/in_accel_z_raw', 'r') as f: # Adjust path/device z = int(f.read()) if z > 500: # Threshold for upright/flipped; calibrate based on your tests subprocess.call(['kodi-send', '--action="SetGUIOrientation(0)"']) # 0=normal, 2=180 deg flip else: subprocess.call(['kodi-send', '--action="SetGUIOrientation(2)"']) except: pass time.sleep(1)- This monitors accel and flips Kodi's GUI. Test thresholds with
.
- For GBM rotation, if needed: Edit
to add
or similar, but test.
Troubleshooting
- If I2C not probing: Add kernel params in
(append line:
).
- Build errors: Check logs in
. If kernel patch fails, manually edit the config during build (pause at menuconfig:
).
- If modules load but no events: Check ACPI tables (
) for HID overrides; might need a DSDT patch (advanced).
- Performance: N5095 has UHD Graphics; enable VAAPI in Kodi for hardware decoding (Settings > Player > Video > Allow hardware acceleration - VAAPI).
- Community: Post your build logs on the LibreELEC forum (your recent thread there is a good start) for x86-specific help.
If this doesn't resolve it, provide dmesg output from LibreELEC.
-
Just in case you don't want to re-invent this wheel: Best Kodi-capable Media Players in 2025 for Video Playback
-
Did you notice that several builds are picking up the same commit hash? Is it normal? Few examples:
CodeLibreELEC-Generic.x86_64-13.0-nightly-20250626-c1e526c.img.gz (sha256) 2025-06-26 17:08 279.7M LibreELEC-Generic.x86_64-13.0-nightly-20250627-c1e526c.img.gz (sha256) 2025-06-27 09:57 279.7M LibreELEC-Generic.x86_64-13.0-nightly-20250628-c1e526c.img.gz (sha256) 2025-06-28 07:18 279.7M LibreELEC-Generic.x86_64-13.0-nightly-20250628-e7d7252.img.gz (sha256) 2025-06-28 23:25 279.7M LibreELEC-Generic.x86_64-13.0-nightly-20250630-fa3ad4b.img.gz (sha256) 2025-06-30 16:49 279.7M LibreELEC-Generic.x86_64-13.0-nightly-20250701-fa3ad4b.img.gz (sha256) 2025-07-01 15:58 279.7M -
ChatGPT
:
1. Check Kernel CompatibilityThe 6.12 kernel may be ahead of NVIDIA’s QA validation curve. Try running with a more conservative, supported kernel version like 6.6.x LTS or 6.7.x to verify stability.
2. Patch the NVIDIA Kernel Module for Compatibility
If you must use 6.12, verify that the DKMS or manual installation succeeded without warnings. Run:
Check /var/lib/dkms/nvidia/570.144/build/make.log for errors. If there are symbol mismatches or KMS hook issues, NVIDIA may not yet support 6.12, and you may need to:
- Use a community patch set (e.g., from NV-Kernel-Patcher if using open kernel modules)
- Or manually adapt the build if the symbol changed (common with drm API updates).
3. Test Disabling DRM KMS for Isolation
Set in modprobe:
Codeecho "options nvidia-drm modeset=0" | sudo tee /etc/modprobe.d/nvidia.conf sudo update-initramfs -uReboot and see if the timeout disappears. This will narrow the issue to modeset interaction with the new kernel's DRM layer.
4. Enable Early KMS Logging
For deeper kernel debugging, append this to your GRUB:
Then run:
Watch dmesg output for RmLogonRC flags — this can help pinpoint which channel stalls.
5. Run with Open Kernel Modules (Optional)
Since R515, NVIDIA supports open kernel modules:
============================================================================================================
============================================================================================================
============================================================================================================
and here some suggestions tailored to LE nighties (I'm wondering how much it all makes sense)
:1. Add NVIDIA DRM Modeset Boot Option
LibreELEC lets you append kernel params via cmdline.txt on the /flash partition (accessible from SSH or directly from the SD card/USB):
💡 Purpose: Disables DRM modesetting which causes timeout in some nightly builds.
Quote✅ Highly recommended as first fix to isolate the nvidia-modeset stall.
2. Force Legacy Rendering Path (X11 instead of GBM) — if available
Some builds may allow fallback to X11 rendering using the x11 variant of the NVIDIA driver.
From SSH, check if GBM is active:
If GBM + KMS is the cause, switching to legacy X11 (if supported in this build) can reduce stalls — but not all LibreELEC nightlies retain this support.
3. Check for Nouveau Conflicts
Even though LibreELEC is minimal, you can verify nouveau isn’t mistakenly loaded:
If present, blacklist it permanently via /flash/syslinux.cfg or /flash/extlinux/extlinux.conf (depends on build):
4. Set NVIDIA Power Management Policy
Add to your cmdline.txt (or bootloader config):
In some cases, firmware-based runtime power management causes timing problems on newer kernels.
5. Enable Persistenced (if supported)
LibreELEC often omits nvidia-persistenced, but if present:
If not present, ignore — this is only effective in systems that use persistent GPU state management.
-
Anyways, this is how it works currently:
[VideoPlayer] Fix and improve subtitle stream selection by CastagnaIT · Pull Request #25813 · xbmc/xbmcDescription i started rework this part, starting from impaired problems and then i improved also other use cases problems fixed: if you set…github.com -
I still haven't found a solution to this problem.
I had opposite problem with subtitles, always wanted to have original audio but specific subtitles language plus ignore forced subtitles if exists - ended up with creating my own little plugin for this

Anyways, if current (updated) settings in Kodi aren't working for you, you can install Language Preference Manager plugin, which has zillion of options so some settings here should fix your problem. -
If you want more changelog info please go look at the full/original commit log on GitHub. We have no plans to bloat page load times and increase webserver load with more commit data that likely few people read.
Yeah, right - we are listing as for now 145 build images (starting from May 2024) and only 20 past commits, no bloating at all, just perfect excuse for someone not getting work done?
Nah, that would be just stupid to keep both in sync (say past 20 builds + 20 commits)

-
-
You can always install EXT4 driver on Windows laptop.
-
Is force mounting going to fix errors from LE?
It won't fix anything, just mount it regardless these errors. The other (maybe better) option is to fix the disk in Windows system and change LE to mount it always as RO (the above url to autostart is good reference for details).
BTW, the option to mount external contents disks as RO could be good extension for LE, but perhaps it happens so rarely that it is not worth the effort. I'm using RPi5 with latest LE12 and SSD disk formatted as NTFS and while I had that "dirty disc" errors in the past (probably around LE10 or LE9), it works now without problems. So this could be also some combination of disc type, NTFS and LE version (driver version).
-
-
Oh sure, just be patient enough and all the problems will magically solve themselves! 😀
With the following nightly LE release I can play above stream without problems:
Code
Display MoreStarting Kodi (22.0-ALPHA1 (21.90.700) Git:db813bfaec3b3bd510e084158fec3ad7be7557a2). Platform: Linux x86 64-bit Using Release Kodi x64 Kodi compiled 2024-10-02 by GCC 14.2.0 for Linux x86 64-bit version 6.11.0 (396032) Running on LibreELEC (community): nightly-20241002-a95d055 13.0, kernel: Linux x86 64-bit version 6.11.0 FFmpeg version/source: 6.0.1 Host CPU: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 8 cores available CAddonMgr::FindAddons: inputstream.adaptive v22.1.4.1 installed CAddonMgr::FindAddons: inputstream.ffmpegdirect v22.0.1.1 installed CAddonMgr::FindAddons: inputstream.rtmp v22.0.0.1 installed CAddonMgr::FindAddons: kodi.binary.instance.inputstream v3.3.0 installed SECTION:LoadDLL(/storage/.kodi/addons/inputstream.adaptive/inputstream.adaptive.so.22.1.5) CAddonMgr::FindAddons: repository.slyguy v0.0.9 installed CAddonMgr::FindAddons: script.module.slyguy v0.85.23 installed CAddonMgr::FindAddons: slyguy.dependencies v0.0.22 installed CAddonMgr::FindAddons: slyguy.disney.plus v0.17.3 installedHowever someone with fresh eye catched up that it originally failed on HEVC stream and now it is openning H264 stream, so perhaps Kodi in this version has different preferences - not sure if H264 stream was available originally or was added later by Disney...