[KERNEL][OREO] [SM-T830/T835] [2019-11-21] Modesty 1.0.0 [Linux 4.4.202] [ARK4]

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,817
0
XDA The message you have entered is too short. Please lengthen your message to at least 2 characters??? <---- I keep getting this mgs when trying to quote you @ianmacd ? XDA is crashing dude..
It only says that if you post less than 3 characters. Quotes don't count.
 

N1NJATH3ORY

Senior Member
Aug 16, 2010
1,046
181
63
It only says that if you post less than 3 characters. Quotes don't count.
Yes but i typed out a few paragraphs answering ianmacd and i still was getting that msg..

Ahh I think where I was going wrong, I was typing within ianmacd post not underneath it,

And I think XDA would not recognize, that I have entered a response. Thanks
 

ianmacd

Senior Member
Jan 5, 2016
2,278
3,583
183
Amsterdam
Version 0.99.10 released.

The 0.99.10 release brings the inclusion of the KCAL advanced colour/gamma control driver. Amongst other things, @Chainfire's CF.lumen can make good use of this to efficiently apply a blue light filter to your screen. Android Oreo has a built-in blue light filter, of course, but in my opinion it leaves much to be desired. There is no gradual transition to night mode and when active, colours appear oversaturated. If, like me, you had abandoned CF.lumen on Oreo, you may wish to revisit that decision.

The number of tracing and logging features has also been further reduced in this release. Such features really have no place outside an internal engineering build and cause the kernel's footprint to be unnecessarily large, both on disk and when loaded into memory. Pretty much only logging features I have left enabled are those that are actually useful, plus those whose removal causes recurring messages to be emitted to the system log.

Disabling some of these logging features caused a spurious and rather grave-sounding Android System warning to appear on boot, the solution to which was to have the kernel falsely report a stock config to user land when queried via /proc/config.gz. Please be aware, therefore, that this is no longer a reliable mechanism. GitHub is the definitive source of the configuration actually used to build the kernel.

Finally, Linux 4.4.164 appeared as I was preparing 0.99.10 for release, so this has also been merged.

All users on ARJ3 firmware are encouraged to upgrade.

Here's a comparison of the memory used by Modesty 0.99.10 vs. 0.99.9 (and 0.99.9 was already much improved over the stock kernel):

Code:
    0.99.9: Memory: 3169928K/3856128K available (19582K kernel code, 2183K rwdata, 10888K rodata, 7424K init, 8001K bss, 501880K reserved, 184320K cma-reserved)
    0.99.10: Memory: 3172276K/3856128K available (19390K kernel code, 2151K rwdata, 9740K rodata, 5952K init, 7669K bss, 499532K reserved, 184320K cma-reserved)
Change log

  • Updated to Linux 4.4.164.
  • Added KCAL advanced colour/gamma control driver. (Configure with MTweaks or EX Kernel Manager.)
  • Lots of tracing and debug logging disabled, further reducing kernel size.
    • CONFIG_DISPLAY_USE_INFO
    • CONFIG_SEC_DISPLAYPORT_LOGGER
    • CONFIG_FB_MSM_MDSS_XLOG_DEBUG
    • CONFIG_SEC_FILE_LEAK_DEBUG
    • CONFIG_SEC_DEBUG_USER
    • CONFIG_SEC_DEBUG_SUMMARY
    • CONFIG_SCSI_UFSHCD_CMD_LOGGING
    • CONFIG_MSM_SMEM_LOGGING
    • CONFIG_PROFILING
    • CONFIG_DEBUG_INFO
    • CONFIG_SCHED_DEBUG
    • CONFIG_SEC_PM_DEBUG
    • CONFIG_CORESIGHT
  • Built as monolithic kernel (i.e. without CONFIG_MODULES).
  • Built as relocatable code (CONFIG_RELOCATABLE_KERNEL).
  • Assembler symbols stripped (CONFIG_STRIP_ASM_SYMS set).
  • Embedded kernel config (reported via /proc/config.gz) now falsely reports stock settings to allow disabling of superfluous kernel features that otherwise cause grave Android System warning on boot.
 
Last edited:

ianmacd

Senior Member
Jan 5, 2016
2,278
3,583
183
Amsterdam
T835N( For Korea) or T835C ( For China), can use this?
I don't know. Back up your existing boot partition and give it a try.

There's a chance the installer reject the device, depending on how strictly I'm detecting the model. From memory, though, I think I'm doing it loosely enough that it will work.

If it flashes, you'll soon find out whether the kernel works and to which extent. I wouldn't be surprised if these models at least differed in their DTBs, if nothing else. And the Samsung open source site has a separate download for what looks like a Chinese model.

So, it's untested. Be sure to report back if you give it a try.



Sent from my SM-G965F using XDA Labs
 

ianmacd

Senior Member
Jan 5, 2016
2,278
3,583
183
Amsterdam
A fix for: "E propClient: PropClient failed to load"

If, like me, you are irritated by your Tab S4's system log being constantly hammered with messages similar to this one:

Code:
11-19 19:35:29.600 12835 12835 E propClient: PropClient failed to load
you may me interested in this Magisk module that offers a quick and easy way to silence them. The module is available via the official Magisk Module Repo, so it can be directly installed from Magisk Manager on your device.

Note that the messages in question are not caused by running a custom kernel. They also occur on a fully stock device. I'm simply posting about the problem here, because people with a rooted Tab S4 are in a position to circumvent these messages.
 
  • Like
Reactions: ALLDAT

dr460nf1r3

Senior Member
Dec 6, 2013
477
195
73
garudalinux.org
If, like me, you are irritated by your Tab S4's system log being constantly hammered with messages similar to this one:



you may me interested in this Magisk module that offers a quick and easy way to silence them. The module is available via the official Magisk Module Repo, so it can be directly installed from Magisk Manager on your device.

Note that the messages in question are not caused by running a custom kernel. They also occur on a fully stock device. I'm simply posting about the problem here, because people with a rooted Tab S4 are in a position to circumvent these messages.
Saw this one in the download section just a few hours ago thanks for doing so much for our tabs ?
 
  • Like
Reactions: ianmacd

ianmacd

Senior Member
Jan 5, 2016
2,278
3,583
183
Amsterdam
Version 0.99.11 released.

In this release, @flar2's sound control driver has been adapted for the WCD9341 DAC and added to the kernel. This offers headphone and microphone gain via the usual avenues of MTweaks or EX Kernel
Manager. Do note, however, that the latest versions of both apps currently use a hard-coded range of values that is too restrictive for this DAC: -40 to +20 dB. This should be -84 dB to +40 dB. So, if you want to configure values outside the restricted range, you will need to do so manually for the time being. The relevant sysfs entries can be found at
/sys/kernel/sound_control/{micro,head}phone_gain.

I have contacted the author of MTweaks and a fix is in the works for that app.

Also bear in mind that this driver will be overridden by ViPER4Android (and possibly other mods) if installed and enabled.

The KCAL driver has been optimised. It is now smaller and perhaps microscopically more efficient.

The latest Linux kernel has also been merged into this release.

Change log

  • Updated to Linux 4.4.165.
  • KCAL advanced colour/gamma control driver optimisation.
  • Added @flar2's sound control driver for controlling headphone and microphone gain. (Configure with MTweaks or EX Kernel Manager).
 

MrPhilo

Senior Member
Dec 12, 2010
2,016
646
183
Sheffield
It's certainly possible. I'm not sure the demand is there, though. This kernel doesn't have many users and it's not a feature I'm inclined to implement for myself.
No problem. Just annoyed with samsung using last gen, so wanted to squeeze just a bit more performance out of it if I could
 

ianmacd

Senior Member
Jan 5, 2016
2,278
3,583
183
Amsterdam
No problem. Just annoyed with samsung using last gen, so wanted to squeeze just a bit more performance out of it if I could
It's relatively easy for Samsung to throw together a device like this. It's basically an oversized Adreno S8, so they can reuse all of their existing code.

Of course, that means that pre-existing patches aren't too much work to shoehorn onto this device, either, so there's also an upside.
 
  • Like
Reactions: ALLDAT and MrPhilo

MrPhilo

Senior Member
Dec 12, 2010
2,016
646
183
Sheffield
It's relatively easy for Samsung to throw together a device like this. It's basically an oversized Adreno S8, so they can reuse all of their existing code.

Of course, that means that pre-existing patches aren't too much work to shoehorn onto this device, either, so there's also an upside.
Understandable, I know this ain't relevant but the kernel, how is the RAM management? Only asking as when I had an S8 plus it was terrible and i can't see how Samsung would improve it. Does the kernel manage ram better?
 

ianmacd

Senior Member
Jan 5, 2016
2,278
3,583
183
Amsterdam
Understandable, I know this ain't relevant but the kernel, how is the RAM management? Only asking as when I had an S8 plus it was terrible and i can't see how Samsung would improve it. Does the kernel manage ram better?
I'd first have to know what you consider wrong with memory management on the S8. I never had any issues with that device and haven't had any with this device, either.
 
  • Like
Reactions: ALLDAT

MrPhilo

Senior Member
Dec 12, 2010
2,016
646
183
Sheffield
I'd first have to know what you consider wrong with memory management on the S8. I never had any issues with that device and haven't had any with this device, either.
Coming from OnePlus, I've always had apps in memory a lot of the time. But with Samsung they don't keep it in memory as much, like maybe 6-8 apps depending on the size of the app, with my 6T now I'm able to keep more than 16 on average. I always like going into app instantly without refreshing. That's one reason why I got rid of my Pixel XL2 as well.
 

dr460nf1r3

Senior Member
Dec 6, 2013
477
195
73
garudalinux.org
Coming from OnePlus, I've always had apps in memory a lot of the time. But with Samsung they don't keep it in memory as much, like maybe 6-8 apps depending on the size of the app, with my 6T now I'm able to keep more than 16 on average. I always like going into app instantly without refreshing. That's one reason why I got rid of my Pixel XL2 as well.
Install ram fixes via magisk
 
  • Like
Reactions: ALLDAT

Peter KIKI

Senior Member
Nov 11, 2014
90
130
0
Modesty - a modest custom kernel for the Samsung Tab S4

Modesty aims to provide a mildly appealing and reasonable alternative to the stock 4.4.78 kernel that comes with The Tab S4. In its pursuit of being both mildly appealing and reasonable, it will eschew features that could compromise device stability, whilst gleefully embracing low-risk, self-contained enhancements. In other words, your lowest expectation should be that this kernel will be at least as stable as the stock kernel.

Since there are currently no other custom kernel projects supporting the Tab S4, there isn't really any previous device-specific work to build on. Development of this kernel is therefore likely to be slow and steady.

"Why is this kernel called Modesty? That's crap! Why not Wolverine, Intrepid or Jupiter?"

Because it's just a operating-system kernel, not a turbo-charged supercar or a mission into outer space. Even as operating-system kernels go, this one is pretty dull. Besides, I'm a weary curmudgeon in his fifties, not a teenager.

This project has the modest aim of modestly enhancing the pleasure you derive from your Tab S4 and is therefore modestly named Modesty.

Key characteristics

  • Supports both the wi-fi only (T830) and wi-fi/LTE (T835) models.
  • Forked from Samsung's pristine kernel source code (Linux 4.4.78 for ARGH firmware at time of launch).
  • Regular merging of the upstream Linux kernel's linux-4.4.y branch (4.4.161 at time of public launch).
  • Regular merging of Samsung's updates to its modified kernel source as they are made available.
  • Includes @savoca's KCAL advanced colour/gamma control driver.
  • Includes @flar2's sound control driver to manage headphone and microphone gain.
  • Disables a huge amount of tracing and logging features inexplicably left enabled by Samsung in the stock release kernel. These debugging features have no place outside engineering builds.
  • Packed into a boot.img (boot image) taken directly from Samsung's latest stock firmware and kept as close to the original as possible. No obscure boot-time kernel configuration is stashed away here, and no changes are made to any other part of the file system at either install time or run time.
  • Provides a fully automated installer, with the option of interactive installation to allow manual selection of features and the ability to automatically root the device with Magisk in the post-installation phase.
  • Includes WireGuard VPN support (version 0.0.20180818 at the time of public launch), which will be updated as available.
  • Includes @Lord Boeffla's generic kernel wakelock blocker. The conservative default block-list is: qcom_rx_wakelock and NETLINK.
  • Utilises Westwood+ TCP congestion algorithm by default.
  • Includes Veno TCP congestion algorithm.
  • SELinux operates in enforcing mode and cannot be dynamically switched to permissive mode.

FAQ

Q. Can I overclock or underclock the CPU using this kernel?

A. No. At least, not yet. Possibly in the future.​

Q. How does interactive installation mode work?

A. If the ZIP file name contains the string _interactive or a dot-file called .modesty_interactive is present in the root of the external SD card, interactive installation mode is triggered. Please note that this mode overrides any selections implied by the archive name or the presence of dot-files on the file-system.

In interactive mode, you will be asked whether to root the device afterwards with Magisk. Selections are made using the Volume buttons. Just follow the on-screen prompts.​

Q. Can I safely block wakelock X?

A. Perhaps. However, unless you know what a particular wakelock does and are certain that it is causing an actual problem on your device, I suggest you leave it alone.​

Q. Why is this kernel labelled beta? Is it safe to use? And who are you, anyway? Can you be trusted?

A. My T830 has been running this kernel every day since I first rooted it, and I can therefore personally vouch for its stability on this model.

A couple of users have reported Modesty running well on the T835. Initially, it was reported that the kernel did not boot on this model, but after trying several test kernels, the user in question discovered that his machine had a non-standard firmware installation. Once this situation was remedied, Modesty booted and worked as designed.

As the person who built the kernel, I know exactly what's in it, and therefore the only risk I'm exposing myself to when I run it is that of my own incompetence. That's not true for you, however, and you should exercise due caution and at least pause for a moment to consider what you are installing, and the far-reaching powers you are about to grant this unaudited code over your device. Although I link to the source code below, you have only my word for it that this bears any resemblance to the kernel actually provided in the installer.

There are likely to be many iterations of this kernel before it sees a 1.0 release. Features may be added or removed along the way, although there is no clear roadmap at this point in time. Development will go where the needs of the users take it.

Please see the Installation section below for an important note regarding the use of this kernel in combination with stock (i.e. unmodified) Samsung firmware.

Q. Can I safely root this kernel?

A. Of course. What use would it be if you couldn't? I recommend Magisk for the task. It has a few minor issues, but as a project is very much alive, something that cannot be said about its peers. Magisk has arguably now established itself as the de facto root solution for Android devices.

It just so happens that I also produce my own builds of Magisk, which you are welcome to use. These are release builds (as opposed to debugging builds), produced from my own fork of @topjohnwu's original source, often augmented with patches. You can use anyone's builds, though.

Again, these builds work for me on various Samsung devices, but they are unofficial and you should approach them with fitting caution.​

Q. Can I install Magisk at the same time as Modesty?

A. Yes. The Modesty installer allows you to automatically root your device with Magisk following installation of Modesty..

To make use of this facility, either rename the Modesty zip file to contain the string _magisk or create a file called .modesty_magisk in either the root of your external SD card or in the standard Download directory of the internal SD card. Alternatively, you can utilise interactive installation mode. See above for details.

If any of these trigger conditions is met, the installer will look in the standard internal Download directory as well as in ./Magisk (if present) on the external SD card (if present) for a suitable Magisk zip file to install. Preference is given to versioned files matching the glob Magisk-v*, in which case the latest according to lexical sort order will be used. If none is found, the installer then looks for unversioned release builds (e.g. official Canary channel release builds) called magisk-release.zip in the same locations, selecting the one with the most recent timestamp. If none is found, the installer will then try to find unversioned debug builds (e.g. official Canary channel debug builds) called magisk-debug.zip, again picking the one with the most recent timestamp. Finally, the installer falls back to looking for the most recent file called Magisk.zip or magisk.zip. If still no files have been found by this stage, chaining of Magisk is abandoned.

For example:

Code:
star2lte:/ $ ls -l /storage/0000-0000/.modesty_magisk
-rwxrwx--x 1 root sdcard_rw 0 2018-09-15 14:31 /storage/0000-0000/.modesty_magisk
star2lte:/ $ ls /storage/0000-0000/Magisk/Magisk-* | tail -n 3
/storage/0000-0000/Magisk/Magisk-v17.2-2018091001-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091201-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091501-ianmacd.zip
When you flash the Modesty archive in TWRP, the most recent version of Magisk that could be found will now be used to automatically root your kernel, i.e. Magisk-v17.2-2018091501-ianmacd.zip in this example.​

Q. Why doesn't Modesty have its own Telegram group?

A. Because my experience of Android-themed Telegram groups is that they invariably degenerate into seething cesspits of rudeness, ignorance, superstition and — on a good day — pseudo-science. I don't wish to police such a den of iniquity. Of course, it's a free world (or so I still like to kid myself), so you are at liberty to create your own Telegram group for Modesty if you wish. Just please don't invite me to it.

Building

Building a kernel is beyond the scope of this document. If you want to build this kernel from scratch, start with this handy reference tailored to building kernels for Android.

Download

See posting #2 in this thread for links to the latest and all previous versions.

Installation

Make a back-up of your existing boot partition using the custom recovery environment provided by TWRP. If your device doesn't yet have TWRP, you will need to install it first. Then, use it to flash the Modesty ZIP file. The boot image will automatically be installed in the boot partition of your device.

If your device has unmodified Samsung firmware, you will encounter problems with Bluetooth (namely delayed initialisation and forgotten pairings) after installing this or any other custom kernel. To remedy this, you will need to patch your system with modified libsecure_storage.so libraries. Some custom kernel installers actually install these without telling you, overwriting your system libraries and transparently circumventing the problem before you can run into it. This approach necessarily modifies your device's file-system, however, and that may not be what you want. At the very least, the user should be made aware what is happening to his device.

For this reason, I have instead prepared a companion Magisk module that achieves the same goal without modifying the file-system. This will allow you to run a custom kernel (not just this one, but any custom kernel) on pristine stock firmware without any Bluetooth issues. The module can be found in the official Magisk module repository, accessible from Magisk Manager on your tablet. If you install this Magisk module, you may wish to also disable the secure_storage_daemon by editing /system/etc/init/secure_storage_daemon.rc (change start to stop), as it no longer serves a purpose.

In a similar vein, you may encounter authentication errors when connecting to wireless networks after installing this or any other custom kernel. This problem is not serious and easily remedied by re-entering your passphrase for the networks you use.

Finally, if SecurityLogAgent notifies you that unauthorised actions have been detected, do not be alarmed. This is a normal consequence of having installed a custom kernel. You may wish to disable SecurityLogAgent to avoid being repeatedly notified..

Whilst the above issues are the only ones you can expect to encounter when running this kernel vs. the stock Samsung kernel, they may sound like more trouble than they're worth. In that case, you might be happier just sticking to Samsung's stock kernel. The company supplies a perfectly good kernel straight from the factory.

Configuration

You are encouraged to use either @morogoku's excellent MTweaks (a modified version of Kernel Aduitor) or @flar2's EX Kernel Manager to manage the features provided by this kernel.

Source code

Modesty's GitHub repository.

References


Credits

Thank you to everyone in the Linux kernel world for getting us this far. Within the Android hacking community, I am grateful to the following people for their time-saving contributions:

  • @morogoku for his work on MTweaks.
  • @flar2 for the his work on ElementalX, and for authoring the excellent EX Kernel Manager (not to mention the equally excellent DevCheck).
  • @osm0sis for Android Image Kitchen, which has saved me a huge amount of work in packing and unpacking boot images.
  • An honorary mention must go to @Chainfire, the extent of whose benefaction to the Android community is still not fully understood or appreciated in some quarters.
Hi i am a developer from Samsung s8(835),G9550,may i request you for some guide of modifying the kernel ,i have my own rom and kernel
Here is my form:
https://forum.xda-developers.com/ga...g9550-g9500-phoenixo9-crf2-everytime-t3819774

at last my i have your contact please for work to together to improve our 835 version of Samsung devices