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

[KERNEL][G955] AMOLED PWM flickerfree

Search This thread

Wootever

Senior Member
Jun 27, 2012
1,089
2,798
What is PWM?
  • Pulse Width modulation (PWM) is a way to control display brightness.
  • When you lower the brightness, the light intensity of the display is not reduced by voltage, but instead quickly turned off and on by the electronics with a fixed frequency.
  • If this frequency is high enough (>4000hz), it is indistinguishable by the human eye.

Why is Samsung AMOLED using PWM?
  • AMOLED can't be dimmed low enough (<40cd/m2) by just reducing voltage without noticeable image deterioration.
  • This deterioration affects grayscale linearity, color temperature and shows another display issue called mura defects.
  • Grayscale linearity and color temperature can be corrected to some extent by the display driver.
  • But mura defects are basically small irregularities / deviations caused by the OLED production process and will become more visible with lesser voltage applied.
  • PWM can prevent those issues by dimming the brightness with short on/off intervals instead of voltage dimming, thus the applied voltage can be high enough (~100cd/m2) to avoid optical deterioration and we still perceive a lower brightness.

What is the problem with PWM?
  • PWM is not bad per se, it is the very low frequency of 240hz that Samsung chooses to implement.
  • Some people that are very susceptible to flickering (often without knowing it), may notice eye strain, headache or even nausea (comparable with motion sickness).
  • This is also the reason why almost all modern computer displays are assembled with a flickerfree backlight.

Oscilloscope measurements
  • Default kernel PWM behaviour with 240hz (10% on-time and 90% off-time ratio).

    glg83t24.png

Kernel PWM comparison
  • Default kernel.
kwah44hd.png

  • Flickerfree kernel.
fxz2nn3o.png


PWM visualized in slow motion
  • Both videos are starting at 100% brightness -> 60% -> 20% -> 5%.
  • Left video: stock kernel, right video: flickerfree kernel (the pink stripe is the refresh interval).

iims9tl7.jpg


Disadvantages
  • If the brightness is below 40cd/m2 the visibility of the above mentioned mura defects will increase.
tfmlnjjs.jpg


Download:
 
Last edited:

neitin

Senior Member
Jul 25, 2007
361
15
Hyderabad
Hi

Thanks for your work. I have been looking for this and its great to have it.

I have flashed it but the phone is stuck at Samsung logo. It doest boot. Please can you help me. I have a dual dim unlocked INS phone and am on latest Ironman RoM.

Edit: flashed v2 it is stuck at installing android app 39 to 56.
 
Last edited:

Wootever

Senior Member
Jun 27, 2012
1,089
2,798
@neitin
This seems like a problem with mismatching vendor libraries, i use the Kernel with the current stock Samsung firmware (G955FXXU1AQK7).
I will later take a look what might cause this issue on the custom rom.
 
  • Like
Reactions: duttyend and neitin

neitin

Senior Member
Jul 25, 2007
361
15
Hyderabad
@neitin
This seems like a problem with mismatching vendor libraries, i use the Kernel with the current stock Samsung firmware (G955FXXU1AQK7).
I will later take a look what might cause this issue on the custom rom.

Hi Wootever, please can i ask you to let me know which RoM are using, I flashed Batman rom with stock kernel and flashed your kernel, but failed, tried on ironman rom with stock kernel in aroma and it fails to boot.

Thanks in advance.
 

Wootever

Senior Member
Jun 27, 2012
1,089
2,798
@neitin
I'm using the current default Samsung rom (G955FXXU1AQK7), it can be downloaded with SamFirm.

7zw67kmp.png


Edit:
Region codes can be found here.

If you decide to flash the stock Samsung rom via Odin, don't forget to create a backup of your /data and /sdcard partition to an external card as the original boot.img will encrypt those partitions.
 
Last edited:
  • Like
Reactions: duttyend and neitin

neitin

Senior Member
Jul 25, 2007
361
15
Hyderabad
Thanks @Wootever

I was on RpmAur-2.1 and flashed the kernel, all works well and I can proudly say that my eyes are not burning as it used to earlier.

Thank you for your work, Cheers
 
  • Like
Reactions: Wootever

Wootever

Senior Member
Jun 27, 2012
1,089
2,798
I made some adjustments to retain the calibration and overall image quality, it should be pretty much identical with the stock kernel now.
The difference is basically the increased visibility of mura defects without PWM (flickerfree kernel behaviour) or almost no visible mura defects with PWM enabled (stock kernel behaviour).

Here is a quick comparison photo:
(Stock kernel is on the left side; if you look closely you can see the some repeating transversal lines, those are the typical PWM lines captured by camera.)
(Flickerfree kernel is on the right side; there are some bright dots that looks like compression artifacts, those are mura defects.)
6ygj5oi8.jpg
24hsqzxj.jpg


Edit:
Here is another photo for a better comparison (left side: mura defects masked by PWM, right side: visible mura defects due to missing PWM).
(Note: those mura defects are especially visible on very low brightness <20cd/m2, anything above 40cd/m2 shouldn't be noticeable).

4v2czksr.jpg


More information about can be found in the Samsung AMOLED patent description: Organic light emitting display device and driving method thereof
 
Last edited:
  • Like
Reactions: robcore

jujusito

Senior Member
Nov 1, 2007
224
51
I had the same issue. Refer couple of post above for resolution

Sent from my SM-G955F using Tapatalk

If the solution is flashing stock rom with odin i don't want this.
This kernel need more compatibility with custom roms, v3 and v4.

Don't work for me, stay in Samsung logo when boot.
 

this.guy.lol

Senior Member
May 14, 2015
341
72
Welcome aboard sir! I was just curious about this kernel last night. Was thinking to myself, I miss the flicker kernel for the edge and was going to seek you out to see about a port but looks like its an early Christmas for me :)
 

Wootever

Senior Member
Jun 27, 2012
1,089
2,798
I added the flickerfree setting to the S8 (G950F) panel driver. If someone is willing to test this version please report back if it's working correctly.
(note: for now the lowest brightness step is set much higher (300cd/m2) to verify that the flickerfree brightness table is working.)

@djb77
Not yet, but i might add that in a future version.
 

djb77

Recognized Developer / Contributor
Oct 2, 2011
3,093
7,359
44
NSW
github.com
I added the flickerfree setting to the S8 (G950F) panel driver. If someone is willing to test this version please report back if it's working correctly.
(note: for now the lowest brightness step is set much higher (300cd/m2) to verify that the flickerfree brightness table is working.)

@djb77
Not yet, but i might add that in a future version.

I've been speaking with @morogoku (author of MTweaks) about it. We may even able to patch it to make it work.
I'll have a look at both sources today (hero and dream) and see what I can do.
I've noticed the changes in the hero code which check for the 0 or 1 o be enabled, doesn't look too complicated, but ofcourse if you do have time it would be appreciated if you can do it yourself to make sure its 100% correct.

Once again thanks for supporting the S8 with this :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    What is PWM?
    • Pulse Width modulation (PWM) is a way to control display brightness.
    • When you lower the brightness, the light intensity of the display is not reduced by voltage, but instead quickly turned off and on by the electronics with a fixed frequency.
    • If this frequency is high enough (>4000hz), it is indistinguishable by the human eye.

    Why is Samsung AMOLED using PWM?
    • AMOLED can't be dimmed low enough (<40cd/m2) by just reducing voltage without noticeable image deterioration.
    • This deterioration affects grayscale linearity, color temperature and shows another display issue called mura defects.
    • Grayscale linearity and color temperature can be corrected to some extent by the display driver.
    • But mura defects are basically small irregularities / deviations caused by the OLED production process and will become more visible with lesser voltage applied.
    • PWM can prevent those issues by dimming the brightness with short on/off intervals instead of voltage dimming, thus the applied voltage can be high enough (~100cd/m2) to avoid optical deterioration and we still perceive a lower brightness.

    What is the problem with PWM?
    • PWM is not bad per se, it is the very low frequency of 240hz that Samsung chooses to implement.
    • Some people that are very susceptible to flickering (often without knowing it), may notice eye strain, headache or even nausea (comparable with motion sickness).
    • This is also the reason why almost all modern computer displays are assembled with a flickerfree backlight.

    Oscilloscope measurements
    • Default kernel PWM behaviour with 240hz (10% on-time and 90% off-time ratio).

      glg83t24.png

    Kernel PWM comparison
    • Default kernel.
    kwah44hd.png

    • Flickerfree kernel.
    fxz2nn3o.png


    PWM visualized in slow motion
    • Both videos are starting at 100% brightness -> 60% -> 20% -> 5%.
    • Left video: stock kernel, right video: flickerfree kernel (the pink stripe is the refresh interval).

    iims9tl7.jpg


    Disadvantages
    • If the brightness is below 40cd/m2 the visibility of the above mentioned mura defects will increase.
    tfmlnjjs.jpg


    Download:
    3
    The refresh interval (Vsync) seems like a necessary OLED function, as it is also used by LG OLED PWM free devices Flex 2 (60hz) and B6 (120hz):

    ul4oibd3.png


    3e386oro.png


    ixbt.com

    lhdb5tj5.jpg


    rtings.com
    2
    @amakuramio and @vrveee
    Please take a look at this thread: pwmfree application
    This application uses a transparent overlay to dim the brightness, which pretty much results in the same outcome as the customized (flickerfree) display drivers.
    2
    @neitin
    This seems like a problem with mismatching vendor libraries, i use the Kernel with the current stock Samsung firmware (G955FXXU1AQK7).
    I will later take a look what might cause this issue on the custom rom.