[PROJ] Overclocking the Adreno GPU on Snapdragon Devices - Nexus One Android Development

INFO:
Let me save you the time of reading all this. In it's current form, this is impossible. An inside connect at Qualcomm has told us we can't change the GPU clock from userland or kernel. That mean's we're screwed basically. Here is the post by Jack_R1:
Checked, as promised. Bad news. If I sum it up in one sentence - GPU overclock w/o touching the rest of the system is plain impossible, and GPU overclock while trying to play with the whole system is most probably still impossible (pending further deeper check), and it's definitely impossible for anyone that doesn't have the clock diagram, which is NDA, thus won't be available. The reason isn't software, and don't ask, what it is - I won't give direct explanations.
I've written a long post with some explanations of clock networks, to educate those that want to learn and prevent some of big mistakes that I've seen along this thread, and it's pending approval, since I don't want to accidentally spill more than I can share. I hope it gets approved and I'll post it. It should give some more insight.
The only good news is - global overclocking that affects 1GHz CPU clock will affect GPU too.
Click to expand...
Click to collapse
I'm sure we all heard about being able to overclock the GPU on some of the old MSM devices, but the Snapdragon handles the graphics chip in a different way. The goal of this thread is to try and overclock the GPU on Snapdragon devices as well.
There is nothing GPU related in acpuclock-scorpion.c at least for setting clock speed as far as I can tell.
In board-mahimahi.c there is some kgsl init code, but so far as I can tell it isn't setting the clock there, instead it seems to be pointing to PWR_RAIL_GRP_CLK to set the clock. It defines the variable in board-mahimahi.c but I'm not sure where that variable is set, since it doesn't seem to be in any of the other board files as far as I can tell. I could be completely off here too though.
In drivers/video/msm/gpu/kgsl/kgsl.c there is a method called kgsl_clk_enable that seems to be called whenever the GPU is enabled. It looks like this:
Code:
/* the hw and clk enable/disable funcs must be either called from softirq or
* with mutex held */
static void kgsl_clk_enable(void)
{
//clk_set_rate(kgsl_driver.ebi1_clk, 128000000);
clk_set_rate(kgsl_driver.ebi1_clk, 245000000);
clk_enable(kgsl_driver.imem_clk);
clk_enable(kgsl_driver.grp_clk);
}
The line that's been commented out is the original value, I replaced it with my value on the line below it in a failed attempt to overclock it. Probably a stupid effort on my part, I doubt it's that simple, but it was worth a shot.
According to the clk.h files in the standard linux kernel, clk_set_rate is obviously a method to set the clock rate. The first variable is a struct that tells it which clock to set, and the second variable is a long value that is the rate you want it set at. Is it setting the right clock there for Snapdragon chips? Or is it only the clock for older chips? Actually I've looked again, the kgsl files are ONLY for the newer Qualcomm chips, the QSD8x50 Snapdragons & the midrange MSM7x27 series that replaced the old MSM7x00a chips like in the Dream & Magic. At least thats the way it seems to me judging from what Qualcomm & AMD have written in the source.
I'm in way over my head with this source, I'm but a lowly Java dev , but I really wanna solve this. Can anyone with a little more experience than me throw in a little more info? Sorry if it doesn't make much sense, if it isn't clear just ask me & I'll try to explain a little more.
Regards,
Jesse C
EDIT: Okay I did a little more digging and those kgsl settings should work for QSD8x50 chips. In the config file, under Drivers, Graphics Support, it allows you to enable 3D accelleration for QSD8x50 & MSM7x27 chips. The tag for that is CONFIG_MSM_KGSL_MMU. If you check in kgsl.c it checks to see if that is enabled in the config, and if it is then it compiles and uses kgsl.c & all of the kgsl code. That tells me that the clock is either not being set, or the wrong clock is being set. I'm adding some debug code right now so I can see in dmesg what code is actually being run.
EDIT 2: Another status update. Adding the debug code showed that it is setting the clock at my level whenever the kgsl initializes. Also, as IntersectRaven pointed out, clocks.h in arch/arm/mach-msm nicely lays out what each clock is:
Code:
grp_clock = Graphics clock
ebi1_clock = External Bus Interface 1 clock
imem_clock = Internal Graphics Memory clock
If you want to add your own debug code to it, calling the method "pr_info" and passing it a string with the message you want will output it to the kernel logs you can view with dmesg. An example would be "pr_info("kgsl: clock set at 245mhz\n");"
EDIT 3: I now know the values for all the GPU related clocks.
Code:
<6>[ 70.681793] kgsl: grp_clock= 256000000
<6>[ 70.682464] kgsl: imem_clock= 256000000
<6>[ 70.683441] kgsl: ebi1_clock= 128000000
If you want to get these values yourself, the following code in the kgsl_clk_enable method will output them to the kernel log:
Code:
int clkg = clk_get_rate(kgsl_driver.grp_clk);
int clki = clk_get_rate(kgsl_driver.imem_clk);
int clke = clk_get_rate(kgsl_driver.ebi1_clk);
// this will get the clock rate & print it in the kernel log
pr_info("kgsl: grp_clock = %d", clkg);
pr_info("kgsl: imem_clock = %d", clki);
pr_info("kgsl: ebi1_clock = %d", clke);
Just add that into the function I mentioned and it will output it to the kernel log, quite often in fact, so I wouldn't leave it in there except to see the values
EDIT 4: 7-2-2010
Qualcomm has now released a new driver. It looks a lot better for our purposes. I'm looking through it today but I have other stuff I need to do. I will look at it, but I can't promise I can devote much time to it until at least Sunday.
EDIT 7-7-2010:
I've collaborate with storm99999 over GTalk and things aren't looking good. Here's what it comes down to:
If we try and lock it with any of the clk_set_rate methods, there is no effect. Not matter how we change it, it just stays at the original value. This either means it's set in the radio (impossible for us to change) or that it's set one time on boot and never changes, but we just don't know where it's actually set (more likely, but I'm not sure either way)
If we try and change it with msm_proc_comm, which is a direct interface to the hardware, it causes the kernel not to boot at all. This is really really strange. We can monitor the clock with pr_info as before, and if we read the data1 argument, it prints to the kernel fine, but if we try and read the data2 arg passed to msm_proc_comm, it also freezes on boot.
We seem to be out of ideas here. We're open to any reasonable suggestions, so if you have any, PLEASE let us know in this thread or PM one of us. Or you can email me at [email protected]

This is a great idea for sure. I will certainly lend a hand where I can.
That being said don't know if it is possible to OC the GPU. I remember discussing this with kmobs in the past and he didn't think so. Perhaps tweaking Open GL might prove more fruitful. All of this is definitely worth thinking about.

jlevy73 said:
This is a great idea for sure. I will certainly lend a hand where I can.
That being said don't know if it is possible to OC the GPU. I remember discussing this with kmobs in the past and he didn't think so. Perhaps tweaking Open GL might prove more fruitful. All of this is definitely worth thinking about.
Click to expand...
Click to collapse
Hmm well that may be kind of a downer...
I know it sets the values somewhere, but I can't seem to find anywhere it could be setting them other than the kgsl stuff, and that doesn't have any effect on performance at all. Unless it could be set in hardware?
I don't really care about harming my Nexus at this point, now that I've upgraded to an Evo, so I'm willing to try dangerous kernels on my Nexus (read: any kernel changes I make ).
If someone could give me any more ideas about where to look, I'd be greatful. I've gone through everything I can think of and it doesn't seem to be getting me anywhere closer.
P.S. I love your avatar jlevy! Simpsons FTW!

This is definitely for the kernel masters like Cyanogen, pershoot and kmobs to weigh in on. In the meantime I am going to rip through the code to see what I can find (if anything). To bad you are moving on to the EVO. We'll miss all of the great ideas/solutions you provide (well N1 user will)

jlevy73 said:
This is definitely for the kernel masters like Cyanogen, pershoot and kmobs to weigh in on. In the meantime I am going to rip through the code to see what I can find (if anything). To bad you are moving on to the EVO. We'll miss all of the great ideas/solutions you provide (well N1 user will)
Click to expand...
Click to collapse
Thanks! I'll still be hanging around the N1 forums, since so much of the code is interchangeable with them both having the QSD chips and all. If you're looking through source, can you get with me on GTalk or Wave & we can work together on it. Also I've updated the first post with a little more info.

Geniusdog254 said:
Thanks! I'll still be hanging around the N1 forums, since so much of the code is interchangeable with them both having the QSD chips and all. If you're looking through source, can you get with me on GTalk or Wave & we can work together on it. Also I've updated the first post with a little more info.
Click to expand...
Click to collapse
Sounds good, I will PM you my gtalk address.

So I added the debug code. It shows that it is calling my code every time the GPU is initialized. This means it is setting the EBI1 clock to 245mhz instead of the original 128mhz. However I guess that is the wrong clock. it also defines 2 other clocks along with the EBI1 clock, however EBI1 is the only one that it sets a value for, the other 2 it just turns on (hardware values?).

After looking at the code, the clocks seem to be initialized at kgsl_platform_probe by clk_get. (correct me if I'm wrong since I'm a newbie at tracing through the GPU... )
*Nope...wrong analysis...that was the clock SOURCE instead of clock RATE...
**After looking through a bigger part of everything, I think you can't specifically overclock it. The way I see it, the clock source used by kgsl is unified with different clocks being set elsewhere. This is why you're not getting it to work. When it calls the kgsl part you modified, it sets to the modified clock BUT the moment it exits, some other part which uses the same clock source will reset it to 128Mhz. If you want to modify that, you'll pretty much have to modify everything which uses the same clock source. (again, correct me if I'm wrong but I think that pretty much describes what I'm seeing with the code...)

Geniusdog254 said:
So I added the debug code. It shows that it is calling my code every time the GPU is initialized. This means it is setting the EBI1 clock to 245mhz instead of the original 128mhz. However I guess that is the wrong clock. it also defines 2 other clocks along with the EBI1 clock, however EBI1 is the only one that it sets a value for, the other 2 it just turns on (hardware values?).
Click to expand...
Click to collapse
Yeah, I think the other two value are hardware related. To find the right clock...

intersectRaven said:
After looking at the code, the clocks seem to be initialized at kgsl_platform_probe by clk_get. (correct me if I'm wrong since I'm a newbie at tracing through the GPU... )
*Nope...wrong analysis...that was the clock SOURCE instead of clock RATE...
**After looking through a bigger part of everything, I think you can't specifically overclock it. The way I see it, the clock source used by kgsl is unified with different clocks being set elsewhere. This is why you're not getting it to work. When it calls the kgsl part you modified, it sets to the modified clock BUT the moment it exits, some other part which uses the same clock source will reset it to 128Mhz. If you want to modify that, you'll pretty much have to modify everything which uses the same clock source. (again, correct me if I'm wrong but I think that pretty much describes what I'm seeing with the code...)
Click to expand...
Click to collapse
I think you are reading it correctly and that one would have to manipulate all the other values to ensure it won't reset to 128mhz. However, even if you do modify all that, there could be a master over-ride that controls the clock set at a pre-set value.
One interesting thing I did come across is one can write their own Open GL code. http://android-developers.blogspot.com/search/label/OpenGL ES
So if one could manipulate the values for Open GL, it would almost be equivalent to OC the GPU. Just a thought.

jlevy73 said:
Yeah, I think the other two value are hardware related. To find the right clock...
Click to expand...
Click to collapse
I know for sure 2 of the 3 are set in the kernel. The EBI1 clock of course is the one I'm trying to modify now, it has no effect. Then there is the "imem" clock which I haven't seen any code to set it, and then there is the "grp" clock.
If you see my first post, in board-mahimahi.c it defines PWR_RAIL_GRP_CLK which is the GRP clock. It is set at 8 as I just discovered. Here is that code:
Code:
#define PWR_RAIL_GRP_CLK 8
static int mahimahi_kgsl_power_rail_mode(int follow_clk)
{
int mode = follow_clk ? 0 : 1;
int rail_id = PWR_RAIL_GRP_CLK;
return msm_proc_comm(PCOM_CLKCTL_RPC_RAIL_CONTROL, &rail_id, &mode);
}
The only thing that leaves is the imem clock which may be a memory clock? I haven't found it set anywhere, but it could be in the kgsl_sharedmem.c & .h files. I haven't checked there yet. That covers 2 of the 3 clocks. I don't know what the 8 value on the grp clock means, or even what the grp clock is. But so far, those 2 are for sure set in the kernel...

I forget his username, but maybe the guy who got use all the mem hacks would be of great service? I think it's c00l something

Who got us* damnit I hate these typos. I'm going to bed. Too tired, and tapatalk has no flipping edit button lol

dictionary said:
I forget his username, but maybe the guy who got use all the mem hacks would be of great service? I think it's c00l something
Click to expand...
Click to collapse
Coolbho3000. He posted in the original thread or the MSM7500 chip about how it was handled differently on Snapdragon chips and that we may be able to change it, but that's all he said.

Yup him. I see. I'll have my bro look over this and see if he can find anything relevant, or help in any way
I'm not so advanced with my dev

Geniusdog254 said:
I know for sure 2 of the 3 are set in the kernel. The EBI1 clock of course is the one I'm trying to modify now, it has no effect. Then there is the "imem" clock which I haven't seen any code to set it, and then there is the "grp" clock.
If you see my first post, in board-mahimahi.c it defines PWR_RAIL_GRP_CLK which is the GRP clock. It is set at 8 as I just discovered. Here is that code:
Code:
#define PWR_RAIL_GRP_CLK 8
static int mahimahi_kgsl_power_rail_mode(int follow_clk)
{
int mode = follow_clk ? 0 : 1;
int rail_id = PWR_RAIL_GRP_CLK;
return msm_proc_comm(PCOM_CLKCTL_RPC_RAIL_CONTROL, &rail_id, &mode);
}
The only thing that leaves is the imem clock which may be a memory clock? I haven't found it set anywhere, but it could be in the kgsl_sharedmem.c & .h files. I haven't checked there yet. That covers 2 of the 3 clocks. I don't know what the 8 value on the grp clock means, or even what the grp clock is. But so far, those 2 are for sure set in the kernel...
Click to expand...
Click to collapse
According to clock.h, imem_clk is the clock source for the internal graphics memory so that seems right.

intersectRaven said:
According to clock.h, imem_clk is the clock source for the internal graphics memory so that seems right.
Click to expand...
Click to collapse
Hey look at that! It just nicely lays out what all those clocks are!
grp_clock = Graphics clock
ebi1_clock = External Bus Interface 1 clock
imem_clock = Internal Graphics Memory clock
Not sure what the ebi1_clock is linked to, but kgsl sure sees it as important enough to set it every time it runs. It's the only one set in a recognizable format (hz).
I'm not sure where the imem_clock is set or if it even is. Intersect, did you happen to see it set anywhere? It may be important to change though, it would allow more memory throughput and we could increase the graphic memory size in the board file and that may boost performance.
The grp_clock seems to be actually the real GPU clock according to clock.h. It's set 8 in board-mahimahi.c but I'm not sure what the 8 means. But then it may be that PWR_RAIL_GRP_CLK is setting a voltage or other power level to the graphics bus? Maybe the clock is set somewhere else. That'll take some more digging.

Geniusdog254 said:
Hey look at that! It just nicely lays out what all those clocks are!
grp_clock = Graphics clock
ebi1_clock = External Bus Interface 1 clock
imem_clock = Internal Graphics Memory clock
Not sure what the ebi1_clock is linked to, but kgsl sure sees it as important enough to set it every time it runs. It's the only one set in a recognizable format (hz).
I'm not sure where the imem_clock is set or if it even is. Intersect, did you happen to see it set anywhere? It may be important to change though, it would allow more memory throughput and we could increase the graphic memory size in the board file and that may boost performance.
The grp_clock sleeps to be actually the real GPU clock according to clock.h. It's set 8 in board-mahimahi.c but I'm not sure what the 8 means. But then it may be that PWR_RAIL_GRP_CLK is setting a voltage or other power level to the graphics bus? Maybe the clock is set somewhere else. That'll take some more digging.
Click to expand...
Click to collapse
The EBI clock is the external bus interface clock so I don't think we should mess with it. Anyways, it's set I think to ensure that it's working when the GPU is rendering something. If you'll look at the things that set it, it's usually set to 0 when entering suspend or sleep. Anyways, the variables in clock.h are used as sort of pointers to where the system will actually try to set the clock. (from what I can read at least) As for the imem_clk, I didn't find it set anywhere so it may be that it's on the radio or hardcoded. As for the graphics memory size, I think coolbho3k already knows more about resizing it since he's studied the N1's memory layout in further detail. (he did create that mod which increased the size of the available memory AND also figured out how to get charansingh's camera more memory) Anyways, I'll take a look further.

Interesting, but can we activate hardware acceleration in the device? i think if you can think of a way to do that you will be able to overclock the GPU just like on a PC and easily access the clocking just like the CPU.
I'm no expert on overclocking Phones only PC's.

intersectRaven said:
The EBI clock is the external bus interface clock so I don't think we should mess with it. Anyways, it's set I think to ensure that it's working when the GPU is rendering something. If you'll look at the things that set it, it's usually set to 0 when entering suspend or sleep. Anyways, the variables in clock.h are used as sort of pointers to where the system will actually try to set the clock. (from what I can read at least) As for the imem_clk, I didn't find it set anywhere so it may be that it's on the radio or hardcoded. As for the graphics memory size, I think coolbho3k already knows more about resizing it since he's studied the N1's memory layout in further detail. (he did create that mod which increased the size of the available memory AND also figured out how to get charansingh's camera more memory) Anyways, I'll take a look further.
Click to expand...
Click to collapse
I just woke back up. I guess I will remove the EBI1 overclock since I'm not sure what it does. I'm also not sure what increasing the GPU memory will do, but it's worth a shot.
I had noticed EBI1 is being set to 0 whenever it's diabled, and then setting it back at the time it's enabled. I'm gunna go back through and try to find another setting for the grp clock & a setting for the imem clock.

Related

[Q] CPU Governor in UrukDroid vs SetCPU

Hey guys!
Wanted to bounce a question off of all of you,
I have Uruk 1.0 installed, with Urukconfig 1.1.0, I also have SetCPU installed.
I'm looking to find the 'best' config to optimize my CPU governing....
SetCPU seems to take longer to 'set' due to SU permissions, but 'runs' just fine after booting - the system is nice and snappy, but there seems to be some slight bugs in it.... sometimes it wipes my settings out of it, especially after a reboot, but it is intermittant.
CPUGovernor in Urukconfig works well no matter how I cut it, but I am unsure how to set the scaling of the CPU.
One thing I did notice, between the two governors, if I have them both 'running' SetCPU reports 'interactive' scaling, while urukconfig reports 'ondemand' scaling... I think they might not like playing nice with each other, but don't quote me on that.
Any suggestions or comments?
wokker666 said:
CPUGovernor in Urukconfig works well no matter how I cut it, but I am unsure how to set the scaling of the CPU.
Click to expand...
Click to collapse
I figured this out, go into /etc/uruk.conf and edit the cpugovernor file.
wokker666 said:
SetCPU seems to take longer to 'set' due to SU permissions, but 'runs' just fine after booting - the system is nice and snappy, but there seems to be some slight bugs in it.... sometimes it wipes my settings out of it, especially after a reboot, but it is intermittant.
Click to expand...
Click to collapse
I think I may have 'fixed' this problem (I'm not sure though, I really hope I'm not screwing things up...)
I went into /sys/devices/system/cpu/cpu0/cpufreq and edited cpuinfo_min_freq to my desired 600000 (default 300000) and rebooted.
There seems to be no issues, SetCPU is now keeping my settings.
EDIT: Even after setting the cpu speeds manually, even making them read only permissions, the system resets them on reboot, seems like a fix described in this thread http://forum.xda-developers.com/showthread.php?t=1169625 may do the trick.
EDIT2 Between the script I wrote and killing SU to SetCPU, the system is no longer rewriting the cpu_min/max_freq - Thanks arpruss!
wokker666 said:
One thing I did notice, between the two governors, if I have them both 'running' SetCPU reports 'interactive' scaling, while urukconfig reports 'ondemand' scaling... I think they might not like playing nice with each other, but don't quote me on that.
Click to expand...
Click to collapse
I can say, with the changes I implemented editing both the cpugovernor and cpuinfo_min_freq files, my system is most definitly running in interactive mode, but urukconfig still reports the mode as 'ondemand' - pretty sure it's not reporting correctly.
Im still open to thoughts on this, I would really like to hear what some of the seniors around here have to say
Cool, great info. What did you change in the cpugovernor file? Have you tried to change the Max freq yet? I'd love to get uruk to 1.2
bug splat said:
Cool, great info. What did you change in the cpugovernor file? Have you tried to change the Max freq yet? I'd love to get uruk to 1.2
Click to expand...
Click to collapse
I set my desired min / max cpu speeds, and set the governor to interactive mode (seems to be a bit peppier than ondemand)
Unfortunately the only way to overclock is a kernel capable of it, then setting everything appropriately. Uruk 0.7 has an OC kernel - try it out
wokker666 said:
I set my desired min / max cpu speeds, and set the governor to interactive mode (seems to be a bit peppier than ondemand)
Unfortunately the only way to overclock is a kernel capable of it, then setting everything appropriately. Uruk 0.7 has an OC kernel - try it out
Click to expand...
Click to collapse
ok, gotcha.
Yeah, I was afraid you says 0.7 was the only way. I was hoping you found a way on 1.0. I used to be on 0.7 with OC and I might go back.

Tweaking Adreno Config

I was looking through /system with root explorer to see what I notice that it new from the EVO 4G and I stubbled across a file called adreno_config.txt. I opened it and read through parts of it and it has a lot of values that can be changed. I changed binning from software to hardware and noticed a very slight jump in benchmark scores using antutu benchmark. Mainly I noticed smoother scrolling on homescreens and webpages with a lot of flash content. I was hoping maybe a dev or someone who knows alittle more about these things than I do could look thru this file and see if we could get a performance boost from anything in this file. The exact path to the file is /system/etc/adreno_config.txt. thanks and hopefully something good could come of this. One of the big things I noticed was antialiasing settings that were all turned off by default. If this has already been looked at then I am sorry for the double post and don't mind being told I'm wrong.
I will upload the file if needed, but I figure that anyone who would know anything about this should already have root and s-off so it is really pointless.
Clay333 said:
I was looking through /system with root explorer to see what I notice that it new from the EVO 4G and I stubbled across a file called adreno_config.txt. I opened it and read through parts of it and it has a lot of values that can be changed. I changed binning from software to hardware and noticed a very slight jump in benchmark scores using antutu benchmark. Mainly I noticed smoother scrolling on homescreens and webpages with a lot of flash content. I was hoping maybe a dev or someone who knows alittle more about these things than I do could look thru this file and see if we could get a performance boost from anything in this file. The exact path to the file is /system/etc/adreno_config.txt. thanks and hopefully something good could come of this. One of the big things I noticed was antialiasing settings that were all turned off by default. If this has already been looked at then I am sorry for the double post and don't mind being told I'm wrong.
I will upload the file if needed, but I figure that anyone who would know anything about this should already have root and s-off so it is really pointless.
Click to expand...
Click to collapse
seems like an AWESOME find. subscribed
Don't apologize, sounds like you found something thar we can tinker with. Good post.
did a little bit of searching about this config file..it seems it got monkeyed around with while they were trying to achieve s-off, but I cant find anything showing any performance differnces from changing the values, so hopefully were on to something good
Success100 said:
did a little bit of searching about this config file..it seems it got monkeyed around with while they were trying to achieve s-off, but I cant find anything showing any performance differnces from changing the values, so hopefully were on to something good
Click to expand...
Click to collapse
Could you post it? I'll take a look to see if the file can improve performance.
DDiaz007 said:
Could you post it? I'll take a look to see if the file can improve performance.
Click to expand...
Click to collapse
just use root explorer to go in and grab it from your phone. i would definetely make a backup of it on your sd card and nandroid before messing around with it. I dont have s-off just yet (computer is down) or Id mess with it myself
here it is
Thanks I'll take a look to see what he's talking about exactly.
From what it looks, it looks like it is the Adreno 220 graphics configuration settings. It seems it can be tweaked, but I do not know entirely since this is a phone.
Take a look at these lines...
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Specify the allocation strategy for multisampling antialiasing buffers.
; Valid values:
; on_demand - allocate MSAA buffer on demand. This is the default value.
; always - always allocate MSAA buffer.
; never - never allocate an MSAA buffer.
;
;MSAABufferAllocation=on_demand
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Force the MSAA antialiasing mode to the value in MSAAMode.
; Valid values:
; 0 - (default) do not force the MSAA antialiasing mode.
; 1 - force the MSAA antialiasing mode to the values in MSAAMode and MSAASmoothing.
;
;forceMSAAMode=0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Specifiy the antialiasing mode to use if forceMSAAMode is enabled.
; Valid values:
; 0 - (default) do not antialias.
; 1 - use 2x antialiasing.
; 2 - use 4x antialiasing.
;
;MSAAMode=0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Now I don't know if this will fully improve performance, but I do know that when I am tweaking files like this for a PC video card, it'll make all the difference in the world for running games. But these files are within the games directory so this seems to be some sort of universal settings. I don't know entirely since this is a phone. Someone with knowledge in regards to this please chime in.
Yup this has to do with the configuration settings, it is universal. I can see an FPS cap option. Our evos aren't capped by FPS, if anyone would want to know that.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Cap value for frames per second. Do not cap if value < 0 or value > 1000.
; Valid values:
; 0 - (default) do not cap.
; Int - (integer) cap to this number of frames per second if N 1000.
;
;FPSCap=0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I'll probably tweak this file to see if it really does anything, but I don't have the time to fiddle with it right now. Anyone who has knowledge in regards to phones, I don't mind if you chime in and educate.
good ****..
i just sent viper a pm and well see what he says about it.
He's one of the more popular devs in the dev section
I pm'ed two Devs... I know files like this are used always in computers for adjusting configurations precisely rather than using presets. I'm just not entirely sure for a phone lol
to get full benefit of these tweaks, you must use chainfire 3D PRO, and enable EGL beta driver when you install CF3D driver. Also, since you have pro, go ahead and hide CF3Ds announce ID. good luck, have fun.
I assume this is what joelZ9614 might have used to "force GPU UI rendering" mentioned in his Shooter Rewind ROM changelog
phatmanxxl said:
I assume this is what joelZ9614 might have used to "force GPU UI rendering" mentioned in his Shooter Rewind ROM changelog
Click to expand...
Click to collapse
I don't believe so, there is another way to do it.
Tilde88 said:
to get full benefit of these tweaks, you must use chainfire 3D PRO, and enable EGL beta driver when you install CF3D driver. Also, since you have pro, go ahead and hide CF3Ds announce ID. good luck, have fun.
Click to expand...
Click to collapse
gotcha. well viper says he's gonna f around with it tonight and report back. so tilde your saying this is only going to benefit gamplay and not system operations?
edit: and here comes viper lol. right on time
phatmanxxl said:
I assume this is what joelZ9614 might have used to "force GPU UI rendering" mentioned in his Shooter Rewind ROM changelog
Click to expand...
Click to collapse
I always wonder what that meant. If anyone uses his ROM, is there a noticeable difference using it?
Success100 said:
gotcha. well viper says he's gonna f around with it tonight and report back. so tilde your saying this is only going to benefit gamplay and not system operations?
Click to expand...
Click to collapse
Most likely gameplay only.
DDiaz007 said:
I always wonder what that meant. If anyone uses his ROM, is there a noticeable difference using it?
Click to expand...
Click to collapse
I've enabled it in my ROM (in my test build) and it seems a little smoother, not amazingly different, but every little bit helps
Joel just told me he's seen the file but hasn't bothered looking into it at first.. he said he's going to though.

[Kernel] [26/04] Perseus

Welcome to the Perseus kernel! I thought it would be a nice catchname considering the Galaxy/Universe/Pegasus themes.
I'm trying to be more cutting-edge in terms of development in this kernel. In contrast to other kernels and philosophies of other developers, I don't believe giving the users more choice is a very smart thing to do. As such you won't find a dozen different governors or twenty different settings for this kernel. There is a optimal, or at least, most optimal setting on which the devices operate both in terms of performance and power management. For the average user this kernel will brings lots of benefits to battery life, screen improvement, fluidity and sound enhancements without having to set up any of the configurations.
The kernel comes with a configuration application called STweaks, and is installed automatically with the kernel. You will find all advanced options in there.
Don't be scared by the alpha denomination of the kernel, I'm just taking the traditional naming scheme where alpha designates feature development, beta is feature-completeness, and final will actually be when I'll actively stop developing the kernel. The kernel is very stable, and any bugs are fixed in hotfix versions (alpha x.y)
The kernel is also being maintained and released cross-device for the I9305 (S3 LTE), N7100 (Note 2) and N7105 (Note 2 LTE) and shares the same base-source.
Features / changelist:
Perseus alpha36.3 (26/04):
Fixed slice lookup issue on ABB: It's recommended you put your slices back to default before flashing if you changed them to borderline stability values. Please upgrade.
Perseus alpha36 (22/04):
Adaptive Body Bias control (ABB). (Experimental feature)
Body biasing is taking advantage of transistor body effect for binning the chip depending on its quality. In fact, this is used on the latest Samsung SoCs both for reducing power consumption and validating bad chips by adjusting their electrical characteristics.
The body bias is dictated by the voltage applied to the transistor gate (The usual voltages you're all used to) minus the voltage applied to the transistor body. The resulting bias can change the transistor's electrical characteristics in two possible ways:
Before reading on: A transistor's voltage and operating frequency is defined/limited mostly on its threshold voltage. Wikipedia has a neat visual representation of this; voltage must raise to a certain point for the transistor to be able to switch and operate. This threshold voltage can be highly dependant on temperature, influenced by the body effect, and defined by the manufacturing process. What we're doing nowdays with undervolting is to get as near as possible to the upper bound of this threshold voltage.
With that in mind:
Forward Body Bias
A FBB is defined when the bias of the gate voltage minus body voltage is positive, meaning the gate voltage is higher than the body voltage. This has the effect of reducing the threshold voltage. By reducing it, you can achieve lower voltages, or be able to clock the transistor higher. However the side-effect of lowering the threshold voltage is that you are sacrificing power leakage, meaning that the lower the threshold voltage becomes, the higher leakage current in the transistor becomes. This leakage power rises exponentially with a linear lowering of the threshold voltage. This is what is called static transistor leakage.
Reverse Body Bias
A RBB is defined when the bias of gate voltage minus body voltage is negative, meaning the gate voltage is lower than the body voltage. it has the direct opposite effect of FBB, it raises the threshold voltage thus you would need a higher gate voltage for switching, but however you also dramatically decrease static leakage.
What happens is that you want to use RBB when idling, and a reduced RBB, or even FBB at very high clocks.
Samsung currently uses this on top of voltage scaling to bin their chips. Here's an excerpt of the stock body biasing on the 4412 Prime chip (I'm using that one as an example as it has better adjusted ABB values over the Rev 1.1 chips).
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
To find out your ASV group: You can read out your ASV group in /sys/devices/system/abb/abb_info now.
I have rewritten the ABB scaling logic/driver for CPU, GPU, MIF and INT voltages.
In the current implementation, since it would be insane to have paired-up gate-body voltages divides the frequency range in several slices; even Samsung uses only three voltage ranges on the DVFS scale. I divided the frequency ranges as follows:
CPU: Divided into four slices, with frequency ranges of 200], 800], 1600] and ]1600 Mhz.
GPU: Three slices: 160], 533] and ]533 Mhz.
MIF and INT: Both only two slices with the bottom frequencies for each as middle-threshold.
As mentioned above, controls can be found in /sys/devices/system/abb/ and the entries are self-explanatory. You can also change the frequency slice limits per sysfs, however in STweaks I only included the voltages for each slice only for now.
Disclaimer
{ And that's about it in that regard. I have tried testing things over last couple of weeks, but I haven't come to a solid conclusion yet beyond what's presented by the stock characteristics: It's up to you people to do some advanced testing on the matter. My limited empirical testing in terms of voltages tells me it works as intended, but if a user with advanced measuring equipment would do similar testing to what I did back on the 4210 it would be perfect. }
zRAM: Switched over from LZO to Snappy compression algorithm, this provides much faster compression and decompression than the LZO implementation which was in the current kernel. I updated the Snappy libraries to the latest original CSNAPPY implementation, so this is extremely new.
Some kernel internal updates to speed up hotplugging and improve I/O latencies.
A correctly (Unlike basically every other kernel out there till now) applied load averaging patch regarding fixing a Moiré pattern in the scheduler load calculations which was floating around.
Fixed mono and equalizer switches in the sound engine. (Thanks to sorgelig for beating me to it)
Fixed led controls to behave correctly with user-space apps.
mDNIe digital brightness reduction:
You can now lower the brightness to basically nothing via this: it uses the mDNIe engine to digitally remove luminance from the RGB channel values, as opposed to reducing brightness via a proper backlight/display driver. The side effect of this is that you lose colour resolution somewhat, but is a practical and working method to reduce the too bright minimum values of our displays.
You have three configurables:
A reduction rate which you want to apply, this is the intensity of the darkening you want to achieve.
The take-over point; the backlight driver gets fed brightness values from 0-255 (In reality values below 20 have no effect). The take-over point is the point where the digital brightness reduction starts, on a reverse scale. The reduction is applied linearly from 0, (Full reduction taking place), to the take-over point (Zero reduction). The stock slider doesn't go below 20 in the interface, so practically the full reduction rate is never applied unless you use a third-party brightness controller app, just to keep that in mind, but in practice it doesn't matter.
Auto-brightness input-delta: This is needed because the stock framework is retarded in the values it forwards to the kernel, you can adjust this to avoid having brightness reduction when you don't want it on auto-brightness.
Somebody needs to edit config_autoBrightnessLevels, config_autoBrightnessLcdBacklightValues in framework-res.apk\res\values\arrays.xml to fix this.
Optionally, if you use a third-party app like Custom Auto Brightness which allows backlight values of down to 0, you can avoid this problem.
The register hook needs to be enabled to be able to use this function.
Increased the maximum brightness by 50 candela: the manual controls were limited to 250cd as maximum as opposed to 300cd which was only usable during auto-brightness, and unusable for any third-party apps.
Unaligned memory access throughout the kernel when applicable.
Switched over to GCC 4.7.3 Linaro toolchain for compiling.
Perseus alpha35 (06/04):
Further rewrote the in-kernel audio controls:
Threw out the old detection methods for something more robust.
This particularly enables non-cellular applications such as Skype, Viber, and so on to be detected correctly. A "calling" state now includes any and all use-cases where the audio is outputted via the phone's earpiece. This fixes microphone levels for such apps to correctly use the calling sensitivity value.
Added microphone level for camera use, this state is enabled whenever a camera stream is active. It should give more options into adjusting things to your likings.
By now the sound engine has only little similarities to Boeffla, any bugs and feedback now go directly to me.
Developers only: MHS: Added a new small tool for tracking media use and reporting it to other in-kernel drivers. Capable of detecting video recording, decoding and camera streams for now. See commit for more info.
mDNIe control changes:
Removed several controls in STweaks simply because people misunderstood them or misused them, or they simply had no rational use.
Video detection, now with the help of MHS, is no longer limited to the stock video player. Any video players using hardware decoding will now be able to make use of edge enhancement, HDR and DNR, this includes any web-based players and the YouTube app.
Custom LED controls implemented; Exposed most variable controls for the notification LED via sysfs and STweaks (LED tab). :
Control LED brightness. Currently the OS dictates, depending on brightness detected by the light-sensor, wether to run the LED in a low-power mode or in a high-power mode, you can now set brightness for both.
Blinking control, this is basically the shape of the wave-pattern that the LED blinks in, you have several controls, best described the data-sheet description:
The fade-in time period is TT1 in the graph, while the fade-out period is TT2.
Slope (1/2/3/4) detention time represents DT1,2,3,4 in the graph, it controls how "steep" the four different curves are.
The LED fading checkbox simply switches between having the detention times controlled by the sliders to having them to 0 (Stock blinking behaviour).
Increased default zRAM size to 400mB. This won't override your STweaks setting, so only new users will see the new value. Others should please adjust the value manually to your liking.
Sources:
https://github.com/AndreiLux/Perseus-S3
Credit and thanks:
gokhanmoral, netarchy, and anybody credited in the commits.
TL;DR: before flashing aside from known issues in the second post.
This isn't an AOSP kernel. I won't work with CM and AOSP derivatives.
DOESN'T WORK ON SAMSUNG JELLYBEAN 4.2.1 ROMS.
Known issues [Updated 02/12]
None
Older changelogs
Perseus alpha34 (22/03):
Updated sound engine. Based on Boeffla (Andip71)sound but custom fork with rewritten system interface and some other code re-factorings.
Should fix all FM Radio issues.
Brings us saturation prevention for the equalizer.
Privacy mode.
Microphone level control
You now have control over the speaker equalizer via sysfs, please visit /sys/class/misc/wolfson-control/ the controls are self-explanatory.
I removed the equalizer pre-sets from STweaks, if you want, set them manually:
Bass-extreme: 12 8 3 -1 1
Bass and Treble: 10 7 0 2 5
Treble: -5 1 0 4 3
Classic: 0 0 0 -3 -5
Pleasant for ears: 4 3 2 3 1
Eargasm: 12 8 4 2 3
I recommend HeadphoneAmpControl (thread - Play Store) for controlling the volume directly on a hardware level; it will overwrite the digital volume of the OS and use the hardware amplifiers only.
Enabled ZRam by default with disk size of 200mB and swappiness of 90%.
The ZRam control is found in the I/O Tab in STweaks. Set it to 0 to turn it off completely, any other value to turn swap on. Changing value takes about ~10-20 seconds depending how loaded the disk is with swap pages so don't piss your pants if it doesn't react immediately.
Applied a requested patch which allows PCs to be booted off from the phone storage.
Perseus alpha33.2 (27/02):
Master profile is correctly calibrated.
Detailed calibration report: Download
Advanced colour management report: Download
All thanks goes to Slimer777 for his excellent work.
Perseus alpha33 (26/02):
Revamped and hopefully final version of mDNIe controls:
The controls work now on two levels: First we have a master sequence that overrides any and all of Samsung's settings; currently this version is released without calibration, however in the next minor version it will be updated with proper professional screen calibration. See the Note 2 thread to see what to expect here too. The master sequence is calibrated to sRGB norms on a precision level equalling and even surpassing the iPad3/4.
The master sequence works as as the calibrated base; for people not wanting to bother further with any more controls, you simply enable this and you're done.
Second part is the register hook, it catches effect values and modifies them by applying delta values available as controls in STweaks and in /sys/class/misc/mdnie/hook_control/.
Leaving both these options will give you Samsung's default values, plus the black crush fix.
The register hook, while used on Samsung's profiles, is not capable to alter effects which are not integrated in that screen profile's value sequence, the "Movie" profile for example lacks some effects present in the "Dynamic" profile. The same is valid when having different scenarios, the "Camera" scenario will use different effects in its base than the "UI" scenario. To fully explore all possible effects, use the Master profile as it integrates all effect values known.
Each control has a master kill-switch which enables or disables the effect. This varies by profile and scenario, so you have control to only "toggle" the switch, whatever its state may be in.
Digital noise reduction - Reduces and flattens out grain. Advanced controls are found in the hook_control folder with the dnr_ prefix.
High dynamic range - A HDR effect which brings out details in dark and extremely bright scenes.
Digital edge enhancement - An edge enhancement effect. What we previously called "sharpening". Divided in controls for radius, amount and threshold. Read the Wikipedia page for more information. More advanced controls found in the sysfs under the de_ prefix.
For the above three effects, scenario consideration is taken into account. You can enable/disable them depending when you want it to be applied. Please be aware only the stock applications trigger the scenarios. I will try to enable at least the video scenario depending on when the hardware decoder is active in the future so that they are enabled also in third-party video players.
Chroma saturation control - Same as in previous version but with fixed labels.
Colour temperature control - By default this is disabled on all profiles, however, if your screen has a tint to it, this is the first control you should try to fix as it alters temperature on all channels.
The SCR controls are colour channel filters working on the Red, Green, Blue, Yellow, Cyan, Magenta, White, and Black channels.
Imagine the controls as manipulating the corners of the RGB cube:
(Credit to Wikipedia for the graphic)
By controlling the RGB coordinates of each corner/channel we can mould the cube into a different shape. At the same time the cube is projected onto a hexagon; the perimeter of the hexagon represents the colour hue, the radius of the hexagon from the middle represents chroma. We can use the chroma saturation controls to "push in" each corner of the cube, while moulding the corner's directions with the RGB controls. The RGB coordinates can be transformed into the HSL space space if needed, however I didn't include this function yet as I don't feel the need for it.
STweaks has controls for the RGBYCMW channels, the K (Black) channel I left out because it makes no sense in altering it, but can be found in the sysfs folder.
Several controls have a "factory setting" switch, this are the burned in-hardware values for some controls, they overwrite the controls themselves.
Additionally to the controls exposed to STweaks, there are several other effects and modifiers exposed in the sysfs interfaces. This also includes the gamma curve controls for levels 0-255 in steps of 16.
There are also some additional unidentified configurables which I wasn't able to properly give a name to or had no effects: Dithering, ABC (Seems to give a gamma brightness boost), SCC, UC, and MCM (Colour temperature) configurables whose exact effect isn't documented.
Perseus alpha32 (29/01):
Charging control implemented. This is my own version.
Charging currents:
Charging currents are dictated by input and charging current limits. The input current is the current flowing into the device through the USB port at 5V. The charging current is the current delivered to the battery at usually 4.35V. The device can have a higher charging current than input current because of the voltage differential, usually a 15% discrepancy. You can also have much higher input currents than charging currents, this can be useful when you are using the device in situations like gaming and charging your battery at the same time, provided your charger actually can provide the power.
There are 3 USB charger type categories: DCP / Dedicated Charging Ports which also includes AC chargers, but also special USB plugs; SDP / Standard Downstream Ports which usually includes almost all data enabled USB ports, and CDP / Charging Downstream Ports which includes also data enabled USB ports but which are designed to provide more power, usually on newer laptops where the USB port has a lightning logo next to it. More info here. - Technical explanation here.
Charging logic:
Stable margin removal option. The charger chip is capable of detecting unstable charging sources; it dynamically reduces the input current in 100mA steps until it detects a stable voltage input [We don't have the charger chip datasheet, so the technical explanation is a bit blurry here on how it decides that it's unstable]. It further reduces it by 100mA as a safety margin, you can disable this now.
Complete disabling of unstable power detection. This simply ignores unstable power sources and leaves the input current limit at its set up value. This will fix charging problems people have been reporting. However, please use it at your own risk, the S3 chargers which have had these symptoms clearly have some issue in their hardware so you might actually kill them with this option enabled as there is no protection from the phone's side anymore.
The actual input current limit can be read out in /sys/devices/platform/samsung-battery/power_supply/battery/current_max, so you can see the real limit there, it's the closest thing we have to the actual charging current on stock values since there is no hardware to read out the live currents.
Voltage control:
Hard voltage control: 4.20, 4.35V, and 4.40V charging voltages are available. This is included for anybody running on third-party batteries, whom most of them have a 3.7V battery chemistry as opposed to the 3.8V on the stock battery. These batteries should be charged at 4.2V instead of 4.35V.
Soft voltage control: As opposed to the hard voltage control which is the voltage which the charger chip provides to the battery while charging, the soft-voltage is the battery voltage itself. 3.7V batteries have a top-off voltage of 4.2V and 3.8V again 4.35V. The default limit on the stock battery is 4.30V before the charger logic stops and considers the battery as full. This is also merely provided for 3rd party batteries which should be charged at lower voltages. If you overcharge your battery beyond these what are safe considered voltages, such as raising the default 4.30 top-off voltage to the design 4.35V or even higher, you are running into the risk of damaging the battery or even causing it to melt-down. Use at your own discretion.
mDNIe sharpness and RGB/YCM chroma saturation control in STweaks:
I started implementing sharpness control in STweaks and went a bit over-board instead of a simple checkbox; You now have controls over the mDNIe registers as a delta offset value compared to the stock register values. I'm applying the offset to all mDNIe profiles and scenarios which have the specific post-processing effect active in that specific scenario. Meaning, that you start with the default profile; Dynamic / Standard / Natural / Movie and have the delta offset applied on top of that.
Sharpness delta. This is what brought most of the quality difference in hardcore's original tweaks. You can now fine-tune it to your own taste, and also take into regard that it produces a different effect for each screen profile while having the same delta - the base values between the profiles are different.
DE control - I don't know what this actually does and I couldn't discern much difference between the values, but it used to be disabled in hardcore's tweaks.
Chroma saturation control: This is composed of 2 values for each RGB/YCM channel. See the Munsell color system for a visual representation of the values controlled here. The chroma curve control describes the curve weight based on chroma intensity, the chroma gain is the chromatic gain that is being applied on the respective channel. Chromatic saturation weight is again another multiplier for all channels combined. I have not managed to properly identify the chroma grey threshold and its effects.
Basically this is like an RGB control on steroids, and enables you to tune your screen to your own liking and calibrate it as you wish. Please note that not all scenarios in the profiles have chroma saturation effects, the Movie profile for example has no effect applied to the UI so chromatic control has no effect on it.
I also want to state that the above are my deductions and theories on the descriptions of these controls, I'm not familiar enough on colour theory to be able to confidently say that these descriptions are correct, and the controls are a work-in-progress for now. Experts are welcome to contribute here.
Front buffer early suspend delay option for those who have issues with the CRT animation.
Did some refactoring on the Mali drivers and fixed a bug which may have caused less capable undervolting than the stock implementation.
Perseus alpha31 (09/01):
Removed my own security fixes and replaced them with the official Samsung one. I guess it can now be disclosed: exynos-mem was only one of multiple entry-points for the memory exploit. We discovered the s5p-smem exploit ourselves back in December but kept it quiet, I fixed that one back in version 29.2 without mentioning. Nobody was secure from a smart exploiter up until then, SuperCurios or Chainfire's software fixes are also just patching a single hole in what is a Swiss cheese. Kernels >v31 and beyond stock LLA are now the only truly protected ones.
Samsung's fix for the sudden death syndrome (SDS) included. It is caused by eMMC failure on phones with VTU00M internal memory chips with revision 0xF1. You can check your phone with the "eMMC Brickbug Check" in the Play Store (Ignore the message if it says you're not affected, the type and revision is what matters). The patch is a firmware soft-patch that is applied on every boot and MMC resume, it is not a permanent fix. You will need to stay forever on kernels which include the patch, this also includes updated recoveries and their embedded kernels.
Some other minor MMC changes extracted from Update 7 sources.
Harmonized some mif/int max voltages with the Note 2 limits.
Perseus alpha30 (06/01):
Internal and memory voltage control. This is the first and only working implementation out there. Memory interface voltage is exactly what it the name implies, the voltage on the chip-to-chip interface from the SoC to the memory chip. Internal voltage is the whole SoC voltage excluding CPU, GPU, and the MIF. This includes all auxiliary function blocks such as the ISP/Image signal processor, camera interfaces, I/O interfaces, display controller and the MFC/Multi function codec hardware video de-/en-coder.
Internal voltage respectively memory voltage table is found in /sys/devices/cpu/busfreq/ as int_volt_table or mif_volt_table
The frequencies are defined as OPP's (Operating performance points), internal frequency and memory frequency (And voltages) together as a pair form an OPP. If you want to change the voltages through the sysfs files, keep in mind how you change them. MIF voltages are stored independently with each OPP step. INT voltages are stored in respect of their frequency key.
Default OPP steps are: 400200, 267200, 267160, 160160, 133133, 100100. The first three numbers represent the memory frequency, the other three the internal base frequency. For example 267200 means the memory interface is at 267MHz (533MHz DDR) and the internal frequency is 200MHz.
The voltages in STweaks are sorted out through some magic and are frequency unique, I recommend using that for controlling them.
Busfreq logic control added into STweaks, this includes all the already available configurables in the stock kernel with added explanations and I supplemented it with a sampling rate parameter.
Some minor source updates from Samsung regarding some new sensor drivers.
Replaced pegasusq's runqueue detection logic with a new more superiror and precise in-scheduler collection logic, I found that the real runqueues are much less than what was previously reported. This should help a lot with hotplugging.
Enabled AFTR by default since we are now running very often in single-core mode. Keep in mind this mode is WFI Idle + LPA + AFTR.
Fixed a kernel bug which was eating up randomness entropy. This is related to that whole seeder business - please don't use any of those fixes. I also disabled virtual addresss randomization and at the same time disabled entropy generation from the block layer, which should avoid I/O overheads.
Perseus alpha29.2 (24/12):
Another minor (major) release due to security. Please update.
I screwed up something touchscreen related in v29 that disabled Flexrate requests, fixed now.
Changed Flexrate requests so that they don't scale down in their sub-samples anymore. This should improve fluidity.
Perseus alpha29 (18/12):
I'm doing a quick release because of the security fix, not very feature rich.
Fixes the exynos-mem security hole. This is my own fix and will not break camera. Read about it here. You don't need to use Chainfire's or Supercurio's fixes, in fact, you shouldn't use them because of the camera.
Updated Wifi drivers.
Added GPU utilization control to sysfs and STweaks.
Changed default GPU thresholds to more relaxed values (75/17)
Added block device read-ahead control to STweaks. Additionally set the default read-ahead for internal memory to 256kB and 1mB for SD cards.
29.1: - Reverted the Wifi drivers back and did some CMA adjustments to see if that fixes some random reboots of people.
Perseus alpha28 (13/12):
28.1: I reverted the striked out changes due to exFat. I changed my mind due to demand. I apologize for the chaos.
On your SD card showing up as damaged: it is not.
I made a decision in terms of exFat compatibility; either I advance the kernel with newer upstream Linux versions or stay back and keep compatibility with the exFat modules. While I have nothing against proprietary modules or such, not being able to adapt them to the kernel is not optimal. You can format your cards to FAT32 or ext4 without much issue. Please back up your data and format your card accordingly before flashing v28.
[*]Updated the block system to Linux kernel 3.3.
Introduced FIOPSv2, ROWv4, ZEN, BFQv5 as new I/O schedulers;
FIOPS is the new default scheduler, it's a CFQ like fairness scheduler optimized for solid state storage. ROW should be the actual better performer here as it has superior logic, but I didn't set it as default because of some lags when installing applications. ZEN is just a mix of SIO and Deadline and nothing special. BFQ seems to underperform. I recommend the first two over everything else, and added the latter two just for comparison's sake.
Added dynamic Fsync control (Faux123). It disables Fsync only when the screen is on. Enabled by default (Fsync off).
Changed some logic on when the adaptive scaling voltages are applied in the kernel init sequence. This fixes GPU voltages not being applied at boot and also fixes the wrong default voltages being displayed in STweaks.
STweaks tab for I/O with scheduler selection for each device block and also dynamic Fsync.
New script side feature in the uci.sh framework: When inserting an override.profile file into the profile folder (/data/.perseus), the entries in the override profile will supersede the ones in your default profile. You can use to make CWM zips to turn off set at boot flags or to share targeted settings with others. The override is applied once at boot after which the profile deletes itself.
Perseus alpha27 (02/12):
Sources updated with various updates from N8000u1 base. Included are following important changes;
CMA memory allocation has been altered and page handling in the kernel in regard to CMA affected pages has been dramatically improved, this should fix the high load of the "migration" process users have had since initial Jellybean kernels.
Updated wireless drivers.
Adds a delay to SD Card host controller power-down, which I assume is to prevent some corruption. There is a specific change to Toshiba 19nm manufactured SD Cards, these are mostly the latest SanDisk 64GB cards. Together this may fix issues users have had.
Updates the camera interface, Video4Linux and Jpeg2x drivers and this fixes compatibility with 4.1.2 ROMs. Backwards compatibility is retained.
Other updates which are more transparent to the end-user.
New PegasusQ logic:
- We now have additional conditionals on the hotplug logic which checks the total load across all cores and is able to bias towards a specified core count if the load is low. This is useful because previously we could have had frequency spikes and lots of low-load threads triggering a hotplug-up while in reality it wasn't needed. The core count is more biased on keeping 2 cores online in most cases now unless really needed.
- The way freq_step is handled has changed. We now take the remainder of load space above the up threshold and dissect it into three slices each having different frequency increase step sizes. The first two slices are each of up threshold differential size, lop-sided towards the lower end of the load scale. We specify the slice size and freq_step delta in regard to the original freq_step.
- A new fast-down scaling logic; if frequency is beyond a certain threshold, we take a heightened up_threshold value solely on the down scaling logic to scale down more aggressively from the higher frequencies.
STweaks. This is my custom implementation of the kernel side, based on Gokhan Moral's initial implementation.
- CPU overclocking and voltages interface.
- Configurables for all CPU governor settings.
- GPU overclocking and voltage interface.
- Interface for audio enhancements.
Perseus alpha26 (14/11):
Updated MTP drivers back to the newest version. Fixes some inconsistencies which some people had.
Further increased MMC command timeout from Linux default 300ms to 3s in trying to finally squash errors and "unexpectedly removed SD card" after resume.
Ported Gokhan Moral's mDNIe interface and also added colour tone modes on top of the scenarios. System interfaces are found in /sys/class/misc/mdnie . Input syntax is the same as the output syntax, or, single register-value pairs as a single line in the output format, except 0xFF which is a terminator value.
Increased default sampling rate down to 30ms from 50ms for a bit more fluidity.
LTE devices only: Updated some power management functions on the MDM modem from latest sources; this will drastically decrease the amount of wakelocks on mobile data and improve battery life.
26.1
Disabled net_os_rxfilter_add_remove userspace/ROM filter management in the Wifi driver to prevent the operating system of enabling unwanted pass-through multicast and broadcast filters while in standby.
Perseus alpha25 (23/10):
Raised and fixed USB, MISC charging rate to 900mA.
Enabled OTG car dock, smart dock and music dock charging. Alternatively this can be triggered if you short pins 4 and 5 of the USB connector with a 40.2kΩ, 64.9kΩ or 619kΩ resistor.
MTP fixed on OSX devices.
Fixed ROM power savings feature, this was originally broken because of the addition of overclocking, and the same interface that Samsung uses for limiting CPU speed in power savings mode also limits the max frequency to factory defaults. This is now fixed and powersavings mode will throttle to 1000MHz.
Fixed mis-configuration of the default audio settings to improve sound quality, sorry about that.
Ripped out the old GPU scaling mechanisms and scaling logic and replaced it by something new.
The old mechanism was getting overly complicated and was a remnant of the Galaxy S2 where we merely had 2 frequency steps originally; this was fine then, but isn't anymore today. The threshold fuçkery was confusing to a lot of people and people generally misconfigured their settings with inane values.
The new scaling logic follows a more CPU governor-like approach: Scaling up logic is basically the same as before: the GPU will scale up to the next frequency step when the load reaches a certain threshold. Up-scaling takes place step by step. The up-scaling threshold is now global and a single value applies for all frequency steps.
Scaling down in the new logic resembles more like the ondemand method; The scaling down takes place when the load goes under a certain threshold. This threshold is dictated by the up-threshold minus a down-differential. By default they are 90 and 10. Triggering this condition we scale down into a dynamic frequency target capable of accommodating and dictated by the load level. In plain words, we can scale from max frequency immediately down to the lowest one. This will improve power consumption.
Ripped out the old GPU control interfaces and rewrote it with something new to accommodate the new logic. Your old scripts won't work anymore.
We now have 10 frequency steps to the user's disposition; defaults are: 54 108 160 266 350 440 533 640 733 800.
The new system interface targets can be found in /sys/devices/system/gpu/ .
- freq_table outputs a list of the current frequency table. You can use this interface for configuring the frequencies themselves in two ways:
Pair-wise target setting: echo 533 500 > /sys/devices/system/gpu/freq_table will change the 533 step frequency to 500.
Whole-table echo: echo 54 108 160 266 350 440 500 640 733 800 > /sys/devices/system/gpu/freq_table
In the above example you end up with the same end-result over the stock settings.
Valid clock frequencies are as follows: 54, 108, 160, 200, 266, 275, 300, 350, 400, 440, 500, 533, 600, 640, 666, 700, 733, 750, 800.
- volt_table outputs the voltages to the corresponding frequencies.
Pair-wise target setting: echo 533 1025 > /sys/devices/system/gpu/volt_table will change's 533MHz's voltage to 1025mV.
Whole-table echo in the same format as freq_table. Valid voltages are 600mV => x <= 1200mV.
- thresholds sets the two global threshold settings. echo 90 10 > /sys/devices/system/gpu/thresholds . Remember that the first is the up-threshold and the second is the down-differential. The down differential may not be higher than (99 - up value).
- min_freq and max_freq set the limits of the current DVFS policy. By default we're scaling from 160MHz to 440MHz (Same as stock).
echo 533 > /sys/devices/system/gpu/max_freq will enable the top limit to 533MHz and basically overclock the device.
echo 108 > /sys/devices/system/gpu/min_freq in the same way sets the lower limit.
25.3:
- current_freq shows the current frequency. This is if somebody likes to make a monitoring app or something.
- time_in_state shows the time spent in µS on each frequency step. Echo 0 to it (by default disabled) to disable it, 1 to enable monitoring, and any other numerical value to reset the timekeeping back to 0.
Perseus alpha24 (09/10):
Galaxy Note 2 source and kernel merge. Various platform fixes included from patching up from update5.
Fixed Mali GPU interface bugs relating to staycount, and lowered undervolt-soft limit down to 600mV.
5 step GPU scaling, for now. Change your scripts.
Fixed black crush on the display. Vastly better black levels are now of order.
Perseus alpha23 (27/09):
Changed some auxiliary CPU clock dividers for frequencies 1600,1704,1800 MHz. These frequencies should use less power now and also should be more easily reached with more stability or lower voltage depending on your device.
Fixed CPUPower driver (Back from alpha20); this will now skew the reported processing capacity of CPU0 in the lower frequencies up until 500MHz to be 8 times greater than CPU1-3, what it does now is that the scheduler will even more migrate tasks onto CPU0 to avoid idle wakeups on the remaining CPUs, resulting in increased power efficiency. For high load > 500MHz, the driver reverts back to the default power configuraitons.
Reset the regulator configurations to their physical minima; you can now undervolt to 600mV on the GPU. Sorry I missed this before.
New feature: Dynamic Screen Frequency Scaling.
This decreases the display controller frequency in tandem with the CPU speed. Usually when you have low activity on the screen; i.e. low re-draw rates, then you mostly also have logically low CPU load. I wrote a scaling mechanic to switch between high display frequency (60Hz), and low display frequency (40Hz) in accordance to CPU scaling. This is tied in in the CPUFreq governor, in this case PegasusQ. We have three new governor configurables found in /sys/devices/system/cpu/cpufreq/pegasusq/ (Or alternatively just use SetCPU):
lcdfreq_enable: Enables or disables the mechanic, disabled by default.
lcdfreq_kick_in_down_delay: The amount of samples to wait on below the threshold frequency before entering low display frequency mode. Default value is 5 for now, a.k.a. in most cases 250ms unless accelerated flexrate is active on low load (fingers touching the screen), then depending on situation it might get as low as 62.5ms.
lcdfreq_kick_in_freq: The frequency threshold below which the low display frequency kick-in will be active. Default is 500MHz, and should probably stay as such, setting it higher will cause lags as we'd be using 40Hz in an interactive situation.
For the curious: I made a rudimentary time_in_state state accounting sysfs in /sys/devices/platform/samsung-pd.2/s3cfb.0/graphics/fb0/lcdfreq/time_in_state for testing purposes. Currently it shows wrong time values for 60Hz as the driver gets initialized before the high resolution timer, and I'll fix that later, but the 40Hz time statistics are correct.
Notice: There will be now conflicts between this and user-space controlled TwDVFS service/app. The service would limit screen frequency to 40Hz while using the camera app, this will be now overridden. I also thought the service would do more but I could not find it scaling for anything else than the camera, so it's pretty much useless in my mind, and you could theoretically remove it.
Feedback 23.3: This feature causes flickering on bright colours and low brightness. Enable it at your own will.
Changed the functionality to boost to 60Hz on any touch interaction, regardless of CPU speed.
Please provide feedback on fluidity and battery life.
Perseus alpha22 (22/09):
Update to update5 source code. Only compatible with Samsung Jellybean ROMs.
Stacks with my previous memory changes: total memory: 857mB for now.
Implemented timer slack controller.
Backported the scheduler NoHz load computation fixes, this should dramatically improve PegasusQ's hot-plugging decision making.
Further reduced Mali sampling rate down to 50ms and changes the default thresholds to more aggressive power savings and clear-cut scaling. Removed 10ms regulator switching latency. I measured a 10% battery improvement in GLBenchmark 2.1 Egypt Battery - 50% Brightness 60 FPS.
config.gz support.
Alpha21 is the same as above but without update5 and for ICS. This is the last kernel for ICS, I'll not longer support it.
Perseus alpha20 (9/09):
Gökhan Moral's port of Voodoo Sound implemented. Currently no configuration interface is available, so if you wish to play with the settings, refer to the sysfs interfaces in /sys/class/misc/scoobydoo_sound/ . If you wish to change the device name, you must do echo 0 > /sys/class/misc/scoobydoo_sound_control/enable , followed by an echo output to the same file with the target device driver name. You can use this to change the device path to /sys/class/misc/voodoo_sound/ and sub-sequentially make a certain configuration application work. Please do not ask me for support on the latter. You can disable the sound modifications completely by the same method, by of course not re-enabling it afterwards.
Changed the Wifi packet filter to block out all but mDNS multi-cast packets.
Increased mmc timeout for bad quality SD cards.
Perseus alpha19 (1/09):
Updated Samsung source base up to update4, includes changes to the Wifi driver and various other small fixes
Added ARM topology support for the scheduler to be able to use sched_mc levels. This should increase cpu idle power consumption by decreasing idle wake-ups. For the moment disabled by default, and cpu_power doesn't seem to correctly work.
Swap support.
mDNIe sharpening improvement, courtesy of hardcore.
Decreased Mali utilization timeout to 100ms down from 1s which improves reaction time on instant GPU loads (Lock screen is best example).
New valid GPU frequencies : 54, 108, 160, 200, 266, 275, 300, 333, 350, 400, 440, 500, 533, 600, 640, 666, 700 Mhz
Increased user-space memory by 48mB to have a total of 825mB useable RAM; this comes from reduced DMA memory spaces on the part of:
- The Mulfi Function Codec a.k.a. the hardware decoding and encoding unit memory space from 50176kB to 28672kB
- The camera interface imaging subsystem from 12080kB to 10240kB
- The front-camera firmware block-space from 15360kB to 14336kB
- The ION heap size for the Video4Linux driver from 71680kB to 48128kB
In the case of the ION/V4L and MFC heap sizes I determined it by setting a benchmark for all the HD sample videos listed here to not have any detrimental effect before and after the changes. Below 41mB is the size for which the Planet Earth birds scene at 1080p high profile 4.1 40mbps video starts to lag. Keep in mind that there is no way this would be considered normal quality as this is basically un-recoded Blu-Ray quality and most videos are vastly under this bit-rate.
I note that I also haven't found any detriment in use of the cameras including the modded 30mbps camera quality.
Disabled the Kies daemon, I see no point in it and it uses up memory uselessly. Obviously Kies won't work any-more, if you want you can start the service yourselves manually.
Perseus alpha18 (11/07):
Updated Samsung source base up to update3, includes various fixes to fuelgauge battery reporting on full charge, MHL code, video media drivers, Wifi driver updates, gyroscope, MAX77686 battery charger changes, increased max display brightness, a buttload of LCD panel changes, and changes to the pixel refresh rate driver (This thing is controlled by the TwDVFSapp by the way and decreases screen power consumption at runtime).
ro.secure=1 again now but with an insecure adbd as root included.
LFB ramdisk.
Compiled with Linaro 4.6.2 and some higher level optimizations.
Keep in mind that running the new kernel on older ROMs can cause some funny behaviour, so update your ROM if so.
Perseus alpha17 (9/07):
Rewrote flexrate request code for pegasusq: I apologize for releasing the previous version in the state that it was, shame on me.
Now upon receiving a flexrate request and active ones, the governor delays hot-plugging sampling logic so that accelerated sampling is being taken into account and hot-plug sampling is normalized for the standard sampling rate. All sub-samples are being averaged into a normal sized sample at the end of the normalized period. This no longer interferes with the runqueue read-outs as they were being reset too fast and generally accelerated hot-plugging in a bad manner.
Changed touchscreen flexrate requests to 12500µS sampling rates over 4 periods to synchronize with the default pegasusq sampling rate.
I consider this chapter to be done and a success as far implementing flexrates as a viable and working alternative to touch-boost to increase responsiveness without having the bad battery-life side-effects of the touch booster.
Performance governor is now core-aware, previously as no other hot-plugging logic was available, the governor would start with whatever number of online cores were available at that time and stay like that. This made Performance useless for it's designed purpose, that being bringing maximum performance. It now brings up all available cores online upon start and turns all additional cores back offline on governor stop. It is now by far the best and consistent governor for benchmarking.
Removed unused cpu_freq_up, cpu_freq_down, and several other flexrate related governor parameters in Pegasusq as they were either not used, or senseless.
Default Pegasusq parameters changed:
- Sampling-down factor reduced to 1 from 2, this caused reduced sampling speed upon reaching maximum frequency. It now scales (possibly down) faster.
- Frequency steps reduced from 40% to 21% of maximum frequency, this causes it to scale in 300MHz steps for the default maximum policy of 1400MHz. As we now have flexrates to scale faster I did not notice any negative effects on performance and this should help battery-wise on load-"spiky" applications, and in general.
- Increased runqueue-length thresholds for the hot-plugging logic by a flat 75 for all conditions. In my opinion and experience they were too low and caused to keep the cores needlessly online. This now reduces for "average low" use the online-time of the third core considerably.
- Increased the hot-plug frequency conditions for the 4th core.
Updated the kernel from upstream to 3.0.36.
Memcopy and string function improvements, won't bring any noticeable differences.
Compilier optimizations (Roughly the same as Ninphetamine's) are now in. VFP uses the NEON libraries now. I couldn't measure any increase in any synthetic benchmarks with this though.
LFB exFat modules.
Perseus alpha16 (3/07):
Disabled touchscreen touch booster; this previously locked the CPU frequency at 800MHz, memory interface to 400MHz and bus frequency to 200MHz at any time the finger touched the screen.
Implemented flexrate capability into pegasusq; additionally added a frequency threshold above which flexrate requests are ignored. Currently this is set at 800MHz but is configurable in the governor tunables.
Enabled quality of service requests in the touchscreen driver, this currently triggers a flexrate request at a sampling period of 15ms over the governor default of 50ms, and over 5 periods, giving 75ms of heightened reactivity. It also sends a direct memory access throughput quality of service request to the the linux power management quality of service interface to guarantee a 266MHz bus frequency for 142ms. Still need to check if that the last part works correctly.
Perseus alpha14 (21/06):
Only Mali platform changes.
Remove Samsung integrated checks on in the Pegasus platform that prevented the GPU control interfaces to work. Overclocking, undervolting, and the rest now properly work.
Removal of the CPU frequency lock to 1200MHz if the GPU is at 440MHz, this is excessive as 3D load heavy applications usually do not tax the CPU that far, and is an unnecessary power consumption burden.
The thermal control unit temperature throttling causes to fix the voltage to a fixed value when throttling is in place; this is useless considering frequency is not limited, making the whole thing senseless. Thus removed.
Perseus alpha13 (20/06):
Rebased sources on a Linux branch for commit completedness. All commits reapplied and cleaned. New repo.
CIFS included as module
Busybox removed. This should be part of the ROM.
Perseus alpha12 (14/06):
Added enhanced init.d support as per dk_zero-cool's implementation.
SHA-1 improvements
Added exception to the module loading logic for the exFat driver module thus making it work. (Credit to gokhanmoral)
Perseus alpha11 (10/06):
ro.secure=0
Recovery renamed as busybox in /sbin. I'll compile a proper busybox later on, or remove it alltogether when a recovery with autoinstall is released by CF or somebody else.
Perseus alpha10 (8/06):
Overclocking up to 1800MHz. Voltages in ASV table are somewhat scaled up until 1600MHz, after that you're on your own and have to optimize yourself.
Intel claims maximum sustainable safe voltage for 32nm HKMG to be 1.4V, above that may cause electron migration to the silicon and permanently deteriorate your chip. 1700 and above only for avid overclockers and benchmark freaks. Credit to tvanhak for playing lab rat with his phone.
Samsung frequency limitation removed to scale above 1400MHz, full credit goes to Gokhanmoral for finding this hack in the kernel as it is in a very sneaky location.
Perseus alpha7 (5/06):
Reduced regulator voltage initialization minimum to 600mV, you can now undervolt that far. Be aware of crashes.
Added SIO scheduler
Some network and CRC related patches
Perseus alpha6 (4/06):
UV_mV_table support, apps like SetCPU work now.
If you have a voltage set at for example 1187500µV the output will be rounded up to be displayed at 1188mV. If you set a voltage non multiple of 12.5mV then for example, 1190mV, it will round it to the nearest valid step, being 1187.5mV. UV_uV_table is there for finer grained control but no app suports that yet.
Perseus alpha3 (4/06):
Mali: disable state tracking
Mali: GPU frequency, scaling and voltage control
Governor pegasusq: make up_threshold_at_min_freq and freq_for_responsiveness configurable values. This is the reason the Galaxy S3 is so smooth, it has super aggressive scaling values for the governor until default 500MHz.
Enabled 1500MHz per defconfig and added voltage values to ASV table for it
Added UV_uV_table for voltage control on the CPU; this is not compatible for any programm which supports undervolting right now, we need UV_mV_table for that and since we have 12.5mV steps being fed to Vdd it's not compatible for now.
Boot partitions are made visible.
Knowledge base
I'm going over time to update this post with some informations. It may be unsorted, unfinished or un-editorialized for the time being.
2) Hardware
The Galaxy Note 2 will be coming out with a new 4412 versioned Rev 2.0, where as the one currently in the S3 is versioned Rev 1.1. The new chip will be launched at 1.6GHz default clock. What is interesting is that they have increased the base clock from 800MHz to 880MHz, most of the SoC internals feed off this clock, meaning that we're going to have 10% clock boost in the internal bus and memory speeds.
Now as a side note: One thing that I haven't understood from the press releases back in May, is that there were this "internal 128bit bus" mentioned, with some idiotic websites taking that tidbit and claiming the chip was a 128bit architecture. Whatever. Anyway, the reason for this is that the way the Samsung SoCs internally function: they are separated in a "left bus" and a "right bus". The left bus is connected to the memory controllers and is also just called the MIF/Memory Interface. The right bus is called the "internal bus" and is connected to the ARM cores and everything else. The biggest difference here between the 4412 and the previous Samsung iterations was that both these were running at the same clock. In the 4412 the internal bus is running at half the memory interface bus, this corresponds to the increase to 128bit in the internal bus.
Now I got curious due to all this talk about the A6 and this tidbit:
"K3PE7E700F-XGC2" the last two characters refer to the clock speed. The iPhone 4S was [under]clocked at 800 Mhz. "K3PE4E400B-XGC1" was the A5's part number. E4 refers to 2 Gb LPDDR2 die and because A5 features a dual-channel LPDDR2 memory with two 32-bit die. 2 GB x 2 = 512 mb of RAM. C1 was the clock speed which was 2.5ns which indicates a 400MHz clock frequency. Two channels result in the A5 clock speed of 800MHz. So the A6 has C2 which is 1.9ns which indicates a 533 MHz clock frequency. 533 x 2 is ~1066 GHz.
Click to expand...
Click to collapse
Both the A6 and 4412 use the same memory, only difference being what seems to be a revision serial character. I was talking a few months ago how the 4412 showed a good 30% bandwidth improvement over the 4210, and credited this to it running 1066mbps memory instead of 800mbps; but in reality that is not the case.
I went over the source code of the busfrequency driver in the S3, and found that actually there is an entry for the internal frequency to run at 266MHz (128bit), but that entry is disabled in the driver; because the memory interfaces don't exceed 400MHz. The bus speed is defined in (MIF/INT) pairs and top speed available is 400200 (400MHz memory, 200 internal). Well this is interesting we can overclock our device's memory then if there's headroom! Well that idea quickly faded as I found that the C2C (Chip-to-chip) interface to the memory isn't capable of being clocked to 533MHz because simply the C2C clock divider register simply doesn't allow a divider value needed for that frequency, only being able to run 400MHz(and lower) and 800MHz. Basically we can't use the fast memory because it seems the clock dividers don't allow it. Anyway, coincidentally the i9305 sources were released two days ago and it included all the Note 2 sources and so on, so what Samsung did was simply increase the MPLL base clock from 800 to 880MHz, actually increasing the frequency of a load of things like the camera interface and who knows what at the same time.
What this also means is that Samsung increased effective bandwidth by 30% without increasing the memory speed. This indicates much improved memory controllers, and also why it easily beats the Tegra 3 and others in memory benchmarks.
Another new addition to the REV 2.0 chip is that we'll be running 533MHz for the Mali clock by default. We were already experimenting with this on the S3 and pretty much made the GPU run up to 700MHz, of course, it gets quite warm and battery hungry, but it's neat nonetheless.
3) Reserved memory spaces
There is the current reserved memory space breakdown, with red as Perseus changes over stock:
#Secure spaces on fixed memory addresses
Front-camera firmware & heap: fimc0: fmic1 =
0x65800000 - 0x66700000 => 15360K (0xF00000) => 14336K
Multi function codec B memory space: mfc-normal =
0x64000000 - 0x64400000 => 4096K
ION device memory allocator reserved space: ion =
0x5F200000 - 0x63800000 => 71680K (0x4600000) => 48128K
Multi function codec device reserved space: device_mfc =
0x5C800000 - 0x5CA80000 => 2560K (0x280000)
Multi function codec A memory space (Virtually contiguous to MFC, practically has a physical memory hole): mfc-secure =
0x5C100000 - 0x5C800000 => 7168K (0x700000)
0x5F000000 - 0x5F200000 => 2048K (0x200000)
Bootloader: sectbl =
0x5C000000 - 0x5C100000 => 1024K (0x100000)
# non secure
Camera imaging subsystem: fimc_is => 12080K (0xBCC000) => 10240K
Display interface and frame buffer: fimd => 8192K (0x800000)
Main-camera firmware & heap: fimc0 => 62464K (0x3D00000)
Audio buffer: srp => 1024K (0x100000)
Good start dude, i will release my kernel in 2 days max too, just need to finish a few things and it's done
Sent from my Desire HD using Tapatalk 2
simone201 said:
Good start dude, i will release my kernel in 2 days max too, just need to finish a few things and it's done
Sent from my Desire HD using Tapatalk 2
Click to expand...
Click to collapse
Desire HD? Did you already get rid of your S2? Thanks. Do you have your device or also waiting for the blue one?
AndreiLux said:
Desire HD? Did you already get rid of your S2? Thanks. Do you have your device or also waiting for the blue one?
Click to expand...
Click to collapse
Haha yeah i sold it to buy a GS3, i ordered the white one from amazon.it but it is taking ages -.-"
BTW, look at my repo, i have done some great new mods if someone wants to use other govs than pegasusq (that is way better but you know, it's always good to have a choice)
Sent from my Desire HD using Tapatalk 2
Nice AndreiFlux let's test
Gesendet von meinem GT-I9300
simone201 said:
BTW, look at my repo, i have done some great new mods if someone wants to use other govs than pegasusq (that is way better but you know, it's always good to have a choice)
Click to expand...
Click to collapse
Great work. Personally I'm not going to allow anything other than Pegasusq though, I just don't see the point. The users can use your kernel if they want choice
AndreiLux said:
Great work. Personally I'm not going to allow anything other than Pegasusq though, I just don't see the point. The users can use your kernel if they want choice
Click to expand...
Click to collapse
Yeah you're right, that's why i will stay with pegasusq by default
My mods are good to use the cores as you want, like it was with Tegrak's 2nd Core
Sent from my Desire HD using Tapatalk 2
Hi
is a bootanimation possible with this kernel or is it in a future version planed?
Bootanimations on the S3 are supposedly in a proprietary format now, so we'll have to see about it. As said, for now it's baby steps as long as I'm not able to molest the flash counter on the device myself.
Wifi is not working on this Kernel
Kevinkuensken said:
Wifi is not working on this Kernel
Click to expand...
Click to collapse
Yes, me too...
+1
Same issue with wifi...
Kevinkuensken said:
Wifi is not working on this Kernel
Click to expand...
Click to collapse
I guess it boots well then! Reuploaded a new version for Wifi, please test if you want to.
AndreiLux said:
I guess it boots well then! Reuploaded a new version for Wifi, please test if you want to.
Click to expand...
Click to collapse
Strange, modules not loaded?
For me it worked perfectly from first build, using fully stock ramdisk
Sent from my Desire HD using Tapatalk 2
AndreiLux said:
I guess it boots well then! Reuploaded a new version for Wifi, please test if you want to.
Click to expand...
Click to collapse
Still no wifi with Alpha3.1
Mopral said:
Still no wifi with Alpha3.1
Click to expand...
Click to collapse
Same here
simone201 said:
Strange, modules not loaded?
For me it worked perfectly from first build, using fully stock ramdisk
Sent from my Desire HD using Tapatalk 2
Click to expand...
Click to collapse
Hmmm. I'm reverting to fully untouched ramdisk now, alpha3.2 uploaded.

[Q] ICS, Acer E330, stock kernel doesn't want to cooperate

i have searched and re-searched a lot of times for threads that talk about my same problem, but none of them is related to it in terms of phone, kernel or ROM, and they're all nearly 2 years old
in addition, i am new to this forum, so please don't shoot me
anyway here it is:
i've tried almost every existing method to get governors like smartassV2 and interactive (my favorites) to stick without reverting to ondemand, but none worked
i noticed this:
in the exact moment the screen is locked, something sets the governor to ondemand
in the exact moment the screen is UNlocked, the same thing (i guess) sets it to performance, then to ondemand
since i know a bit about intents and receivers, i can say this behavior is triggered by android.intent.action.SCREEN_OFF/ON intents, so there must be some system apk with a receiver for those which reacts and changes governor accordingly
right now i'm running a modded init.qcom.post_boot.sh that sets back the governor to a custom one (i.e. smartassV2) every 20 seconds, which is the only way i can get it to "stick", however i hate this method 'cause it implies there is a shell running in the background, thus stealing some (yet minimal) resources and battery, and the problem is still there
some info that might come in handy:
phone: Acer Liquid Glow E330
ROM: Glowing Liquid 1.5.2 (ICS)
kernel: Lupo's kernel V3
take a look at the logcat screenshot attached, i think i found something but i have no idea what to do
EDIT: if you can't read what's in the pic, it's saying something about a CpuGovernorService
how is it possible that nobody cares? i've given more info than anyone else on this problem people, experts, devs, anyone, say sumthin'
Maybe try tot set it with an app like trickster mod and set it on boot? Or try another ROM to see if its a system app. Sorry I dont really know the programming part..
Sent from my Galaxy Nexus using XDA Premium HD app
i'll disable my script and give it a shot, however there is no other ROM, only two existing alternatives are stock (which only has crappy ondemand) and glowing liquid by vache
EDIT: didn't work dammit
UPDATE: by raising the log level to 7 in a custom boot.img i can now see PrintK saying this:
cpu_policy->user_policy.governor name interactive, str_governor = ondemand
update_cpufreq_governor cpufreq_update_policy return = 0
as a linux user, i know that PrintK is basically the kernel talking to the user/log daemon, so i am now asking help to kernel developers for any clues about it, and maybe how to change that parameter (or whatever it is) in the kernel to get rid of ondemand
as difficult as this can be to figure out, i'm sure that this would be the end to many headaches, so anyone who knows about how linux kernels work please help me find the solution to this thing
Alright, i give up, ain't no answers here
Somebody close/delete this goddamned thread, please
Sent from my scumbag cheap phone
SuicideFlasher said:
Alright, i give up, ain't no answers here
Somebody close/delete this goddamned thread, please
Sent from my scumbag cheap phone
Click to expand...
Click to collapse
hello , i got the same E330 , stock rom but root and kernel LupoV3 , to set it at 1300 mhz and SmartassV2 , maybe try Android tuner , or some who got possibility to change CPU with screen on/off , i'll try to see ...
Vache did a release 1.6 of this Rom , and Acer too (Acer_AV044_E330_1.041.01_EMEA) you can found them at Acer-club.fr
tchao
Speedo.thc said:
hello , i got the same E330 , stock rom but root and kernel LupoV3 , i set 1300 mhz and SmartassV2 with nofrills CPU , it work well.
Vache did a release 1.6 of this Rom , and Acer too (Acer_AV044_E330_1.041.01_EMEA) you can found them at Acer-club.fr
tchao
Click to expand...
Click to collapse
If you look closely, it resets to ondemand every time the screen changes state
Sent from an utter FAIL phone
EDIT: the thing is, i do have a cpu tuner with wake/sleep profiles, i simply can't seem to have it doing its job
also i stick on stock kernel because the other ones have buffer problems with music, and i'm not sacrificing my flac files for
crappy mp3s
SuicideFlasher said:
If you look closely, it resets to ondemand every time the screen changes state
Sent from an utter FAIL phone
EDIT: the thing is, i do have a cpu tuner with wake/sleep profiles, i simply can't seem to have it doing its job
also i stick on stock kernel because the other ones have buffer problems with music, and i'm not sacrificing my flac files for
crappy mp3s
Click to expand...
Click to collapse
is it this one ? "CPU tuner (Rooted phones)" on play store , i give it a chance yesterday and it looks to do the job, more than nofrill etc .... no easy to set fine but if i see the log file 'journal' it works , i come back to "smartassV2" (wich is "virtuel" gov settings) after wake up and at enter calls ...
Speedo.thc said:
is it this one ? "CPU tuner (Rooted phones)" on play store , i give it a chance yesterday and it looks to do the job, more than nofrill etc .... no easy to set fine but if i see the log file 'journal' it works , i come back to "smartassV2" (wich is "virtuel" gov settings) after wake up and at enter calls ...
Click to expand...
Click to collapse
No, just the setcpu implementation in rom toolbox. anyway i tried that "cpu tuner" and it kept forcing the governor to ondemand despite the "normal" mode being set to interactive (and yes, "normal" was the current setting)
Sent from an utter FAIL phone

[2.42/2.33][Kernel][EAS][02.02][4.4.170] Kirisakura_EAS_OREO 15.0 | Feel the Future!

Hello everyone,
after countless hours of work here it finally is. The first working EAS kernel for our beloved HTC U 11.
Important question: What is EAS?
Energy Aware Scheduling (EAS) is an enhancement to Linux power management, unifying CPU power control under the Linux kernel. EAS extends the Linux kernel scheduler to make it fully aware of the power/performance capabilities of the CPUs in the system, to optimize energy consumption for advanced multi-core SoCs including big.LITTLE. With EAS, the Linux kernel will use the task load and a CPU ‘Energy Model’ to control task placement to select the optimal CPU to run on.
Google thinks, EAS is the way to go for the future. With this kernel you can get pixel (2) experience even before the pixel (2) is released.
Interesting links for further research:
http://www.linaro.org/blog/core-dump/energy-aware-scheduling-eas-progress-update/
https://developer.arm.com/-/media/d...overview_and_integration_guide_r1p3.pdf?la=en
DISCLAIMER:
I had to rewrite and cut out a lot of code to get EAS working. Due to this the prebuilt WLAN and texfat modules are no longer working for this kernel. There are conflicts because I moved to far away from HTC´s codebase.
Because of this I had to compile the WLAN driver from source and integrate it as a module in the kernel zip. To get texfat working I had to built the exfat-nofuse driver from @dorimanx into the kernel.
To allow the kernel to fully operate we need to disable HTC´s PNPMGR.
That means in case you want to go back to a HMP kernel you will have to either backup the wlan module and the pnpmgr files manually or do a nandroid/dirty flash your rom (which is way easier).
This also caused WLAN calling not to work!
Features:
- EAS for 4.4 with patches from 4.9 eas-dev
- Upstreamed to latest 4.4.170
- Rootless interface supported
- Enabled NOOP, DEADLINE, CFQ, MAPLE, TRIPNDROID and BFQ IO scheduler
- Enabled advanced TCP Congestion Control
- Included GPU Boost
- S2S across navbar area
- KCAL color calibration
- Backlight Dimmer
- Button Mapper Support
- Fsync On/Off support
- Green Pulsating Notification LED @tbalden)
- Fingerprint Double Tap to sleep support @tbalden)
- Button Light Notification from @tbalden
- Gradient Charging LED from @tbalden
- Squeeze Control (squeeze to wake/peek/sleep; squeeze to swype) from @tbalden
- Flashlight notification from @tbalden
- Vibrating Notification reminder from @tbalden
- Notification Boost from @tbalden
- Generic wakelock blocker
- Completely rewritten CPU-Boost for EAS (thanks to @RenderBroken) along with Dynamic Stune Boost from @joshuous
- included BFQ IO Scheduler for 4.4 kernels
- USB Fastcharge
- Various CAF improvements
- upstream patches from kernel/common
- Locking Backports from 4.9 Kernel
- OOM_Reaper, OOM_Kill Backport from 4.9 kernel
- Lowmemorykiller Backport from 4.9 Kernel
- RCU backport from 4.9 kernel
Instructions:
1. Please dirty flash your rom to have a clean ramdisk
2. Backup your current setup in twrp
3. flash the zip file/s according to your favorite install method in twrp
4. reboot
5. If you dont want to use @tbalden ´s rootless kernel apps, but traditional root via supersu or magisk delete the uci....cfg file from the root of your sdcard
6. Enjoy your phone
Download:
OREO: https://www.androidfilehost.com/?w=files&flid=251050
Nougat: https://www.androidfilehost.com/?w=files&flid=229307
Changelog:
1.003:
https://forum.xda-developers.com/showpost.php?p=73283377&postcount=174
https://forum.xda-developers.com/showpost.php?p=73283388&postcount=175
ZERO_BETA_2
https://forum.xda-developers.com/showpost.php?p=73500972&postcount=233
ZERO_GAMMA_4
https://forum.xda-developers.com/showpost.php?p=73533313&postcount=296
ZERO_GAMMA_6
2.0
https://forum.xda-developers.com/showpost.php?p=73806358&postcount=386
3.0
https://forum.xda-developers.com/showpost.php?p=73874622&postcount=424
CAF_1.0
https://forum.xda-developers.com/showpost.php?p=73983865&postcount=493
CAF 1.10
https://forum.xda-developers.com/showpost.php?p=74055104&postcount=626
CAF 1.20
https://forum.xda-developers.com/showpost.php?p=74103333&postcount=676
CAF 1.30
https://forum.xda-developers.com/showpost.php?p=74135102&postcount=687
CAF 1.31
https://forum.xda-developers.com/showpost.php?p=74163796&postcount=703
CAF 2.00
https://forum.xda-developers.com/showpost.php?p=74202067&postcount=719
CAF 2.10
https://forum.xda-developers.com/showpost.php?p=74270321&postcount=755
CAF 3.0
https://forum.xda-developers.com/showpost.php?p=74476266&postcount=792
CAF 3.1
https://forum.xda-developers.com/showpost.php?p=74677436&postcount=845
OREO 1.0
https://forum.xda-developers.com/showpost.php?p=75636045&postcount=918
OREO 1.3
https://forum.xda-developers.com/showpost.php?p=75675979&postcount=938
OREO 2.0
https://forum.xda-developers.com/showpost.php?p=75843285&postcount=955
OREO 4.0
https://forum.xda-developers.com/showpost.php?p=76020308&postcount=987
OREO 5.0
https://forum.xda-developers.com/showpost.php?p=76287809&postcount=1029
OREO 7.0
https://forum.xda-developers.com/showpost.php?p=76625681&postcount=1053
OREO 10.0
https://forum.xda-developers.com/showpost.php?p=77187817&postcount=1082
OREO 11.0
https://forum.xda-developers.com/showpost.php?p=77588328&postcount=1107
OREO 12.0
https://forum.xda-developers.com/showpost.php?p=77757572&postcount=1113
OREO 13.1
https://forum.xda-developers.com/showpost.php?p=78144426&postcount=1146
OREO 15.0
https://forum.xda-developers.com/showpost.php?p=78815371&postcount=1170
Credits and Thanks:
I want to say thank you to all those who helped me along my way, who answered all my questions and took their time to support me. Huge thanks to @tbalden @Eliminater74 @Captain_Throwback @RenderBroken
Additionally a huge thanks to @RenderBroken for doing the main work on getting EAS on the android 4.4 kernel. Without him this wouldn´t exist. Drop him a thanks on his threads or show your appreciation with a little donation.
This credit also goes out to @joshuous who works together with @RenderBroken.
Credits:
@flar2 for his complete work
@tbalden for his led tricks, adreno boost etc
@Flinny for helping me with compiling the kernel!
@savoca for Kcal
@Eliminater74 for bringing me into the kernel game
@Sultanxda
@eng.stk
@osmosis
@frap129
@velimirchek for all the testing and support
@tomascus for the nougat base!!
@jsaxon2 for helping me with the OREO magisk module!
and all others that helped me on my way
also for the OREO Kernel Testers!
@zhuchella
@aadeshiscool
@Snah001
@ffh2303
@cjrivera04
@Derepinar
@p50kombi
@CharliesTheMan
@jsaxon2
Donations:
Donations are not mandatory but very welcome..
If you like my work: http://paypal.me/freak07
Source: https://github.com/freak07/OCEAN_OREO_EAS
So this post will be dedicated to information about EAS in general.
Here is a good breakdown on EAS vs traditional HMP (which the other kernels here are using)
Right here we go.
EAS is a completely different breed compared to the conventional HMP system, where it serves an entirely different purpose of achieving the optimal balance between performance and efficiency, with the latter taking the top spot. EAS achieves that via cleverer tasks placement, by which the system determines which is the more efficient cluster for the task to be processed by, as well as categorising the different tasks into cgroups (top-app, foreground and background, in order from highest priority to lowest priority respectively) by which each cgroup receives its sliver of the available firepower (cpuset). EAS also offers the capability of inflating the perceived load, that's determined by the load trackers, of the task in any of the cgroups via its schedtune.boost setting, and whether the task should be processed by all the cpu cores available or only by the cluster the task has been placed on via its schedtune.prefer_idle setting. One of the key features of EAS is lifting almost all the processing from the governor to the CPU scheduler (no it is not the I/O scheduler, something different) and letting it take much much more control, leaving the CPU governor to only do the frequency determination part, which unsurprisingly relies heavily on data supplied by the scheduler. With all that said, it is easily deduced that EAS is not all about governors and governor settings and the like, rather a much cleverer solution that serves the purpose of seeking the best balance between performance and efficiency, and to ensure the CPU is not overdoing a task or the CPU governor is overshooting a simple task, which would attribute to needlessly draining a lot of power as a natural consequence. EAS is about ensuring you get the smoothest UI possible while retaining as much power as possible. However, that does not mean that EAS is lame poor when it comes to performance. Sometimes, if not in most cases, this cleverer tasks placement makes tasks get processed faster, a point that is already proved quite well by the EAS-supporting non-OOS based custom ROMs like VertexOS, ZeNiTy-RR and PAEX. Conserving battery does not necessarily mean crushing performance. This explains that app launches are on-par with HMP if not ahead of it sometimes.
Now on to your question. After going through that brief explanation of EAS, i think your question is actually invalid, since it is not an apple-to-apple comparison anymore. EAS seeks for the optimal balance between performance and efficiency. Should there be a commit to improve performance while not being at the expense of efficiency, EAS should have that stuffed in, whereas HMP is prioritising performance higher than efficiency by design. What Burnout does is taking HMP and making it even more performance oriented, hence it is very unlikely to face micro lags with it. However, HMP still misses the cleverer tasks placement, which can show its canines if you have so much processes going in the background, where in that area EAS takes the lead quite noticeably.
Conclusion: You should try and see what suits you more. But something i can safely say is, EAS is more than satisfactory when it comes to performance from the perspective of a man that always seeks the best performance available, and with the battery gains you yield with EAS, it can go better.
Hope i helped and clear the confusion.
-TDK
A short Explanation on WALT vs PELT. This kernel uses WALT.
RenderBroken said:
An amazing write up by a talented dev @joshuous:
PELT and WALT
Time for me to flex the analogy muscles.
Just to set things straight, PELT and WALT are different load tracking metrics that try to determine the load of the system. The load will eventually be used by the frequency governor to set the frequency. Think of them (the load tracking metrics) as an employee who is dedicated to announcing how quickly customers are coming into your burger restaurant. The frequency governor is the burger chef, who isn't able to see the number of customers entering, so he has to rely on the announcer in order to know the rate at which he is making burgers. The announcer can say that there are "many" customers, and the chef has to decide how fast to make the burgers based on how he interprets "many".
One announcer can say that 10 customers is "many", while another may say that 20 is "many". An announcer may also attempt to predict the number of customers that will enter based on how many he sees at the current point in time. In this way, burger output is more 'bursty'. For example, there are 10 customers ("many"), then no customers ("none"), then 15 customers ("very many"). The chef works hard, then thinks he can take a break for a moment, then suddenly has to work like crazy to dish out burgers for 15 customers. An oversimplified analogy to WALT.
On the other hand, another announcer may observe a trend of customers and apply some prediction to guess how many customers might come through the door. Using the same customer sequence as before, he may instead tell the chef "many", "some", then "many". So the chef may make burgers even when there are no customers, in anticipation of future customers, but he won't be worked so darn hard all of a sudden. This is less bursty and more consistent. An oversimplified analogy to PELT.
In the same way there are different chefs (e.g. Sched and Schedutil). They have different interpretations of what "many" means to them. That's why their burger outputs may be different even when having the same announcer.
So which is better? It all boils down to your workload, and even so it is difficult to make a conclusion. All I can say is that you must test each mechanism for over a week and check your active drain rate (Ex Kernel Manager is good for this). Active drain rate is a much better measure than SOT. And make sure to keep jumping back and forth between the two to account for anomalies.
Edit: On another note, to complete the analogy... Interactive and HMP is more similar to the chef being the announcer as well. Except for he is able to see less than a dedicated announcer can. I.e the chef (interactive governor) can't look at the queue outside his restaurant but only the ones in his restaurant (so he is partly blind). A dedicated announcer can look at customers inside and outside the restaurant though.
Do note that this has little to do with EAS per se. EAS is a different beast that focuses on optimizing which customers is assigned to which chefs. I'll probably write the analogy for this another time if there is a demand for it
Click to expand...
Click to collapse
FAQ
Q: I got the SD is corrupted message after booting and my sdcard is formatted as exfat. What should I do?
A: Reboot to Recovery mount USB storage, unmount it and reboot.
Q: I switched kernels and now my wlan isn´t working?
A: that is because I have to use my own wlan module. restore system of your nandroid. or extract stock wlan module from custom rom.
Q: My device does not sleep and the reason is media scanner is holding the device awake. What to do?
A: There can be a strange case where the exfat nofuse driver I have to use in order for external sdcard to work creates an infinite folder loop.
It can be solved if you check your sdcard with a file manager for a folder like android/data/com.xyz.app/files/files/files/files...... and so on.
Go to twrp recovery move the infinite file folder to the root of external sdcard. Then it can be easily deleted. Before moving the file deleting it is not possible.
Q: How to set up the cleanslate LED/Notification Light/BLN options?
A: Take a look at this post: https://forum.xda-developers.com/showpost.php?p=72710244&postcount=2
Not needed as per Version 3.0
Q: Netflix isn´t playing videos?
A: go to settings -> dev options -> untick disable hw overlays, watch netflix and don´t forgot to tick the option again after using netflix ( say thank you to HTC for not releasing the new source)
So allright guys. This will be the section where you will fine information on how to fine tune the EAS kernel if you aren´t satisfied with my default settings.
So as you can see in a kernel manager like EXKM for example we have an input boost on this kernel.
The 4 little cores ( aka the little cluster) gets boosted to 1171.200mhz for 1500ms when you interact/touch your screen by default.
This ensures scrolling/fling/app loading smoothness.
Now you say, only core 0 gets boosted. But if you look at the source you will see the cpu boost driver works only for both clusters and single cores. This is done by design.
If you want to additionally boost the big cluster (because you aren´t satisfied with above mentioned scrolling/fling/app loading etc) you have to define the boost frequency for core 4 also.
Writeup for dynamic stune boost v1 (OLD)
Now a writeup on dynamic stune boost by @joshuous
For those who are not sure what Stune (schedtune) boosting is, it is an EAS feature that allows you to bias frequencies higher or lower for certain task groups.
Android defines the following task groups that you can boost:
1. Top-app: The task that you're directly working on, or the task that you see. This mostly refers to the app that you're currently interacting with.
2. Foreground: Tasks that are not the top-app, but are still part of the user experience (e.g. the surfaceflinger display thread and audio threads)
3. Background: Tasks that are not part of the user experience (e.g. some random task running in the background that you don't care about)
4. System-background: Similar to background, but specifically for system tasks
5. Root: anything that else that does not belong to the other categories
Why do we need Schedtune boosting when we already have the cpu-boost feature?
cpu-boost works by allowing the user to set the specific boost frequencies and duration for clusters. But how do you know whether the frequency you specified is too little or too much? If you specify 1000 MHz boost for Little cluster, is that overkill for typing, or is it too miniscule for scrolling in a content-heavy app like Google Calendar? You end up facing a dilemma of choosing between increased battery drain or increased smoothness. Personally, I find that cpu-boost is rather inflexible and doesn't scale according to the user's needs.
So how does Schedtune boosting work?
Let's first talk about Schedutil governor. It works by using utilisation data provided by the [Linux] Completely Fair Scheduler. The 'CFS Scheduler' (not I/O scheduler erherm), in simple words, decides which tasks should be assigned to which CPU cores. Based on the Scheduler's knowledge of the tasks it allocates to cores, it can directly sends signals about the cores' utilisation to the Schedutil governor. Think of utilisation as the number of customers that a chef needs to serve at this point in time. The Schedutil governor uses the utilisation value and tells the chef how fast he must cook (what frequency the core should run at).
Now sometimes you may have certain customers (who are part of the Top-App Company) who are in a hurry to get their food and rush back to work. You need to serve the Top-App customers urgently, so you ask the chef to cook even faster than usual. You can think of Schedtune boosting as artificially inflating the number of customers (boosting the utilisation value) to get your chef to cook faster.
The beauty of Schedtune boosting over cpu-boost is that you don't need to fix a frequency to boost to. Instead, the Schedutil governor will give certain tasks a little bit more oomph. If the original unboosted frequency for scrolling is 600 MHz, Schedutil may boost it a little bit more to 750 MHz, for example. If the unboosted frequency for scrolling in calendar is 1000 MHz, perhaps Schedutil may boost it to 1300 MHz. It all depends on the boost value you want to set.
Give Schedtune boosting a go
Analogies aside, you can adjust the boost value in /dev/stune/{top-app, foreground, background, system-background}/schedtune.boost. Usually we mostly care about boosting top-app. Schedtune boost basically boosts the utilisation value by a certain factor. For example, if you set a boost value of 10, the utilisation (not the frequency) is boosted by 10%. A larger utilisation value will cause Schedutil to select a higher frequency.
Try setting the value in /dev/stune/top-app/schedtune.boost to a value between 10-20. Turn off cpu-boost. Enable GPU profile rendering and watch the magic. If your results are like mine, you'll see very low bars which means that it's really smooth. Launch CPU Float app and observe the frequencies. You might notice that they run at a very low frequency compared to the default cpu-boost value, yet it is even smoother. Why is Schedtune boosting producing smoother experience at a lower frequency? I have no freaking clue :S.
Now what is Dynamic Schedtune Boosting?
The issue with setting schedtune boosting (in /dev/stune/*) is that it boosts 24/7 and could drain a bit more battery. There are some situations when you may not want to boost, such as watching YouTube (Top-app task). Boosting is beneficial for mostly touch activity, such as scrolling or typing. The solution I implemented was extending the cpu-boost feature to apply schedtune boost only during touch activities. Other than touch events, schedtune boost won't run 24/7 and drain excess battery.
Getting started with Dynamic Stune Boost
To get started do the following:
1. Enable cpu-boost
2. Set all cpu-boost frequencies to zero
3. Set the boost duration to 1500ms (you can vary it depending on your needs)
4. Edit the boost value in /sys/module/cpu_boost/parameters/dynamic_stune_boost to between 10-20. Feel free to adjust this value. Make sure to set /dev/stune/top-app/schedtune.boost to 0, otherwise it may overwrite dynamic schedtune boost.
5. Turn on GPU Profile Rendering to analyse smoothness of frames.
6. Enjoy and report back your findings in terms of your tunable values, smoothness and battery drain.
tldr; If your brain hurts, just follow the instructions in "Getting started with Dynamic Stune Boost"
Now you may see that I don´t use the dynamic schedtune boost by default. That is because most tasks got assigned to the little cores when activating it and it actually performs worse. This will get solved in some time and I may update the guide then again.
But for now it is not recommended to turn on the dynamic stune boost.
Current setting are
dev/stune/schedtune.boost is at 5
dev/stune/top/app/schedtune.boost is at 15.
input boost is enabled for the little cluster (core 0) at 1171.200mhz for 1500 ms
If you want to experiment with different schedtune.boosts for global, background, foreground and top-app and found good values please share them with us here in the thread
A workaround for you experiment guys that want to enable the dynamic schedtune boost is:
1. Set /dev/stune/top-app/schedtune.boost to 5-10
2. Set dynamic stune boost to 10-20 (I like 20)
The issue with dynamic stune boost is that it only (at the moment) boosts the frequencies of the cluster that a top-app task resides in. So why were there still performance issues? That's because top-app tasks preferred to stay on Little cores, which is likely overcrowded already. That means that the top-app task have to compete with the other tasks on the same overcrowded core for computing power. Imagine it like having a huge pizza (high frequency), but so many people have to share it such that you only get a tiny piece. This is why a task can run on the less-crowded Big cluster at a much lower frequency but still perform better than running on a crowded Little cluster with high frequency.
Now, setting the /dev/stune/top-app/schedtune.boost to 5 does two things. Firstly, it increases the perceived load of the individual top-app task, consequently biasing Schedutil to select a higher frequency (not by much). Secondly and most importantly, since the perceived load is higher (imagine a very hungry person), EAS decides that it needs to be shifted to the Big cluster (larger pizza). 5 was chosen because it's around the tipping point to cause the shift. Use 10 if it's not smooth enough.
Dynamic stune boost doesn't influence tasks to be shifted to the Big cluster, which is why top-app tasks tended to stay on Little cluster.
Combining both steps, we can influence top-app tasks to run on Big cluster (step 1), and a larger Dynamic Stune Boost value will cause the frequency to ramp up during touch interactions on the Big cluster where top-app tasks run (step 2). No unnecessary boosting when watching YouTube woohoo!
Tldr; You're in a pizzeria. Regular schedtune boost shifts you to a less crowded table. Dynamic schedtune boost increases the size of your pizza. Your stomach rejoices
Writeups about dynamic schedtune boost v2 from @Mostafa Wael and @joshuous
Dynamic SchedTune Boosting v2
Couple of weeks ago, Joshuous wrote a new feature, namely Dynamic SchedTune Boosting, that’s been incorporated in recent RenderZenith kernel builds, which essentially alters the value of schedtune.boost for the top-app cgroup dynamically on touch events, to conserve battery. But still, the solution was not that flawless, since it didn’t migrate the task to the big cores when essential as Joshuous previously explained. A quick workaround was to increase the value of /dev/stune/top-app/schedtune.boost to 1 (at least) to allow the utilization of the big cores when required. Many of you may be wondering why that was necessary. Well, hopefully I can break it down a bit for you.
Given the task that needs processing, the find_best_target() function – that is responsible for placing the tasks on the suitable cluster – iterates firstly on the big cluster when the SchedTune boost value is greater than 0, whereas the little cluster will be iterated firstly, should the value of SchedTune boost be equal to or less than 0, to save power. What SchedTune boost does is inflating the task and CPU utilisation fed to the scheduler, and therefore impacting the OPP selection and allowing the task to be placed on the big core(s) if needed. What the older version of Dynamic SchedTune Boosting did was rather inflating the value of utilisation going into Schedutil governor, that is then used to determine the frequency step to be selected for the task via a linear formula, which consequently increases the calculated frequency. But since the value of utilisation going into the scheduler is not inflated, the placement of the task on the corresponding core(s) won’t be impacted and therefore, the task won’t be moved to a big core instead. In essence, the older version would only increase the frequency and not impact the tasks placement on the cores. This caused a drastic performance difference compared to what you get when setting the SchedTune Boost value statically.
With the new v2 version, Dynamic SchedTune Boosting will directly change the value of /dev/stune/top-app/schedtune.boost directly, addressing the issue of only inflating the utilisation data going to the schedutil governor, and therefore the tasks should be able to move to the big cluster when demanded as well as increasing the CPU frequency. This will allow us to safely leave the value of /dev/stune/top-app/schedtune.boost at 0 and save some power for low-medium workload scenarios, since the tasks will be moved to the big cluster on touch with no issues.
-TDK
with a little addition from @joshuous
Very well explained Mostafa
And thanks for saving me the time
To add on, don't be alarmed to see /dev/stune/top-app/schedtune.boost having the same value as dynamic_stune_boost when you want to edit it because your touches trigger the boosting. Just write the value you want into the file and save. It will automatically update the default stune boost value when the boosting stops. To confirm it, you can connect your phone to computer and do
adb shell cat /dev/stune/top-app/schedtune.boost
to confirm that it has changed. You gotta wait a second or so before you issue that command.
I would recommend keeping the /dev/stune/top-app/schedtune.boost at 1 or higher if you want lower latency when Dynamic Stune Boost kicks in. Reason being that default stune boost of 1 somewhat ensures that most of the top-app tasks are already on Big cluster so that we don't have to suddenly migrate too many tasks from Little to Big when Dynamic Stune Boost kicks in.
If you don't type much, and watch videos or listen to music mostly, then setting default stune boost to zero may save you more battery
following this link you will also find a goog explanation on how things work with EAS. It is quite simplified but good to get the general idea of it.
https://forum.xda-developers.com/showpost.php?p=74054394&postcount=526
Proper Way to Report a Bug
ramopps: is an oops/panic logger that writes its logs to RAM before the system
crashes. It works by logging oopses and panics in a circular buffer. Ramoops
needs a system with persistent RAM so that the content of that area can
survive after a restart.
logcat: the logoutput of the Android system
kernel log: (kmsg / dmesg): the kernel messages
Additionally there's the last_kmsg which is a dump of the kernel log until the last shutdown.
radio log: the log outpur ot your System / BB / RIL communication
4
ramopps: Some Documentation on Ramopps
Normal Logcat:
Code:
adb logcat -v time -d > logcat.log
Radio Logcat:
Code:
adb logcat -b radio -v time -d > logcat_radio.log
Ramoops:
Code:
adb shell su -c cat /sys/fs/pstore/console-ramoops > kmsg.txt
Kernel Log:
Code:
adb shell su -c dmesg > dmesg.log
Last_Kmsg: NOTE:
New location of last_kmsg on Android 6.0 and above: /sys/fs/pstore/console-ramoops
Code:
adb shell su -c "cat /proc/last_kmsg" > last_kmsg.log
NOTES:
-v time will include timestamps in the logcats
-d will export the complete log.
If you want to save a continuous log you can remove the -d parameter - then you need to cancel the logging process via CTRL+C.
To export a continuous kernel log use adb shell su -c "cat /proc/kmsg" > dmesg.log (and cancel it via CTRL+C again).
PS: This Document was taked from another XDA Thread Called: [Reference] How to get useful logs
URL: http://forum.xda-developers.com/showthread.php?t=2185929
Also check this one out: [Tutorial] How To Logcat
I only Revived it a bit for ramopps.
I will update this more at a later time..
[DMESG Help Commands]
Code:
Usage:
dmesg [options]
Display or control the kernel ring buffer.
Options:
-C, --clear clear the kernel ring buffer
-c, --read-clear read and clear all messages
-D, --console-off disable printing messages to console
-E, --console-on enable printing messages to console
-F, --file <file> use the file instead of the kernel log buffer
-f, --facility <list> restrict output to defined facilities
-H, --human human readable output
-k, --kernel display kernel messages
-L, --color[=<when>] colorize messages (auto, always or never)
colors are enabled by default
-l, --level <list> restrict output to defined levels
-n, --console-level <level> set level of messages printed to console
-P, --nopager do not pipe output into a pager
-r, --raw print the raw message buffer
-S, --syslog force to use syslog(2) rather than /dev/kmsg
-s, --buffer-size <size> buffer size to query the kernel ring buffer
-u, --userspace display userspace messages
-w, --follow wait for new messages
-x, --decode decode facility and level to readable string
-d, --show-delta show time delta between printed messages
-e, --reltime show local time and time delta in readable format
-T, --ctime show human readable timestamp (may be inaccurate!)
-t, --notime don't print messages timestamp
--time-format <format> show time stamp using format:
[delta|reltime|ctime|notime|iso]
Suspending/resume will make ctime and iso timestamps inaccurate.
-h, --help display this help and exit
-V, --version output version information and exit
Supported log facilities:
kern - kernel messages
user - random user-level messages
mail - mail system
daemon - system daemons
auth - security/authorization messages
syslog - messages generated internally by syslogd
lpr - line printer subsystem
news - network news subsystem
Supported log levels (priorities):
emerg - system is unusable
alert - action must be taken immediately
crit - critical conditions
err - error conditions
warn - warning conditions
notice - normal but significant condition
info - informational
debug - debug-level messages
[LOGCAT Help Commands]
Code:
Usage: logcat [options] [filterspecs]
options include:
-s Set default filter to silent.
Like specifying filterspec '*:S'
-f <filename> Log to file. Default is stdout
-r <kbytes> Rotate log every kbytes. Requires -f
-n <count> Sets max number of rotated logs to <count>, default 4
-v <format> Sets the log print format, where <format> is:
brief color long printable process raw tag thread
threadtime time usec
-D print dividers between each log buffer
-c clear (flush) the entire log and exit
-d dump the log and then exit (don't block)
-t <count> print only the most recent <count> lines (implies -d)
-t '<time>' print most recent lines since specified time (implies -d)
-T <count> print only the most recent <count> lines (does not imply -d)
-T '<time>' print most recent lines since specified time (not imply -d)
count is pure numerical, time is 'MM-DD hh:mm:ss.mmm'
-g get the size of the log's ring buffer and exit
-L dump logs from prior to last reboot
-b <buffer> Request alternate ring buffer, 'main', 'system', 'radio',
'events', 'crash' or 'all'. Multiple -b parameters are
allowed and results are interleaved. The default is
-b main -b system -b crash.
-B output the log in binary.
-S output statistics.
-G <size> set size of log ring buffer, may suffix with K or M.
-p print prune white and ~black list. Service is specified as
UID, UID/PID or /PID. Weighed for quicker pruning if prefix
with ~, otherwise weighed for longevity if unadorned. All
other pruning activity is oldest first. Special case ~!
represents an automatic quicker pruning for the noisiest
UID as determined by the current statistics.
-P '<list> ...' set prune white and ~black list, using same format as
printed above. Must be quoted.
filterspecs are a series of
<tag>[:priority]
where <tag> is a log component tag (or * for all) and priority is:
V Verbose (default for <tag>)
D Debug (default for '*')
I Info
W Warn
E Error
F Fatal
S Silent (suppress all output)
'*' by itself means '*:D' and <tag> by itself means <tag>:V.
If no '*' filterspec or -s on command line, all filter defaults to '*:V'.
eg: '*:S <tag>' prints only <tag>, '<tag>:S' suppresses all <tag> log messages.
If not specified on the command line, filterspec is set from ANDROID_LOG_TAGS.
If not specified with -v on command line, format is set from ANDROID_PRINTF_LOG
or defaults to "threadtime"
[/QUOTE]
That's great achievement, congrats and thanks for bringing eas to the u11!
congrats!
Also @damanrico this might interest you. For me every lag the u11 with the stock hmp implementation had is eliminated with EAS.
To everyone.
Just set input boost to 1,401ghz for the small cluster in ex kernel manager.
duration to 1500ms
And
dev/stune/top-app/schedtune.boost to 20
Edit:
dev/stune/schedtune.boost to 5
Please experiment with this settings. I want this completely smooth.
Make sure to use schedutil governor!
Freak07 said:
Also @damanrico this might interest you. For me every lag the u11 with the stock hmp implementation had is eliminated with EAS.
To everyone.
Just set input boost to 1,401ghz for the small cluster in ex kernel manager.
duration to 1500ms
And
dev/stune/top-app/schedtune.boost to 20
dev/stune/schedtune.boost to 5
Please experiment with this settings. I want this completely smooth.
Make sure to use schedutil governor!
Click to expand...
Click to collapse
For me it is smooth as baby a$$ in this short time I am using it ..
I'd like to try this...any chance for a Magisk-compatible version? I don't ever write directly to system anymore...
Flashed it and my wifi won`t turn on at all.
grega_slo said:
Flashed it and my wifi won`t turn in at all.
Click to expand...
Click to collapse
Are you on magisk?
Nope.
Latest Viper coming from elemetalx kernel.
grega_slo said:
Flashed it and my wifi won`t turn on at all.
Click to expand...
Click to collapse
Freak07 said:
Are you on magisk?
Click to expand...
Click to collapse
Same here, wifi not turning on. I'm on US Unlocked 1.16 firmware running magisk version of Viper rom 1.5
I'll see if I can grab log files later today, but I'm at work now.
grega_slo said:
Nope.
Latest Viper coming from elemetalx kernel.
Click to expand...
Click to collapse
Can you extract the file qca_cld3_wlan.ko out of the directory /system/lib/modules/qca_cld3 from my Zip
And push it to /system/lib/modules/qca_cld3
overwrite the existing module, set permissions to 644 rw-r--r-- and reboot?
And see if that fixes it?
What version of the phone do you have?
jsaxon2 said:
Same here, wifi not turning on. I'm on US Unlocked 1.16 firmware running magisk version of Viper rom 1.5
I'll see if I can grab log files later today, but I'm at work now.
Click to expand...
Click to collapse
Would you also try this?
Can you extract the file qca_cld3_wlan.ko out of the directory /system/lib/modules/qca_cld3 from my Zip
And push it to /system/lib/modules/qca_cld3
overwrite the existing module, set permissions to 644 rw-r--r-- and reboot?
And see if that fixes it?
What version of the phone do you have?
Freak07 said:
Would you also try this?
Can you extract the file qca_cld3_wlan.ko out of the directory /system/lib/modules/qca_cld3 from my Zip
And push it to /system/lib/modules/qca_cld3
overwrite the existing module, set permissions to 644 rw-r--r-- and reboot?
And see if that fixes it?
What version of the phone do you have?
Click to expand...
Click to collapse
just did that and it worked
Edit: European dual sim
velimirchek said:
just did that and it worked
Click to expand...
Click to collapse
Yup +1
Thank you both. Did a silly mistake. Will upload new zip soon. The wlan module didn’t get flashed.
Freak07 said:
Thank you both. Did a silly mistake. Will upload new zip soon. The wlan module didn’t get flashed.
Click to expand...
Click to collapse
FYI I made a Magisk version of the zip that doesn't flash anything to system and a separate Magisk support module, and it seems to be working okay (I have working Wi-Fi, if that's any indication). Is there any way for me to know for sure that everything is working as it should?

Categories

Resources