[Epic 4G Android Development] Linuxuberant:
*** Fix for Epic minimum screen brightness ***

*** Update 2: Adjustable version via sysfs interface

EDIT 10/13/2010 0600 UTC: The binary for version 2 that I posted was originally built wrong, lacking an initramfs image. I removed it and posted a new version now, called epic-brightnessfix-kernel02-di18-repaired.zip. The source in the howto.zip was OK. My apologies to the 15 of you that downloaded the broken binary.

As promised, here is a new version with an extensive sysfs interface that allows you to completely tweak brightness and color adjustments without further modifying the kernel. See the README in the attached linuxuberant-brightness-02-howto.zip for instructions. This zip file also contains the full source code.

NOTE: I have been in discussions with Project Voodoo, which may merge this work soon.

Intro

One of widespread complaints with the Epic 4G is that the screen is way to bright for use in a dark room, even with the brightness turned all the way down. So, I modified the brightness controls in the kernel to provide many more steps below the stock kernel's minimum brightness setting.

Since several people claim that minimum brightness on Epic is on par with Evo at 30%, I pushed the 25 discrete brightness levels in the stock kernel up to the range of 30%-100% and added about 10 dimmer levels between 0% and 30%. In addition, I added interpolation between levels so you effectively get much finer control over brightness at all levels.

How to install:

Use Clockworkmod recovery to apply the attached zip file to flash this change. I packaged this as 100% stock Samsung di18 kernel with stock initramfs. The only difference between this and the stock kernel is my brightness change. This means it is safe to try on a stock phone.

md5sum, version 1: 43669330823c2f80c59d152a963325cc

md5sum, version 2: a7da371fcd51c4413a2abb268866e3d7

Affect on permanent Root:

If you currently depend on a custom kernel's initramfs to provide permanent root, then flashing this kernel will lose root for you, because I used the stock initramfs. You can always flash right back to the other kernel after you've played with this. If you rely on the original joeykrim "one click" method of permanent root, this kernel will not interfere with that. If there is interest, I can repackage this using an initramfs that provides permanent root.

Source code:

Only one source file was changed, and it's a mostly simple change. I have attached the whole file as well as a patch that can be applied to a di18 kernel (applies equally well to the dg27 kernel and probably to some of the custom kernels that other developers have made).

What's Next?

I hope that some of the other Epic kernel developers will pick up this patch so that many can benefit from it. I do not intend to become ROM/kernel mod owner myself :)

My change modifies the low end of the brightness curve aggressively - making possible to get the screen _very_ dark. This suits my needs well, but not everyone will like that. So, I plan to make an enhanced version of this code that will allow you to modify the brightness gamma tables from userspace by writing to special files on sysfs.

Blue Tint Fix?

This brightness tables provides independent control over the red, green, and blue channels, so could be used to fix the blue tint that some people complain about. When I get the userspace access to modify Now that you can modify the table from userspace, feel free to experiment with adjusting the tint.

Enjoy,

Linuxuberant