Posts by offbeat

    Also, did some quick unscientific power usage checks on Beelink GS1, tested consumption at 230V wall socket using Voltcraft Energy Logger 4000.

    1) ~0.0W in shutdown state (with Crust running on co-processor).

    2) ~0.0W in suspended state (with Crust running, yey).

    3) 2.4W running, idle on Kodi homescreen. Kodi IS wasting too much CPU in idle mode though, shouldn't be more than a single digit percent of a low frequency state CPU core, not ~35-40% like at the moment.

    4) 2.7W playing 1080p60 H264 video from the SD card.

    5) 5.3W playing video + 100% load on all quad cores using 'openssl speed'

    I'd say, as soon as GPU driver and suspend/resume process is stable enough for a particular Alwinner board, default remote power button could be remapped from poweroff to suspend. That would result so much smoother and pleasant user experience, since suspend/resume is almost instant and power usage is insignificant as well.

    Preferred way to check CEC on mainline Linux is to stop Kodi (systemctl stop kodi) and run cec-ctl --playback -S.

    Tested Beelink GS1 CEC with a capable TV, command line scan and power on / standby are working just fine.

    Kodi CEC plugin integration isn't yet stable though:

    1) Bootup always brings up TV, shutdown mostly puts TV to standby, but sometimes Kodi crashes on shutdown and fails to send standby CEC command to TV. Didn't have time to check crash logs yet, only saw gdb core process before shutdown in htop.

    2) When it comes to suspend, there is like 50%/50% chance to standby TV as well. Perhaps suspend is too fast and doesn't wait for the result of CEC command?

    Here is another test image: LibreELEC-H6.arm-10.0-devel-20210330172558-ba292b4-beelink-gs1-pm-and-int-32k-osc.img.gz (burn it, don't update). At least RTC should be quiet now and maybe CEC and suspend/resume will work too. Let me know.

    1) RTC is fixed, time is saved between warm startups/reboots, nice!

    Code
    # cold 
    Feb 02 15:29:47 LibreELEC kernel: sun6i-rtc 7000000.rtc: registered as rtc0
    Feb 02 15:29:47 LibreELEC kernel: sun6i-rtc 7000000.rtc: setting system clock to 1970-01-01T00:00:03 UTC (3)
    Feb 02 15:29:47 LibreELEC kernel: sun6i-rtc 7000000.rtc: RTC enabled
    
    # warm
    Mar 30 17:20:41 LibreELEC kernel: sun6i-rtc 7000000.rtc: registered as rtc0
    Mar 30 17:20:41 LibreELEC kernel: sun6i-rtc 7000000.rtc: setting system clock to 2021-03-30T17:20:37 UTC (1617124837)
    Mar 30 17:20:41 LibreELEC kernel: sun6i-rtc 7000000.rtc: RTC enabled

    2) No more CEC errors in dmesg and cec-client. I will test ir further later, no access to capable TV at the moment.

    3) Suspend/resume and poweroff/poweron worked perfectly while connected to TV. In headless mode though suspend rarely works, mostly fails due to GPU driver error, resulting either instant wakeup, or suspend/crash/smthelse without ability to wake using remote.
    Headless poweroff/poweron using remote worked 100% during my tests

    Code
    Mar 30 17:12:22 LibreELEC kernel: OOM killer disabled.
    Mar 30 17:12:22 LibreELEC kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    Mar 30 17:12:22 LibreELEC kernel: printk: Suspending console(s) (use no_console_suspend to debug)
    Mar 30 17:12:22 LibreELEC kernel: PM: dpm_run_callback(): platform_pm_suspend+0x0/0x70 returns -16
    Mar 30 17:12:22 LibreELEC kernel: PM: Device 1800000.gpu failed to suspend: error -16
    Mar 30 17:12:22 LibreELEC kernel: PM: Some devices failed to suspend, or early wake event detected
    Mar 30 17:12:22 LibreELEC kernel: OOM killer enabled.
    Mar 30 17:12:22 LibreELEC kernel: Restarting tasks ... done.

    Thank you!

    Regarding RTC - it would be helpful, if you could read address 0x07000004 from Android.

    Here goes, Beelink GS1 last stock Android, firmware 106N0, kernel 3.10.65

    Code
    # busybox devmem 0x07000004
    0x00000004
    # echo "0x07000004,0x07000008" > /sys/class/sunxi_dump/dump
    # cat /sys/class/sunxi_dump/dump
    0x0000000007000000:            0x00000004 0x0000000f

    I see you had some relevant discussions when merging RTC support for H6. Re: [linux-sunxi] [PATCH v2 0/3] Add basic support for RTC on Allwinner H6 SoC - Jernej Škrabec

    Also, other user had this problem on GS1 Beelink GS1 Allwinner H6 - General Chat - Armbian forum

    So even if it is a hardware problem, whole batch has it then.

    Please test this image: LibreELEC-H6.arm-10.0-devel-20210328122614-ba292b4-beelink-gs1-pm-test.img.gz Note that you should not try to update but burn it freshly. Most types of update don't update bootloader which is responsible for loading suspend/resume firmware (this firmware is embedded in bootloader).

    Burned test image to SD card, booted, burned to eMMC. Had a rather limited access to TV during this weekend, so enabled SSH and tested using shell and remote.
    1) Cold boot via power toggle and issuing 'systemctl suspend' = box reboots in a few seconds. Subsequent 'systemctl suspend' seems to suspend the box, remote power button doesn't wake it up.

    2) Cold boot and 'systemctl poweroff' (or remote power button) = box reboots in a few seconds. Subsequent 'systemctl poweroff' (or remote power button) shutdowns the box, remote power button doesn't wake it up.

    BTW, poweroff take quite some time, ~15-20 seconds on cold boot, all the shutdown jobs run instantly and then its sitting there, waiting for something.. Wonder if its related to sun6i-rtc/cec-dw_hdmi oscillator problems. Here is a journalctl log captured on poweroff:

    Strange. I don't have this box but other developers do. Nobody reported such issues. This would suggest that external 32 kHz oscillator is missing. I'm pretty sure at least some GS1 boxes have it. Can you open your box and make high quality image (so all markings are readable and all components distinguishable)? It's possible that this is another revision and they changed few things.

    Here is a photo of my PCB, revision 2.0 Imgur: The magic of the Internet

    Almost the same as the one published in Beelink GS1 - linux-sunxi.org , although some chips are diferent.

    Sadly Beelink GS1 is the only H6 board without proper suspend/resume support. One of our developers couldn't make it work.

    I understand GitHub - crust-firmware/crust: SCP firmware for sunxi SoCs is used to suspend/resume main CPU. Should I open bugreport there, or can I help in any other way?

    Installed LibreELEC-H6.arm-10.0-nightly-20210326-9345935-beelink-gs1, on eMMC

    There are some issues with RTC, getting spam in dmesg.

    HDMI-CEC seems to be failing, more spam in dmesg:

    Doesn't wake up after suspend, using stock IR remote power button

    Code
    Mar 26 19:42:49 beelink-gs1 systemd[1]: Starting LIRC sleep hook...
    Mar 26 19:42:49 beelink-gs1 kernel: sun6i-rtc 7000000.rtc: rtc is still busy.
    Mar 26 19:42:49 beelink-gs1 kodi-send[830]: Sending: {'type': 'action', 'content': 'LIRC.Stop'}
    Mar 26 19:42:49 beelink-gs1 systemd[1]: Finished LIRC sleep hook.
    Mar 26 19:42:49 beelink-gs1 systemd[1]: Reached target Sleep.
    Mar 26 19:42:49 beelink-gs1 systemd[1]: Starting Suspend...
    Mar 26 19:42:49 beelink-gs1 Boot[839]: ### running sleep script 10-addon-sleep.sh (pre)... ###

    Theoretical question, is it possible to manually build latest LE master with a stable Kodi 18?

    Kodi 19 is a no-go at the moment, and will be for quite some time, because of migration to python3 and addons lagging behind, yada yada.
    But I pretty much need latest LE master for my Allwinner H6 hardware.

    Tried latest LibreELEC-H6.arm-9.80-nightly-20191108-27a5673-beelink-gs1, device is booting just fine, resolution/hdmi audio/network seems to be OK.

    Didn't test any further due to inability to access LibreELEC settings, addon crashes with error.

    Copy/paste from kodi.log, not sure if its the relevant part, but here goes:

    Code
    2019-11-09 21:14:21.960 T:2990   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
    Error Type: <class 'SyntaxError'>
    Error Contents: invalid syntax (service.py, line 33)
    File "/usr/share/kodi/addons/service.libreelec.settings/service.py", line 33
    except Exception, e:
    ^
    SyntaxError: invalid syntax
    -->End of Python script error report<--
    Code
    2019-11-09 21:41:36.617 T:3195   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
    Error Type: <class 'SyntaxError'>
    Error Contents: invalid syntax (default.py, line 20)
    File "/usr/share/kodi/addons/service.libreelec.settings/default.py", line 20
    except Exception, e:
    ^
    SyntaxError: invalid syntax
    -->End of Python script error report<--