FORUMS
Remove All Ads from XDA

'Phone is Starting' fix for LOS/Based ROMs [FLASHABLE]

12,278 posts
Thanks Meter: 3,788
 
By Dirk, Senior Member on 17th July 2019, 05:32 PM
Post Reply Email Thread
Devs seem pretty certain that Livedisplay is the cause of this bug now. See:

"The error is due to LOS livedisplay. Proper fix unknown.
Someone has posted a workaround in our telegram group - this workaround fixes PIS issue at cost of livedisplay."

https://forum.xda-developers.com/sho...postcount=1568

We now have:

"the issue resides in LiveDisplay implementation
if you can live without some LiveDisplay options, flash the "fix" attached below"

https://forum.xda-developers.com/sho...postcount=2029

At least one ROM removed Livedisplay in favour of another implementation:

https://forum.xda-developers.com/sho...&postcount=975

That was in May and as far as i know that fixed the issue there.

While Livedisplay may not account for ALL instances of this bug, it certainly appears to be at least a major factor. My own logs, (taken when both my OP3T and OP5 were hung on the 'Phone is Starting' message), include Livedisplay entries that are not present on a subsequent bootup.

Overall it doesn't look good for Livedisplay. You can see from the second link above that the .zip mentioned in the first link has been posted for use with the OP5/T.

What we know about the fix:

1) It makes edits to /vendor/etc/vintf/manifest.xml removing Livedisplay entries
2) Removes two files: /vendor/bin/hw/[email protected]_msm8998 and /vendor/etc/init/[email protected]_msm8998

(In the case of the OP3/T the 'oneplus_msm8998' would read 'oneplus3')

3) It removes a lot of Livedisplay functionality.
4) The fix as posted here should work on any LOS/Based ROM for both the OP3 and OP3T


Please read what @nvertigo67 had to say about the PIS bug:

Quote:
Originally Posted by nvertigo67

In the logs I've seen, there is not only livedisplay hal crashing, but other hals as well. It seems to me that this relates to some boot timing differences over different boots, depending when hwservicemanager is started - if hardware service manager comes up to late quite some hals (among others also livedisplay) are constantly crashing. Perhaps late start of hwservicemanaher is a followup error from something even more different. Removing livedisplay changes the boot up sequence and it's timing, as using a third party launcher or uninstalling magisk does for others. configstore seems to play in here, too. But I don't completely umderstand, if crashing hwcservice is the cause fpr configstore to crash, or vice versa.

Ideally the bug would be squashed at it's source. i.e Livedisplay would be fixed by LOS. Otherwise it could be removed and replaced by something better on a ROM by ROM basis.

The flashable zip is attached as well as a screenshot showing what the Livedisplay settings now look like after it is applied: (crDroid/OP3T). 'Profiles' is removed but to me the calibration looks like 'Standard'.

Dirty flash your ROM again to undo the changes.

Many thanks to 2Tweak for adapting the script for use here, and to nvertigo67 as always for input and inspiration. Great work as always from both.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20190720-174623_crDroid_Settings.png
Views:	256
Size:	117.1 KB
ID:	4795051  
Attached Files
File Type: zip PIS Fix (OP3T).zip - [Click for QR Code] (967 Bytes, 30 views)
The Following 3 Users Say Thank You to Dirk For This Useful Post: [ View ] Gift Dirk Ad-Free
17th July 2019, 07:18 PM |#2  
Senior Member
Thanks Meter: 10,433
 
Donate to Me
More
Something's wrong with your screenshots:

Display mode (and therefor colour temperature) has been removed from livedisplay in favour for aosp Nightlight. Color profile (where one can select advanced color spaces like srgb and dci-p3) is missing completely.

I'll attach shots from curtent livedisplay implementation and after applying your zip.

EDIT: the linecount computation needs some love. Currently it's cutting like this:
Code:
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ linecount=$(sed -n '/<name>IPictureAdjustment<\/name>/=' configs/manifest.xml)
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ echo $linecount
781
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ sed  "772","786"d configs/manifest.xml >/tmp/t1
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ colordiff -c5 configs/manifest.xml /tmp/t1                         *** configs/manifest.xml        2019-06-16 11:48:17.368090055 +0200
--- /tmp/t1     2019-07-17 19:37:09.170151287 +0200
***************
*** 767,791 ****
      </hal>
      <hal format="hidl">
          <name>vendor.lineage.livedisplay</name>
          <transport>hwbinder</transport>
          <version>2.0</version>
-         <interface>
-             <name>IAdaptiveBacklight</name>
-             <instance>default</instance>
-         </interface>
-         <interface>
-             <name>IDisplayModes</name>
-             <instance>default</instance>
-         </interface>
-         <interface>
-             <name>IPictureAdjustment</name>
-             <instance>default</instance>
-         </interface>
-         <interface>
-             <name>ISunlightEnhancement</name>
-             <instance>default</instance>
          </interface>
      </hal>
      <hal format="hidl">
          <name>vendor.lineage.power</name>
          <transport>hwbinder</transport>
--- 767,776 ----
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $
I guess it should be deleted from "<hal format="hidl">" to the next "</hal>". The unaligned "</interface>" breaks some other hals. I havn't tested everything, but - at least - wifi is broken.

I'm too lazy to look up the exact sed patterns, but I would delete from "<name>vendor.lineage.livedisplay</name>" minis one line to the next occurance of "</hal>" after " <name>vendor.lineage.livedisplay</name>"

Sorry, I have assumed the livedisplay section of op5t and op3/t are identically.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20190717-190123_LineageOS_Settings.png
Views:	160
Size:	130.0 KB
ID:	4793511   Click image for larger version

Name:	Screenshot_20190717-191556_LineageOS_Settings.png
Views:	166
Size:	103.4 KB
ID:	4793512  
The Following User Says Thank You to nvertigo67 For This Useful Post: [ View ] Gift nvertigo67 Ad-Free
17th July 2019, 08:07 PM |#3  
Dirk's Avatar
OP Senior Member
Thanks Meter: 3,788
 
1010
More
Quote:
Originally Posted by nvertigo67

Something's wrong with your screenshots:

Display mode (and therefor colour temperature) has been removed from livedisplay in favour for aosp Nightlight. Color profile (where one can select advanced color spaces like srgb and dci-p3) is missing completely.

I'll attach shots from curtent livedisplay implementation and after applying your zip.

The screenshots are from crDroid where they maybe aren't using the current LOS implementations.

My Wifi is disabled with the fix installed. Removing the fix restores it. Can't see how it could be affected by the zip though. How is yours?

Edit: You've seen it. I was expecting the same file versions on both the OP5/T and OP3/T.
The Following User Says Thank You to Dirk For This Useful Post: [ View ] Gift Dirk Ad-Free
17th July 2019, 08:13 PM |#4  
Senior Member
Thanks Meter: 10,433
 
Donate to Me
More
Quote:
Originally Posted by Dirk

The screenshots are from crDroid where they maybe aren't using the current LOS implementations.

My Wifi is disabled with the fix installed. Removing the fix restores it. Can't see how it could be affected by the zip though. How is yours?

Edit: You've seen it.

Your posting and my edit have crossed. See my edit above

---------- Post added at 20:13 ---------- Previous post was at 20:10 ----------

The longer I look at this, I think tje sed on the manifest file is nice, but unnecessary if the hal and the rc file are removed.
The Following User Says Thank You to nvertigo67 For This Useful Post: [ View ] Gift nvertigo67 Ad-Free
17th July 2019, 08:29 PM |#5  
Dirk's Avatar
OP Senior Member
Thanks Meter: 3,788
 
1010
More
Quote:
Originally Posted by nvertigo67

The longer I look at this, I think tje sed on the manifest file is nice, but unnecessary if the hal and the rc file are removed.

This goes way beyond my level of understanding. That block of entries in the manifest.xml are very different on my crDroid version comapred to your LOS version:

Code:
<hal format="hidl">
        <name>vendor.lineage.livedisplay</name>
        <transport>hwbinder</transport>
        <version>2.0</version>
        <interface>
            <name>IAdaptiveBacklight</name>
            <instance>default</instance>
        </interface>
        <interface>
            <name>IDisplayModes</name>
            <instance>default</instance>
        </interface>
        <interface>
            <name>IPictureAdjustment</name>
            <instance>default</instance>
        </interface>
        <interface>
            <name>ISunlightEnhancement</name>
            <instance>default</instance>
        </interface>
        <fqname>@2.0::IAdaptiveBacklight/default</fqname>
        <fqname>@2.0::IDisplayModes/default</fqname>
        <fqname>@2.0::IPictureAdjustment/default</fqname>
        <fqname>@2.0::ISunlightEnhancement/default</fqname>
If there are changes like that between ROMs, even on the same device, then specific versions of the fix would be needed for each ROM, and would stop working as soon as a ROM dev makes modifications to the base LOS implementation.

My mistake in thinking that the Livedisplay implementation would be consistent between ROMs.

If the edits to the manifest.xml aren't necessary, and only the two files need removing, that would make things much simpler.
17th July 2019, 08:39 PM |#6  
Senior Member
Thanks Meter: 10,433
 
Donate to Me
More
Quote:
Originally Posted by Dirk

This goes way beyond my level of understanding. That block of entries in the manifest.xml are very different on my crDroid version comapred to your LOS version:

Code:
<hal format="hidl">
        <name>vendor.lineage.livedisplay</name>
        <transport>hwbinder</transport>
        <version>2.0</version>
        <interface>
            <name>IAdaptiveBacklight</name>
            <instance>default</instance>
        </interface>
        <interface>
            <name>IDisplayModes</name>
            <instance>default</instance>
        </interface>
        <interface>
            <name>IPictureAdjustment</name>
            <instance>default</instance>
        </interface>
        <interface>
            <name>ISunlightEnhancement</name>
            <instance>default</instance>
        </interface>
        <fqname>@2.0::IAdaptiveBacklight/default</fqname>
        <fqname>@2.0::IDisplayModes/default</fqname>
        <fqname>@2.0::IPictureAdjustment/default</fqname>
        <fqname>@2.0::ISunlightEnhancement/default</fqname>
If there are changes like that between ROMs, even on the same device, then specific versions of the fix would be needed for each ROM, and would stop working as soon as a ROM dev makes modifications to the base LOS implementation.

My mistake in thinking that the Livedisplay files would be consistent between ROMs.

I've asumed the same. You need a more generic solution. This isn't trivial.

Trivial and Quick'n'dirty: leave the manifest alone (should work without touching the manifest).
The Following User Says Thank You to nvertigo67 For This Useful Post: [ View ] Gift nvertigo67 Ad-Free
17th July 2019, 08:51 PM |#7  
Dirk's Avatar
OP Senior Member
Thanks Meter: 3,788
 
1010
More
Quote:
Originally Posted by nvertigo67

I've asumed the same. You need a more generic solution. This isn't trivial.

Trivial and Quick'n'dirty: leave the manifest alone (should work without touching the manifest).

Yep. I wonder how essential the manifest edits are vs just deleting the two files.

If LOS releases an update that changes the manifest.xml contents, the fix would need updating. It would get messy across multiple builds of LOS and messier still with LOS/Based ROMs and various builds.

Like you said, generic/works in all cases would be best, but probably not possible unless there were a way to delete that whole 'Livedisplay' block in the manifest regardless of it's contents.

I'm just going to delete those files manually now and see what it does to Livedisplay.

BRB.

Edit: Restored Backup, removed the two files and booted straight into a PIS Hang. I guess the manifest edits are essential. Gonna have to rethink this whole thing.
GuestK00264
17th July 2019, 09:44 PM |#8  
Guest
Thanks Meter: 0
 
More
Quote:
Originally Posted by Dirk

Yep. I wonder how essential the manifest edits are vs just deleting the two files.

If LOS releases an update that changes the manifest.xml contents, the fix would need updating. It would get messy across multiple builds of LOS and messier still with LOS/Based ROMs and various builds.

Like you said, generic/works in all cases would be best, but probably not possible unless there were a way to delete that whole 'Livedisplay' block in the manifest regardless of it's contents.

I'm just going to delete those files manually now and see what it does to Livedisplay.

BRB.

Edit: Restored Backup, removed the two files and booted straight into a PIS Hang. I guess the manifest edits are essential. Gonna have to rethink this whole thing.


+1
GuestK00264
17th July 2019, 11:53 PM |#9  
Guest
Thanks Meter: 0
 
More
Removed the files and did the editing by hand; issue seems gone with wifi and other functionality still there.

So a smart sed or awk oneliner would probably solve it.
Unfortunately did not find a smart solution for that....
The Following User Says Thank You to For This Useful Post: [ View ] Gift Ad-Free
18th July 2019, 10:06 AM |#10  
Senior Member
Thanks Meter: 10,433
 
Donate to Me
More
After a night with less than enough sleep, I belive I'm going crazy. I'm pretty sure something's wrong in my brain after looking too long at the same lines and I really need some help to unlock my brain again.

We agree that (for los16/oneplus3) that the block from line 768 to 788 needs to be deleted: https://github.com/nvertigo/android_....xml#L768-L788

This should be easy with sed:
Code:
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ sed -e '768,788d' /tmp/manifest.xml >/tmp/t2
I assume that the block (marked above in git) is deleted now, but look at this:
Code:
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ colordiff -u /tmp/manifest.xml /tmp/t2
--- /tmp/manifest.xml   2019-07-18 09:27:39.296058200 +0200
+++ /tmp/t2     2019-07-18 09:49:34.846269326 +0200
@@ -766,27 +766,6 @@
         </interface>
     </hal>
     <hal format="hidl">
-        <name>vendor.lineage.livedisplay</name>
-        <transport>hwbinder</transport>
-        <version>2.0</version>
-        <interface>
-            <name>IAdaptiveBacklight</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IDisplayModes</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IPictureAdjustment</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>ISunlightEnhancement</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
         <name>vendor.lineage.power</name>
         <transport>hwbinder</transport>
         <version>1.0</version>
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $
Ok, I thought, let's decrease start line and end line by one:
Code:
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ sed -e '767,787d' /tmp/manifest.xml >/tmp/t2
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ colordiff -u /tmp/manifest.xml /tmp/t2
--- /tmp/manifest.xml   2019-07-18 09:27:39.296058200 +0200
+++ /tmp/t2     2019-07-18 09:51:25.986269375 +0200
@@ -766,27 +766,6 @@
         </interface>
     </hal>
     <hal format="hidl">
-        <name>vendor.lineage.livedisplay</name>
-        <transport>hwbinder</transport>
-        <version>2.0</version>
-        <interface>
-            <name>IAdaptiveBacklight</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IDisplayModes</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IPictureAdjustment</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>ISunlightEnhancement</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
         <name>vendor.lineage.power</name>
         <transport>hwbinder</transport>
         <version>1.0</version>
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $
Strange, isn't it? But I can make it even mote strange. Let's cut from line 768 to 787:
Code:
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ colordiff -u /tmp/manifest.xml /tmp/t2
--- /tmp/manifest.xml   2019-07-18 09:27:39.296058200 +0200
+++ /tmp/t2     2019-07-18 09:54:39.826271669 +0200
@@ -765,26 +765,6 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl">
-        <name>vendor.lineage.livedisplay</name>
-        <transport>hwbinder</transport>
-        <version>2.0</version>
-        <interface>
-            <name>IAdaptiveBacklight</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IDisplayModes</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IPictureAdjustment</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>ISunlightEnhancement</name>
-            <instance>default</instance>
-        </interface>
     </hal>
     <hal format="hidl">
         <name>vendor.lineage.power</name>
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $
Code:
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ sed -e '768,789d' /tmp/manifest.xml >/tmp/t2
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $ colordiff -u /tmp/manifest.xml /tmp/t2
--- /tmp/manifest.xml   2019-07-18 09:27:39.296058200 +0200
+++ /tmp/t2     2019-07-18 10:08:08.535812187 +0200
@@ -765,28 +765,6 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl">
-        <name>vendor.lineage.livedisplay</name>
-        <transport>hwbinder</transport>
-        <version>2.0</version>
-        <interface>
-            <name>IAdaptiveBacklight</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IDisplayModes</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>IPictureAdjustment</name>
-            <instance>default</instance>
-        </interface>
-        <interface>
-            <name>ISunlightEnhancement</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
         <name>vendor.lineage.power</name>
         <transport>hwbinder</transport>
         <version>1.0</version>
[email protected] /usr/local/src/los16/device/oneplus/oneplus3 $
As you can see, cutting from 768 to 787 works as well as 768 to 789, but as soon as I try to cut from 768 to 788 it gets strange.

I've compiled two different sed versions (4.5 and 4.7) and compiled a busybox with sed: all three seds show the same behaviour.

Please help me unwinding this.

EDIT: some hours of sleep helps: I should finally learn to read diffs. It's as expected and working, of course...
18th July 2019, 10:07 AM |#11  
Dirk's Avatar
OP Senior Member
Thanks Meter: 3,788
 
1010
More
Quote:
Originally Posted by 2Tweak

Removed the files and did the editing by hand; issue seems gone with wifi and other functionality still there.

So a smart sed or awk oneliner would probably solve it.
Unfortunately did not find a smart solution for that....

I dare say the modifications would work as expected if they could be applied consistantly, in a manner that doesn't break unrelated parts of the OS. I'm given pause to even use it on my OP5 knowing that the goalpoasts could shift any time.

Thanks for taking a look.
Post Reply Subscribe to Thread

Tags
fix, livedisplay, phone is starting

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes