yashsingh1/xdaforums huggingface dataset:
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
np ^^

Here some more logs. I'm not too familiar with that stuff so one of you may give me a hint faster than I find the cause:

http://pastebin.com/raw/0sTM3EfS

The phone is bootlooping it isn't the full log but the same messages again and again. Guess something related to JNI

Edit:

/*
* Register several native methods for one class.
*/
static int registerNativeMethods(JNIEnv* env, const char* className,
JNINativeMethod* gMethods, int numMethods)
{
jclass clazz;
clazz = env->FindClass(className);
if (clazz == NULL) {
ALOGE("Native registration unable to find class '%s'", className);
return JNI_FALSE;
}
if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) {
ALOGE("RegisterNatives failed for '%s'", className);
return JNI_FALSE;
}
return JNI_TRUE;
}

this fails for class android/util/Log
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
01-28 20:00:42.042 3291 3291 E ImagingSystem: failed to dlopen(/system/lib/hwcam/hwcam.hi3635.m.GRACE.so)!

01-28 20:00:42.042 3291 3291 F ImagingSystem: hw::CNoAddRefRelease4T<T>* hw::CIntfPtrBase<T>::operator->() const [with T = hw::IImagingSystem; hw::CIntfPtrBase<T>::_TPtrNoAddRefRelease = hw::CNoAddRefRelease4T<hw::IImagingSystem>*]: SHOULD NOT BE NULL!

Looks like you miss /system/lib/hwcam/hwcam.hi3635.m.GRACE.so and you get a null pointer error.

Did you included the vendor blobs?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
https://github.com/mt7-dev/cm_andro...mmit/8bc68453dc0e6faca201c87ff19d921702c951e4

This is most likely the same issue.... however I don't want to edit the build environment even more there must be a clean way to do this or just an alternate.

I'm new to porting devices so what is the usual way to alter the framwork source provided by the cm build environment?

This "print_powerlog_native" function comes from at least 1 shared library I can't omit.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
https://github.com/XePeleato/https-...huawei_gra_l09/blob/master/p8-vendor-blobs.mk

You have probably already seen this, but just in case... hope this helps
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
These don't even work with the 5.0 rom for cyanogenmod for me (6.0 is even more different) and I don't want to add these vendor files in bruteforce mode if you know what I mean ;)

In my case I had to replace the libandroid_runtime.so and there this native method is referenced. The solution in the link I posted before would work pretty well I guess this is just a non-standard function I'd have to add and the problem would be solved. However I'm pretty sure the ndk has a standardized way to do this without editing these files directly. To my point of undersanding editing the build environment is a no-go to make it official.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
-.- that's not the problem
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Kostyan_nsk:
Together with hwcomposer? If not, then libGLES_mali.so just was not used.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
libGLES_mali.so is the gpu driver itself. There's not graphic at all without it and it must match the kernel space GPU driver (right?). Surfaceflinger has a fallback path to GPU (gpu driver) when it can't use hwcomposer to compose some of the overlays via CPU. The system does not boot without any gralloc library no matter if there is any hwcomposer or not. gralloc itself requests the memory for image producers. Isn't it used by both of them? Otherwise it would boot without it. And what about GPU intense apps? it seems they're using the GPU just fine.

(please correct me not sure about that)

Anyway it isn't like the hwcomposer from huawei is completely broken a.e. the boot animation is fine and it doesn't report any gralloc errors when using the one compiled from source. It just fails for itself when it has to partial update surfaces (has something to do with the surface damage, the layer count and the layers effectively available at the pointer) or when it gets more than 2 layers to compose. It must be possible to modify the surfaceflinger to do what the hwcomposer expects or well... implementing a dumb hwcomposer would be an option too.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Ok not the greatest update of all but I just looked at the /etc/permissions folder adapted the contents to the rom.

It seems that this has fixed a lot of stuff. a.e. The signal is reported correctly, apps in the play store are not marked anymore as "incompatible" and the setupwizard doesn't crash at the very beginning.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Ok managed to get WiFi-Tethering to work.

When someone feels the urge to have a system.img + boot.img I may provide one after I fixed the "standby-wake on battery = black display" issue.

I'm not really in need for testers there are to many problems to fix at the moment but I guess that's the point where I would use the device for myself so why not.

Just in case someone else can't agree with huaweis terms and conditions like me or for whatever reason.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
I will try it for sure but maybe I'll wait for GPS :)

Hint: The P9 plus developer had issues (now solved) with deep sleep too, drop him a line ;)
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
May be a good idea. The git it public I will search there maybe it's mentioned in one of the commits.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
Have a look at this too: https://github.com/Huawei-Dev/andro...mmit/23499e33c590c299ea2b17df3a3ee131fbbc9249

Comment is: fix HwComposer
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
I did but that commit does absolute nothing. There's a shimlib involved but it is not build according to the device.mk nor is there any source for this one. The problem for the P8 hwcomposer also don't reside in libandroid. libgui + surfaceflinger cause the problems.

btw: the commit where he fixed the issue with deep sleep isn't up yet so I wrote in the thread for the p9 plus.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Ok the dev from the p9 plus said the problem was solved together with HWC. That means it's indeed related do direct drawing (This issue still exists in a few android versions but it doesn't break the functionallity when HWC is enabled).

I asked the p9 plus dev where the source of the shim lib is which he has added. I just assume he uses the vendor version and the version built by default. So not really a shim lib. The issue is different no question but the way he did it would probably help me too.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Uaaa

horrible

way to solve it. Well the p9 dev didn't respond so far but I managed boot up the phone together with huaweis HWC! I don't trust it yet we will see in a few minutes.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
What's the horrible way?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
In case you don't remember. In order to get the HWC running I had to replace the surfaceflinger - no matter what. But the SF depends on libgui which was problematic in this case since libandroid_runtime (which I absolutely can't replace) depends on some symbols of the built libui.so which are missing in the vendor version. The problem was a segfault caused by an existing symbol (function) so I needed a way to override this function without even knowing what exactly it is but still keep the compatibility to libandroid_runtime.so.

LD_PRELOAD does override functions with the same name but in my case it did not worked. Well the alternate is to use LD_SHIM_LIBS in a way it's not really supposed to be used. I took the surfaceflinger from the stock rom as well as libgui.so AND used LD_SHIM_LIBS with

the built libgui.so -> libshim_gui.so

in order to have the symbols as well which would be missing and are required by libandroid_runtime.so which I can't replace. Uhm... well It works...

Yes we have a working vendor HWC in this port :)
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
P9 plus way
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Did he mentioned that anywhere? I even asked him - no response. He could just have used his own source without commiting it. That's not the way LD_SHIM_LIB is usually used.

Well I guess that way this rom will never be "official". but who cares...
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] user_x25:
So you successed to port the HWC. Okay, it will not be official, but you worked very hard to do this, so this is great.

Inviato dal mio HUAWEI GRA-L09 utilizzando Tapatalk
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
To be honest I feel stupid for not trying this earlier.

Hm the issue with the sleep and black screen without any power source still persists. But the p9 dev told he solved it together. He shim_libbed libandroid.so. Maybe the problem resides in the source for this one.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] herald1368:
why no one is talking about p8 gra-ul00?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
[MENTION=7384465]herald1368[/MENTION] I don't own it so I can't help directly.

I can just try to make it compatible but there must be any brave soul out there to try it. I assume it's only the modem which is different. The files are included, the build.prop is made for GRA-L09 it may work by just using another set from the phone.prop. As far as I can tell huawei included all required files to use the same stock rom on GRA-L09 as well as on -UL00
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] user_x25:
BTW, will the rom be flashable via recovery with a zip, or will we need Fastboot (so unlocked bootloader)?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Fastboot and that's the way it should be. But I can't imagine that you can flash a zip without unlocking the bootloader... The content of these zips are as far as I can tell simply the partitions to flash. (system.img, boot.img, recovery.img or whatever.). You will need an unlocked bootloader anyway.

I will think about providing zips when this rom is stable and contains all functions which isn't the case yet. system.img + boot.img as soon as it doesn't break the daily usage.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Shamako:
Hey man, I can test the ROM on my GRA-UL00 - it's my secondary phone so I dont mind! I have the BL unlocked already too.

Btw great job on getting HWC to work!
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
10-17 17:00:05.768 3271 3471 D LightsService: Excessive delay setting light: 10874ms

10 seconds...

Edit: You probably already seen this but who knows? 4 eyes are better than 2 :P

Sorry if sometimes I post something obvious
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
It's not related to light or any of those "timeouts" that's just a result. Something bad happened previously. But well this wasn't mentioned in the logs:

"KernelUidCpuTimeReader: Failed to read uid_cputime: /proc/uid_cputime/show_uid_stat: open failed: ENOENT (No such file or directory)"

This file is created by a program in the kernel which doesn't exist in the one provided by huawei. I'm not even sure if this causes it but I'm patching the kernel now to make that vanish.

KernelUidCpuTimeReader is provided by the API23. It may be possible that something relies on this feature. I should mention that it is used at a point where it comes to Battery/Powersaving/Profiling stuff.

Edit: ok kernel patch was successful. Let's see if the problem is solved....

Edit2: Ok problem is

not

solved but one error less.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] :
Dude, Your work here is great. Just wanted to say thanks to keep You going :D
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] user_x25:
Hi, have you got any luck with bugs?

Inviato dal mio HUAWEI GRA-L09 utilizzando Tapatalk
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
I was sick the last few days and started again today. But no - no luck yet. I'm out of ideas what could possibly cause it. There is no real initial error message no matter what. All I know is basically that the windows freezes because of whatever reason after the device was asleep for some time without beeing connected to any power source. Most of this messages are just the result but don't help at all. I even used adb via hotspot to not miss anything.

WindowManager: Timeout waiting for drawn....

WindowManager: Window freeze timeout expired

It's funny sometimes I still see the ui as it should be about 10-20 seconds later. It's just frozen until the screen times out again and the rest of the system begins to crash.

Something causes problems but doesn't report any obvious error and only when it was put to sleep before. However asuming that the sourcecode and the default settings are fine it must be related to any vendor library. But there's not a single one where I possibly could imagine that it's the source of this bug. The bug was present even before HWC fix and all the power related libs are built by CM.

I don't have a very deep understanding of the android as a whole system so I don't know the relations between all of those libraries. It would help to know what's included in this sleep/wake process. Just some hint's - don't send me links. I have already seen them by a chance of 99%. Some issues can't be solved by using google. Especially when there's no one with the exact same problem.

It must be something minor and that makes it even more annoying.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Kostyan_nsk:
The reason why connected to charger device doesn't have this issue is because of charger's wakelock, so device in this state just doesn't go to deep sleep. No deep sleep => no issue.

So I would recommend you to take a look at kernel's log and framebuffer's sourcecode in the way of suspend/resume.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
I think you're right except about "deep sleep" there is no deep sleep in AOSP and it's not supposed to be enabled because of the cloud service requirement. It's disabled by default with this statement. Let's call it just "sleep" to avoid confusion.

Kernel logs don't show anything about the problem so far :/ (I will take a look again). It could indeed be something related to the graphic stuff I will look at this at well.

Edit:

Here's a kernel log from kmsgcat. It starts when the devices screen is turned off until I wake it up.

http://pastebin.com/raw/aw3y8dHe

I was connected via hotspot during this and what makes me wonder about the sleep thing is this: "soft wakelock: 0x1". So it's not really sleeping? These messages occured up to the point where I pressed the power button again. It also doesn't get black it's just like 0.2 fps (first few seconds black) with all the ui elements crashing after each other. I guess those fence timeouts also visible in logcat are the indicator for this. But that might be as well just a result.

Shouldn't android clear and redraw the whole surface after waking up? I suspect this isn't done and causes these problems....
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
Could it be related to power profile? You said stock one is somehow messed up
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Yes I did in a commit. But the issue was present with the default profile (from the very beginning), with the stock profile and with mine. Which just uses the stock values in the format found in the framework template. It doesn't seem to be related to sleep in anyway. The issue was the reason why I looked at the power stuff and noticed these power profiles.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
I'm now testing different kinds of wake locks with an app. PARTIAL_WAKE_LOCK is still fine. Everything below crashes when waking up again.

/**
* Wake lock level: Ensures that the CPU is running; the screen and keyboard
* backlight will be allowed to go off.
* <p>
* If the user presses the power button, then the screen will be turned off
* but the CPU will be kept on until all partial wake locks have been released.
* </p>
*/
public static final int PARTIAL_WAKE_LOCK = 0x00000001;

...It basically happens when the CPU goes to sleep and wakes up again. Yes it might be graphic related but it could also be that the CPU doesn't recover very well.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
Our loved phone has the tap to wake feature so I guess it won't deep sleep for true
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Uhh these are framework settings which are different in CM than in any vendor rom.

By default "double tap to wake" is disabled in CM13. I guess it wouldn't be a problem to enable it later. I won't enable deep sleep in near future anyway it was disabled for a good reason.

But that's off-topic at the moment ^^
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
Have a look at CM for LG G2 it has tap to wake too and it works well

P. S. Any chances to get testing images?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
I am

not

trying to enable tap to wake at the moment and it seems to be a thing of true/false.... I'm trying to fix a daily usage breaking bug which makes images for testers/consumers obsolete at the moment. Or well to be honest there are to many issues these would not be testing images. These would be alpha images where the users just have to deal with lacking functionality. Reporting issues wouldn't make the progress faster as I have to fix the essential stuff first.

Do you want it that badly? It's just 2-4 hours to provide a clean build. I'd prefer to fix this bug first.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
I have to admit I am really curious to try cm on p8 but if some testing is not needed and doesn't help I'll wait with patience.

I'll go on giving my 2 cents suggestion sometimes :p
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Hm I just noticed that there was no way to specify the cpu core usage.

By default it uses only cpu0! That's defined in init.rc. I noticed that when I saw that a few files from governors were missing. That error message also appeared near the outputs of the bug I'm working on.

The perfomance is a lot better now. 8 instead of 1 core where I had an antutu benchmark score of 32'000 before. Now it should be as high as with stock.

Just sad that it wasn't related to the sleep of death bug.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
:crying:
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Kostyan_nsk:
Cloud services is not related here at all. There is deep sleep! Otherwise device could discharge very quick. Anyway, I was talking about deep sleep in the meaning of kernel.

Kernel log shows a lot of sync fence problems.

When tap to wake enabled, touch panel stays powered on and its IRQ has flag IRQF_NO_SUSPEND or enable_irq_wake() function used, thus tp's irq handler function stays active and wakes up device from deep sleep by irq interrupt. Just in the same manner as irq interrupt from power button.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
https://developer.android.com/training/monitoring-device-state/doze-standby.html

http://android.stackexchange.com/qu...ze-mode-and-sleep-mode-in-android-marshmallow

I assume doze = deep sleep

since there is also the normal "sleep", there is no such term like "deep sleep" and doze describes what I imagine under "deep sleep". Doze is a feature of android 6+ which is disabled in aosp according to the comments/code in config.xml. The cloud service thing is mentioned as well.

But when you're talking about kernel well then it's a different thing. People guessed that the kernel was involved in all these sleep of death issues. But no one could proove it so far. So it's probably related to kernel power management or as you said the framebuffer source. (The kernel space driver?). Once the screen is gone I can't recover by restarting the services the only remedy is to reset the device.

When this is related to the kernel then I wonder if the compiled one from source works fine with the stock rom. If so then it might by caused by a library which talks to the kernel in a different way.

Indeed but the warnings from the WindowManager occur before the first Fence errors (and probably the ANR in systemui as well) are shown in log. I guess they time out because of whatever was the source of them crashed or does not respond. Later I also see NullPointerExceptions.

Those 0.2-0.4 fps are also suspect. A frame after each Fence timeout probably. While parts of the ui black out over time.

I'm busy at sa/so so I can only tell from what I remember or I had posted.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Kostyan_nsk:
You're keeping to confuse doze mode with deep sleep. Doze mode != deep sleep.

Doze mode freezes apps to not let them wake up device from deep sleep by rtc alarms, meanwhile in deep sleep kernel freezes whole user-space, i.e. whole android. It's a different levels. Kernel just has no idea about your config.xml :D

http://www.thinksrc.com/2010/11/20/suspend-en.html
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Thx well I wasn't aware that there's something like a sleep mode on kernel level. I will dig into that.

Edit ok by reading the first lines it sounds like system halt. It isn't a completely new thing then. Still I wasn't aware^^

Hm well I switched the kernel GPU driver with a new version which I took from another huawei device which had the 6.0 rom since Huawei has not released any 6.0 Kernel for the P8 so far. The issue may be located there in the resume from standby function. The kernel space driver is open source so I might try with the source directly from mali. Well but first... There are a few ifdef parts in the platform code there. I don't think they are defined by any way during the build process so I might have some luck defining them. They are related to suspend/resume stuff and some of them are especially for the hi3635 platform. It looks like some of them were added later and the device from which I took the kernel code for the GPU share's the platform code with the P8 (So basically not yet released code for the P8).

I will build it again with KBASE_HI3635_GPU_IRDROP_ISSUE enabled.... This option is defined in the original kernel platform code for the GPU but not in the one I took. It's almost the only difference. There would be also an option for hardresetting the GPU after sleep.... I'm crossing the fingers now^^

Edit well that doesn't really help and otherwise there's almost no difference. I'm looking into the framebuffer code now.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] wbrambley:
Thanks for all your hard work on this, it's no wonder there has been hardly any official CM support for Huawei phones.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
I never did any port before but "this" is the worst I can imagine. They put out a 6.0 rom on the market but aren't able to provide an updated kernel which is basically a GPL violation. Well and apart from the kernel all the sourcecode for the modified parts of android is missing. But I guess that's common.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] erayrafet:
Here's is a mirror link for 6.0 kernel source code which I've downloaded from the Chinese Huawei website 2/3 months back.

https://mega.nz/#!oNY1TCKY!z9LmXZQlIc_0Dp0P_9hFXgOkrxA0GRplFCbap9TZYLw