[KERNEL][PATCH][Semi-working] Gamma Controls (compatible with FauxClock) - Nexus 4 Original Android Development

I decided to have a go with custom gamma control as many people want to use it in other kernels, not just stock and Faux's. In a nutshell, it doesn't produce the same colours as Faux's kernel or stock (with Faux's lge_gamma_control kernel module) so it's not a drop-in replacement to his solution.
The reason that it's not working is because I haven't been able to find the correllations/formulae between the colours on the screen and the variables in kernel. I'm not sure why Faux isn't able/willing to release his code, although it could be due to NDA.
Attached is the patch to enable gamma control that works with FauxClock and also a prebuilt kernel with UV enabled.
I hope that inspired devs will be more patient than I am so we can have gamma control for all .

fnf said:
I decided to have a go with custom gamma control as many people want to use it in other kernels, not just stock and Faux's. In a nutshell, it doesn't produce the same colours as Faux's kernel or stock (with Faux's lge_gamma_control kernel module) so it's not a drop-in replacement to his solution.
The reason that it's not working is because I haven't been able to find the correllations/formulae between the colours on the screen and the variables in kernel. I'm not sure why Faux isn't able/willing to release his code, although it could be due to NDA.
Attached is the patch to enable gamma control that works with FauxClock and also a prebuilt kernel with UV enabled.
I hope that inspired devs will be more patient than I am so we can have gamma control for all .
Click to expand...
Click to collapse
Thanks so much for the .patch, its much better than my half-assed attempt few weeks ago. I'm gonna try and make yours work with correct colors
Thank you again.

Thanks Franco,
I peeked into the lge_gamma_control.ko from Faux, it's doing some more calculations before storing back the values to the kernel. I don't have much experience with decompiling ARM instructions, but it doesn't look complicated. It's probably worth less than 10 lines of C code.
I updated the patch to separate the handling of kgamma_* to their own methods, as different correction coefficients apply to red, green and blue.
Of course, credits to Faux for the binary .

@fnf thanks for the patch.
As i can see we are now able to access the values from board-mako-display.c via /sys/:
Code:
static char p_gamma_r_setting[10] = {0xD0, 0x72, 0x15, 0x76, 0x00, 0x00, 0x00, 0x50, 0x30, 0x02};
static char p_gamma_g_setting[10] = {0xD2, 0x72, 0x15, 0x76, 0x00, 0x00, 0x00, 0x50, 0x30, 0x02};
static char p_gamma_b_setting[10] = {0xD4, 0x72, 0x15, 0x76, 0x00, 0x00, 0x00, 0x50, 0x30, 0x02};
somebody knows how these values are working?
thanks
YourNameInHere
Edit: ok just tested it with the faux-app:
Gamma Amp Adjust 0 = value number 6
Gamma Amp Adjust 1 = value number 7
some more info?

Here are my original mods to the LGE video driver (see attachment) (fnf has faithfully reverse engineered, congrats and very nice indeed, we should talk sometimes if you have a chance):
The last bit of "mystery code" that fnf has noticed is nothing really big as he suspected. This is a simple checksuming code that's commonly used in many computer data transfers. What it does it to validate the payload values before accepting them into the video drivers because incorrect values could CAUSE PERMANENT damage to your screen. It was added to prevent derps from users trying to mess with the sysfs directly burning up the displays due to incorrect values.
Also as YourNameInHere have described:
gamma amp 0 is value 6
gamma amp 1 is value 7
This code needs a custom kernel in order to function and won't work in non-custom kernels.

faux123 said:
Here are my original mods to the LGE video driver (see attachment) (fnf has faithfully reverse engineered, congrats and very nice indeed, we should talk sometimes if you have a chance):
The last bit of "mystery code" that fnf has noticed is nothing really big as he suspected. This is a simple checksuming code that's commonly used in many computer data transfers. What it does it to validate the payload values before accepting them into the video drivers because incorrect values could CAUSE PERMANENT damage to your screen. It was added to prevent derps from users trying to mess with the sysfs directly burning up the displays due to incorrect values.
Also as YourNameInHere have described:
gamma amp 0 is value 6
gamma amp 1 is value 7
This code needs a custom kernel in order to function and won't work in non-custom kernels.
Click to expand...
Click to collapse
Looking forward to see this enhancement (LG-Presets: YAY!!!) in other kernels

Does anybody know more about the other values we can control this way?
The only hint I found is in the change to the color calibration by google:
https://github.com/CyanogenMod/lge-kernel-mako/commit/c1be92b7967f05ed5c6ea3b9c31060617541f96a
https://github.com/CyanogenMod/lge-kernel-mako/commit/0c0acb146c275ae01837fd6ad583df5fcdaa744c
What does ief stand for?
Also has anyone played with the look up tables yet?
https://github.com/CyanogenMod/lge-...bean/arch/arm/mach-msm/lge/lge_qc_lcdc_luts.c

Related

[PROJ] Overclocking the Adreno GPU on Snapdragon Devices

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.

[Q] Exposure control on Optimus S camera

I recently got an Optimus S and am disappointed that the camera has no exposure control. It's almost a deal breaker because it's such a step down from my old Samsung m510 flip phone's camera. I have posted at length about it on androidcentral, but here is the deal:
The Optimus S has no exposure control, even though the T definitly does, and by one review, the Optimus U does too. It's not a matter of the camera app; even apps that show an exposure slider have no effect on the exposure. (Scene modes also have no effect.) Because the hardware is so similar on all these phones, I can't believe it's simply a hardware limitation - the app, camera driver, or the interface between the driver and Android's java APIs, has to control exposure somehow in software, right?
I got ahold of some other roms, from the Optimus T and the V, and tried swapping all lib files with camera in the name - libcamera, libcamera_client, libcameraservice, and liboemcamera on both phones, and additionally libOlaCameraJNI, libOlaEngine, and libOlaMaskResource on the T. Rebooting with various combinations of those resulted in a hang on boot, crashing camera apps, or no effect at all. Also tried installing CameraApp.apk from the T's rom to no effect.
Downloaded the S and U's source code from LG, ran a diff, and noticed that the Optimus U's kernel/drivers/media/video/msm folder has some differences compared the Optimus S's, including at least one file that the S doesn't have at all that seems to send different hex codes for setting exposure values. I also think the T had similar differences from the S. So I copied the msm folder over from the U to the S, compiled the S kernel from scratch, flashed it, and verified it was actually running from my new kernel, but the camera apps still had no control over the exposure.
Flashing a custom rom from the V will allow the S to boot, but doesn't give camera control. Flashing a rom from the T will make it hang while booting.
Where else can I go with this? Is there some bridge between the kernel drivers and the Android camera API (look up Camera.Parameters in the android dev site), that I'm missing? What actually goes between a call to getMinExposureCompensation() and the kernel to find out what capabilities the camera has? Again, I don't see how the Optimus S hardware would simply not support exposure adjustments when other Optimus phones do.
Thanks!
Found Camera.java in frameworks/base/core/java/android/hardware from Google's source code. It says "This class is a client for the Camera service, which manages the actual camera hardware." Then I looked for the camera service, which I found at frameworks/base/services/camera/libcameraservice . But this is in Google's code, not LG's device-specific code, which leads me to believe that this stuff is the same across every phone. So I'm still trying to figure out where in the software exposure control happens.
Bump. Tried boggling around more folders and config files between various kernels from different versions of this phone. Am now thinking about using the ndk and modifying the original camera app. Will I be able to use it to access the hardware directly in native code and send exposure adjustments to the camera?
The file kernel/drivers/media/video/msm/isx005.c (for a Sony camera chip - how do I know if that's what's actually in my phone?) contains the following code:
It looks like the other files in kernel/drivers/media/video/msm allow have functions along the lines of [chipname]_write_exp_gain(uint16_t gain, uint32_t line).
Code:
static int32_t isx005_set_brightness(int8_t brightness)
{
int32_t rc = 0;
switch (brightness) {
case 0:
rc = isx005_i2c_write(isx005_client->addr,
0x0060, 0x80, BYTE_LEN);
if (rc < 0)
return rc;
rc = isx005_i2c_write(isx005_client->addr,
0x0061, 0x50, BYTE_LEN);
if (rc < 0)
return rc;
break;
case 1:
rc = isx005_i2c_write(isx005_client->addr,
0x0060, 0x80, BYTE_LEN);
if (rc < 0)
return rc;
rc = isx005_i2c_write(isx005_client->addr,
0x0061, 0x60, BYTE_LEN);
if (rc < 0)
return rc;
break;
case 2:
...etc.
It still seems that auto exposure control wouldn't happen in the camera firmware. Maybe I'm wrong?
edit: from the looks of these files, it seems like it's done in firmware. Still, would I be able to call these exposure functions from an application built using ndk?
Another edit: from kernel/arch/arm/configs/thunderc-sprint-perf_defconfig:
Code:
#
# Qualcomm MSM Camera And Video
#
CONFIG_MSM_CAMERA=y
# CONFIG_MSM_CAMERA_DEBUG is not set
#
# Camera Sensor Selection
#
# CONFIG_MT9T013 is not set
CONFIG_ISX005=y
CONFIG_ISX005_ROTATION_180=y
# CONFIG_MT9D112 is not set
# CONFIG_MT9P012 is not set
# etc, etc, etc - no other camera drivers enabled

[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.

[Req] Screen mod between natural and standart

Hello everybody.
I find standart mod really too saturated but natural mod is also too washed out.
Could someone create a profile between them ?
Thanks a lot !
Envoyé depuis mon GT-N7100 avec Tapatalk
Up
GreekOne said:
Hello everybody.
I find standart mod really too saturated but natural mod is also too washed out.
Could someone create a profile between them ?
Thanks a lot !
Envoyé depuis mon GT-N7100 avec Tapatalk
Click to expand...
Click to collapse
I'm not sure but I think display controls are all within the kernel and to my knowledge the only one where you can play with these is Perseus.
Here is a quote from the author of Perseus about the first implementation of display controls:
AndreiLux said:
Features / changelist:
Perseus alpha32 (29/01):
.....
[*]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.[/list]
Click to expand...
Click to collapse
I've read the dev was looking for testers preferably with color calibration equipment, so more is to be expected.
I wonder if Supercurio is making some display tweak apps for the N2, Id really like to have the ability to change the color temperature as most if not all of the Galaxy Note 2's Ive seen are really steering towards the warm whites ( depending on the brightness and ambient light )
Thanks androssama.
I use redpill but I tried perseus too. I saw that possibilty but it seems to complicated to me (I'm a noob).
I'm gonna try again. Which setting should I change to get between the two profiles ?
Envoyé depuis mon GT-N7100 avec Tapatalk

[KERNEL][AOSP][AnyKernel][LOS-15.1+EAS] Gamma Kernel for [All Lineage Variants]

{
"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"
}
DESCRIPTION
Hey guys, I have started a custom Kernel based on LineageOS sources with 98% CAF. So I would like to share my own performance and usability improvements with minimal feature and enhancements on top. The intention is to have a minimal light-weight kernel that is very fine tuned for the device.
FEATURES
Minimal Kernel with a stripped defconfig base to be more streamlined and have less memory footprint
User space display color calibration (KCAL) with screen calibrated against iPhone 8 Plus, also helps reducing screen retention
Schedutil governor making use of EAS features with updates from Linux 4.4 and 4.12
Up to date with LineageOS sources for maximum compatibility and security bugfixes
Memory and cache subsystem optimizations, you will feel it
Adaptive LMK enabled by default
Transparent Hugepages are enabled
ZRAM/Swap partition is disabled by default
BFQ IO scheduler set by default to avoid slow-downs on task intensive scenarios
No overclocking was chosen to avoid unnecessary heat, optimizations were focused on other different areas
Kernel Samepage Sharing enabled with deferred timer by default to gain some memory usage optimizations, the process sleeps on regular basis and I've profiled it so that there's no battery drains due to it
Simple temperature controls for msm_thermals exposed
Compiled with GCC 6.x optimized toolchain and -O3 plus other hardware specific flags
Undervolted the Adreno 530 GPU voltage rail to keep things cooler
CAF Rebase on major portions of the Kernel has helped lower the memory footprint a lot
ES9218 Quad DAC automatic toggling working inside the kernel for headphone HIFI playback, please read here for details
DOWNLOADS
AnyKernel: Click Here (Or check top of the post, download tab)
Extended Screen AnyKernel : Click Here (Maintained by @iDefalt)
(Recommended) Stock Tasha XML Audio Mixer FIles : Click Here
(Recommended) Stock Thermal Engine with Tweaked Values Flashable : Click Here
(Recommended) Vulkan Adreno GPU Drivers with correct SELinux labels and permissions : Click Here
SOURCE
V20-Kernel-Gamma GitHub Source
NOTES
Here is a GeekbenchV4 result example : http://browser.geekbench.com/v4/cpu/10667886
KNOWN BUGS
Changing CPU governors will greatly impact EAS and give erratic behaivour -- please check here, here and here. This is an EAS only Kernel.
I would also like to thanks to various people who contribute tremendously such as:
@x86cpu
@EvilHowl
@USA-RedDragon
@savoca
@albinoman887
@emdroidle
@Rashed97
@joshuous
@RenderBroken
and many others!
<< If you like my work here is my hat, please donate! >>​
​
XDA:DevDB Information
Gamma Kernel, Kernel for the LG V20
Contributors
Omar-Avelar
Source Code: https://github.com/oxavelar/V20-Kernel-Gamma
Kernel Special Features:
Version Information
Status: Stable
Current Stable Version: 105.0.0
Stable Release Date: 2019-09-21
Created 2018-05-09
Last Updated 2019-09-21
CHANGELOG
105.0.0 - Increased responsiveness by adjusting input boost and stune values. Updated the thermal mod values again, revert LA.UM.6.5.r1-11700-8x96.0 to fix green tint crashes and updated to AnyKernel3.
103.0.0 - Merging LA.UM.6.5.r1-11700-8x96.0.
102.0.0 - Update SDCARDFS driver. And updated the thermal mod values to account for GPU undervolt.
101.0.1 - Re-enabled -O3 optimizations and increased little cores boost.
101.0.0 - Compiled with Linaro GCC 8.3.
99.0.0 - Experimental performance values.
90.0.0 - Adding dynamic_stune_boost_ms as part of input boost schedtune.
88.0.0 - Performance increase while phone is used.
87.0.0 - Dynamic schedtune adjustments.
86.0.0 - BFQ enhancements and fixing the last watchdog timer bites.
85.0.0 - Merging LA.UM.6.5.r1-10900-8x96.0 with stability fixes and no green-screen crashes. Tweaking further the input boost frequencies, and enabling IO wait boost on big.LITTLE cores. More BFQ merges from upstream Kernel.
84.0.0 - Back to the performance levels, after being stable for 24 hours without green screening on tag LA.UM.6.5.r1-09800-8x96.0.
83.0.0 - Revert a merge which I believe be the culprit of the kernel panics. Tag is now based on LA.UM.6.5.r1-09800-8x96.0.
82.0.0 - Synced wireless drivers, as I think this was causing kernel panics.
80.0.0 - Merge LA.UM.6.5.r1-10600-8x96.0, fixing infrared and updating AnyKernel.
78.0.0 - Align memlat with gpubw frequency tables to prevent jerking. Backporting a few of BFQ Linux 5.0 mainline changes and enhancements into Linux 3.14.
77.0.0 - Further tweak schedtune values and dynamic boosting.
76.0.0 - Enable schedtune 3.0 boosting, finer Kernel CPU boosting, and disabling user-space perfd.
74.0.0 - Extracting more performance by tweaking BCL and memory bandwidth scaling again.
73.0.0 - Optimized BFQ a tad bit, and some power saving features on the memory bandwidth scaling ramp values on idle.
72.0.0 - Updated BFQ-v8r12 for 3.14 and some UFS clock scaling tweaks for the IO subsystem.
71.0.0 - iowait_boost_enable save and restore working. Keeping this enabled for MSM8996 EAS as well as keep allow_attach just like Wahoo.
70.0.0 - Add debug.gralloc.gfx_ubwc_disable=0, as well as reverting to default OpenGL renderer due to whatsapp camera glithces and other misc glitches depending on GPU driver.
68.0.0 - Adjusting allocstall_threshold.
67.0.0 - Updated AnyKernel files and fixed a regression caused by down_thres that was there for a lot of builds.
66.0.0 - Enabling Skia OpenGL rendering by default. Also please update the "(Recommended) Stock Thermal Engine with Tweaked Values Flashable" file, updated some timer values to keep the smoothness consistency overall with this Kernel version better with these thermal and timer values.
65.0.0 - Relaxing memlat to see how much battery improvements we get from this.
64.0.0 - Updated the EAS timer values and the memory subsystem. Re-increased the freq mitigation freq back again to 1.3 GHz on big cluster for less jank.
63.0.0 - Carved out the memory map back of some ADSP devices and modem back to what LGE is using, let's see if this fixes the sporadic Kernel panics on H990DS.
62.0.0 - Further tweaked our GPU Adreno drivers setprop values on boot.
60.0.0 - Overhauled the charging code by removing a lot of factory junk and taking some pieces from Alice. Tweaked a tad bit the the memlat governor values again.
59.0.0 - Changes in MTP handling that came from LGE to see if it helps the Kernel panics seen with MTP file transfers. (Tired to see if the panel can be bumped to 90 Hz refresh rate but decided to not include as screen seems to not be responding after trying it for a while...).
58.0.0 - Shaved off 4 MiB from unused msm8996pro-*.dtsi files.
57.0.0 - Better charging mitigation. Updated to CONFIG_LGE_PM_CHARGING_SCENARIO_V18.
56.0.0 - Charging detection logic clean-up based on CAF and less of LGE's.
55.0.0 - Merged the charger controller scenarios code with Oreo.
54.0.0 - MDSS display cleanup and memlat tweaks. Should feel snappier. Merged a few USB Type-C code portions from the Oreo source, hopeful fixed h918 static on boot as well with my experiments.
53.0.0 - Charger logic detection was taking longer sometimes, fixed this. And removed some extra dtsi junk that helped shave 300 KiB of Kernel image size.
52.0.0 - Backported a few things from newer schedutil. And fixed h910 static on boot I had introduced due to my own experiments.
51.0.0 - Converged to only two panel files, "dsi-panel-sw49407-dsc-qhd-cmd.dtsi" and "dsi-panel-sw49407-dsc-qhd-cmd-global.dtsi", experimental. Fixed on mem subsystem tweaks not being honored due to me starting perfd earlier than expected by mistake.
50.0.0 - Converged on single "dsi-panel-sw49407-dsc-qhd-cmd.dtsi" file. Added lge,skip-auto-mute in the audio *.dtsi. Increased the panel qcom,switch-freq-khz to 800 based on latest Oreo sources as well.
49.0.0 - LGE's Panel & MDSS extra clean-up.
47.0.0 - Re-adjusted the thermal and tasha files, updated the lpm cpuidle and memory subsystem parameters.
46.0.0 - Updated memory sybsystem parameters, and re-ajdusted thermal and tasha files.
45.0.0 - LA.UM.6.5.r1-09800-8x96.0 merge and ramdisk module debugging disable fixes.
44.0.0 - More MSM ISP CAF merges that keep LGE compatibility intact.
43.0.0 - firmware_class: make firmware caching disabled by default. Since NETLINK wakelocks are disabled in our Kernel keeping this disabled makes the most sense.
42.0.0 - Re-did the BCL freq mitigation to override Elsa variant for now, reverted the anx7688 firmware and updated the screen calibration further.
40.0.0 - Re-did the BCL voltage and freq mitigation changes to make the phone usable when battery levels drop and prevent any potential kernel panics.
39.0.0 - Re-introduced MSM_PERFORMANCE and tamed a tiny bit the memory scaling subsystem to keep a better active power consumption.
38.0.0 - fs: sdfat: Update to version 2.0.8 and more ARM64 related memory optimizations.
37.0.0 - Display color calibration was re-adjusted using iPhone panel as reference again. It got shifted a little bit after *.dtsi merges months ago and just had noticed.
36.0.0 - Major cleanup in the qpnp-smbcharger.c portion. Playing with BCL removal.
35.0.0 - Keeping ULPS and LP11 both in the *.dtsi files for the Panel and tuned further with micro-benchmarks.
34.0.0 - Changing compiler flags a little bit. Adding explicitly the LP64 ARM ABI, and using UPSTREAM: arm64: lib: improve copy_page to deal with 128 bytes at a time. Reverted the arm64 prefetchers during memcpy, and re-introduced the msm_thermal sysfs entries that I had take out during debug.
33.0.0 - Fixed a MSM ISP Bug when taking photos from certain applications was fixed. It would sometimes crash when taking pictures from Whatsapp with the recent merges I have been trying and the bug went unnoticed by me. Fixed USB not charging under certain USB cables as well as qpnp-smbcharger.c code cleanup.
32.0.0 - MSM ISP Upstream changes that improve msm-camera daemon performance. Also noticed this has improved focusing speed with the camera.
31.0.0 - Performance boosts changes to memory scaling and latency had to be adjusted after using CONFIG_SCHED_AUTOGROUP to take into account.
30.1.0 - Rebased now from LA.UM.6.5.r1-09300-8x96.0 CAF and CONFIG_SCHED_AUTOGROUP is being enabled.
29.0.0 - BCL big freq fixes from ls997 Oreo's source as well merge on USB's ANX7688 code.
28.0.0 - Stopping and restarting perfd when doing cpu tweaks to be safer on the state of EAS when changing things up. Fix for Ok google, returned LGE's VTS.
27.0.0 - Removing sched while keeping schedutil, updating the BCL masks, and removing LGE's VTS. Updating GCC's Linaro 6.4 to the 2018 pre-builts.
24.1.0 - Triggering enable-cpu-tweaks on events enable-low-power, property:sys.perf.profile=1 to see if it fixes gaming performance profile switching.
24.0.0 - mmc: move to a SCHED_FIFO thread, power: make sync on suspend optional.
23.0.0 - Disabling BCL hotplugging for voltage based while still keeping the temperature one. Added a commit to prevent writeback dirtying by multiple threads.
22.0.0 - Added updating of the BCL masks during EAS schedutil changes, one suspect on limiting to 1 GHz. Investigating if low-battery power mode also could impact this in the meantime.
21.0.0 - Updated the Kernel scheduler tunables.
20.0.0 - Remove duplicate commit in IRQ subsystem, and letting LineageOS use the default EAS cpusets and DVR values instead. Setting saturation again after boot-complete.
19.0.0 - Re-introducing CONFIG_LGE_PM_LGE_POWER_CLASS_CHARGER_SLEEP in Oreo as well as minor changes in memory subsystem scaling again.
18.0.0 - Removing backlight levels override on boot -- this was a leftover from Nougat time where cache-build might have happened at boot, so I had used this to lower heat generation but it's not needed. Tweaked a little the memory subsystem scaling timer interrupts now that msm_irqbalance is enabled in recent Oreo builds.
17.0.0 - Letting LOS handle msm_irqbalance now as this was enabled recently on LOS 15.1 July 12th 2018 build.
16.0.0 - Started msm_irqbalance by default on boot, disabled lp11 and enabled allow mdss phy powerdown during idle screen.
15.0.0 - Smoother memlat ramp and tuned the schedTune DVR cpusets a bit for better performance overall.
14.0.0 - Fix for touch not working when the phone boots connected to charger, more deep sleep enhancements and addition to H990 and H990DS to the builds.
13.0.0 - Update to Oreo TouchScreen firmware and more MDSS PLL merge fixes that help deep sleep.
12.0.0 - Missing MDSS Oreo merges are now in place.
11.0.0 - Added IPA_WS as a default in the wakelock blocker, as well as enabling CONFIG_PM_SLEEP which if missing would in turn cause some ueventd wakeups.
10.0.0 - Fixed video recording, disabled CONFIG_RMNET_DATA_DEBUG_PKT. Full fix for USB OTG and added missing slimport drivers. Tweaked the random wakeup values, added some extra cpusets based on Marlin's android-cts-8.0_r8/init.common.rc and fixed some BFQ IO possible hang.
8.2.0 - Removed LGE's battery manager alarms.
8.1.0 - Fixed potential wireless packet loss, reverted the potential video recording fix from previous build.
8.0.0 - Further tweaked the wlan_rx_wake wakelock, added a potential video recording fix identified, migrated the audio and thermal workers to power efficient queues, and added an arm64 prefetching optimization for memcpy (the last 3 changes got into LineageOS as well).
7.0.0 - Better deep sleep enhancements with the charger infrastructure borrowed from the V30 Kernel Oreo sources.
6.0.0 - Full fix for 6a00000.ssusb wakelocks while keeping fast charging enabled.
4.1.0 - Tuned further the wakelocks to avoid any wireless packet loss. As well as adding [timerfd] into the block list.
3.0.0 - Added boeffla_wl_blocker to tame NETLINK wakelock, this wakelock is caused by IPC between the wireless driver in the Kernel and Android. This was the reason why when on wireless the battery would drain more compared than radio.
2.0.0 - Rolled back the OTG fixes so that the phone deep sleeps well, and patched the "6a00000.ssusb" wakelock by reverting a few files. Enabled a few more battery savings from EAS that should help battery.
1.0.0 - Synced the NFC driver with Lineage, OTG fixes by @x86cpu. Adjusted the DAC impedance thresholds per LG's Oreo Kernel, as well as disabling store mode and factory cable detection on newer Oreo LG's PM stack.
0.9.99 - Initial version, with KCAL, GPU Undervolting, EAS schedutil, memory subsystem tweaks, and so far working and booting LineageOS 15.1 with better input frequency values due to lack of perfd. Re-introduced the Virtual Thermal Sensor (VTS) for even better thermal management when using the LG's stock thermal flashable.
Thanks, flashing in the morning! ??
Good job Omar, will flash this and report later
Where's 1.0.0? Also, can we use one of your GPS fixes from the previous kernel topic?
Just flashed yesterday and used it for a day. Performance is good, although not significantly better than the stock LOS kernel and things ran pretty smooth overall.
However battery life was straight up horrible, especially in standby. I went to sleep with 95% battery but even with Naptime enabled (forced doze) I woke up with the battery at 60%. The phone was losing more battery in standby than while I was actually using it. So for now I'm back on the stock LOS kernel but hopefully new builds will fix battery.
Ruckamongus said:
Where's 1.0.0? Also, can we use one of your GPS fixes from the previous kernel topic?
Click to expand...
Click to collapse
The GPS fixes are already in Lineage-15.1 AFAIK, no need!
droidrzr1610 said:
Just flashed yesterday and used it for a day. Performance is good, although not significantly better than the stock LOS kernel and things ran pretty smooth overall.
However battery life was straight up horrible, especially in standby. I went to sleep with 95% battery but even with Naptime enabled (forced doze) I woke up with the battery at 60%. The phone was losing more battery in standby than while I was actually using it. So for now I'm back on the stock LOS kernel but hopefully new builds will fix battery.
Click to expand...
Click to collapse
0.9.9 was decent in this front, 0.9.99 had some bugs as I was testing out (idle power consumption is one). That is why I have not released 1.0.0 as I want to iron everything out for the first release. These are experimental builds and feedback is greatly welcome as I prepare to fix it all!
I'm trying to figure out this dac Volume situation, how do I get the volume to kick in. It still sounds stock to me. I don't have much volume as I used to on a stock rom. Do I have to have the impedance to kick it in or can I bypass it like I used to
lowridincrew said:
I'm trying to figure out this dac Volume situation, how do I get the volume to kick in. It still sounds stock to me. I don't have much volume as I used to on a stock rom. Do I have to have the impedance to kick it in or can I bypass it like I used to
Click to expand...
Click to collapse
Manually editing the mixer file to force high impedance doesn't work on AOSP roms. Only stock. The code is there for it to work automatically, but if your headphones don't have a resistance of higher than 50 ohms, than it won't activate. I haven't seen anyone test with high impedance headphones to actually see if it works though. Code is there, but still unknown if it works. I had no luck getting it to activate.
Just a thanks and a quick recap of my post on the unofficial thread Omar!
Long-time lurker and H918 abuser on the 10p Firmware and modem here.
Just wanted to post on here and give my sincerest thanks to x86cpu, Omar-Avelar and all the devs responsible for breathing new life into my V20!
I haven't been this excited to use it since I first got the dang piece of lazily coded korean garbage back in 2016.
Reminds me of my Note 4 days, man that thing has also had a long ass run.
I've tried so many ROMs, kernels, zips and hacks.
Lost count of how many times I debloated, rebloated, went stock, went AOSP, flashed and unflash magisk.
Good Lord, If I knew performance could EVER have been this good in an AOSP like rom and if it weren't
for the removable battery, I probably should have gone with a Pixel or something.
Definitely feels faster since I replaced the battery before flashing, definitely recommend you guys consider replacing it if you've used it for a year or so and it's starting to die at like 15-30%.
Running it since the 05/12 build, on the 05/16 build now. Currently using the EAS Gamma Kernal as well, not sure if that comes with problems of it's own.
Will test accordingly with the unofficial kernel at some point.
Performance is amazing! This thing zips through all my apps and notifications like a champ.
On the LG UI (Bleh) it used to bog down so fast and get super slow.
Got like 120-ish apps running on the thing, no problem!
What Works
2.4 GHZ Tethering (Tested on iPad)
Bluetooth Tethering (Tested on iPad)
USB File Transfers
ADB Debugging and connected via USB
Ambient Display
Smart Lock
Bluetooth to my Honda Civic
(was weird, had to pair FROM the phone Not the car, works great)
Bluetooth to my Jabra Headset
Google Dialer
Android Messages
Netflix
Hulu
Plex
Chrome
Snapchat
Whatsapp
Facebook
Instagram
Tumblr
Twitter
Telegram
Google Assistant when opened from the home button or app icon
Fingerprint Unlock
Google Pay
Visual Voicemail using T-Mobile
(sometimes fails to connect, rarely)
CStark27's Google Camera
Safety Net and Magisk 16.0, Youtube Vanced
Powers my High Impedance Headphones, Not as loud as Stock LG
IR Remote function, using the "Peel" remote app off the play store
"Cast"ing to my Xbox One and other "Cast"able devices
What Doesn't
Speakerphone, and the Mic in general. Not as "Clear" as Stock.
Callers say I keep breaking up?
Wifi Calling wasn't that great a feature anyway but, I feel like the dialer or calling services on Stock were more normal sounding-ish?
Maybe I'll try that Magisk Low Mic Fix module some time...
Bluetooth clarity is pretty good for the most part.
5GHZ Wifi Tethering
Voice activating Google Assistant using "OK Google"
General Battery Drain concerns, still prefer LOS to stock.
Probably forgot some other stuff but super happy with all the improvements and hard work by the XDA community.
(Protip, update the ROM, optional kernel, GAPPs same options as before, AND then magisk. Had to redo it all when I killed Google Play by just flashing the ROM and Kernel, boy what a mistake that was! note: Using Google Dialer and some more google apps than nano.)
GAPPS Aroma 5/12 with the following options.
GoogleAssistant
BatteryUsage
CalculatorGoogle
CarrierServices
Chrome
ClockGoogle
CloudPrint
ContactsGoogle
DialerFramework
DialerGoogle
DMAgent
Docs
Drive
Duo
ExchangeGoogle
FaceDetect
FaceUnlock
Fitness
GCS
GooglePay
GoogleTTS
KeyboardGoogle
Maps
Messenger
Movies
PackageInstallerGoogle
PixelIcons
PixelLauncher
PlayGames
PrintServiceGoogle
ProjectFi
Sheets
Slides
Search
Speech
StorageManagerGoogle
Street
TagGoogle
Talkback
Translate
VRService
Wallpapers
WebViewGoogle
ClockStock
Email
KeyboardStock
Launcher
MMS
+Browser
+Gallery
+MMS
# End User's gapps-config
New version called "v0.9.9rc.zip" is up. Seeing how battery life goes for this one and performance. It is still missing partial panel update and USB OTG, haven't had too much spare time lately...
toastyp said:
Manually editing the mixer file to force high impedance doesn't work on AOSP roms. Only stock. The code is there for it to work automatically, but if your headphones don't have a resistance of higher than 50 ohms, than it won't activate. I haven't seen anyone test with high impedance headphones to actually see if it works though. Code is there, but still unknown if it works. I had no luck getting it to activate.
Click to expand...
Click to collapse
I think it is easily doable to fake the impedance with a sysfs argument to force high-Z mode. It is in my to-do things , unless someone beats me first... but I am also a little concerned that it could damage some headphones if too much current goes into them... mmmm
Which app is recommended to manage kernel settings?
Omar-Avelar said:
I think it is easily doable to fake the impedance with a sysfs argument to force high-Z mode. It is in my to-do things , unless someone beats me first... but I am also a little concerned that it could damage some headphones if too much current goes into them... mmmm
Click to expand...
Click to collapse
with my less than 50ohm headphones I can't get sound out of the dac when forcing the dac into into hi-fi (low) mode (by changing the. c file)
and when not forcing it just stays in bypass mode when checking via terminal with either it
tinymix | grep Es9
dmesg -w | grep -iC 0 es9
it appears some stuff from lge's sound stuff is missing in the kernel and I've been stuck at the no sound part for a while and once I fixed that I thought of using sysfs too
I'll update with what stock does and what lineage does, with and without my modifications, later my notes on this are scattered everywhere.... (also I'm not that experienced with programming so it's possible I did something wrong :silly: )
Dr_DjEnder said:
with my less than 50ohm headphones I can't get sound out of the dac when forcing the dac into into hi-fi (low) mode (by changing the. c file)
and when not forcing it just stays in bypass mode when checking via terminal with either it
tinymix | grep Es9
dmesg -w | grep -iC 0 es9
it appears some stuff from lge's sound stuff is missing in the kernel and I've been stuck at the no sound part for a while and once I fixed that I thought of using sysfs too
I'll update with what stock does and what lineage does, with and without my modifications, later my notes on this are scattered everywhere.... (also I'm not that experienced with programming so it's possible I did something wrong :silly: )
Click to expand...
Click to collapse
I'm interested in anything that might be missing for the Lineage kernel too, as I thought i got it all. Thanks.
Anyone here using VS995 after dirty santa exploit? When I run the AnyKernel installer with the vs995 version of the kernel, it says my device is not supported since after the exploit it shows up as a US996. When I try using the US996 version, bad things happen. I'm able to boot, but there's a lot of screen glitching once I'm at my home screen.
@x86cpu
I should have clarified the stuff I think is missing is for the DAC as they are called when the DAC is active and when the user skips tracks but regardless the files and changes are in:
and heres my commit of exactly what changed (its a bit messy): https://github.com/Devoark/android_kernel_lge_msm8996/commit/200e2d43c89bf98c2bd2c79f1767a60277234803
include/sound/apr_audio-v2.h
sound/soc/msm/qdsp6v2/lge_dsp_sound_effect.h
sound/soc/msm/qdsp6v2/lge_dsp_sound_mabl.h
sound/soc/msm/qdsp6v2/lge_dsp_sound_normalizer.h
sound/soc/msm/qdsp6v2/msm-audio-effects-q6-v2.c
sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
sound/soc/msm/qdsp6v2/q6asm.c
-----------------------------------------------------------------------------------------------
Right for the other Stuff
On stock lineage without any kernel mods this is the sequence for me with my <50ohm headphones
https://pastebin.com/JH8cS9Yc
Modified Lineage Kernel For the DAC
https://pastebin.com/uQgyHm3b
And stock LGE ROM DAC behavior :
https://pastebin.com/3XUNNLDq
The main problem with lineage's kernel is that it doesn't assign a headset type (1, 2, 3) for low, high-imp, and aux. Then the amp isnt being turned on, in es9218_startup, which is part of another set of functions that aren't called which is why i think the DAC isn't outputting sound, or at least would get us closer to a working Hi-Fi Mode. So by forcing it on and assigning the Headset a static value it allows the DAC to proceed into Hifi mode in bypass2hifi, and es9218_sabre_wcdon2bypass_put confirms that but now there is no sound output through the headphone jack (well its odd the first track that is played is in the es9218 bypass so there IS sound, but when you skip a track or start another audio stream it THEN puts the DAC in Hi-Fi mode then theres no sound :silly: )
Now the dac calls functions in LGE stock ROM that arent called in Lineage among them are :
Code:
lge_dsp_sound_offload_playback_number_put: current_be_id = 3, lge_effect_be_id = 3
es9218_headset_type_put (headset-type)
es9218_startup (called)
es9218_startup : state = BYPASS : goto HIFI !!
es9218_set_thd(): Headset Type = #
es9218_sabre_amp_start(): Headset Type = #
es9218_startup(): exit
es9218_pcm_hw_params(): entry , bps : 16 , rate : 48000 //////// (bit 16/24) and the sampling rate
es9218_pcm_hw_params(): Rev-B PCM Format Running
es9218_pcm_hw_params(): exit, ret=0
+++++++++++++++++++++++++++++++++++++
lge_dsp_sound_effect_allparam_put: value 1
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
lge_dsp_sound_mabl_devicespeaker_put: value 0
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
lge_dsp_sound_mabl_monoenable_put: value 0
+++++++++++++++++++++++++++++++++++++
Chances are I'm doing something wrong here but its where if gotten with this with the limited time I have anyone who wants to check out the commits they are here:
https://github.com/Devoark/android_kernel_lge_msm8996/commits/lineage-15.1st/sound
Ill continue to work on this when I can but I've mostly run out of ideas of what to do to call the missing functions and some clean up of what I've done I feel is really needed.
Dr_DjEnder said:
@x86cpu
I should have clarified the stuff I think is missing is for the DAC as they are called when the DAC is active and when the user skips tracks but regardless the files and changes are in:
and heres my commit of exactly what changed (its a bit messy): https://github.com/Devoark/android_kernel_lge_msm8996/commit/200e2d43c89bf98c2bd2c79f1767a60277234803
include/sound/apr_audio-v2.h
sound/soc/msm/qdsp6v2/lge_dsp_sound_effect.h
sound/soc/msm/qdsp6v2/lge_dsp_sound_mabl.h
sound/soc/msm/qdsp6v2/lge_dsp_sound_normalizer.h
sound/soc/msm/qdsp6v2/msm-audio-effects-q6-v2.c
sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
sound/soc/msm/qdsp6v2/q6asm.c
-----------------------------------------------------------------------------------------------
Right for the other Stuff
On stock lineage without any kernel mods this is the sequence for me with my <50ohm headphones
https://pastebin.com/JH8cS9Yc
Modified Lineage Kernel For the DAC
https://pastebin.com/uQgyHm3b
And stock LGE ROM DAC behavior :
https://pastebin.com/3XUNNLDq
The main problem with lineage's kernel is that it doesn't assign a headset type (1, 2, 3) for low, high-imp, and aux. Then the amp isnt being turned on, in es9218_startup, which is part of another set of functions that aren't called which is why i think the DAC isn't outputting sound, or at least would get us closer to a working Hi-Fi Mode. So by forcing it on and assigning the Headset a static value it allows the DAC to proceed into Hifi mode in bypass2hifi, and es9218_sabre_wcdon2bypass_put confirms that but now there is no sound output through the headphone jack (well its odd the first track that is played is in the es9218 bypass so there IS sound, but when you skip a track or start another audio stream it THEN puts the DAC in Hi-Fi mode then theres no sound :silly: )
Now the dac calls functions in LGE stock ROM that arent called in Lineage among them are :
Code:
lge_dsp_sound_offload_playback_number_put: current_be_id = 3, lge_effect_be_id = 3
es9218_headset_type_put (headset-type)
es9218_startup (called)
es9218_startup : state = BYPASS : goto HIFI !!
es9218_set_thd(): Headset Type = #
es9218_sabre_amp_start(): Headset Type = #
es9218_startup(): exit
es9218_pcm_hw_params(): entry , bps : 16 , rate : 48000 //////// (bit 16/24) and the sampling rate
es9218_pcm_hw_params(): Rev-B PCM Format Running
es9218_pcm_hw_params(): exit, ret=0
+++++++++++++++++++++++++++++++++++++
lge_dsp_sound_effect_allparam_put: value 1
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
lge_dsp_sound_mabl_devicespeaker_put: value 0
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
lge_dsp_sound_mabl_monoenable_put: value 0
+++++++++++++++++++++++++++++++++++++
Chances are I'm doing something wrong here but its where if gotten with this with the limited time I have anyone who wants to check out the commits they are here:
https://github.com/Devoark/android_kernel_lge_msm8996/commits/lineage-15.1st/sound
Ill continue to work on this when I can but I've mostly run out of ideas of what to do to call the missing functions and some clean up of what I've done I feel is really needed.
Click to expand...
Click to collapse
Exteremly helpful, I can see where the missing kernel code it. Quite a bit more than you have as well. But it does identify where and the CONFIG_ options missing. Thanks. I'll see what I can do to add to my UNOFFICIALS.
---------- Post added at 15:25 ---------- Previous post was at 15:05 ----------
Dr_DjEnder said:
@x86cpu
Chances are I'm doing something wrong here but its where if gotten with this with the limited time I have anyone who wants to check out the commits they are here:
https://github.com/Devoark/android_kernel_lge_msm8996/commits/lineage-15.1st/sound
Ill continue to work on this when I can but I've mostly run out of ideas of what to do to call the missing functions and some clean up of what I've done I feel is really needed.
Click to expand...
Click to collapse
What device do you have as I can build a test one for that device? (if us996 indicated if you had to use Dirty Santa or not).
I'm using a us996 US Cellular so I used dirty santa
Dr_DjEnder said:
I'm using a us996 US Cellular so I used dirty santa
Click to expand...
Click to collapse
I got the changes in, but need some tweaking to get it built correctly. LGs code sucks for this.

Categories

Resources