yashsingh1/xdaforums huggingface dataset:
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
http://pastebin.com/raw/Lw12Mvnm

Looks a bit better now :)... Yay got something from the OS on the screen :D looks a bit broken but it's something.

Edit: ok

the hwcomposer is still making the surfaceflinger crash but I've seen enough to know that it doesn't have to crash in every situation

and it's probably possible to workaround that problem.

[IMG="..."]http://dl-1.va.us.xda-developers.com/3/8/6/9/7/6/3/IMG_20160909_142605.jpg?key=ZAJYh592FFbW9gjUjX_lUg&ts=1473424302[/IMG]
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
:victory::victory::fingers-crossed:

it's the actual cyanogenmod boot screen
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] :
Good job man!

Sent from Huawei P8
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Never used CM 13.0 x)

I guess we will see more as soon as I get it to not black out the display after that.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
I hope so!

I am using CM 13.0 on my S4, let me know if boot logs from it can be useful.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] aswertya:
Good joop

And ihope work all variants huawei p8 (ul10 )

Middle east ?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] :
I'm afraid there are too many differences between L09 and L10, and this port will only work on L09

Sent from Huawei P8
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Blackball:
I think it will work on all normal P8 devices but we will see

Gesendet von meinem Nexus 6P mit Tapatalk
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] :
UL10 is a Chinese Dual Sim version, do it depends on our awesome port author if he decides to implement dual sim support.

Sent from Huawei P8
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] user_x25:
C'mon, can't wait to try this port!

Inviato dal mio HUAWEI GRA-L09 utilizzando Tapatalk
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] user_x25:
Any news?

Inviato dal mio HUAWEI GRA-L09 utilizzando Tapatalk
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] AD2076:
Please don't put pressure on [MENTION=5532236]nexolight[/MENTION]

She is working hard on this port and made amazing progresses so far.

The best you can do is wait and help as you can if needed :)
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Let me have my weekend ;) It will take a while that's for sure but I'm looking forward to not buy a new device. As stated on the CM website the porters are often consumers. So am I.

Well I don't own the dual sim version and it really depends on how different they are. I can barely buy this one as well but I guess it would be a minor thing togehter with another dev. At least if they jut switched the sim reader.

... *she not he ;) thx
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] user_x25:
Okay, thanks so much and sorry for my pressure. Your work is awesome.

Inviato dal mio SM-A500FU utilizzando Tapatalk
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] user_x25:
May it be a runtime issue? Or maybe a GPU one...

Inviato dal mio SM-A500FU utilizzando Tapatalk
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] wfonz:
Is there any other things to do before flashing the latest build? Or do I go as I've always done?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
The crashs will be hard to fix without replacing the HWC which would bring a bug back that make the rom unusuable. I gues none of the opensource HWCs would help at this point and I don't really have time to work on such a project (again) in my free time.

in order to use the vendor hwc surfaceflinger and libgui is replaced. The 2nd has a reverse shimlib to make it run.

I couldn't find any way to make it run with less vendor libs except removing the hwc completely.

I've seen 2 different stack traces so far. The one is I had with A.I. type seems fixable by doing a shimlib with the mentioned library (in the stacktrace) but I couldn't workaround the one I had with a.e. Viper4Android or chrome
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
It should be fine to flash the latest boot.img and system.img, install gapps and clean the cache/dalvik.

Maybe data as well- might help when something doesn't work.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] wfonz:
I just installed it and did also a data wipe but app crash frequency is almost the same.. Especially for whatsapp and telegram.

Anyway, the rest is fine and smooth
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] insomnixXx:
Question...

About that...the change is in system ui, so when I applied a different theme the placebo effect was not visible... Can you tell me exactly what u changed so i can apply it on othe themes?

And btw [MENTION=5532236]nexolight[/MENTION] after i did a factory reset (dalvik, cache, data) the only thing that crashes are social apps... System and other apps like chrome work flawless... That is just what i found out... I might be wrong, but maybee that can lead to a clue...
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Speedo.thc:
well .. files are into res/drawable , it's "ic_qs_signal_0", "ic_qs_signal_1", "ic_qs_signal_2", "ic_qs_signal_3","ic_qs_signal_4" for status bar.

and "ic_qs_signal_full_0" to "ic_qs_signal_full_4" for expand notifications

- need to do a copy of xxx_4 , then delete xxx_0 ,

rename xxx_1 to xxx_0 ,

rename xxx_2 to xxx_1 ,

rename xxx_3 to xxx_2 ,

rename xxx_4 to xxx_3 ,

rename xxx_4_copie to xxx_4 ,

repack like that and you got placebo+1 , do all again and you will have placebo+2

is it clear ??
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Again - No logs = no help.

But yes (again) I know approximately what the source of the problems is, since I did the logs for anyone who is complaining.

TLDR;

Most of the crashes are casued by a passed poiner to a Surface instance within libutils... The Surface object comes from the libgui source which I replaced with the vendor library. Eighter I use the stock libgui library which would mean removing the vendor hwc and bring back a few issues or I change the sourcecode within libutils. Remeber that I am neighter a c/cpp dev nor have I a clue what exactly has changed.

The issues from most of the social apps come from libicui18n which is a vanilla Library where the Constructor/Destructor appears in the stacktrace. I'm not exactly sure what's wrong here but I had less issues when I replaced this library. I Have no logs yet.

The one which is already fixed had it's source in the dalvik/art settings.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] insomnixXx:
Yup, thanks, its clear as the day.

---------- Post added at 09:08 PM ---------- Previous post was at 09:05 PM ----------

Thank you for the detail infos. I will try and get the logs. Also, do you know anyone who could help you with that error?

Edit: [MENTION=5532236]nexolight[/MENTION] i have the the log for the crashing Facebook, Snapchat and Instagram. Hope it helps.

https://drive.google.com/file/d/0B7BTZKRSJL65aVZvblhOelMwVUk/view?usp=drivesdk
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
[MENTION=7989679]insomnixXx[/MENTION]

- Facebook: This is a new kind of error but most likely related to the Surface object in libgui as well

Apart from that I can't find more app crashes. At least not caused by a low level error (System libraries).

Wait /bin/sh crashed? That's really weird.

It's probably less about help than about time.

Any c/cpp dev who has some expirience with reverse engineering "could" help.

Such stuff is just pretty time demanding.

There would be different approaches.

1. Replacing the huawei HWC while also fixing the (screen) sleep of death bug. This would allow to take the full CM vanilla libraries.

2. Trying alter the CM surfaceflinger that it does work with the huawei HWC (See the reversed part at the beginning of that thread). I'd prefer this one.

3. Trying to alter the CM libgui library in a way that it works with the huawei Surfaceflinger and doesn't cause issues with the CM libraries. (atm this is a reverse shim lib)

4. Trying to alter "all" libaries to accept the references to instances which were created within the vendor libraries (most likely the Surface object within the huawei libgui).

(5) Somehow I also had the idea to run the surfaceflinger within an encapsulated environment. Like a docker container. But that's just fancy theory. In case that "could" work it should be possible to run any vendor binary like the surfaceflinger, while keeping the stock CM libraries for everything else. Maybe it would be even enough to make another folder within the root and change LD_LIBRARY_PATH to the pure vendor libs within that separated environment for just this binary.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] insomnixXx:
[MENTION=5532236]nexolight[/MENTION]

Looks like every social app like Facebook crashes like thet, in my case Instagram and Snapchat and Messenger... someone sayed Whatsapp...

but again... in my case its just that. Everything else is ok.

Yeah, i agree. But with some help the "time issue" would be fixed .

Anyway about the options you mentioned i think the first one would be awesome (if it would work) but is i think the most time demanding. Thats why in my oppinion the second as you said and maybe the last you mentioned would be worth a try.

Anyway i will try and get some help, as its very welcome.

Edit: And when i showed the CM rom to my friend who also has the P8 he was like daaammmnn that looks sexy on P8, fix the issues and ill use that. He has battery issues with stock B892 build, drains battery like nothing.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
[MENTION=7989679]insomnixXx[/MENTION]

The opensource HWC implementations only have a very minor subset of the features as far as I know and to be honest I don't really care how hacky the solution is when it does work well.

I'm strugeling with trying 5. The idea seems almost pathetic but I don't see a reason why it shouldn't work and that's the only thing I'm probably in when it comes to the time question.

At least... There are a few linux distros which do this.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] insomnixXx:
[MENTION=5532236]nexolight[/MENTION] sure man, i mean u know what u can do. I will do tests and report with logs. Thank you for your hard work man.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Looks like [MENTION=7730396]murdge[/MENTION] found something interesting about most of the app crashes what might help. See github #9
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] ASMstudent:
Does it need a new build or something to be done on installed ROM?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Any sourcode change would need a new build.

Well there's a way to patch the system I guess with twrp.

I avoided using TWRP and providing zips as it's not really the recommended way to provide it and furthermore the CM ndk refuses to build a zip.

Basically it's enough to just copy over the libraries which have changed or well - just flash the new system.img and done.

The problem of flashing the system.img vs patching the system are apps installed as system apps. Like GApps. They will be overriden by flashing a system.img.

On the other hand those .img files are basically raw partitions which you can flash via fastboot and fastboot is (correct me when I'm wrong) always the last hope when something goes terribly wrong. A zip wouldn't help there for the 0815 user.

It would however not make any circumstances to provide both except that I might run out of storage in mega.nz at some time and I don't have a good upload speed after all. The choice for mega was basically because of the available download speeds. I could have done a rant each time when I wanted to download a rom and those **** devs have choosen a slow filehoster. :eek:

Well I could look at some alternates. There should be quite a few.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] insomnixXx:
[MENTION=5532236]nexolight[/MENTION]

I am about to sell the P8, got a great deal for Le Max 2 so yeah, thank you for at least creating the opportunity to run CM, and a very last question... amm how do i get to stock rom? (i think i need to flash stock recovery and then update.zip, correct if im wrong please).

Thanks ☺️ Please continue the great work. Looks like som clues have been found for the crashes...
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] fpippo1999:
Wipe all, flash the original recovery of the firmware you want to install and then put the full update on dload on SD and turn on the phone with 3 method button
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] insomnixXx:
The 3 method button?? Umm is that volume up + power? Thanks btw ?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] murdge:
Volume+ and volume- and power.

Firmware and recovery must be same build.

Search [MENTION=6870018]Tecalote[/MENTION] here then you find full description.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] fpippo1999:
sorry, i haven't seen the reply, usually when i start a job I finished it.

how said [MENTION=7730396]murdge[/MENTION] Volume+ and volume- and power.

Make sure the recovery that you install is the same of your firmware that you want to install so extract it with https://xdaforums.com/showthread.php?t=2433454

If you have any problem ask :)
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Is there any need for vol up + down + power? or a specific recovery version?

I always took the backup (quite old) recovery or recovery2 (doesn't seem to matter) partition and bootet one of them.

Which one of them does boot up depends only on USB connected/not connected. It was always volup+power. Pressing voldown had never any effect to that.

Well and then you just need to have dload/UPDATE.app on the sdcard and the stock recovery should start to install it immediately.

It might also work via hisuite over fastboot. But I never tried that.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] murdge:
As I know this works only with the same firmware. If you have had B370, then CM and now try to flash B390/B391 with the B370 recovery it should end with bootloop.

So this is new for me. But every day many things are new for me...thank's.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
That was only from my expirience so far. I cannot confirm anything ;)

When I remember correctly I updated my 5.0 to some 6.0 rom with the 5.0 recovery.

Gonna try some things out today.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Kostyan_nsk:
Well, obviously, if you want to run vendor's hwcomposer with CM's surfaceflinger, this shim

int _ZNK7android10GLConsumer18getCurRefreshDirtyEv() {
return 0;
}

is not the right decision. You can see it in Xepeleato's investigation about negative dimensions of rectangle. That means, that it just was not initialized.

So the first step I would recommend to do is decompile getCurRefreshDirty function, try to implement it and inject its call to where it is called from.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
I guess you are right. But at this point I could need some help.

The cpp demangler showed this: _ZNK7android10GLConsumer18getCurRefreshDirtyEv = android::GLConsumer::getCurRefreshDirty() const

So what does this actually return? I'm not familiar at all with it altought for me it doesn't look like it have to be an int.

I will probably try to decompile it by time... And well try to implement it somehow.

My plan is indeed to continue using the vendor hwc for 2 reasons.

1. It's a complete implementation which we don't have yet as opensource. 2. there's a bug without *this* hwc (~screen timeout of death). I must admit I'm not sure where exactly this comes from but I assume it's the vendor hwc which makes the difference.

I will also write the guy who told me about having a "partnership" with huawei maybe they are willing to send some sourcecode.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Kostyan_nsk:
Open it in IDA and most probably you'll see what it actually returns.

Don't even hope for it. :p
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Just some notes... that's the assembly of this function.

Here's a reference https://yurichev.com/mirrors/ARMv8-A_Architecture_Reference_Manual_(Issue_A.a).pdf

The CM libgui source: https://github.com/CyanogenMod/android_frameworks_native/tree/stable/cm-13.0-ZNH5Y/libs/gui

Just in case someone want to help.

Pretty sure it won't be the last function call but anyway.

Pseudocode

__int64 __fastcall android::GLConsumer::getCurRefreshDirty(android::GLConsumer *this)
{
android::GLConsumer *v1; // x19@1
char *v2; // x20@1
__int64 v3; // x21@1
__int64 v4; // x19@1

v1 = this;
v2 = (char *)this + 1584;
pthread_mutex_lock((char *)this + 1584);
v3 = *((_QWORD *)v1 + 207);
v4 = *((_QWORD *)v1 + 206);
pthread_mutex_unlock(v2);
return v4;
}

Raw

; Attributes: bp-based frame

; __int64 __fastcall android::GLConsumer::getCurRefreshDirty(android::GLConsumer *__hidden this)
EXPORT _ZNK7android10GLConsumer18getCurRefreshDirtyEv
_ZNK7android10GLConsumer18getCurRefreshDirtyEv

var_20= -0x20
var_10= -0x10
var_s0= 0

STP X22, X21, [SP,#-0x10+var_20]!
STP X20, X19, [SP,#0x20+var_10]
STP X29, X30, [SP,#0x20+var_s0]
ADD X29, SP, #0x20
MOV X19, X0
ADD X20, X19, #0x630
MOV X0, X20
BL .pthread_mutex_lock
LDR X21, [X19,#0x678]
LDR X19, [X19,#0x670]
MOV X0, X20
BL .pthread_mutex_unlock
MOV X0, X19
MOV X1, X21
LDP X29, X30, [SP,#0x20+var_s0]
LDP X20, X19, [SP,#0x20+var_10]
LDP X22, X21, [SP+0x20+var_20],#0x30
RET
; End of function android::GLConsumer::getCurRefreshDirty(void)
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] ayesse:
Just a stupid question

Is the latest build safe to use, since it's "unclean", or..?
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] XePeleato:
How does a "screen timeout of death" look like?

About the HwC function, this is my best guess:

Rect GLConsumer::getCurRefreshDirty() const {
// Get the dirty rect
}

Because (my changes in blue):

I haven't touched stock HwC for a while, I may give it a go if I have time.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] papsi177:
I think work on implementation of stock HWC to cm-lineos, it just lost of time only, imho. It need to much addictions..imho.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] murdge:
@ XePeleato Huawei knows what this caused - so why they do it dirty?

Oke, for me it looks this function only correct a given rect(top[0], right[-1], bottom[-2], left[-3].

Only the top[0] is positiv, the other three sometimes are negativ but in every given rect only one of them.

The function makes it positive, calculate the real value and give it back as rect.

That's dirty....

v1 = this; //I think its the rect
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] XePeleato:
Do you know what the dirty rect is? The dirty rect(s) are a list of rectangles that work in such a way that everything that intersects with them is marked to be redrawn.

Not really, because in first place, the function doesn't take any parameter. That function retrieves the actual dirty rect, that would make total sense, wouldn't it?

'this' is a keyword in C++, in this case, it's a pointer that directs to 'GLConsumer' class. You see it as a function parameter because it's implicitly called by every class member.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] murdge:
@ XePeleato Blame on me! Sorry, I'm high over 60 and learned 40 years ago Fortran and Pascal. Yesterday I set up my first Linux system with the Git branche. Even now I read the first time about splines after I read your answer. Oke, I'm going on with learning in my rent, thank you!
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
Should not matter.

During compilation it is detected what has changed and then this part is recompiled and included in the previous existing already built files.

Depends if you want to rely on that mechanism, but I use the same build it seems fine. I'd take it down otherwise.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
I have some addictions ;) just no time. I'd however personally prefer it this way unless there's a solid alternate.

But anyway it's all available in case someone want's to do an own rom based on my previous work that's fine... I don't have to be the only person who works on it.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
[MENTION=7354786]XePeleato[/MENTION] Thx for the help :) I'm new into this disassembly stuff so the comments and explination help a lot. I started to implement it but wasn't yet sure about what it might do apart from the locks. It makes sense to me. Wouldn't be a big effort to just try it.

However I'm on holyday the next weeks and bit exhausted from the project when it comes to motivation at the moment.

btw. The screen sleep of death: The devices starts without hwc just fine and apart from vsync and a little bit of stutter it's ok. However as soon as it turns the screen of due to the timeout and one tries to wake it up again the screen stays black. The device however continues to run. At least logcat continues and the sound from the volume keys is there.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] XePeleato:
That issue can be fixed with this commit (it should be adapted for CM13, I guess): https://github.com/XePeleato/hisi_frameworks_native/commit/47fe957245412aafb6f1bc46519803f00dc782c7

If you want to implement that function, you'll find dirtyRegion inside 'Surface.h' specially useful to get the dirty rect that you want, just quote me if you need help.

Good luck!
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] papsi177:
For me it working without this commit. If phone is unpluged, from USB port, it turned on.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] nexolight:
By removing which files?

The rom doesn't has the issue but with the hwc removed (including the shimlibs and vendor Surfaceflinger) it occurs.

As I said I'm not entirely sure from where this issue comes. It might be libgui, the surfaceflinger or the hwc.

Edit:

I found this in near the call to this function wihtin the libsurfaceflinger.so

* __android_log_print(
3LL,
"SurfaceFlinger",
"@@@latchBuffer-refreshDirty=[%d, %d, %d, %d]-w:%d, h:%d",
(unsigned int)v59);

v59 is returned by that call.

if ( (signed int)v61 > (signed int)v59 && (signed int)v63 > (signed int)v64 )
android::Region::set((android::Region *)&v78, (const android::Rect *)&v72);
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] papsi177:
Can some one give me a tips about zoom? It not working in my build..camera libs are compiled from source(meta, service, client)
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Speedo.thc:
Hi, I've tryed to fix it (inside free rom) with another files, coming from my port, but no success, sometimes no boot, bootloop, or no zoom ..
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] papsi177:
Hi, [MENTION=5532236]nexolight[/MENTION] use stock proprietary camera blobs(libcameraservice.so i think) and shim lib needed to start system with this libs. If you try to put it to my rom, you have to take many addictions too. Zoom issue in my rom is somewhere in compiled libcameraservice.so, it like no connections between libcameraservice. so and camera driver files like libcamera_algo.so and others..Ah, i have not a lot knowledge..**
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Speedo.thc:
Well, here shim for camera are libcamera_client and maybe lib_media , that's all, rest are blobs ones.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] 00471:
Hello devs, any news? whats the progress? there is somehow quiet
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] Speedo.thc:
Hi, [MENTION=5532236]nexolight[/MENTION] is over-booked, we must wait .. But be sure to see progress in next build.
[Huawei P8 ROMs, Kernels, Recoveries, & Other Devel] 00471:
Thanks for answer, cant wait