FORUMS
Remove All Ads from XDA

[KERNEL][G935] AMOLED PWM flicker free

1,050 posts
Thanks Meter: 2,696
 
By Wootever, Senior Member on 12th December 2016, 11:40 AM
Post Reply Email Thread
What is PWM?
Quote:

PWM is used to regulate the brightness of LCD and LED displays. How does that concern us? The pulsations can be bad for your health and more specifically for the users eyesight. They can lead to migraines, headaches or other forms of discomfort after long-term usage. In most cases those pulsations have a frequency somewhere around 200Hz. They cause multiple contractions and expansions of the pupils, which bears down negatively on your health. They are especially harmful in models with LED backlight because the colors of the emitted light are not as inert as the colors of the CCFL backlight and so they reach high amplitudes and rapid luminance changes. Basically, the problem comes from the flickering light, not from the crystals of the LCD monitors.


Default PWM curve:
  • On 100% brightness it shows a rather flat curve with 60hz, this is tolerable even for flicker sensitive people.
  • On 75% brightness the PWM sequence changes to 240hz with high amplitude alternating, this can be already noticable for flicker insensitive people.
  • Below 50% you get the typical stroboscopic effect which can have a negative impact on your eyesight.




Adjusted PWM curve:
  • The lowest possible PWM sequence with a 60hz refresh cycle will be used on all brightness levels.




Here are two videos to show the difference in motion:
  • Recorded with S7 slow motion camera mode; Starting with 100% brightness -> 60% -> 20% -> 5%.
  • The first video shows the default Samsung kernel.
  • The second video shows the pwmfree kernel.



Download:
Links:
The Following 27 Users Say Thank You to Wootever For This Useful Post: [ View ] Gift Wootever Ad-Free
 
 
12th December 2016, 11:40 AM |#2  
OP Senior Member
Thanks Meter: 2,696
 
More
The PWM mechanism used on Samsung displays is called AOR (AMOLED off ratio), the related function on the kernel driver is called AID (AMOLED impulsive driving).
Quote:

Meanwhile, since the AID dimming driving during the fixing and dimming sections uses a principle of increasing currents of pixels and varying currents of pixels by adjusting a duty ratio with reference to a specific luminance (brightness), power consumption may be increased if the same AID driving principle is applied in the high luminance region.

Quote:

As shown in FIG. 5 and FIG. 6, during the AID driving mode, the off duty is turned on and off according to the specified ratio. For example, during the AID fixing section, the reference luminance is set 273 cd/m2 when the conventional method is set at 180 cd/m2, but introduces off duty at 40% in accordance with the present invention to yield an equivalent 180 cd/m2 step as in the conventional method.




Here is a Picture of the visible scan lines:
  • Recorded with S7 slow motion camera mode.
  • The colorful stripes on the left shows the aggressive 240hz refreshment cycle (four indentation per frame with high intensity).
  • The red stripe on the right shows the 60hz refreshment cycle (one indentation per frame with low intensity).



Information source:
Kernel source:
The Following 10 Users Say Thank You to Wootever For This Useful Post: [ View ] Gift Wootever Ad-Free
12th December 2016, 12:02 PM |#3  
Senior Member
Thanks Meter: 36
 
More
so what can we do to protect our eyes ?
12th December 2016, 12:14 PM |#4  
OP Senior Member
Thanks Meter: 2,696
 
More
I'm currently testing a custom kernel with the suggested fix included.
The PWM frequency is consistent even on lowest brightness but it also shows the mentioned issues:
Quote:

due to a low current for pixel driving at a low luminance/low grayscale [...] dispersion of the optical characteristics, such as color difference (MPCD: Minimum Perceptual Color Difference), color temperature, and grayscale linearity, may increase.
If the minimum luminance set to lower than 40 cd/m2, the optical characteristics deteriorates

Probably needs to include a slightly increased PWM on brightness <40 cd/m2.

You can test the PWM flicker by shaking your hand on a white background at 50% brightness, you will notice a stroboscopic effect.

The Following 6 Users Say Thank You to Wootever For This Useful Post: [ View ] Gift Wootever Ad-Free
12th December 2016, 03:36 PM |#5  
OP Senior Member
Thanks Meter: 2,696
 
More
Updated version: http://forum.xda-developers.com/show...05&postcount=6
The Following 4 Users Say Thank You to Wootever For This Useful Post: [ View ] Gift Wootever Ad-Free
13th December 2016, 12:14 PM |#6  
OP Senior Member
Thanks Meter: 2,696
 
More
General notes:
  • Based on G935FXXU1DQG1
  • Enabled power-efficient workqueue.
  • Set TCP Westwood as default.
  • Built with GCC Linaro toolchain 5.4.

Kernel V7:
  • Updated Ramdisk and SuperSU.
Kernel V8:
  • Added fix for black crush issue.
  • Based on G935 kernel source instead of N930 (Note 7).
Kernel V9:
  • Added compatibility for encrypted devices.
  • Reduced minimal brightness to 7 candela.
Kernel V10:
  • Updated Kernel source and Ramdisk.
  • Refactored brightness table.
Kernel V11:
  • Slightly increased color uniformity.
Kernel V12:
  • Updated for Andoid 7.0.
Kernel V13:
  • Removed local SuperSU to fix compatibility with Magisk.
Kernel V14:
  • Based on G935FXXU1DQB7
  • Added more steps for a smoother brightness control.
  • Slightly reduced minimal brightness.
Kernel V15:
  • Updated source and ramdisk to G935FXXU1DQG1

Download:
The Following 10 Users Say Thank You to Wootever For This Useful Post: [ View ] Gift Wootever Ad-Free
13th December 2016, 12:28 PM |#7  
Tkkg1994's Avatar
Recognized Developer / Contributor
Flag Coding City
Thanks Meter: 22,882
 
Donate to Me
More
@Wootever
I miss the kernel source code (GPL requirement)
The Following 3 Users Say Thank You to Tkkg1994 For This Useful Post: [ View ]
15th December 2016, 03:57 PM |#9  
OP Senior Member
Thanks Meter: 2,696
 
More
Updated kernel to V5: http://forum.xda-developers.com/show...05&postcount=6
And summarized original post for better comprehension.
The Following 2 Users Say Thank You to Wootever For This Useful Post: [ View ] Gift Wootever Ad-Free
16th December 2016, 07:19 PM |#10  
Senior Member
Vancouver, BC
Thanks Meter: 14
 
More
Holy crap

Nice work
The Following User Says Thank You to jtl999 For This Useful Post: [ View ] Gift jtl999 Ad-Free
19th December 2016, 09:06 PM |#11  
OP Senior Member
Thanks Meter: 2,696
 
More
Some information about the mentioned deterioration that increases on low brightness; it is called mura defects:
Quote:

Mura: The Japanese word for blemish has been widely adopted by the display industry to describe almost all irregular luminosity variation defects in liquid crystal displays.
Mura defects are caused by process flaws usually related to cell assembly, which affect the transmission of light through the display.
The cyclical nature, randomness, and often, low contrast of mura makes accurate detection and classification extremely difficult for LCD manufacturers.

In short: mura defects are small irregularities / deviations caused by the OLED production process.
Although this is a typical behaviour for AMOLED displays, the pwmfree kernel might increase the visibility of those mura defects due to the reduced pixel current on lower brightness.




The PWM effect is also used to mask those mura defects, so they become less visible:
Quote:

Another aspect [of the PWM mechanism] is to provide an organic light emitting display device and a driving method thereof by which a transverse and longitudinal mura defect or irregular luminosity variation defects of a panel due to process flaws, for example, caused by a lack of driving currents of the panel can be prevented.

Samsung patent description of the mura defects:
Quote:

However, although the smart dimming method according to the teachings of the present invention has the optical characteristics of a 300 cd/m2 luminance step, a mure defect may be generated by a deviation of a pixel current due to a low current for pixel driving at a low luminance/low grayscale, and a dispersion of the optical characteristics, such as color difference (MPCD: Minimum Perceptual Color Difference), color temperature, and grayscale linearity, may increase. Due to the problem associated with the increased dispersion of the optical characteristics at a low luminance, a expressible minimum luminance should be limited to 40 cd/m2. If the minimum luminance set to lower than 40 cd/m2, the optical characteristics deteriorates.

The Following 2 Users Say Thank You to Wootever For This Useful Post: [ View ] Gift Wootever Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes