yashsingh1/xdaforums huggingface dataset:
[Galaxy Tab S2 Q&A, Help & Troubleshooting] retiredtab:
As I wrote, I'm using Lubuntu 22.04.3, but I started with Lubuntu 22.04.1 and upgraded throughout. So when I do

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

$ uname -r
5.15.0-87-generic

I'm on the 5.15 kernel. I didn't even know that Ubuntu switched to the 6.2 kernel in Ubuntu 22.04.3.

If you're still getting that CANNOT LINK error, you must use 0.9 version of patchelf as per metterschling's script at

https://github.com/metterschlg/los-devel-scripts/blob/main/blob-patching/patch_libsec-ril.sh

When I first used the provided patchelf from Lubuntu, it was 0.10 and I didn't know it at the time, but it seems that only 0.9 works properly for Android. I haven't tried 0.18 and always stayed with 0.9.

The most likely reason RIL doesn't work is that you're using the repo

https://github.com/universal5433/android_device_samsung_gts210ltexx

as is and not forking/building your own with this very important, but subtle, commit. It took weeks of troubleshooting before we found the problem.

https://github.com/metterschlg/andr...mmit/fcb0817c352e7aa4ebd07cfc6d0b1c73c7dc33ad

Here's what I wrote in a PM on May 27, 2022

=== start PM ===

In this commit, there's 2 NON OBVIOUS errors

https://github.com/universal5433/android_device_samsung_gts28ltexx/blob/lineage-18.1/BoardConfig.mk

While the above is syntax correct, it's semantically incorrect.

First,

DEVICE_MANIFEST_FILE := $(LOCAL_PATH)/manifest.xml

needs to "+" because

DEVICE_MANIFEST_FILE += $(LOCAL_PATH)/manifest.xml

With the "+" sign, you can see in the generated manifest.xml file, that both the device tree variant and the main gts2-common manifest.xml are included at

$ cat ./system/vendor/etc/vintf/manifest.xml | more
<!--
Input:
manifest.xml
manifest.xml
-->

Otherwise as metterschling found out, the device tree manifest.xml gets overwritten by the gts2-common one.

The other non obvious error is that

DEVICE_MANIFEST_FILE += $(LOCAL_PATH)/manifest.xml

needs to go AFTER line 23

include device/samsung/gts2-common/BoardConfigCommon.mk

because

https://github.com/universal5433/an...n/blob/lineage-18.1/BoardConfigCommon.mk#L146

line 146 has the definition

DEVICE_MANIFEST_FILE := $(LOCAL_PATH)/manifest.xml

The := is defined here first in BoardConfigCommon. Then the device gts28ltexx that has += is appended or added on to the existing manifest.xml file.

So with the += and moving that line AFTER line 23, you should be able to maintain the LTE code to the device specific tree and not in

gts2-common.

=== end PM ===

I did a screenshot of meld with 18.1 gts28ltexx and gts210ltexx. As you can see, it's documented right inside the code.

So that's 2 bugs why RIL never worked in earlier versions. The binary was not correctly patchelf with the correct version (i.e. use 0.9) and the manifest.xml file was not generated properly due to the := vs +=
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
With the point releases, Ubuntu 22.04 now uses a rolling release model for the kernel: https://ubuntu.com/about/release-cycle#ubuntu-kernel-release-cycle

With the so-called HWE kernel refreshes, Ubuntu provided a means to change back to the previous kernel series. I hope that is still available with the rolling kernel release model.

I'd rather use a down level (but still fully maintained as in security patches) kernel than using the prior Ubuntu release, but if it works, you're good to go.

You nailed it, the upstream (universal5433) 18.1 device trees are proven to have broken RIL, see ripees builds.

@MrBrause As I mentioned in my PM, a better starting point would have been using bluess57 device tree as base for your own gts210ltexx fork and compare it to my recent gts28ltexx commits for 18.1. Alternatively you can port my gts28ltexx RIL fixes to your own gts210ltexx device tree forked from upstream universal5433.

Thank you so much for your detailed explanations @retiredtab.

Using patchelf 0.9 is imperative, no other release will lead to a properly patched libsec-ril.so. I documented my attempts in code here.

Additionally, our kernel @MrBrause is using is configured for SELinux enforcing, thus you need the appropriate policies to get RIL working - I had to spend weeks to capture all of them. You'll find them here.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
@MrBrause your radio.txt log shows the RILD modem came online and started

10-24 13:20:17.573 3683 3749 E RILD : Modem is in ONLINE state
10-24 13:20:17.573 3683 3749 E RILD :
10-24 13:20:17.573 3683 3749 E RILD :
10-24 13:20:17.573 3683 3749 E RILD : create Thread.
10-24 13:20:17.573 3683 3749 E RILD : Modem is started now.

Is your SIM ok / fully inserted / does it work on stock ROM ?

10-24 13:20:19.780 4305 4305 D SST : [0] EVENT_ICC_CHANGED: SIM absent

10-24 13:20:19.783 4305 4305 D SST : [0] updateSpnDisplay: radio is on but out of service, set plmn='Dienst nicht verfügbar'
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
You won't get ril working with ripee's lineage 18.1 tree try the commits @metterschling made in his T715 tree as they're similar devices with different screen sizes
[Galaxy Tab S2 Q&A, Help & Troubleshooting] MrBrause:
Thanks for analyzing. Yes it was working on stock rom.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] MrBrause:
Thank you for the additional information according the manifests.

The patchelf 0.18.0 does not lead to the LINKER-error. It patches correctly.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] MrBrause:
Thank you, also for your detailed steps documented in Github.

I was pretty sure that the code on universal5433-repos was broken.

The reason I used this repo in the first place was, that I wanted to solve my issue with the black screen before starting to work on the RIL-problem. I am confident that I will get this done with the good explanations here in this thread. THX
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
@MrBrause I built 18.1 last night for gts210ltexx in engineering mode using local manifest below, didn't have any black screen issues...

I did have black screen and gralloc issues when I was trying to build it when the source tree was combined with another device (exynos5420). Making a completely separate build tree folder for gts210ltexx fixed that problem.

Also AFAIK , the RIL in my build works correctly. I'm just re-building in user-debug mode and testing some more.

I can share a built ROM if you want to use/test.

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="LineageOS/android_device_samsung_slsi_sepolicy" path="device/samsung_slsi/sepolicy" remote="github" revision="lineage-18.1" />
<project name="LineageOS/android_hardware_samsung" path="hardware/samsung" remote="github" revision="lineage-18.1" />
<project name="LineageOS/android_hardware_samsung_slsi_exynos" path="hardware/samsung_slsi/exynos" remote="github" revision="lineage-18.1" />
<project name="LineageOS/android_hardware_samsung_slsi_exynos5" path="hardware/samsung_slsi/exynos5" remote="github" revision="lineage-18.1" />
<project name="LineageOS/android_hardware_samsung_slsi_openmax" path="hardware/samsung_slsi/openmax" remote="github" revision="lineage-18.1" />
<project name="bluess57/android_device_samsung_gts210ltexx" path="device/samsung/gts210ltexx" remote="github" revision="lineage-18.1" />
<project name="bluess57/android_device_samsung_gts2-common" path="device/samsung/gts2-common" remote="github" revision="lineage-18.1" />
<project name="bluess57/android_kernel_samsung_universal5433" path="kernel/samsung/universal5433" remote="github" revision="lineage-18.1" />
<project name="bluess57/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="lineage-18.1" />
<project name="retiredtab/android_hardware_samsung_slsi_exynos5433" path="hardware/samsung_slsi/exynos5433" remote="github" revision="lineage-18.1" />
</manifest>
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
I also got that gralloc error
[Galaxy Tab S2 Q&A, Help & Troubleshooting] MrBrause:
Hey there, I was finally able to build correctly for gts210ltexx with working RIL :)

@metterschling: Your gts28-repo did a great job! There were only a few and some funny modifications to do - like a rotated screen with a non rotated touchscreen.

The issue I had with the black screen at the beginning where resolved or simply did not happen by using Ubuntu 20.04 instead of 22.04 for the build process, maybe because of the kernel version.

An interesting fact was also that if I reinstall Lineage a second time without wiping, the issue with the black screen turned into a looping lineage boot-animation.

As @retiredtab said right at the beginning, I would also write a thread how I get there.

I have one final question: The Trust-agent in LOS stated that SElinux is disabled. Is this just a wrong displayed information or has it something to do with the fact that the build is an unofficial build? As @metterschling said the kernel is compiled as enforcing.

Depending on the answer I would build it again as SElinux-enforcing.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
Excellent, well done!

The kernel configuration is device-specific. As my tree hasn't touched the gts210ltexx config file, you need to port these commits over there. Start with the "Enable SELinux Enforcing" one - that does the trick!
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
Congratulations!! you have got a working ril build of gts210ltexx unlike me still working on android 13.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] MrBrause:
Great, I will check that ou.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
Btw. I just booted up my android development system and just recognize that I'm using the following kernel:

$ uname -a
Linux tp 6.2.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Both los18.1 and los20 T715 ROMs build perfect on Ubuntu 22.04.3 using this kernel.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] MrBrause:
Thanks for the info. Maybe I will try it again building from scratch as the time of writing the new thread for the T815.

Btw. Your commits worked and I run with SElinux enforcing. Atm I receive some Avc: denied messages from netd (concerning wlan and mtu) and vold (concerning mmcblk0p22) and I have problems with accessing the sdcard over USB. I think that these messages are directly linked. I've added some policies and rebuild as the time of writing this. Also found these issues in here: https://xdaforums.com/t/rom-unoffic...t810-t815-t815y.3879302/page-95#post-85533725
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
The appropriate policies (non-RIL-device-specific) should be have been covered either in gts2-common or in android_device_samsung_slsi_sepolicy.

If that is not the case, you can add them yourself. There are good guidelines here and here.

The core commands the find the appropriate policies are

adb root
adb pull /sys/fs/selinux/policy
adb logcat | grep "avc:" | audit2allow -p policy

Please review manually (automated policy generation might reveal structural problems with the device filesystem labeling for example) and also have a look at the predefined SEPolicy macros.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] retiredtab:
Since metterschling says 6.x kernel works building 18.1 and 20, perhaps the error message is because you're running older processor? See

https://www.reddit.com/r/LineageOS/comments/geh78r

"

to get rid of "ERROR: Dex2oat failed to compile a boot image. It is likely that the boot classpath is inconsistent. Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS=--runtime-arg -verbose: verifier to see verification errors."

as found in

https://www.reddit.com/r/LineageOS/comments/9q26j9
60/ pointing to https://review.lineageos.org/c/LineageOS/android_art/+/242869

export CPU_SSE42=false

"

Also, there's this 19.1 commit

https://github.com/LineageOS/android_art/commit/f60525793a1fd784ce7de82f18e7ad9de242c431

Once Lubuntu 24.04 is released in late April 2024, I plan to move to that build environment.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] MrBrause:
Yes, I've tried that also but in differenet places, sadly with no success.

Tested in here:

~/android/lineage/art/build$ vi art.go
// if !ctx.Config().IsEnvFalse("CPU_SSE42") {
// cflags = append(cflags, "-msse4.2")
// cflags = append(cflags, "-mpopcnt")
// }

And here:

device/samsung/gts2-common/BoardConfigCommon.mk
# Dexpreopt
#ifeq ($(HOST_OS),linux)
# ifneq ($(TARGET_BUILD_VARIANT),eng)
# WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= false
# WITH_DEXPREOPT := true
# endif
#endif
WITH_DEXPREOPT := false

Maybe your runtime-args and export-commmand do work.

I am building on an i9-10980HK :)
[Galaxy Tab S2 Q&A, Help & Troubleshooting] MrBrause:
Hi there, THANKS to all of you for your support.

I completed my first built. What a journey!

I posted a new thread on the completed release.

Btw. I am pretty sure that the Dex2oat-errors can be safely ignored. I've read that they are only visible in this LOS-release.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
For anyone interested...

I just did a kernel minor version update to 3.10.12 from upstream linux sources , it booted without issue.

see https://lwn.net/Articles/565304/ for 3.10.10 changes

https://lwn.net/Articles/566063/ 3.10.11 changes

https://lwn.net/Articles/566915/ 3.10.12 changes

I might progress with some more minor version updates.

gts210ltexx:/ # uname -a
Linux localhost 3.10.12+ #14 SMP PREEMPT Sun Nov 5 14:16:16 AEDT 2023 armv7l

GitHub - bluess57/android_kernel_samsung_universal5433: Exynos5433 Kernel for Note 4 / Tab S2 Series | Lineage-OS

Exynos5433 Kernel for Note 4 / Tab S2 Series | Lineage-OS - bluess57/android_kernel_samsung_universal5433

github.com
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
BTW the goal will be to progress the kernel updates all the way to 3.10.y
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
Hello @bluess57 I tried using your kernel yesterday in my build but it was no success for me.I think it happened because I tried a early build or some issues in my build environment .Maybe you could assist me in this matter. As you've written that it is bootable.

Regards.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
What was the issue?

It didn't compile? Or didn't boot?

I'll run a clean build tonight and see what happens
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
There were some issues with the compiler. https://nekobin.com/negijixoci I will build it again today and see what is the result.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
Anoyone following along , kernel patched now to Linux 3.10.15

@eduyl Are you still experience compiler issues ? The nekobin link you posted above, is empty.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
The issue was resolved by using lineage 18.1 repo . I think the kernel doesn't work on lineage 20.

I am sycing the 18.1 trees again rn to see any improvements.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
Ok I'm building lineage 18 only... you are on your own with LOS20

For LOS20 , need to see last kernel messages...

i.e. attempt boot and wait till it loops at lineageOS (or "breaks")

restart into TWRP , get contents of /proc/last_kmsg or the /sys/fs/pstore
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
im building 18.1 rn .
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
I'm almost done with the build. let me se if it boots .
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
What was the result?
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
It works. Trying to get it working on a13 anyways here is the error i had earlier on lineage 20 https://nekobin.com/katisayeza
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
Keep an eye on the updates I'm pushing

Got to version 3.10.18 yesterday
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
Something with the build system ... the linker not being found for some reason

clang-14: error: unable to execute command: Executable "ld" doesn't exist!
[Galaxy Tab S2 Q&A, Help & Troubleshooting] eduyl:
yes the issue is with newer clang versions also is there any method to compile exynos5433 kernel with clang?

Also Yes i am building regularly testing new updates so good so far.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
kernel 3.10.22 cherry picks cause kernel panic at boot.

This is going to be a blockage till I can figure out what the issue is.

Looks like 3.10.21 cherry picks had kernel panic as well...
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
So it seems kernel 3.10.21 cherry picks

wants to change ptrace.c , and it would seem there is a null reference caused by __task_cred(task)->user_ns

This is the cherry pick diff

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 557b46661eb2..eb178732117d 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -278,7 +278,8 @@ ok:
if (task->mm)
dumpable = get_dumpable(task->mm);
rcu_read_lock();
- if (!dumpable && !ptrace_has_cap(__task_cred(task), mode)) {
+ if (dumpable != SUID_DUMP_USER &&
+ !ptrace_has_cap(__task_cred(task)->user_ns, mode)) {
rcu_read_unlock();
return -EPERM;
}
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
@bluess57 thank you for taking the effort to bring the kernel to a more up-to-date level!

I adopted your kernel updates (currently up to 3.10.30) to a new branch forked from my just-updated branch containing the R22P0 GPU driver. I build for T715, but my methodology might be helpful for peer gts2 (including T815) builders who are watching this thread. FYI @retiredtab

The steps to get the 3.10.30 kernel built and running starting from my 3.10.9 kernel were:

git checkout -b lineage-20-r22-kernelupd
git remote add bluess57 https://github.com/bluess57/android_kernel_samsung_universal5433
git fetch bluess57
git cherry-pick 2357befe9c7e5682ba5ab49c692fdd196ecadb58^...3d969bba22e1797cf43d48abf5973e7ada58b17f -m 1 --allow-empty
git cherry-pick 6493fc9
# resolve merge conflict manually
git cherry-pick --continue

Strangely my tree did not contain the 6493fc9 commit that resolves a build error due to a static function in random.c that is declared as external in the header and also referenced externally. The patch generated a merge conflict that I needed to resolve manually.

At first glimpse, my T715 with LineageOS 20 is running fine with the updated kernel, I'll test for a while before I consider to publish it with my standard LOS20 T715 build.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
BTW there's been patches related to HID around logitech drivers etc... I hadn't tested a keyboard and mouse since patching,

and just tried now and didn't seem to work, need to look into it
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
anyone following along for kernel updates, I've just booted with version 3.10.42
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
I had my T715 running with 3.10.30 for a week and noticed reduced battery lifetime compared to 3.10.6. Battery lasts 2 days with my usage pattern vs. 4-5 days with the older kernel.

Evidence is very weak as I also switched to r22 GPU driver and additional upstream kernel patches, but I'll keep an eye on it while testing newer kernel versions.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
Can you check if device is going into deep sleep mode
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
Yes, it does:

I need to go back to the previous kernel to get a reference value.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
You might want to investigate android batterystats and battery historian.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] retiredtab:
@metterschling , with the CPU running at 400Mhz for > 50% uptime, I suggest there's something keeping the device from true deep sleep. From what I've observed on multiple devices running 16.0 to 20, deep sleep should start roughly 10 seconds after the device screen goes off.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
There was a patch changing from a work queue to a tasklet iirc, will need to find the details, wonder if that could contribute to increased power consumption
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
After switching back to 3.10.6 this morning, everything else unchanged, I'm getting the following:

Looks a lot better, so there indeed seems to be a patch that leads to increased battery consumption in-between 3.10.6 and 3.10.30.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] retiredtab:
1 hour 11 minutes at 400Mhz still seems a bit out of the ordinary, but then again, I don't have the LTE variant.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
Kernel/cpu/idle.c had patches, might be a candidate for power problem...

This added power consumption will be hard to spot.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
Tried that today:

12-16 14:58:48.283 3868 3910 I DreamManagerService: Entering dreamland.
12-16 14:58:48.287 3868 3910 I PowerManagerService: Dozing...
...
12-16 14:59:19.502 3868 3888 I DreamManagerService: Gently waking up from dream.
12-16 14:59:19.531 3868 3887 I DreamController: Stopping dream: name=ComponentInfo{com.android.systemui/com.android.systemui.doze.DozeService}, isPreviewMode=false, canDoze=true, userId=0, reason='finished self'(from 'short press on home')
12-16 14:59:19.531 3868 3910 I DisplayPowerController[0]: Unblocked screen on after 84 ms
12

However, CPU spy shows 25 seconds at 400MHz, no deep sleep.

Update: Performed the same test after updating the kernel to bluess57' kernel 3.10.44, no change.

Update2: I had the adb logcat USB connection online while performing the tests, might have interfered..

Update3: No difference without adb connection.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
From what I've seen, when tablet is connected via usb/charging, it won't deep sleep the CPU iirc , the kernel charger code continually checks battery temp, charge stats etc , as you will see in dmesg
[Galaxy Tab S2 Q&A, Help & Troubleshooting] retiredtab:
I don't have any great ideas other than to try each original kernel + .1 update to see when deep sleep stops working. You can just

# just make the kernel changes into boot.img and then flash the image via twrp into the boot partition
mka bootimage
# Boot OS
# do same 30 second wait test
[Galaxy Tab S2 Q&A, Help & Troubleshooting] bluess57:
I just did the instructions from @retiredtab , entered dream state on my device , done with no usb connection

12-17 17:44:24.241 3823 3858 I DreamManagerService: Entering dreamland.

12-17 17:44:24.245 3823 3841 I DreamController: Starting dream: name=ComponentInfo{com.android.systemui/com.android.systemui.doze.DozeService}, isTest=false, canDoze=true, userId=0

12-17 17:45:02.562 3823 3858 I DreamManagerService: Gently waking up from dream.

12-17 17:45:02.562 3823 3841 I DreamManagerService: Performing gentle wake from dream.

12-17 17:45:02.661 3823 6018 I DreamManagerService: Leaving dreamland.

12-17 17:45:02.661 3823 3841 I DreamManagerService: Performing gentle wake from dream.

12-17 17:45:02.661 3823 3841 I DreamController: Stopping dream: name=ComponentInfo{com.android.systemui/com.android.systemui.doze.DozeService}, isTest=false, canDoze=true, userId=0, reason='finished self'(from 'requested stopDr

DevCheck application shows Deep sleep time/% when the tablet is not attached to usb.
[Galaxy Tab S2 Q&A, Help & Troubleshooting] metterschling:
I doubt that the test is working for this issue as it shows identical results for kernels with bad and good battery lifetime.

As my first screenshot above shows, even with the new kernel the device enters deep sleep sometimes, but mostly it dozes at 400Mhz CPU state which leads to excessive battery consumption. That for sure assumes that the CPU Spy values are correct. Devcheck is not available on F-Droid.

As you can see from my above posted logcat excerpt DreamManager is telling that deep sleep state is entered but for the same time period CPU Spy tells that the CPU stayed at 400 MHz.

I'll try the dissection @retiredtab recommended, but that will take a long time.