Gleb

  • Dec 20, 2019
  • Joined Nov 5, 2019
  • annv
    I also bumped into an article today. The "bad zone" is where fonts are too small or too big

    Personally I own two 4k Dells 23.8" and find my fonts small. I was thinking about buying 27" 4k screens, but they are now also out of "comfort zone". But I will have a chance to test a 27-inch screen over weekends, to see if UI elements are more readable.

    There are following settings that help so far:

    1. Disable blurry fonts by enabling legacy subpixel antialiasing (CGFontRenderingFontSmoothingDisabled) and disabling font smoothing in Settings->General

    2. In System preferences->Accessibility->Display:
      a. select Reduce transparency (makes font more readable, as they are printed on paper)
      b. Increase Display contrast to 1.5

    3. Use bigger fonts: TinkerTool and Command+J in Finder lists.

    4. Adjust brightness/contrast of the monitor B:30 C:60 at daytime, 0/40 at night

    5. In Preferences -> Display -> Color tab, select Generic RGB profile instead of Color LCD

    Regarding dithering, I believe it might come from the monitor itself (read your display specs, if it says 8bit + FRC, dithering will be added after video signal. I'm not sure if such thing can be captured using an external capture card. Maybe someone has a good Digital Camera with 50x zoom that can zoom into single pixels?)

    • There is some interesting stuff I stumble upon today. It is regarding font smoothing.
      Mojave seems to change default subpixel antialiasing to grayscale. I had trouble to read such fonts on external screen. I mostly work with code in Intellij IDEs, and the fonts are really hard to read (especially on a light theme)

      Frankly, I believe something is fundamentally broken my macOS applications:

      1. There is setting to disable font smoothing in Preferences-> General
      2. There is setting in Intellij IDE for font smoothing

      leaving both ON (and this is by default) - results in blurry text, that takes me time to focus on:
      img - broken AA, default

      Disabling one of these setting (no matter, system setting or Intellij) results in much crisper text:
      img - after - fix

      You may try to experiment with this font smoothing, trying different options:
      http://osxdaily.com/2018/09/26/fix-blurry-thin-fonts-text-macos-mojave/

      For me, legacy subpixel AA is the best: you need to disable font smoothing in macOS preferences, and put the following command in terminal:

      defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO

      Changes will be visible after restart (or log-out/log-in)

      Please post your experiences with different options.

      PS:
      Generally I started to notice that overall font size and contrast is much smaller than I had on Windows or Ubuntu.
      I'm using 23" 4k screens with 200% scaling, and everything is just too small comparing to my windows setup.
      On the left - font that I can read without eye strain, on the right - default macOS font size:

      comparing default fonts to comfortable

      I don't know how to measure size properly, but this is around 8px height.
      All the menus are using this size.

      Here is another example: tab font is 6px(!) (notice contrast ratio on inactive tabs, it makes text near impossible to read):

      The point of this screenshot is that the height of non-capital letters is 6px. Imagine reading non-contrast books that has such a small font for a day. Even healthy eyes will notice discomfort. And we are using macOS entire day, for 12-14 hours.
      As a workaround may be getting 27-inch screen instead of 23-inch (27" is what entire Apple HQ should be using all days).

      I also did a few tests/days with and without the external screen. And working on a laptop screen didn't cause such eye strain as an external screen.

      P.P.S:
      Going to the topic of discussion - screen dithering, again, I do not really believe in this dithering (if it was any, Iphone 240FPS camera should capture it - as the refresh rate of screen is 60HZ). I'm pretty confident that eye strain is caused by small/blurry fonts and an overall lack of macOS UI contrast. At least for my case.

    • JTL MacBook as server, iPhone as a client

      • JTL replied to this.
      • Seagull

        Do you have a sample video from your capture card? Will it be possible to notice anomalies using a regular screen?

        • diop

          So you put this setting inside your AppleIntelFramebufferCapri.kext? What I think about this: even if there is a notion of the setting, it doesn't mean driver code uses it. So maybe it is hardcoded, for example, to always dither.

          It also happens for me on 10.15, I can't tell for sure that putting DitherDisable changes something (previously on 10.14 there was a definite shift of font crispness/color when switching to AMD).

          I want some proof that dithering is on, but couldn't find any. I even did recording of what I see via remote desktop (VNC):
          https://youtu.be/f1RiOukuKDg

          Even there nothing changes when a picture is static. (There must be pixel dancing if dithering was on)

          I might be getting a 50x Analog Zoom Camera to record individual pixels on video over this weekend. I no longer believe they are really jumping/morphing. It might be electricity AC that not static 220v, but varies from 200v to 240v in my apartment.

          Maybe we are pursuing a wrong goal here, and the issue is in something different than dithering.

          Can you share your experience? I guess it is Mac Mini connected to the external screen? If so, do you have issues when connecting this screen to a different computer? Is it easier on the eyes? Do you use the same cable between experiments?

          • I tried to recap what changed in past year, and at some point (6-8 month ago) I changed display brigthness contrast to
            Brightness = 100
            Contrast = 30

            That was because I was doing some web-design and couldn't distinguish between shades of gray. So I worked with MAX brightness for more than half of the year.

            Reading about CVS (Computer vision syndrome) I realized that 100% brightness is too much - eyes are exposed to w-led which causes eye strain (?). Maybe it is the same as looking at the sun or a bright lamp

            So I dropped my Brightness to 20, and raised contrast to 70:

            Now, letter edges are sharper, and the overall perception of the screen is more relaxed. Also, I no longer notice visual snow.

            Hope this advise will help.

          • I updated to Catalina (10.15).
            I checked decompiled code for AppleIntelCFLGraphicsFramebuffer, and they still have DitherDisable hidden option

            For Catalina there is additional step needed before they allow editing Plist inside kext:
            sudo mount -uw /

            I checked logs with command
            log show --predicate 'processID == 0' --last 1h | grep Intel

            https://ibb.co/TmCqKRb
            and

            log show --predicate 'processID == 0' --last 20h | grep Dither
            https://ibb.co/WzjyHGH

            BUT
            I think things are looking a bit different.
            Previously (on 10.14) when I was switching to High-Performance, I was noticing immediate changes in font rendering and color balance (they looked very strange on AMD).

            Now there is no visual difference between Intel and Amd graphics. There are 3 possible reasons:

            1. DitherDisable option is no longer working in my Framebuffer
            2. Dithering is disabled for both AMD and Intel in the new upgrade
            3. DitherDisable flag now controls BOTH integrated Intel and AMD.

            I will need to look at my screen for a day to see how it works.

            ever visited a good optometrist?

            In the end, martin may be right about this, and I just have aging symptoms (I'm 28 now, work on computers since 6). The reason why I think this might be an issue: I booted Windows PC (with AMD 280x card), disabled\enabled Dithering in registry, and didn't notice any effect. Only thing I see is kind of visual snow (and that is the first symptom for CVS).

            Also I wonder if @JTL is able to connect the capture card to one of DP output? And record video of signal from mac.

            Also, if anyone here does have android eink reader, https://youtu.be/lWAsfZTUrJs?t=560 it might be possible to test screens for dithering using VNC (in theory, without buying expensive dasung). I will try to do such tests, but currently, I do not have eink on android.

            • reaganry
              Is this for windows only? Or there is some kind of AMD control-panel for macos?

              • diop
                You need to navigate deep in that plist file: IOKitPersonalities->AppleIntelFramebufferController->FeatureControl

                FeatureControl is a sub-section 3 layer depth from the root. See my picture again: https://ibb.co/dgqK0MS

                For the file permissions, you may try right-clicking on plist in finder->get info

                And add your account to this list

                • diop replied to this.
                • diop

                  would upgrading OS to Catalina change the drivers installed?

                  Not likely, they seem to bind specific Framebuffer implementation to specific device
                  But worth a try. You can then send me your framebuffer kext so I can look into. Maybe, they added setting there.

                  • diop replied to this.
                  • diop

                    In the meantime, I wonder if you install SwitchResX https://www.madrau.com/srx_download/download.html
                    And reduce colors to Millions of color, instead of billions https://ibb.co/44P4CDQ

                    AND, more important, in System Preferences -> Display -> Color, select Generic RGB Profile instead of Color LCD https://ibb.co/hXz3JmG

                    Then it seems to disable (or at least reduce) dithering effects.

                    You can verify it on gradient image http://www.lagom.nl/lcd-test/gradient.php
                    It should look banded, not linear gradient as here: https://ibb.co/PY4PZ71

                    Can you try it and share the experience?

                  • diop Unfortunately I do not see this hidden parameter for FramebufferCapri:

                    https://ibb.co/5RtdNR8

                    You may try to set Dither instead of mine DitherDisable

                    number = 0 to disable it, if I understood Framebuffer code correctly

                    But I can't promise results. Still worth trying.

                    • diop replied to this.
                    • kextstat | grep Intel

                      That was a typo somewhere

                      Windows

                      I do not have much free space currently for it. But even in MacOS flipping integrated\discrete card switch makes a HUGE difference in how fonts and colors looks. Also now it is relaxing on eyes (my gf also see a difference with and without dithering)

                      • diop replied to this.
                      • diop I'm still on Mojave 10.14.6 (18G95) - didn't upgrade for 32bit reasons.

                        I believe after updating I would need to do config modifications again.

                      • martin Yesterday I screw up with AMD driver modification (every time I set CFG_NO_DITH - I can't restart machine anymore, stuck on logo, about 70%)

                        The way to fix is to load in recovery mode (holding command+R) and copy unmodified kexts from recovery partiyion to your /System/Library/Extensions/

                        Here I did screenshot of commands I use for restoring original kext:
                        https://ibb.co/Gt0X1YH

                        • diop

                          Can I use this code with older versions of MacOS?

                          I think yes. But the final answer depends on the Kext in use. You can list Intel kext's to see if we are using same version. If there are different framebuffers, you can send me framebuffer kext and I can take a look if it has this hidden parameter.

                          when did you notice symptoms

                          I got eye strain after 3-4 months of using MacBook pro. It became worse when I changed lights in my apartment to PWM led strips. Now I do not use LED lightings, just old lightbulb, and desk lamp. Also, I switched my primary screen from MacBook screen to external Displays (Dell UP2414q). Not starring all day into MacBook screen seems to give me relief.

                          Never had any problems with most screens for 20 years. Only some crappy glossy PWM displays made me uncomfortable, but I avoided them with success.

                          how did you find out this kext information?

                          You need some sort of decompiler. I Use IDA64 with hex-rays plugin.
                          Then I went into each suspicious Kext (Show content) and pulled binary into IDA64. You are interested to decompile Unix Executable in *.kext/Contents/MacOS/:
                          https://ibb.co/JCRx1TY

                          Then in IDA - View->Open Subview->Strings (Shift+F12)
                          And try to search for Dither there. x key on the string will show all code usages for this string. Go there and press F5 for hex-rays C-like decompiled code

                          • diop replied to this.
                          • And now I stuck with AMD card dithering. Whenever graphic switches to High-perf (opening Photoshop, Sketch, or simply changing power saving option to Automatic graphics switching), I notice immediate nausea. It is not as bad as with intel, but still not comfortable.

                            It is really hard to explain, it is a sensation that letters are jumping, even when screen image is static. Like visual noise.

                            I wonder if someone can shed a light of what this could be, inside AMDFramebuffer.kext
                            https://ibb.co/pPwDFhf

                            I'm particularly interested in CFG_DEF_DITH. I tried to add this parameter in Info.plist, without success.

                            It seems for me that AMD driver configuration is split and duplicated among several kext, and that is hard to glue together.

                          • I believe it is possible to disable Dithering on Mac Os for Intel Video card (I'm using MacBook pro 2018 with Intel UHD Graphic 630).

                            I was researching driver's code via decompiler and found some interesting configuration parameters.

                            At first, I recommend looking at what kexts are loaded. This can be done using kextstat | grep Intel command.
                            Here is my output:
                            https://ibb.co/tCDQKMY

                            I believe that the underlying issue lays one of the *Framebuffer.kext files, decompiled code for mine com.apple.driver.AppleIntelCFLGraphicsFramebuffer looks like:
                            https://ibb.co/8YGC1Wh

                            AppleIntelFramebufferController::getFeatureControl method seems to load data from underlying Info.Plist

                            All you need to do in order to disable dithering is simply add a new parameter to the section
                            IOKitPersonalities->AppleIntelFramebufferController->FeatureControl
                            in file /System/Library/Extensions/AppleIntelCFLGraphicsFramebuffer.kext/Contents/Info.plist

                            Right-click on FeatureControl section in the xcode, and new Number parameter.
                            name: DitherDisable
                            value: 1

                            Here are the contents of my Info.Plist file (with new parameter included):
                            https://ibb.co/dgqK0MS

                            Side note: in order to actually make changes to plist inside kext, you need to disable security protection
                            https://apple.stackexchange.com/a/251559/320465

                            In short, reboot mac, holding Command+R until recovery utility is loaded.
                            Open terminal there (from top menu), and type:
                            csrutil disable

                            Restart your mac normally. Now you need to add more permissions to be able to edit that file:

                            cd /System/Library/Extensions/AppleIntelCFLGraphicsFramebuffer.kext/
                            sudo chown $USER Contents/
                            cd Contents
                            sudo chown $USER Info.plist

                            Edit plist file as shown above in xcode.

                            Then I'd like to return file ownership back to root user:
                            sudo chown root Info.plist
                            cd ..
                            sudo chown root Contents/

                            Let me know if your eyes are better now. For me it seems to help a lot, but need few days.

                            Here is proof that colors are different after fix (banding appeared on intel):
                            https://ibb.co/pR807tD
                            https://ibb.co/PY4PZ71

                            Note: this will only work for Intel as for now. To check active video card - use activity monitor->Energy tab
                            I was trying to apply similar fix for integrated AMD video card, but stuck on apple logo screen.

                            dev