• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Free APP] Nexus 5 gamma reverse engineering App. Please contribute!

Search This thread

faux123

Senior Member
Dec 16, 2010
8,536
34,426
West Los Angeles
www.canonspike.com
Nexus 5 Gamma Reverse Engineering App is out!

(This app will work on the common sysfs interface, so any kernel using this interface will be compatible with this app, not just my kernel)

Please download my public betas here:

http://faux.androidro.ms/hammerhead/beta/

Franco Kernel is also compatible here:

http://forum.xda-developers.com/showthread.php?t=2508284

ALL Gamma registers are accessible with new APK!

@myfluxi Thank you again!

After hitting apply, it's best to turn screen on/off to see the results updated!

Please help decipher the meaning of these values and write them down in a concise manner so we can all understand what you've done and tried.

My TODO list for this FREE app:
Once things are figured out, I will add:

1: "Set On Boot" options to automatically apply the new values on startup (right now "set on boot" can be dangerous and lead to black screens).
2: Perhaps some basic profiles
3: Maybe other cool stuff if time permits :D


Min Value is 0 (NO NEGATIVES)
Max Value is 255 (Don't Go over it, it will break stuff!!!)



App Change Log:

1.0.6 - Initial release with RGB register access only
1.0.7 - full access to all registers
1.0.8 - add "set on boot" feature, add webview link to 2nd post below, enabled landscape mode.
1.0.9 - updated to latest kernel driver. add old version warning. add action bar for quicker navigation.
1.0.10 - updated to latest kernel driver. removed unused fragments.
1.0.11 - updated to latest kernel driver with stable sysfs locations!
 

Attachments

  • com.teamkang.gamma_test-1.0.8.apk
    449.5 KB · Views: 1,398
  • com.teamkang.gamma_test-1.0.9.apk
    450.9 KB · Views: 860
  • com.teamkang.gamma_test-1.0.10.apk
    456.8 KB · Views: 8,380
  • com.teamkang.gamma_test-1.0.11.apk
    456.3 KB · Views: 11,609
Last edited:

faux123

Senior Member
Dec 16, 2010
8,536
34,426
West Los Angeles
www.canonspike.com
Progress So Far:

Gamma Tabs:

columns => goes from left to right, so 1st position is most let and right most is 5th position
row => goes from top to bottom.

I got VERY CLOSE to ideal Gamma 2.2

Positive and Negative Polarity tweak added. This allows for greater RGB gamma control and balance!

Overall Color Gamma Curve (row 1 column 1 of RGB Gamma tabs) => 0 is highest, 255 lowest
Red Gamma Positive=> 0
Green Gamma Positive=> 73
Blue Gamma Positive=> 78

Red Gamma Negative => 0
Green Gamma Negative => 73
Blue Gamma Negative => 78

Gamma Color Brightness (row 2 column 5 of RGB Gamma tabs) => 0 is highest, 255 lowest
Red Gamma Positive => 100
Green Gamma Positive => 117
Blue Gamma Positive => 121

Red Gamma Negative => 107
Green Gamma Negative => 117
Blue Gamma Negative => 121

Overall White Point Brightness => 0 darkest, 255 brightest
Gamma white point, Column 1 => 30
 
Last edited:

karendar

Senior Member
Aug 9, 2010
2,214
883
Montreal
yeah. this is for the advanced users or tinkerers who like do not mind tweaking their phones. If you are not comfortable with this, you shouldn't participate.

Already broke my phone. hahah. Gamma 31 is evil. =D

Thanks Faux, I've been aching to play around with these settings since I got my N5.

***Edit*** Oh my God! YELLOW TINT IS GONE!!! *faints*
 
Last edited:

karendar

Senior Member
Aug 9, 2010
2,214
883
Montreal
What settings did you use?


Play with green gamma settings by lowering all settings by 6-10 points
Gamma 1 to 255/25/33/33/33
Gamma 3 to 10/33/33
Gamma 5 to 0/32/32
Gamma 20 to 200/33/6/0/6
Gamma 22 to 200/33/33
Don't remember if I modified Gamma 28
Gamma 31 to 200/70/60/55/55

I didn't touch blue gamma or red gamma much, modifying values to see effect now.
 
  • Like
Reactions: BDHela

Polv89

Senior Member
Dec 23, 2011
925
67
Fiastra
www.gexperience.it
Nexus 5 Gamma Reverse Engineering App is out!

(This app will work on the common sysfs interface, so any kernel using this interface will be compatible with this app, not just my kernel)

Please download my public beta 04 here:

http://faux.androidro.ms/hammerhead/beta/

ALL Gamma registers are accessible with new APK!

@myfluxi Thank you again!

After hitting apply, it's best to turn screen on/off to see the results updated!

Please help decipher the meaning of these values and write them down in a concise manner so we can all understand what you've done and tried.

My TODO list for this FREE app:
Once things are figured out, I will add:

1: "Set On Boot" options to automatically apply the new values on startup (right now "set on boot" can be dangerous and lead to black screens).
2: Perhaps some basic profiles
3: Maybe other cool stuff if time permits :D


Min Value is 0 (NO NEGATIVES)
Max Value is 255 (Don't Go over it, it will break stuff!!!)


What does mean "it will break stuff "?
Thanks

Inviato dal mio Nexus 5 utilizzando Tapatalk
 

JesusFreak316

Senior Member
Aug 19, 2009
520
66
30
What does mean "it will break stuff "?
Thanks

Inviato dal mio Nexus 5 utilizzando Tapatalk

I think an explanation that this won't brick your phone but just require a wipe to fix a messed up screen world be useful to allay some fears. A flashable zip to restore to stock would be wonderful too. I'm gonna experiment nonetheless but others might need some reassuring.


Edit: meant for faux. Dang xda app causes me to quote the wrong person.
Sent from my SCH-I605 using xda app-developers app
 
Last edited:
  • Like
Reactions: faux123

ganeshp

Senior Member
Mar 15, 2012
5,498
3,261
Hyderabad
Play with green gamma settings by lowering all settings by 6-10 points
Gamma 1 to 255/25/33/33/33
Gamma 3 to 10/33/33
Gamma 5 to 0/32/32
Gamma 20 to 200/33/6/0/6
Gamma 22 to 200/33/33
Don't remember if I modified Gamma 28
Gamma 31 to 200/70/60/55/55

I didn't touch blue gamma or red gamma much, modifying values to see effect now.

a screen shot?
i am a bit confused :confused:
 
  • Like
Reactions: owain94

aragog53

Senior Member
Apr 24, 2011
127
39
With both karendar's and faux's settings my screen has much more contrast, beautiful colors, but is also less bright. Recommend it anyway ! :)

Sent from my Omniromed and Faux kerneled Nexus 5 using Tapatalk :D
 
  • Like
Reactions: karendar

Top Liked Posts

  • There are no posts matching your filters.
  • 153
    Nexus 5 Gamma Reverse Engineering App is out!

    (This app will work on the common sysfs interface, so any kernel using this interface will be compatible with this app, not just my kernel)

    Please download my public betas here:

    http://faux.androidro.ms/hammerhead/beta/

    Franco Kernel is also compatible here:

    http://forum.xda-developers.com/showthread.php?t=2508284

    ALL Gamma registers are accessible with new APK!

    @myfluxi Thank you again!

    After hitting apply, it's best to turn screen on/off to see the results updated!

    Please help decipher the meaning of these values and write them down in a concise manner so we can all understand what you've done and tried.

    My TODO list for this FREE app:
    Once things are figured out, I will add:

    1: "Set On Boot" options to automatically apply the new values on startup (right now "set on boot" can be dangerous and lead to black screens).
    2: Perhaps some basic profiles
    3: Maybe other cool stuff if time permits :D


    Min Value is 0 (NO NEGATIVES)
    Max Value is 255 (Don't Go over it, it will break stuff!!!)



    App Change Log:

    1.0.6 - Initial release with RGB register access only
    1.0.7 - full access to all registers
    1.0.8 - add "set on boot" feature, add webview link to 2nd post below, enabled landscape mode.
    1.0.9 - updated to latest kernel driver. add old version warning. add action bar for quicker navigation.
    1.0.10 - updated to latest kernel driver. removed unused fragments.
    1.0.11 - updated to latest kernel driver with stable sysfs locations!
    77
    Progress So Far:

    Gamma Tabs:

    columns => goes from left to right, so 1st position is most let and right most is 5th position
    row => goes from top to bottom.

    I got VERY CLOSE to ideal Gamma 2.2

    Positive and Negative Polarity tweak added. This allows for greater RGB gamma control and balance!

    Overall Color Gamma Curve (row 1 column 1 of RGB Gamma tabs) => 0 is highest, 255 lowest
    Red Gamma Positive=> 0
    Green Gamma Positive=> 73
    Blue Gamma Positive=> 78

    Red Gamma Negative => 0
    Green Gamma Negative => 73
    Blue Gamma Negative => 78

    Gamma Color Brightness (row 2 column 5 of RGB Gamma tabs) => 0 is highest, 255 lowest
    Red Gamma Positive => 100
    Green Gamma Positive => 117
    Blue Gamma Positive => 121

    Red Gamma Negative => 107
    Green Gamma Negative => 117
    Blue Gamma Negative => 121

    Overall White Point Brightness => 0 darkest, 255 brightest
    Gamma white point, Column 1 => 30
    30
    ok, do hopefully the last bit..

    First, I'd like to say that the following isn't directly aiming to be the settings everyone should use. It's meant to be just a guidance for how do these settings work. For example my display isn't that much yellowish as many others seem to experience so there are definitely big differences among these displays.

    Now in my previous tests I ended up with some (pretty much linear) green color rebalancing. I took it further then, also rebalanced blue and red a little so that they would match properly and also their levels would be correct (or much loser to that).
    Green was a little tricky as it was visually very sensitive to incorrect changes - mainly not smooth transitions and slight banding were the result. So when performing bigger corrections I had to make some compromises to limit these negative effects.

    Now this is the state after making all initial corrections (rebalancing color levels, but not targeting gamma corrections).
    EDIT: just to explain this setup a little:
    - red levels just corrected a little (minor corrections to get proper match with other color levels, more stable gamma progress)
    - green levels taken down (maybe 8% in average, the main part was done in one of my previous posts, here I tuned this a little bit more like the red above)
    - blue levels taken down (but not as much as green, maybe 2-3% in average)

    R: 0, 10, 17, 27, 37, 45, 56, 72, 83, 101, 113, 121, 129, 123, 117, 104, 89, 77, 67, 61, 52, 37, 21
    R delta:0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, -2, -2, -1, -1, -1, -1, -1, -1
    G: 84, 85, 86, 88, 91, 94, 100, 108, 112, 122, 128, 132, 119, 115, 110, 98, 82, 71, 63, 57, 49, 36, 20
    G delta: 13, 12, 11, 10, 10, 10, 10, 8, 7, 5, 4, 2, -2, -2, -1, -2, -3, -2, -1, -1, -1, -1, -1
    B: 90, 91, 93, 95, 98, 100, 104, 111, 113, 122, 127, 131, 121, 116, 111, 97, 80, 67, 57, 48, 36, 29, 16
    B delta: 4, 4, 4, 4, 4, 4, 3, 2, 2, 1, 1, 0, 1, 0, 1, -2, -4, -4, -4, -4, -4, -4, -4

    Which gives me:
    average gamma: 2.0
    contrast ratio: 920:1

    Now try to get gamma to about 2.1, delta values are difference to gamma 2.0 (above) so that they show only what's needed to correct for the gamma:
    R: 0, 10, 17, 27, 37, 45, 57, 74, 85, 103, 116, 123, 127, 121, 115, 101, 86, 76, 67, 61, 52, 37, 21
    R delta (gamma correction only): 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3, 2, -2, -2, -2, -3, -3, -1, 0, 0, 0, 0, 0
    G: 84, 85, 86, 88, 91, 94, 101, 110, 114, 124, 131, 134, 117, 113, 108, 95, 79, 70, 63, 57, 49, 36, 20
    G delta (gamma correction only): 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3, 2, -2, -2, -2, -3, -3, -1, 0, 0, 0, 0, 0
    B: 90, 91, 93, 95, 98, 100, 105, 113, 115, 124, 130, 133, 119, 114, 108, 93, 76, 66, 57, 48, 36, 29, 16
    B delta (gamma correction only): 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3, 2, -2, -2, -3, -4, -4, -1, 0, 0, 0, 0, 0

    Which gives me:
    average gamma: 2.11
    contrast ratio: 931:1

    Now try to get gamma to about 2.2, delta values are difference to gamma 2.0 (above) so that they show only what's needed to correct for the gamma.
    Note that I didn't go exactly to 2.2 as the display doesn't seem to perform that well after making such big corrections, and basically at gamma around 2.2. Some color transitions turn into just solid colors etc. And again, green is the most affected. I may try to add more exact 2.2 values later but now I've got enough of all this :D
    You can also see that blue required slightly stronger corrections.
    R: 0, 10, 17, 27, 37, 45, 57, 75, 86, 104, 117, 125, 125, 119, 113, 100, 85, 75, 67, 61, 52, 37, 21
    R delta (gamma correction only): 0, 0, 0, 0, 0, 0, 1, 3, 3, 3, 4, 4, -4, -4, -4, -4, -4, -2, 0, 0, 0, 0, 0
    G: 84, 85, 86, 88, 91, 94, 101, 111, 115, 125, 132, 136, 115, 111, 106, 94, 78, 69, 63, 57, 49, 36, 20
    G delta (gamma correction only): 0, 0, 0, 0, 0, 0, 1, 3, 3, 3, 4, 4, -4, -4, -4, -4, -4, -2, 0, 0, 0, 0, 0
    B: 90, 91, 93, 95, 98, 100, 105, 114, 116, 125, 131, 135, 117, 112, 106, 92, 75, 65, 56, 48, 36, 29, 16
    B delta (gamma correction only): 0, 0, 0, 0, 0, 0, 1, 3, 3, 3, 4, 4, -4, -4, -5, -5, -5, -2, -1, 0, 0, 0, 0

    Which gives me:
    average gamma: 2.17
    contrast ratio: 860:1

    When compared to changing just the so called white point to 30, you'll get similar values:
    WP: 31
    average gamma: 2.07
    contrast ratio: 900:1

    WP 30:
    average gamma: 2.14
    contrast ratio: 870:1

    WP: 29
    average gamma: 2.23
    contrast ratio: 870:1

    And the progress of all color levels throughout the whole range is pretty good. So if you just want to change the gamma then you may be alright with WP set to around 30. Just you won't be able to correct the color levels this way.
    When you change the WP value, colors change a little (as I mentioned in one of my previous posts), but change from 32 to 29 isn't that big and the changes will be minimal.

    I mention the average gamma in all above cases, but it of course changes throughout the range and especially around 0-10% and 90-100% gray it's harder to achieve the correct value. However I tried to get the most stable results in all cases - but also didn't go too far to cause some visible artifacts to appear.

    Again, this whole post (and also the previous ones) are more about finding out how this whole thing works so that some app with simple controls can be developed.

    You may try my settings but they may not give you good results as your display might be very different.

    Equipment used for measurements:
    X-Rite i1 Display Pro with factory WLED LCD display type correction - colorimeter
    Voodoo Screen Test Patterns 3.4 - Android test pattern generator
    HCFR 3.1.0.4 - PC colorimeter software
    Display Tester Pro - Android display tester
    27
    franciscofranco sometimes denies evidence...

    Ok, read below.

    franco is sometimes a bit quick with "nothing to do with" and "nothing changed" replies in a bit a flapsy way but usually things will be corrected within a quite reasonable period of time.

    You're a real pain in my arse. I've shown factual evidences that I haven't changed a single bit in the gamma interface - yes factual with git histories - I'm more than interested that people use this app, its free and makes people happy, so why would I make it incompatible on purpose?

    I actually am not too happy about that attitude. Shrug. I respect the guy for his talents, but sometimes he plays the defensive game too much. It's just like when CM compatibility breaks with his kernel. He denies that it's him, but sometimes in the end he makes the changes anyway.

    My point is that if you say your kernel is CM compatible, then you tweak for CM, not the other way around. CM is a full package, and it can do anything it likes. Changes that CM have made are primarily designed for CM to function better as a whole package. CM was never designed to allow for custom kernels anyway. You have to make your kernel compatible for CM. So I don't get his attitude sometimes.

    Similarly when faux hasn't touched this app for weeks now, and r31 of FK works but not r32, then what does that tell you? Even if it isn't Franco's fault, and there's a bug in faux's app, his attitude is still wrong. He should look into it and conclude what the problem is. If he truly believes his own kernel isn't the issue, then the right attitude would be to notify faux (given that he's contributed in this thread too) that his app may have an issue and that faux should look into it further.

    Ok sorry for ranting. I hope this does get fixed one way or the other soon!

    ---------- Post added at 11:05 AM ---------- Previous post was at 11:00 AM ----------



    ooh. let me try that one out. thanks for the tip.

    Just a small info for you from myfluxi, the guy who wrote the gamma Kernel code:

    http://forum.xda-developers.com/showpost.php?p=49316012&postcount=12143
    http://forum.xda-developers.com/showpost.php?p=49318176&postcount=12155

    No Kernel code was changed, regarding gamma interface. I've shown the git history compared to myfluxi's and there are 0 differences.

    Anyway, just wanted to share that out. And about my attitude, deal with it - at least I'm active enough to help my users answering to all kinds of posts and sometimes ridiculous reports.

    This app is not the problem per-se but I would suggest something like this for faux's app to detect the path (now the path is going to be moved to a more standard place, but this info can be useful):

    File[] dir = new File("/sys/devices/").listFiles();

    for (File f : a) {
    if (f.getName().toString().contains("qcom,mdss_dsi_jdi_command_ors"))
    return "/sys/devices/" + ff.getName().toString();
    }

    This would get the correct directory of the sysfs files even if the directory moved around with different ending numbers (.XX). Its a bit "hacky" but store that into a static variable and do it just once on app bootup, profit.

    Hope this helps!
    27

    this is to help reverse engineer the kernel drivers. it is relevant in this section for kernel development.