Monitorian icon indicating copy to clipboard operation
Monitorian copied to clipboard

Restore brightness of external display which is reset to 100% after restart/resume

Open sazconaitbit opened this issue 5 years ago • 24 comments

Hi,

I'm subscript user from the Microsoft store, I use the app to control my external display brightness is working perfectly, but when I sleep my laptop and wake up the external display brightness is reset to 100% same happen after shutdown.

Would be nice if the app store the latest set value so when i wake up my computer the brightness return to the last value.

Thanks.

sazconaitbit avatar Jan 04 '21 14:01 sazconaitbit

Thank you for the suggestion. Could you provide probe.log and operation.log which includes multiple cycles of suspend-resume to get exactly when a reset happens?

emoacht avatar Jan 05 '21 13:01 emoacht

Having thought about it, there is a technical difficulty to determine which brightness value is worth to be stored.

  • First of all, 100% is perfectly valid value and so we cannot tell whether a value is reset or not from the value itself.
  • Second, the suspend event by the OS is not reliable. Usually, the OS is too busy when suspend-resume events happen.
  • Third, the resume event by the OS can be easily filtered out while the succeeding events can not.
  • Fourth, the manual update by clicking the notification icon can be invoked anytime but there is no clue to tell whether the value is reset or not at that moment.

emoacht avatar Jan 07 '21 02:01 emoacht

I temporarily added the function to restore the brightness which is previously set in this app after reconnect/restart/resume for Microsoft Store version (Ver 2.11). It is accessible from Restore set brightness in the menu in the same way as probe.log.

menu

I would like to ask any interested user to report the result along with operation.log which includes the suspend-resume cycles because I am not quite sure what will happens during the cycles in each user's system.

If the function works well, it will be included in add-on features.

emoacht avatar Jan 26 '21 02:01 emoacht

I have the same problem but the deal in my monitor. It doesn't save brightness changes so it always resets the brightness after turning off. I think its possible to restore last brightness value after turning monitor on, isn't it?

Joonel avatar Feb 14 '21 11:02 Joonel

@Joonel Your idea is basically same as what I implemented. The technical difficulty is in how to store and determine the last brightness level before PC suspends. For this purpose, it is necessary to store the brightness levels in memory every time when it changes and save them to storage when the PC turns off. Maybe, the consumption of resources for these operations are negligible. If you try it, please post the logs.

emoacht avatar Feb 15 '21 15:02 emoacht

@emoacht I turned on 'restore set brightness'. I noticed the function in action sometime, but it seems that it doesn't work properly. Also, one of my monitors is losing by Monitorian after its restarting monitor (smth like 'display doesn't support the function').

here is my logs operation.log hope it'll help.

Joonel avatar Feb 27 '21 13:02 Joonel

@Joonel Thank you for the log. Regarding restore function, I could only find successful cases. Could you explain why you think it does not work properly? Regarding the message, I found that your monitor "G34WQC" has a habit of not responding to the command when 1 minute passed after resume. It's interesting but odd.

emoacht avatar Feb 27 '21 14:02 emoacht

Hi. Monitorian had been working for months somehow expectable, but now I discovered some issues. Firstly, it restores the brightness after a PC sleep, but not after login in (a screen is turning off in a few minutes after pressing Win + L so my monitor resets the brightness at next startup). Secondly (it may be my special problem), Monitorian is losing my monitor time to time. Here is a log file.

Joonel avatar Jun 28 '21 19:06 Joonel

Thanks for the log. Regarding the windows lock, you mean the following part? The brightness changed 4 times in row in a very short period.

[Date: 27.06.2021 17:30:44 Ver: 2.19.0.0]
HandleBrightnessChange "G34WQC"
 BEF [Save] 65 - 65
 AFT [Save] 65 - 65

[Date: 27.06.2021 17:30:47 Ver: 2.19.0.0]
HandleBrightnessChange "G34WQC"
 BEF [Save] 65 - 95
 AFT [Save] 95 - 95
HandleBrightnessChange "G34WQC"
 BEF [Save] 95 - 100
 AFT [Save] 100 - 100
HandleBrightnessChange "G34WQC"
 BEF [Save] 100 - 70
 AFT [Save] 70 - 70
HandleBrightnessChange "G34WQC"
 BEF [Save] 70 - 100
 AFT [Save] 100 - 100

[Date: 27.06.2021 17:44:43 Ver: 2.19.0.0]
CheckTransition (IsTransition: True)

[Date: 27.06.2021 17:44:43 Ver: 2.19.0.0]
OnMonitorsChangeInferred (PowerWatcher- Suspend 0)

Regarding the detection, the monitor seems not to be controllable sometimes. It cannot be helped by this app.

emoacht avatar Jun 30 '21 10:06 emoacht

I am not sure when those changes happened but going to change not to save the brightness after the OS locks and to restore it when the OS unlocks.

emoacht avatar Jul 01 '21 12:07 emoacht

@emoacht Now it works as expected (brightness is restoring after PC unlock 🥳) except times when my monitor isn't responding... I didn't think that a cheap monitor could be bad in that simple function.

Joonel avatar Jul 04 '21 07:07 Joonel

This restore function is improved to take into account monitors' unison state. See #271

emoacht avatar Dec 24 '21 00:12 emoacht

This is still an issue for me, even with "restore brightness on reconnection" checked. I don't remember having this issue with Windows 10 and the same monitor, but after getting a new laptop with Win 11, my external monitor always comes on way too bright after resuming from sleep, and I have to manually adjust it every single time back to where it is supposed to be. Logs attached. Let me know if there's any other troubleshooting I can help with. operation.log probe.log

githubyouser avatar Dec 09 '22 18:12 githubyouser

Thanks for the log. But the operation.log is too short to track changes. Could you repost the longer one like 1 hour which includes multiple suspend/resume and disconnect/reconnect of "Q24i-10"?

Particularly, the log at 11:59:09 indicates strange behavior.

[Date: 12/9/2022 11:56:09 AM Ver: 3.15.0.0]
HandleBrightnessChange "Generic PnP Monitor (Internal)"
 [Save] 30 <- 30
HandleBrightnessChange "Q24i-10"
 [Save] 0 <- 0
HandleBrightnessChange "Q24i-10"
 [Save] 0 <- 13
HandleBrightnessChange "Q24i-10"
 [Save] 13 <- 0

Something other than this app set brightness of "Q24i-10" to 13 then to 0 within 1 sec.

emoacht avatar Dec 10 '22 00:12 emoacht

Here's a longer log. operation.log I often have to "bump" the brightness of "Q24i-10" quickly up and then back down to make it drop back to where it's supposed to be. (I keep it at 0 normally, and when the laptop resumes, it shows 0 but is clearly brighter. So I just bump it up a little and then back down, and it goes to the proper brightness.)

githubyouser avatar Dec 10 '22 23:12 githubyouser

it shows 0 but is clearly brighter Wierd. If a monitor does not report correct value, it will be difficult to handle such monitor.

emoacht avatar Dec 11 '22 03:12 emoacht

Yeah, it is kinda weird, but what's strange is that I don't remember this ever happening with my old laptop (running Windows 10) with the same monitor. So I'm not sure if it's a Windows 11 bug, or if it's some sort of driver issue that didn't exist on my older laptop.

githubyouser avatar Dec 12 '22 15:12 githubyouser

I added an experimental code to Microsoft Store version Ver 3.15.1. This version will ignore the brightness reported by a monitor when restoring the brightness.

So, could you udapte to this version and check if this code makes any difference? To enable it, you need to input /restore hard in Command-line arguments.

emoacht avatar Dec 13 '22 10:12 emoacht

Awesome, thanks! After inputting the command line arguments and restarting Monitorian the brightness goes down to 0 without having to manually "bump" it up and back down. It also seems to be working when I wake up the computer from sleeping.

However, it still doesn't seem to work when the computer screen times out (after 5 minutes). The computer isn't actually sleeping, it just shuts off the display. When I wiggle the mouse to turn the display back on, then the external monitor wakes up at high brightness and does not drop down to 0.

githubyouser avatar Dec 13 '22 16:12 githubyouser

However, it still doesn't seem to work when the computer screen times out (after 5 minutes). The computer isn't actually sleeping, it just shuts off the display.

This restore function is not originally intended for these events but there no particular problem in covering it. Could you try Ver 3.15.2 in the same manner?

emoacht avatar Dec 15 '22 04:12 emoacht

I think it's working! 🥳 The external monitor "wakes up" too bright, but after a few seconds it dims back down to 0.

Thank you so much! I don't think I've ever had such a quick response/fix to a software issue before. I really appreciate your time and skill to help me out. 😄

githubyouser avatar Dec 15 '22 21:12 githubyouser

Hey, can you make contrast stay where i set it after reboot? i got very old monitor and could salvage it thanks to monitorian. since it's contrast was so bad with brocken buttons and monitorian made me able to adjust contrast? but after reboot contrast resets to 84? or something. and it a bit annoying to set it manually after every bootup

banana99ou avatar Jun 01 '23 11:06 banana99ou