Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sazconaitbit opened this issue Jan 4, 2021 · 22 comments

Comments

@sazconaitbit
Copy link

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.

@emoacht
Copy link
Owner

emoacht commented Jan 5, 2021

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 emoacht changed the title external display brightness reset to 100% after shutdown/wake from sleep Restore brightness of external display brightness which is reset to 100% after restart/resume Jan 6, 2021
@emoacht emoacht changed the title Restore brightness of external display brightness which is reset to 100% after restart/resume Restore brightness of external display which is reset to 100% after restart/resume Jan 6, 2021
@emoacht
Copy link
Owner

emoacht commented Jan 7, 2021

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 emoacht closed this as completed Jan 13, 2021
@emoacht
Copy link
Owner

emoacht commented Jan 26, 2021

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 emoacht reopened this Jan 26, 2021
@Joonel
Copy link

Joonel commented Feb 14, 2021

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?

@emoacht
Copy link
Owner

emoacht commented Feb 15, 2021

@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.

@Joonel
Copy link

Joonel commented Feb 27, 2021

@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.

@emoacht
Copy link
Owner

emoacht commented Feb 27, 2021

@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.

@Joonel
Copy link

Joonel commented Jun 28, 2021

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.

@emoacht
Copy link
Owner

emoacht commented Jun 30, 2021

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 emoacht pinned this issue Jun 30, 2021
@emoacht
Copy link
Owner

emoacht commented Jul 1, 2021

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.

@Joonel
Copy link

Joonel commented Jul 4, 2021

@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.

@emoacht emoacht unpinned this issue Oct 2, 2021
@emoacht
Copy link
Owner

emoacht commented Dec 24, 2021

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

@githubyouser
Copy link

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

@emoacht
Copy link
Owner

emoacht commented Dec 10, 2022

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.

@githubyouser
Copy link

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.)

@emoacht
Copy link
Owner

emoacht commented Dec 11, 2022

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

@githubyouser
Copy link

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.

@emoacht
Copy link
Owner

emoacht commented Dec 13, 2022

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.

@githubyouser
Copy link

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.

@emoacht
Copy link
Owner

emoacht commented Dec 15, 2022

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?

@githubyouser
Copy link

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. 😄

@banana99ou
Copy link

banana99ou commented Jun 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants