[HOWTO + FAQ] Install community builds on S905/S905D/S905W/S905X/S912 device

  • This post contains information how to install my 7.0 and 8.0 build to a S905/S905D/S905W/S905X/S912 device.

    CAUTION: This HOWTO is written for 7.0 and 8.x community builds by kszaq. If you are using a different build, the information here may not apply, please consult your community builder!

    I strongly recommend running from SD card/USB drive! Installing to internal memory might soft-brick your box and you will have to reinstall Android firmware to make it work again.

    0. Device specific notes


    WeTek Hub and WeTek Play2: you don't need to use toothpick method: update to latest Android version and make use of dual-boot feature!

    Odroid-C2 and LePotato: you do not have to chose a device tree as it is embedded in kernel.img.

    NOTE: If you are upgrading from someone else's build the safest way is to extract partition content from .img.gz image file and copy it to your SD card/eMMC.

    1. Before you install - choose a device tree


    Important: You cannot use device tree from Android firmware as in 99% cases it won't work.

    Please look at release thread for device trees folder link.

    • S905: First look for device tree with your box name in it. In case there is no such image, download generic one.
      • example: for a box with 2GB of RAM and 100Mbit Ethernet, you should download gxbb_p200_2G_100M.dtb
      • example: for boxes with Gigabit Ethernet download gxbb_p200_1Gbit.dtb
      • for boxes with Realtek WiFi download device tree with RealtekWiFi in name
    • S905D: There is a separate folder with device trees for S905D devices. Choose one according to your RAM amount.
    • S905X: You can leave a tree that is already present on SD card (fresh install only) or choose one according to your RAM amount.
      If internal memory of your box is not visible when trying to install to internal memory (i.e. /dev/system does not exist):
      • try a device tree with _nand suffix
      • if that doesn't help, try a device tree with _slowemmc suffix
    • S905W: You should use one of device trees for S905X devices. If you encounter issues when installing to internal memory, see above.
    • S912: You need to choose device tree according to your Ethernet port speed and RAM amount.

    2. Prepare SD card/USB drive


    Note: only 1 USB port is able to boot the box. You have to try them all. Some boxes are unable to boot from USB drive.

    • Look at the beginning of release post and find Downloads link. Download file with img.gz extension.
    • Burn the downloaded file to SD card or USB drive using Rufus. Alternatively you can use LE tool but remember that you have to download the image manually: Installation - LibreELEC
    • After this you will see that drive capacity is 512MB. This is OK as there is a second (hidden) partition on the drive for LE user data!
    • Download a device tree as instructed above and rename it to dtb.img. Copy the renamed file to main folder of SD card/USB drive - replace the one that's already there.
    • To boot the system for the first time you have to use one from the following - sometimes only one way of doing this works!
      • Khadas VIM: insert SD card and boot into Upgrade Mode, LE will start automatically: Howto Boot Into Upgrade Mode - Khadas Docs
      • MINIX U1 / U9: insert SD card, plug in power cord. Then hold in power button for at least 6 seconds or until LE Logo appears.
      • Terminal Emulator: boot to Android, insert SD card/USB drive with LE, install Terminal Emulator app (either from Google Play or APKMirror), run it and type reboot update. Your box should reboot to LE.
      • toothpick method: disconnect the power supply, insert card/drive, push reset button and connect the power while holding the button. Wait until LibreELEC logo appears and release the button.
      • menu button method (works with very few devices): disconnect the power supply, insert card/drive, push menu button on your remote control and connect the power while holding the button. Wait until LibreELEC logo appears and release the button.
      • recovery method: boot into Android, insert card/thumb drive and choose Reboot to recovery. Your box should boot into LibreELEC.
      • recovery method (2nd variant): if you have "Update" app pre-installed open it, insert SD card with LE/connect USB drive, and choose any ZIP file in the app for update. Your box should reboot to LE.
      • recovery method (3rd variant): enable ADB (Google it) and issue adb reboot update command
    How does it work?

    You need to make your box boot once into recovery/update mode to execute aml_autoscript from SD card or USB drive. The script:

    • modifies "normal" boot procedure to make your box look for kernel and dtb on SD card before booting from internal memory
    • switches the box back to "normal" mode

    Your box will now always look for kernel image on SD card/USB drive before booting from internal memory unless you upgrade Android or perform a factory reset.

    Updating


    Update process looks the same for SD, USB drive and internal memory installs:
    Using Samba shares
    or
    Using command line (SSH)

    Note: when upgrading to 8.2.0.1 or later you no longer have to provide a device tree for an update, it will be updated automatically! The only condition is that you have to be using a device tree from 2017-10-28 or later. You can check it by running this command: cat /proc/device-tree/le-dt-id. If this command gives you device tree name, you have all that is needed for an automatic update.

    Boot from SD card, use internal memory for data


    [HOWTO] Boot from SD card, use internal memory for data

    Installing to internal memory (not recommended, risky)


    Run from SD card/USB drive first. If it runs fine, connect to your box over SSH, execute installtointernal command and follow on-screen instructions. This command wipes SYSTEM and DATA partition!

    CAUTION: If your box has a non-standard partition layout, you will see an error when trying to boot from internal memory for the first time. To solve it, you need to boot one more time from SD card and run installtointernal again.


    Back to Android?


    If you installed LE to SD card or USB drive, simply turn off your box, disconnect media with LE and turn on the box.

    If you installed LE to internal memory, you have to find firmware dedicated for your box and follow installation notes.

    To boot into recovery after installing LE to internal memory use this procedure:

    • prepare a clean, FAT32-formatted SD card or USB drive
    • copy recovery.img and dtb.img from your Android firmware to SD card (don't use dtb.img for LE!)
    • use "toothpick" method to boot from SD card/USB drive or execute reboot recovery over SSH
    Why is this needed?

    Each Amlogic kernel release requires the box to use a specific device tree. If you install Android, the device tree is updated to match kernel version. The same device tree is needed by recovery image installed with Android.


    LibreELEC uses a customized Amlogic kernel. In most cases a device tree needed by LibreELEC is a different one than the one required by recovery - one of them will not boot unless you provide an external device tree.

    FAQ


    IR Remote Control, remote.conf

    IR Remote Control, remote.conf

    Q: My remote control does not work, what can I do?

    A: Grab remote.conf file from Android firmware (it's available in /system/etc) and copy it to Configuration folder:

    • over SSH: /storage/.config
    • using Windows Explorer (enter the address in address bar): \\LibreELEC\Configfiles \\your_box_IP\Configfiles

    You can also put that file to main folder of your SD card. You may need to remap some buttons.


    If you want to create the configuration file yourself, you can follow this thread: Create remote.conf from scratch

    If you are looking for some pre-made configuration files, please look into this thread: remote.conf repository

    Q: My LibreELEC Settings screen is empty, hoc can I fix it?
    A: Login over SSH, execute rm /storage/.kodi/userdata/addon_data/service.libreelec.settings/oe_settings.xml and reboot.

    Q: A few seconds are missing at the beginning of the video.
    A: Enable Expert settings, go to Settings > Video > Playback and set "Pause during refresh rate change" to the amount that is missing.

    Q: CEC behaviour is erratic when my box is off.
    A: This is a bootloader issue that needs to be fixed by box manufacturer.

    Q: I cannot turn on my box by remote control.
    A: This is a bootloader issue that needs to be fixed by box manufacturer.

    Q: I cannot select HDMI nor Analog audio output, only Bluetooth is available.
    A: Make sure that you have used device tree that is recommended for the build.

    Q: How do I select SPDIF output? Only Analog and HDMI are available.

    A: In Amlogic world you can select any audio output in Kodi settings and it will be played over all outputs. SPDIF will work even if you select Analog (PCM) or HDMI. One exception is multichannel PCM audio: it can be played only via HDMI. Again, you don't need to specifically select it in Kodi settings.