aiaf / Stillcolor

Disable temporal dithering on your Mac with this lightweight menu bar app. Designed for Apple silicon Macs.
MIT License
331 stars 13 forks source link

handle external monitor disconnection / reconnection #3

Closed jvo203 closed 6 months ago

jvo203 commented 7 months ago

Hi thanks for the Stillcolor app, it works great on the M1 Ultra Mac Studio. Now to the main issue: when an external e-ink screen is disconnected and then re-connected, the previously disabled dithering comes back on. One needs to either re-start the Stillcolor app, or manually switch "off" and "on" the "Disable Dithering" option in the already-running Stillcolor app.

It would be nice if Stillcolor could automatically re-apply the "Disable Dithering" setting upon a monitor re-connection.

aiaf commented 7 months ago

Is it connected via HDMI? There's currently some basic code to handle monitor connects/disconnects, but I will revise.

jvo203 commented 7 months ago

No, not HDMI. It's connected via USB-C (Thunderbolt?).

europaJDM commented 6 months ago

Hi thanks for the Stillcolor app, it works great on the M1 Ultra Mac Studio. Now to the main issue: when an external e-ink screen is disconnected and then re-connected, the previously disabled dithering comes back on. One needs to either re-start the Stillcolor app, or manually switch "off" and "on" the "Disable Dithering" option in the already-running Stillcolor app.

It would be nice if Stillcolor could automatically re-apply the "Disable Dithering" setting upon a monitor re-connection.

How are you able to tell that it becomes disabled? By looking at the gradient test?

jvo203 commented 6 months ago

No, looking at the gradient test is unnecessary.

The attached black-and-white e-ink monitor literally flashes a lot. E-ink monitors cannot handle colour dithering, the dithering manifests itself in the form of strange flashing as the e-ink panel applies greyscale dithering to represent the slightly different colours that the M1 GPU is sending to it.

There is a very limited number of pseudo-colours that e-ink monitors are capable of displaying. Depending on the e-ink monitor mode, it can be as few as 16, or as many as 256. In any case, this is insufficient to represent the 10-bit colour dithering being applied on the Apple M1 GPU side.

When the Apple Silicon GPU dithering is disabled the greyscale pseudo-colours displayed by monochrome e-ink monitors are stable (do not change), hence there is no visible pixel flashing at all with M1 dithering disabled.

europaJDM commented 6 months ago

No, looking at the gradient test is unnecessary.

The attached black-and-white e-ink monitor literally flashes a lot. E-ink monitors cannot handle colour dithering, the dithering manifests itself in the form of strange flashing as the e-ink panel applies greyscale dithering to represent the slightly different colours that the M1 GPU is sending to it.

There is a very limited number of pseudo-colours that e-ink monitors are capable of displaying. Depending on the e-ink monitor mode, it can be as few as 16, or as many as 256. In any case, this is insufficient to represent the 10-bit colour dithering being applied on the Apple M1 GPU side.

When the Apple Silicon GPU dithering is disabled the greyscale pseudo-colours displayed by monochrome e-ink monitors are stable (do not change), hence there is no visible pixel flashing at all with M1 dithering disabled.

I see, thanks for the explanation

aiaf commented 6 months ago

No, not HDMI. It's connected via USB-C (Thunderbolt?).

Please check the latest release https://github.com/aiaf/Stillcolor/releases/latest

I improved screen connect/disconnected detection. Tell me if it works!

jvo203 commented 6 months ago

Thank you but no, the new release does not yet fix the disconnect/connect via USB-C, at least not with the hardware I am using (Onyx Boox Mira 13.3" e-ink monitor connected via USB-C to the M1 Ultra Mac Studio).

jvo203 commented 6 months ago

I don't know, it worked during the second disconnect that I tried. Perhaps there is some timing parameter at play (i.e. it detects disconnects longer than say 10 seconds but not the shorter ones, I dunno).

jvo203 commented 6 months ago

Thank you, I think the issue can be closed. The re-connects work fine in normal usage when the monitor is disconnected for a "sane" amount of time (i.e. NOT disconnected for less than 1s only, and promptly re-connected).

aiaf commented 6 months ago

Glad it's worked out in this case! I think for the next release I'll probably increase the delay to more than 1 second. Up to 2 seconds should be fine. I was thinking of running a repeating timer that keeps checking dithering status every few seconds, but it seems unwarranted at the moment.