[ROM][Android 8/9/10][Unofficial] LineageOS for Mi-4c/Mi-4s

Michal38

New member
Dec 10, 2017
2
0
0
Thanks for the fast reply. So it's not possible to disable the pop up without updating to LineageOS 17? It's not a big issue but I want to be sure.
 

mr_rious

Member
Sep 27, 2013
14
2
0
"do you mean the device got freeze at lockscreen (eg. when you try to unlock the device)?"

It's my old phone, and I didn't use it as a phone now, so I can't really tell the timing of freeze. But I found it was frozen after sleep mode multiple times as you said.

As for frequency, it seems like the cores go up as high as they are allowed. I remember the stock ROMs cap the max freq for safety.

Since I limited the max CPU speed to 144k, it has been very stable without any unpredictable freezes. Also, the phone is not as hot as before.

---------- Post added at 04:24 PM ---------- Previous post was at 04:01 PM ----------

"init.d has been removed by LineageOS team, so it's not officially supported anymore"

Sorry, I didn't know that. It's not critical because Magisk can handle scripts.

:good: :victory: Finally, my phone do no longer randomly reboots.
I reduced the speed to around 144k with a root app called "CpuSpeed". Thanks for the important note!
 
Last edited:

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
:good: :victory: Finally, my phone do no longer randomly reboots.
I reduced the speed to around 144k with a root app called "CpuSpeed". Thanks for the important note!
If CPU/GPU overclock is the reason that caused random reboot (it's surely possible), it means the CPU (or msm8992 SOC) in some devices has different hardware quality than others (just as the screen: only some of them support 75Hz refresh rate, others will stop working). That's why this problem doesn't happens to all Mi-4c/4s (My device doesn't reboot even when overclocking the big cores to 1.8GHz).
 
Last edited:

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
Thanks for the fast reply. So it's not possible to disable the pop up without updating to LineageOS 17? It's not a big issue but I want to be sure.
Technically, yes. We cannot get rid of the pop-ups unless disabling permission review. You may try to decompile framework-res.apk (or generate a RRO overlay to override default configs), find "config_permissionReviewRequired" in "res/values/config.xml" and set it to "false".
 
Jun 26, 2014
9
0
0
Top rom for my mi4c, thanks! I have random reboot in standby with the screen off, i think it's the overclock... How can i decrease it? In which file should i edit? Thanks
 

lousido

Member
Jul 12, 2009
10
1
23
I have updated the ROM to version 20200430, from TWRP only with Wipe Davilk / art, cache. (I have deleted NotoSans CJK.ttf and the Webview from the system) then I have installed the open_gapps 20200501, in 2 devices.
* It works perfect, for daily use and the battery can last all day with good activity.
In another terminal, the update was activated by OTA, but it did not download (it gave an error). Updated by the previous process. Everything was perfect too.
I cannot update another terminal from the ROM version 20200225. With that version of the ROM, it works perfect. A screen lock occurs and restarts constantly. (It may be some component of the terminal, which has other characteristics)
I am very grateful for your work, @WJXXBSH
Many thanks
 
Last edited:

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
Top rom for my mi4c, thanks! I have random reboot in standby with the screen off, i think it's the overclock... How can i decrease it? In which file should i edit? Thanks
If you have root access (or some other ways to modify "/system"), edit "/system/vendor/bin/init.qcom.post_boot.sh" to decrease max frequency for little cores:
Code:
# Configure governor settings for little cluster
echo 302400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
[B]echo 1440000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq[/B]
echo "sched" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Then reboot your device to see if it works. Remember to set right permission and secontext just as the original file.
 
  • Like
Reactions: buonincontrigi

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
I have updated the ROM to version 20200430, from TWRP only with Wipe Davilk / art, cache. (I have deleted NotoSans CJK.ttf and the Webview from the system) then I have installed the open_gapps 20200501, in 2 devices.
* It works perfect, for daily use and the battery can last all day with good activity.
In another terminal, the update was activated by OTA, but it did not download (it gave an error). Updated by the previous process. Everything was perfect too.
I cannot update another terminal from the ROM version 20200225. With that version of the ROM, it works perfect. A screen lock occurs and restarts constantly. (It may be some component of the terminal, which has other characteristics)
I am very grateful for your work, @WJXXBSH
Many thanks
If you deleted the NotoCJK fonts, the free space should be enough for OpenGapps pico package (only need to delete webview for bigger packages).
Do you mean one of your devices restart directly on lockscreen after boot (less than 30 seconds, with no response)? Or the device failed to wake up after some time? My Mi-4c doesn't have such problems, maybe the hardware is really different on devices produced in different time.
 
  • Like
Reactions: lousido

lousido

Member
Jul 12, 2009
10
1
23
If you deleted the NotoCJK fonts, the free space should be enough for OpenGapps pico package (only need to delete webview for bigger packages).
Do you mean one of your devices restart directly on lockscreen after boot (less than 30 seconds, with no response)? Or the device failed to wake up after some time? My Mi-4c doesn't have such problems, maybe the hardware is really different on devices produced in different time.
Thanks for your reply.
The device perfectly updates and loads the new Rom and the open_gapps pico. If the device is connected to the charger it has no problem. If I unplug the charger it allows me 1-3 minutes of activity and then the screen freezes and reboots perfectly in ROM again. Enter a circle of reboots.
I flash the ROM of version 20200225 and it works perfect with the included gapps.
I have done all kinds of updates installation. Every time you edit a new version I try again.
Thank you very much for your dedication. Very thankful
 
Jun 26, 2014
9
0
0
If you have root access (or some other ways to modify "/system"), edit "/system/vendor/bin/init.qcom.post_boot.sh" to decrease max frequency for little cores:

Code:
# Configure governor settings for little cluster

echo 302400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

[B]echo 1440000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq[/B]

echo "sched" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Then reboot your device to see if it works. Remember to set right permission and secontext just as the original file.
Thanks! I try now....

Inviato dal mio SM-N950F utilizzando Tapatalk
 

Sebbo06

Senior Member
Jul 3, 2014
59
10
0
Hi WJXXBSH,
I have sadly a problem with latest version 20200430.
After a little time, the phone closed almost every app after start and went back to home screen.
In the same time the internal vibration sensor clocked like a clock nearly every 1-2 seconds.
After a reboot it works for a while and begins again.

Any hint how to fix this.

Thanks in advanced.
 
Last edited:

Sebbo06

Senior Member
Jul 3, 2014
59
10
0
Hi, I think it is fixed now.
I did a dirty flash with latest version, removed NotoSans CJK.ttf, installed opengapps pico and chenged governor settings for little cluster as recomanded "echo 1440000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq".

No issues so far.
Thanks for this amazing rom.

Hi WJXXBSH,
I have sadly a problem with latest version 20200430.
After a little time, the phone closed almost every app after start and went back to home screen.
In the same time the internal vibration sensor clocked like a clock nearly every 1-2 seconds.
After a reboot it works for a while and begins again.

Any hint how to fix this.

Thanks in advanced.
 

edsuns

New member
May 6, 2020
1
0
0
Hi WJXXBSH,
"SELinux is not work" is not mentioned in version 20200430, which means SELinux has been fixed. However, SELinux is not work on my decive with version 20200430.
Why? I have no ideas. Could you help me?
Thank you!
 

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
Hi WJXXBSH,
"SELinux is not work" is not mentioned in version 20200430, which means SELinux has been fixed. However, SELinux is not work on my decive with version 20200430.
Why? I have no ideas. Could you help me?
Thank you!
If you have enabled root access, SELinux will be disabled as it's not necessary. You could check root access status by "getprop persist.sys.root_access" (1: enable, 0: disable), and "getenforce" for SELinux status.
Currently, SELinux is only enabled after boot finished (but not at the beginning time), or a bootloop will happen. That's one of the reasons why this lineage rom couldn't be official.
 

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
Hi, I think it is fixed now.
I did a dirty flash with latest version, removed NotoSans CJK.ttf, installed opengapps pico and chenged governor settings for little cluster as recomanded "echo 1440000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq".

No issues so far.
Thanks for this amazing rom.
Right, I decided to underclock the the little cores to stock frequency (1632 MHz → 1440 MHz, big cores not changed), which should make the device more stable. The voltage during 302 MHz (for all cores) is also decreased to save more power.
 
Last edited:

Sebbo06

Senior Member
Jul 3, 2014
59
10
0
Hi WJXXBSH,

could you provide a "init.qcom.post_boot.sh" file with stock settings for Mi4C, or better with commentation what values were changed from default values.
From time to time I have the mentioned problems again. But not as much as before.
So I can test to change the values for my device to work without any issue.

Thanks in advanced.

Right, I decided to underclock the the little cores to stock frequency (1632 MHz → 1440 MHz, big cores not changed), which should make the device more stable. The voltage during 302 MHz (for all cores) is also decreased to save more power.
 

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
Hi WJXXBSH,

could you provide a "init.qcom.post_boot.sh" file with stock settings for Mi4C, or better with commentation what values were changed from default values.
From time to time I have the mentioned problems again. But not as much as before.
So I can test to change the values for my device to work without any issue.

Thanks in advanced.
The stock version from MIUI will not work on this rom, as interactive scheduler is not implemented. If you want to change the parameters of CPU scheduler, these lines are what you need:
Code:
# Configure governor settings for little cluster
## Stock value: 384000/1440000
## Available values: [B]302400[/B] [U]384000[/U] 460800 600000 672000 787200 864000 960000 1248000 [U]1440000[/U] 1536000 [B]1632000[/B]
### Set the minimum frequency of little cores
echo 302400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
### Set the maxium frequency of little cores
echo 1632000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
### Set the scheduler of little cores
echo "sched" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# Configure governor settings for big cluster
## Stock value: 384000/1824000
## Available values: [B]302400[/B] [U]384000[/U] 460800 600000 672000 787200 864000 960000 1248000 1440000 1536000 1632000 1689600 [B][U]1824000[/U][/B]
### Set the minimum frequency of big cores
echo 302400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
### Set the maxium frequency of big cores
echo 1824000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq
### Set the scheduler of big cores
echo "sched" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
The other lines should not be changed unless you want to change something else (eg. core control, GPU minimum frequency...).
By the way, could you help me to test if your device works properly at 1536 MHz (little cores)? Thanks.
 
Last edited:

Sebbo06

Senior Member
Jul 3, 2014
59
10
0
Hi WJXXBSH,

i set everyting to default values and changed Configure governor settings for little cluster to 1536000
echo 1536000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

Right now everything seems to be stable and smooth.
I will give further feedback tonight.

Many Thanks so far :)

The stock version from MIUI will not work on this rom, as interactive scheduler is not implemented. If you want to change the parameters of CPU scheduler, these lines are what you need:
Code:
# Configure governor settings for little cluster
## Stock value: 384000/1440000
## Available values: [B]302400[/B] [U]384000[/U] 460800 600000 672000 787200 864000 960000 1248000 [U]1440000[/U] 1536000 [B]1632000[/B]
### Set the minimum frequency of little cores
echo 302400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
### Set the maxium frequency of little cores
echo 1632000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
### Set the scheduler of little cores
echo "sched" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# Configure governor settings for big cluster
## Stock value: 384000/1824000
## Available values: [B]302400[/B] [U]384000[/U] 460800 600000 672000 787200 864000 960000 1248000 1440000 1536000 1632000 1689600 [B][U]1824000[/U][/B]
### Set the minimum frequency of big cores
echo 302400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
### Set the maxium frequency of big cores
echo 1824000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq
### Set the scheduler of big cores
echo "sched" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
The other lines should not be changed unless you want to change something else (eg. core control, GPU minimum frequency...).
By the way, could you help me to test if your device works properly at 1536 MHz (little cores)? Thanks.


---------- Post added at 10:47 AM ---------- Previous post was at 09:50 AM ----------

Hi WJXXBSH,

1536000 didn't realy work for me, after wakeup from standby the vibration sensor startet to virbrate and I get fc on apps.
This only happens after wakeup from standby. Now I am back on default values 1440000 and will see how it behaves til tonight.

Cheers
 

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
Hi WJXXBSH,

i set everyting to default values and changed Configure governor settings for little cluster to 1536000
echo 1536000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

Right now everything seems to be stable and smooth.
I will give further feedback tonight.

Many Thanks so far :)



---------- Post added at 10:47 AM ---------- Previous post was at 09:50 AM ----------

Hi WJXXBSH,

1536000 didn't realy work for me, after wakeup from standby the vibration sensor startet to virbrate and I get fc on apps.
This only happens after wakeup from standby. Now I am back on default values 1440000 and will see how it behaves til tonight.

Cheers
Right, 1440 MHz will be the default frequency (A53) in the next rom update. Thanks for your feedback.
 
  • Like
Reactions: mr_rious

Sebbo06

Senior Member
Jul 3, 2014
59
10
0
Hi WJYYBSH,

even with stock values like 1440000 Hz I got this strange behavior. Not as much as before, but still the same.
After wakeup from standby the vibration sensor starts to pulse and apps i want to open will be forced closed by that pulse.
After opening them again and again the problem is gone till next wakeup from standby. After reebot the phone works fine till next wakeup from standby.

Any Idea how to fix this?

Right, 1440 MHz will be the default frequency (A53) in the next rom update. Thanks for your feedback.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone