Posts by patrickkfkan

    Hi everyone,

    If anyone of you has read my previous posts, you would know that running LibreELEC on mainline 5.3 kernel has not been flawless for the NanoPi K2. There are things I can work around or cope with such as missing WIFI or Bluetooth, but I haven't been able to solve the issue with playing Widevine content (e.g. Netflix).

    So, after checking around / asking in the forums and not finding a solution, I have compiled a working version of LE for the NanoPi K2. It is not based on the latest version by any means. Specifically:

    - LE version is 9.0.2 (Kodi 18.2)

    - u-boot is v2015.01

    - kernel is 3.14

    Despite not being the latest in everything, it works out rather well. The following has been tested:

    - Playing 1080p content with hardware decoding (I haven't tested 4K content because I only have FHD screens :-/)

    - WiFi but note that I haven't been able to stream 1080p without buffering every few seconds. It could be a problem with the driver or the chipset - I don't know. I just used a USB WiFi dongle to work around this.

    - Ethernet

    - Bluetooth

    - HDMI-CEC

    - Playing Widevine content (Netflix is 720p software-decoded of course due to its licensing policy)!


    You can download the image here and write it to MicroSD card with LibreELEC USB-SD creator. I have not tested writing to eMMC but I'm quite certain it will not boot from eMMC with the current u-boot script.

    Sources can be found here (9.0.2-nanopi-k2 branch).

    To compile from source:

    Code
    > git clone https://github.com/patrickkfkan/LibreELEC.tv.git
    > cd LibreELEC.tv
    > git checkout 9.0.2-nanopi-k2
    > PROJECT=Amlogic DEVICE=NanoPi_K2 ARCH=arm make image

    Thanks all!

    Thanks. Unfortunately, I'm quite busy these two days. Will test when I get the chance and show you the UART console output.

    Hi balbes150,

    I was about to try the two u-boot bin files you asked me to download when I notice you had them removed. Sorry I was busy with other things so I haven't had the time to try.

    On the other hand, I'm pretty sure that the file u-boot.bin.sd.bin works instead of the other one (u-boot.bin). I once compiled LE from master branch and manually wrote this file to the SD card for it to boot. Also, I would note that in projects/Amlogic/bootloader/mkimage, you have this:

    Code
    dd if="$INSTALL/usr/share/bootloader/u-boot.bin.sd.bin" of="$DISK" conv=fsync,notrunc bs=1 count=444 >"$SAVE_ERROR" 2>&1 || show_error
      dd if="$INSTALL/usr/share/bootloader/u-boot.bin.sd.bin" of="$DISK" conv=fsync,notrunc bs=512 skip=1 seek=1 >"$SAVE_ERROR" 2>&1 || show_error

    For NanoPi K2, the first dd is unnecessary. You only need this:

    Code
    dd if="$INSTALL/usr/share/bootloader/u-boot.bin.sd.bin" of="$DISK" conv=fsync,notrunc bs=512 seek=1 >"$SAVE_ERROR" 2>&1 || show_error

    This should be enough to get the device booting into LE.

    I'd be happy to test the images you release for the NanoPi K2 as long as I have time. On the other hand, because of the other still-unresolved issue I have with playing widevine content, I cannot use these versions of LE with mainline 5.3 kernel on a daily basis, so my tests may not be thorough. Right now, I have compiled an older version of LE 9.0.2 running on outdated 3.14 kernel and everything works well enough for me (including widevine content). I'll post that in another thread shortly.

    Thanks :)

    jdpc  patrickkfkan can you provide output of following commands during playback of video with 48kHz audio?

    Code
    cat /sys/kernel/debug/clk/clk_summary
    cat /sys/kernel/debug/regmap/1c22800.i2s/registers

    I would still like to resolve this issue, if possible.

    My apologies for the late reply. Anyway here's the output I got from running the above commands during playback of a video with 48Khz audio:

    Note that I have limited audio resampling to 44.1Khz but, unlike jdpc, I still get broken HDMI audio. If I choose other sampling rates (e.g. 48Khz) or set output configuration to "Optimized", then there is no audio at all. If I choose "ALSA: H3 Audio Codec, Analog" as output device and connect a pair of speakers to the headphone jack on the board, audio plays smoothly (no stuttering).

    Hope this helps. Thanks.

    jdpc  patrickkfkan Another update to test: libreelec-h3.arm-9.80-devel-20190917173122-d52e8dc.tar If this still doesn't work, I'll have to write that script.

    Thanks for sharing! I'll test this after a couple of days when I have more time, and report back.

    No, it doesn't work for everyone, that's why I'm asking. Anyway, I tried to reproduce this issue on my TV, but it worked every time. If nothing would help, I'll write a script which will dump HW settings and you'll run it on LibreELEC and OpenELEC. Comparison of those two dumps should give clue what's different and why it doesn't work. But before that, there are still some settings to be updated.

    Thanks, much appreciated!

    Hi all,

    When trying to play DRM protected content, LibreELEC segfaults and restarts.

    - Device: NanoPi K2 (S905 SOC, Mali-450 GPU)

    - LE version: devel-20190915174406-76b3023 (master branch)

    - Command used for compiling: PROJECT=Amlogic ARCH=arm DEVICE=AMLGX UBOOT_SYSTEM=nanopi-k2 make image

    - Kernel version: mainline 5.3.0-rc8 (aarch64)

    - OpenGL vendor: Lima

    - Userspace: 32-bit (Python platform.machine() reports armv7l)

    - Inputstream Adaptive version: 2.4.2

    Tested with:

    - Netflix add-on

    - Video Test Streams add-on

    In both tests, playing video with WideVine will cause segmentation fault :cry:.

    I hope someone can shed some light as to why this is happening...If further tests are required, please let me know what I should do. Better still, if someone has this or a similar device (any Odroid C2 users here?), please test if the same problem also happens with LibreELEC running on mainline kernel, so I know this is not specific to my device. Thanks.

    Full log: kodi_crash.log

    Last lines in log:

    Code
    2019-09-15 17:19:46.036 T:3788288880   DEBUG: AddOnLog: InputStream Adaptive: Entering encryption section
    2019-09-15 17:19:46.191 T:3788288880   DEBUG: AddOnLog: InputStream Adaptive: CDM version: 4.10.1440.18

    Segfault appears here:

    Hi,

    Just tested the LibreELEC-H3.arm-9.80-nightly-20190916-d799b5a-orangepi image on my OrangePi PC and got the same HDMI audio problem as jdpc above. It doesn't make a difference whether I'm playing Youtube or just audio files. On the other hand, audio out through the analog jack of the device works fine.

    Thanks jernej

    Hi all,

    I've compiled LibreELEC for my NanoPi K2 by FriendlyArm:

    - Version: devel-20190915174406-76b3023 (master branch)

    - Command used for compiling: PROJECT=Amlogic ARCH=arm DEVICE=AMLGX UBOOT_SYSTEM=nanopi-k2 make image

    Image was created and burnt to SD card.

    PROBLEM 1: SD card did not boot

    - On powering on NanoPi K2, UART messages indicated bootloader failure (looping "BL1" messages).

    - Solution is to write the compiled bootloader manually to the SD card, as follows:

    Code
    sudo dd if=build.LibreELEC-AMLGX.arm-9.80-devel/u-boot-2019.07/fip/u-boot.bin.sd.bin of=/dev/sdX conv=fsync,notrunc bs=512 seek=1

    * Replace sdX with SD card reader device location.

    - After manually writing the bootloader, LibreELEC will start up successfully.

    - Apparently, u-boot was compiled successfully but did not get written to the image or was written wrongly. I believe this can be easily addressed in the bootloader installation script?

    PROBLEM 2: WiFi and Bluetooth firmware failed to load

    - LibreELEC failed to show WIFI connections nor detect Bluetooth on the NanoPi K2.

    - The chipset for WIFI and Bluetooth is AP6212 (brcmfmac43430a0)

    - dmesg | grep brcm shows the following line:

    Code
    [ 4582.214555] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430a0-sdio for chip BCM43430/0
    [ 4582.214818] brcmfmac mmc0:0001:1: Direct firmware load for brcm/brcmfmac43430a0-sdio.bin failed with error -2

    - Solution (WIFI): The file brcmfmac43430a0-sdio.bin is missing in lib/firmware/brcm, so pull the relevant files from Armbian firmware and place them in LibreELEC's "additional firmware" directory:

    Code
    LibreELEC:/ # cd /storage/.config/
    LibreELEC:~/.config # mkdir -p firmware/brcm
    LibreELEC:~/.config # cd firmware/brcm
    LibreELEC:~/.config/firmware/brcm # wget https://github.com/armbian/firmware/raw/master/brcm/brcmfmac43430a0-sdio.bin
    LibreELEC:~/.config/firmware/brcm # wget https://github.com/armbian/firmware/raw/master/brcm/brcmfmac43430a0-sdio.txt -O brcmfmac43430a0-sdio.friendlyarm,nanopi-k2.txt

    - After doing the above, reboot and WiFi will work.

    - Bluetooth still doesn't work - maybe it's disabled in NanoPi K2's dtb?

    - Ideally, we should have these files present in the build itself. I note they are missing from LibreELEC/brcmfmac_sdio-firmware (where the firmware files are obtained during compilation).

    I have another issue with playing DRM content (e.g. Netflix). I've mentioned this in balbes150 's thread but I should probably post it under Bug Reports. As I'm not sure if it relates only to the NanoPi K2 or devices with Mali-450 GPUs in general (nobody has verified so far), I shall post a separate report.

    Thank you all for your contributions!

    New look with KODI-19. Please note, this is the first trial version and many things may not work.


    To check the reasons I don't post the image for nanopi-k2. Can you specify the exact version of the image (full name) that runs from the SD card ?

    I checked on the Beelink GT1 mini. Everything works, including WiFi. Follow the instructions exactly.

    Hello balbes150 ,

    The last version that boots is LibreELEC-AMLGX.arm-9.80-devel-20190821172816-07b919f-nanopi-k2.img.gz.

    I've looked at your Github and it appears that the extra steps required to get u-boot working on the NanoPi K2 is missing in the latest builds. Copied from the u-boot readme for this boot, these steps are:

    These lines do show up in your Amlogic-Leia-4.x branch (in http://LibreELEC.tv/projects/Amlogic/bootloader/mkimage), but do not appear to have been merged into the latest builds. That's probably why the images are no longer booting? FYI, I compiled u-boot from the above instructions and burn it to the SD card that already has your image and it boots fine again.

    While you're at it, could you please test if playing DRM content works on your builds (any device and not just the NanoPi K2)? As mentioned in my earlier post, so far I've had no success and I'm not sure if it's your images that's not working, or it's the InputStream Adaptive add-on / libwidevine that's not compatible.. You can test with the Video Test Streams Add-on by Matt Huisman (choose "Input Stream Adaptive - Dash with Widevine").

    Thank you for your hard work!

    Sorry, I misunderstood. Yes, Kodi will restart (here was my mistake, reading reboot means for me rebooting LibreELEC).

    Thanks for the confirmation. I'm not a developer myself so I don't know if it's a bug in balbes150 test builds, InputStream.Adaptive, Widevine or something entirely different...might have to rely on others to find out, but I'll certainly help with testing or providing debug information where possible.


    Since you have this board, could you verify #5 as well? If you have a Netflix account you can also test (and most likely get the same results) with the Netflix Add-On. Thanks!

    Since I don't have a Netflix account i tried it with Amazon prime. I can confirm that Kodi crashes. Kodi Crash Log is available, but maybe you will find this useful (from Kodi.old.log):

    2019-09-07 06:51:46.618 T:4045398896 NOTICE: Creating InputStream

    2019-09-07 06:51:46.691 T:4045398896 ERROR: GetDirectory - Error getting /usr/lib/kodi/addons/inputstream.adaptive/

    Thanks for your response.

    When you say Kodi crashes, does it simply show an error message or does it reboot? In my case, it reboots and my Kodi crash log also has those lines you quoted but goes further than that:

    The last line seems to indicate that Widevine has loaded and then crashes (reboots). Same line appears when trying to play a video in Netflix Add-On. I wonder if the same thing happens with devices other than the NanoPi K2 - can anyone verify?

    Thanks.

    Hello,

    Thanks for the awesome work balbes150 ! I have been trying to get LE 9 working on my NanoPi K2 and your test builds are promising :)

    I can confirm that Nanopi-K2 20190902 image won't boot. Seems like the last version that will boot is 20190821 as reported by slartibartfazz . Got the 20190902 image working by writing the previous 20190821 image to SD, then replacing the SYSTEM and KERNEL (including their MD5) files with those provided by the newer image.

    Further, I would like to note the following with the current test image:

    1. Ethernet works

    2. Video plays with Hardware Decoding -- Nice!

    3. Built-in WIFI still not working. I got around this by using a WIFI USB dongle (the one I used is a TP-Link TL-WN823N)

    4. Built-in Bluetooth not working.

    5. Playing DRM protected content causes a reboot

    #5 can be tested by installing the Video Test Streams Add-on by Matt Huisman. Choosing "Input Stream Adaptive - Dash with Widevine" will trigger a reboot, while choosing the other video stream options will not. Here's the Kodi Crash Log.

    slartibartfazz Since you have this board, could you verify #5 as well? If you have a Netflix account you can also test (and most likely get the same results) with the Netflix Add-On. Thanks!

    Best regards,

    Patrick