[LinOS][M][N] OPO 3.10 kernel (27/05)

Search This thread

erorcun

Senior Member
Oct 14, 2012
901
3,559
Hello guys,

Some of you guys will recognise me, I was trying to make progress on Sultan's 3.10 kernel on his topic. After a while I've wanted to do that from scratch, in new base, and now I can say it's done.

This kernel is the one all recent flagships' use. Also 3.10 kernels' support will end in Oct. 2017, while 3.4 ones will end in Apr. 2017.
In theory it should have better memory management, less battery consumption etc. It took me about 7-8 months to come to this point.

Currently everything works.

Extra features

* KCAL
* 6 new governors
* Touchscreen driver has been updated and optimized - also S2W added, you can find it in Kernel Aduitor
* Works with pelya's USB Keyboard app.
* New charger driver features:

They're placed in: /sys/devices/qpnp-charger-ed443000
You need to reach them from some terminal app or adb shell.

threea_charge

Making it 1 will activate experimental 2.5A charge. It's triggered if AICL mA is 2000(if you're not sure about AICL mA, simply disable AICL by below parameter), temperature is appropriate and screen is off.
Only use if you have 2.5A or above charger. Don't use QC's Quick Charge adapters.
Untested, but can't damage your phone.

disable_aicl

Making it 1 will disable AICL and charger driver will always try to take 2A from your AC/wall charger (there's no problem if you charger isn't 2A)
You need to replug adapter to see the effect.

max_aicl_rate

Max. charge current. (Not exactly if it's below 0 Celsius)
It should be one of those: 100,150,500,900,1200,1500,2000. Other values will be rounded. Values below then 100 and higher then 2000 won't be accepted.
Has no effect if AICL is disabled via above parameter.
If threea_charge is enabled and this parameter is 2000, max current will be 2.5A.
You need to replug adapter to see the effect.

fast_usb_charge Can also be found in Kernel Aduitor

Making it 1 will charge your phone through 900 mA if it's charging via USB port.
You need to replug adapter to see the effect.

charge_limit

It only accepts values between 0-100. Charger driver will cap charge percent to entered value. It's known that capping it to 50-60 percent increases battery life.
Making it 100 will revert the effect.

soft_aicl_vol

It must be between 4350 and 5000.
Default is OP2 value (4465 - but algorithm is different from LinOS and you shouldn't directly enter Sultan's or LinOS's value).
Don't change that if you don't know what it is.


Ramdisk changes
Last update: 17-02-2017


in fstab.bacon:
* F2FS filesystems must be mounted without noatime option.
* "/devices/platform/xhci-hcd" --> "/devices/*/xhci-hcd.0.auto/usb";
* "voldmanaged=usbdisk:auto" --> "voldmanaged=usb:auto";

in init.bacon.rc:
* qcom_oncrpc must be removed from loc_launcher (this is CM's mistake)
* netmgrd must also have system group
* qmuxd's user must be changed to root
in init.qcom.power.rc/init.recovery.bacon.rc:
* cpubw.40 must be changed to cpubw.47

These are only things different than CM ramdisk right now.

in anykernel patch format (all credits goes to @idprophecy)
## 3.10 ramdisk fixes

# fstab

if [ -f fstab.bacon ]; then
fstab="fstab.bacon";
backup_file $fstab;
elif [ -f fstab.qcom ]; then
fstab="fstab.qcom";
backup_file $fstab;
fi;

if [ -n $fstab ]; then
replace_string $fstab "/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs nosuid" "/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs noatime,nosuid" "/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs nosuid";
replace_string $fstab "/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs nosuid" "/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs noatime,nosuid" "/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs nosuid";
replace_string $fstab "/devices/*/xhci-hcd.0.auto/usb" "/devices/platform/xhci-hcd" "/devices/*/xhci-hcd.0.auto/usb";
replace_string $fstab "voldmanaged=usb:auto" "voldmanaged=usbdisk:auto" "voldmanaged=usb:auto";
fi;

# init.recovery.bacon.rc

if [ -f init.recovery.bacon.rc ]; then
qcomrecovery="init.recovery.bacon.rc";
backup_file $qcomrecovery;
fi;

if [ -n $qcomrecovery ]; then
replace_string $qcomrecovery "cpubw.47" "cpubw.40" "cpubw.47";
fi;

# init.qcom.power.rc

if [ -f init.qcom.power.rc ]; then
qcompower="init.qcom.power.rc";
backup_file $qcompower;
fi;

if [ -n $qcompower ]; then
replace_string $qcompower "cpubw.47" "cpubw.40" "cpubw.47";
fi;

# init.bacon.rc

if [ -f init.bacon.rc ]; then
qcomdevice="init.bacon.rc";
backup_file $qcomdevice;
elif [ -f init.oppo.common.rc ]; then
qcomdevice="init.oppo.common.rc";
backup_file $qcomdevice;
fi;

if [ -n $qcomdevice ]; then
replace_string $qcomdevice "# loc_launcher qcom_oncrps not needed" " group gps qcom_oncrpc inet" " # loc_launcher qcom_oncrps not neededn group gps inet";
replace_string_multiline $qcomdevice "# fix netmgrd service" "service netmgrd /system/bin/netmgrdn class mainn user rootn group radio" "service netmgrd /system/bin/netmgrdn class mainn user rootn # fix netmgrd servicen group radio system";
replace_string_multiline $qcomdevice "# fix qmuxd service" "service qmuxd /system/bin/qmuxdn class mainn user radio" "service qmuxd /system/bin/qmuxdn class mainn # fix qmuxd servicen user root";
fi;

## 3.10 ramdisk fixes


Downloads

Code:
Nobody knows is your warrant is still valid.
Also it's suspicious is there any warranty for OPO.

After you started to use this kernel, I'm not resposible for anything happened to your device.

* Encryption works but I cannot guarantee that it won't cause any data loss.
* They're all AnyKernel.

* There will be two types of build after 19/05, one with CM camera driver, one with CAF/Sultan camera driver.


27-05-2017:
With CM camera: https://www.mediafire.com/?7z672wl1y6xy275
With CAF/Sultan camera: https://www.mediafire.com/?sts35t5hd5ca3xr

19-05-2017:
With CM camera driver: https://www.mediafire.com/?4pkk3co7290lx1l
With CAF/Sultan camera driver: https://www.mediafire.com/?hohbwk9l805nrn0

09-04-2017: http://www.mediafire.com/file/h2k3moy0s6mxiht/09042017kernel.zip


A little nostalgia :p (It's too buggy, you have been warned)
26-08-2016: http://www.mediafire.com/file/6j5xw1j1lel1tra/260816kernel310.zip

Source code link is available bottom of this post.

Technical side

* It is based on LA.BF.2.1.2
* You can use both LA.BF and LA.BR prima, I'm using LA.BF one with some LA.BR commits.
* Tspp driver was causing bootloop, so i've disabled it. And I don't know is it used at all, it's disabled in apq8084 devices (like nexus 6) even.
* I'm compiling it with GCC 4.8. I've switched to Uber 6.0 after 09-01 build.
* KGSL drivers is pretty messed up after 30-08 build. It's my fault.
* And compiled DT is in in arch/arm/boot, it was different in 3.4 I think.

Pull requests are welcome.

You can use use/fork/develop this but you should give credit for 3.10 kernel on your releases.

Did you like my work?

I appreciate all the donations, it will keep me motivated, also I'm a student so it will help me in my life :)
Addendum: PayPal has been banned from my country, if PayPal denies your transaction and if you want to donate, I can give you my IBAN.

Credits
Sultan - this kernel would be impossible without his helps & his first 3.10 kernel attempt.
Ra1nst0rm - for helping me to upload repo - releasing this would be impossible due to creeping internet in here.
Mecca UL & idprophecy - for their insane effort to test and improve this kernel =)

XDA:DevDB Information
OnePlus One 3.10 kernel, Kernel for the OnePlus One

Contributors
erorcun, Sultanxda
Source Code: https://github.com/erorcun/android_kernel_oneplus_msm8974-3.10

Kernel Special Features: 3.10 kernel - better memory management and battery consumption in theory

Version Information
Status: Beta
Current Beta Version: 1.0

Created 2016-05-14
Last Updated 2017-05-27
 
Last edited:

erorcun

Senior Member
Oct 14, 2012
901
3,559
My country is famous with creeping internet, so I gave a chance to github import tool to import it from caf first, but it has been almost 1 day and progress bar still seems full, I think it got stuck.

I will be grateful to anyone who gives me LA.BF.2.1.2_rb1.5 kernel imported repo :silly: Ofcourse I can do it myself but I don't know when I can.

And I will add credits to one who upload it.
 
Last edited:
  • Like
Reactions: mucinch

mucinch

Senior Member
Nov 30, 2010
124
29
Works beautifully with CM Nightly 15-05 on a secondary Multirom installation. GPS worked well for me, but during calls the other party couldnt hear my voice. So reluctantly removed for now. Hope you fix the issues and continue developing the kernel for our beloved OPO.
 
  • Like
Reactions: erorcun

erorcun

Senior Member
Oct 14, 2012
901
3,559
Works beautifully with CM Nightly 15-05 on a secondary Multirom installation. GPS worked well for me, but during calls the other party couldnt hear my voice. So reluctantly removed for now. Hope you fix the issues and continue developing the kernel for our beloved OPO.

Yeah, GPS works well actually but it shouldn't be perfect since part of it crashes.

Thanks!
 
  • Like
Reactions: mucinch

Spider-Vice

Senior Member
Jul 15, 2013
469
210
Nice development! Thanks for this!

Edit: Working nicely on a test install of Vanilla Unicorn (CM based)
nl61YNx.png
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 160
    Hello guys,

    Some of you guys will recognise me, I was trying to make progress on Sultan's 3.10 kernel on his topic. After a while I've wanted to do that from scratch, in new base, and now I can say it's done.

    This kernel is the one all recent flagships' use. Also 3.10 kernels' support will end in Oct. 2017, while 3.4 ones will end in Apr. 2017.
    In theory it should have better memory management, less battery consumption etc. It took me about 7-8 months to come to this point.

    Currently everything works.

    Extra features

    * KCAL
    * 6 new governors
    * Touchscreen driver has been updated and optimized - also S2W added, you can find it in Kernel Aduitor
    * Works with pelya's USB Keyboard app.
    * New charger driver features:

    They're placed in: /sys/devices/qpnp-charger-ed443000
    You need to reach them from some terminal app or adb shell.

    threea_charge

    Making it 1 will activate experimental 2.5A charge. It's triggered if AICL mA is 2000(if you're not sure about AICL mA, simply disable AICL by below parameter), temperature is appropriate and screen is off.
    Only use if you have 2.5A or above charger. Don't use QC's Quick Charge adapters.
    Untested, but can't damage your phone.

    disable_aicl

    Making it 1 will disable AICL and charger driver will always try to take 2A from your AC/wall charger (there's no problem if you charger isn't 2A)
    You need to replug adapter to see the effect.

    max_aicl_rate

    Max. charge current. (Not exactly if it's below 0 Celsius)
    It should be one of those: 100,150,500,900,1200,1500,2000. Other values will be rounded. Values below then 100 and higher then 2000 won't be accepted.
    Has no effect if AICL is disabled via above parameter.
    If threea_charge is enabled and this parameter is 2000, max current will be 2.5A.
    You need to replug adapter to see the effect.

    fast_usb_charge Can also be found in Kernel Aduitor

    Making it 1 will charge your phone through 900 mA if it's charging via USB port.
    You need to replug adapter to see the effect.

    charge_limit

    It only accepts values between 0-100. Charger driver will cap charge percent to entered value. It's known that capping it to 50-60 percent increases battery life.
    Making it 100 will revert the effect.

    soft_aicl_vol

    It must be between 4350 and 5000.
    Default is OP2 value (4465 - but algorithm is different from LinOS and you shouldn't directly enter Sultan's or LinOS's value).
    Don't change that if you don't know what it is.


    Ramdisk changes
    Last update: 17-02-2017


    in fstab.bacon:
    * F2FS filesystems must be mounted without noatime option.
    * "/devices/platform/xhci-hcd" --> "/devices/*/xhci-hcd.0.auto/usb";
    * "voldmanaged=usbdisk:auto" --> "voldmanaged=usb:auto";

    in init.bacon.rc:
    * qcom_oncrpc must be removed from loc_launcher (this is CM's mistake)
    * netmgrd must also have system group
    * qmuxd's user must be changed to root
    in init.qcom.power.rc/init.recovery.bacon.rc:
    * cpubw.40 must be changed to cpubw.47

    These are only things different than CM ramdisk right now.

    in anykernel patch format (all credits goes to @idprophecy)
    ## 3.10 ramdisk fixes

    # fstab

    if [ -f fstab.bacon ]; then
    fstab="fstab.bacon";
    backup_file $fstab;
    elif [ -f fstab.qcom ]; then
    fstab="fstab.qcom";
    backup_file $fstab;
    fi;

    if [ -n $fstab ]; then
    replace_string $fstab "/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs nosuid" "/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs noatime,nosuid" "/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs nosuid";
    replace_string $fstab "/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs nosuid" "/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs noatime,nosuid" "/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs nosuid";
    replace_string $fstab "/devices/*/xhci-hcd.0.auto/usb" "/devices/platform/xhci-hcd" "/devices/*/xhci-hcd.0.auto/usb";
    replace_string $fstab "voldmanaged=usb:auto" "voldmanaged=usbdisk:auto" "voldmanaged=usb:auto";
    fi;

    # init.recovery.bacon.rc

    if [ -f init.recovery.bacon.rc ]; then
    qcomrecovery="init.recovery.bacon.rc";
    backup_file $qcomrecovery;
    fi;

    if [ -n $qcomrecovery ]; then
    replace_string $qcomrecovery "cpubw.47" "cpubw.40" "cpubw.47";
    fi;

    # init.qcom.power.rc

    if [ -f init.qcom.power.rc ]; then
    qcompower="init.qcom.power.rc";
    backup_file $qcompower;
    fi;

    if [ -n $qcompower ]; then
    replace_string $qcompower "cpubw.47" "cpubw.40" "cpubw.47";
    fi;

    # init.bacon.rc

    if [ -f init.bacon.rc ]; then
    qcomdevice="init.bacon.rc";
    backup_file $qcomdevice;
    elif [ -f init.oppo.common.rc ]; then
    qcomdevice="init.oppo.common.rc";
    backup_file $qcomdevice;
    fi;

    if [ -n $qcomdevice ]; then
    replace_string $qcomdevice "# loc_launcher qcom_oncrps not needed" " group gps qcom_oncrpc inet" " # loc_launcher qcom_oncrps not neededn group gps inet";
    replace_string_multiline $qcomdevice "# fix netmgrd service" "service netmgrd /system/bin/netmgrdn class mainn user rootn group radio" "service netmgrd /system/bin/netmgrdn class mainn user rootn # fix netmgrd servicen group radio system";
    replace_string_multiline $qcomdevice "# fix qmuxd service" "service qmuxd /system/bin/qmuxdn class mainn user radio" "service qmuxd /system/bin/qmuxdn class mainn # fix qmuxd servicen user root";
    fi;

    ## 3.10 ramdisk fixes


    Downloads

    Code:
    Nobody knows is your warrant is still valid.
    Also it's suspicious is there any warranty for OPO.
    
    After you started to use this kernel, I'm not resposible for anything happened to your device.

    * Encryption works but I cannot guarantee that it won't cause any data loss.
    * They're all AnyKernel.

    * There will be two types of build after 19/05, one with CM camera driver, one with CAF/Sultan camera driver.


    27-05-2017:
    With CM camera: https://www.mediafire.com/?7z672wl1y6xy275
    With CAF/Sultan camera: https://www.mediafire.com/?sts35t5hd5ca3xr

    19-05-2017:
    With CM camera driver: https://www.mediafire.com/?4pkk3co7290lx1l
    With CAF/Sultan camera driver: https://www.mediafire.com/?hohbwk9l805nrn0

    09-04-2017: http://www.mediafire.com/file/h2k3moy0s6mxiht/09042017kernel.zip


    A little nostalgia :p (It's too buggy, you have been warned)
    26-08-2016: http://www.mediafire.com/file/6j5xw1j1lel1tra/260816kernel310.zip

    Source code link is available bottom of this post.

    Technical side

    * It is based on LA.BF.2.1.2
    * You can use both LA.BF and LA.BR prima, I'm using LA.BF one with some LA.BR commits.
    * Tspp driver was causing bootloop, so i've disabled it. And I don't know is it used at all, it's disabled in apq8084 devices (like nexus 6) even.
    * I'm compiling it with GCC 4.8. I've switched to Uber 6.0 after 09-01 build.
    * KGSL drivers is pretty messed up after 30-08 build. It's my fault.
    * And compiled DT is in in arch/arm/boot, it was different in 3.4 I think.

    Pull requests are welcome.

    You can use use/fork/develop this but you should give credit for 3.10 kernel on your releases.

    Did you like my work?

    I appreciate all the donations, it will keep me motivated, also I'm a student so it will help me in my life :)
    Addendum: PayPal has been banned from my country, if PayPal denies your transaction and if you want to donate, I can give you my IBAN.

    Credits
    Sultan - this kernel would be impossible without his helps & his first 3.10 kernel attempt.
    Ra1nst0rm - for helping me to upload repo - releasing this would be impossible due to creeping internet in here.
    Mecca UL & idprophecy - for their insane effort to test and improve this kernel =)

    XDA:DevDB Information
    OnePlus One 3.10 kernel, Kernel for the OnePlus One

    Contributors
    erorcun, Sultanxda
    Source Code: https://github.com/erorcun/android_kernel_oneplus_msm8974-3.10

    Kernel Special Features: 3.10 kernel - better memory management and battery consumption in theory

    Version Information
    Status: Beta
    Current Beta Version: 1.0

    Created 2016-05-14
    Last Updated 2017-05-27
    59
    Hi guys, after a long journey I release first stable version today. Probably there won't be frequent releases anymore because nothing much to do left. Thanks to everyone who contribute and test :)

    Things I've done in a week:

    - Cell standby drain fixed
    It was happening if wifi got activated while mobile data is open, thanks to @spanish33 for reporting
    - Most of kernel has synced with upstream 3.10
    Net stack has seen an overhaul, CAF's mobile data could work now, but if won't I have nothing else to do.
    Memory management also seen a big improvement.
    - We're using OnePlus 3 fuelgauger(battery reading) driver now
    Because Oppo one was a mess and I don't trust CM one
    - Some latest important CM commits imported
    - Some people reported not detected gestures and panels that's not resuming, these should be fixed
    Touchscreen driver is final now, I won't touch it anymore
    - WCNSS stack has changed and there is no more warnings on logs and boot is faster also.
    - Prima has some new 3.10 commits
    It's not completely same with CM's LA.BF branch Prima anymore,
    but if anyone wants, can use it with LA.BF prima since the kernel is compatible with both LA.BR and LA.BF Prima.
    - Defconfig has seen an overhaul
    All possible USB devices should work now, also useless debug things got removed
    - I gave up using old touchscreen firmware, latest ones are better
    - If there were an extra battery drain after watching video, it's also fixed

    And beside I think mobile data on CAF fixed I also think CAF camera focus should be fixed too. I will try to release CAF version today, if I won't be able, I will release tomorrow.

    Also .diff and anykernel patch that can be applied to ramdisk is available on OP.

    Link: http://www.mediafire.com/download/3dmeld1xdyasptj/bacon3.10(s2).zip

    Do not try on encrypted phone.
    idprophecy will post anykernel version soon and I will put it to OP.
    42
    Yes.

    Guys, I'm back. I will prepare the environment as soon as possible in this PC and will continue to develop it.
    I've began making my custom kernel also but I don't when I will finish it.
    34
    Hey, there is a new version :p This time in anykernel, so it works with COS.

    Battery driver updated with latest OP3 one, synced with CM commits, there is a fix in binder and improvements in gpu driver.
    Also I can confirm it works in enforced selinux, atleast with anykernel. But I will give anykernel link this time anyhow.

    http://www.mediafire.com/download/6j5xw1j1lel1tra/260816kernel310.zip

    I'm testing it only for a hour, so there can be reboots, I don't know.
    30
    All sound problems are fixed.

    It became even better than before if you ask me :p

    All feedbacks are welcomed.

    --------

    Did Sultans 3.10 kernel have sound?

    I think it never had sound.
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