jacob-pro / solar-screen-brightness

Automatically adjust monitor / screen brightness at night using sunrise/sunset times
GNU Lesser General Public License v3.0
60 stars 4 forks source link

Failed to list brightness devices - EnumerationMismatch (Windows) #10

Closed mruac closed 2 years ago

mruac commented 2 years ago

Heyo - interesting GUI, the transition feature is definitely a plus, if I can get this working.

It's not able to detect my monitor - ClickMonitorDDC tells me that I have a VC279. It's an ASUS brand

image

I'm using the pre-built release 0.1.0 for Windows.

Edition Windows 10 Home Version 20H2 Installed on ‎19/‎11/‎2020 OS build 19042.1237 Experience Windows Feature Experience Pack 120.2212.3530.0

jacob-pro commented 2 years ago

Please could you try running from the command line - so that you get the full log output? If you used the installer the exe should be in: %APPDATA%\Solar Screen Brightness\solar-screen-brightness.exe

I.e. should look something like:

C:\Users\jacob\AppData\Roaming\Solar Screen Brightness>solar-screen-brightness.exe
[2021-10-18T22:05:57Z INFO  solar_screen_brightness::lock::lock_impl] Acquired lock: solar-screen-brightness-026652976
[2021-10-18T22:05:57Z INFO  solar_screen_brightness::config] Successfully loaded config file
[2021-10-18T22:05:57Z INFO  solar_screen_brightness::controller] Starting BrightnessController
[2021-10-18T22:05:57Z INFO  solar_screen_brightness::tray] Launching tray application
[2021-10-18T22:05:57Z INFO  solar_screen_brightness::controller::apply] Computed base brightness of 70%
[2021-10-18T22:05:57Z INFO  solar_screen_brightness::console] Showing console
[2021-10-18T22:05:57Z INFO  solar_screen_brightness::tui] Cursive thread starting
jacob-pro commented 2 years ago

Actually now I had a look at the source that may not help much, I think it will log the same error. It will be coming from here

And the error itself is coming from a dependency: https://github.com/stephaneyfx/brightness/blob/master/src/lib.rs#L105

I will push a new build that prints a bit more info for you.

jacob-pro commented 2 years ago

@mruac Please can you do the following?

  1. Download and install version 0.1.1
  2. Exit the application
  3. Launch it from the command prompt by running "%APPDATA%\Solar Screen Brightness\solar-screen-brightness.exe"
  4. Copy and paste what error we are getting
mruac commented 2 years ago
[2021-10-18T23:34:42Z INFO  solar_screen_brightness::lock::lock_impl] Acquired lock: solar-screen-brightness-09bd9d529
[2021-10-18T23:34:42Z INFO  solar_screen_brightness::config] Successfully loaded config file
[2021-10-18T23:34:42Z INFO  solar_screen_brightness::controller] Starting BrightnessController
[2021-10-18T23:34:42Z INFO  solar_screen_brightness::tray] Launching tray application
[2021-10-18T23:34:42Z INFO  solar_screen_brightness::controller::apply] Computed base brightness of 100%
[2021-10-18T23:34:42Z ERROR solar_screen_brightness::controller::apply] An error occurred getting monitors: ListingDevicesFailed(EnumerationMismatch) - EnumerationMismatch
[2021-10-18T23:34:42Z INFO  solar_screen_brightness::controller::worker] Brightness Worker sleeping for 32916s
[2021-10-18T23:34:42Z INFO  solar_screen_brightness::console] Showing console
[2021-10-18T23:34:42Z INFO  solar_screen_brightness::tui] Cursive thread starting
[2021-10-18T23:34:42Z INFO  solar_screen_brightness::console::console_impl] Found valid PDC_hWnd in 5.02 ms
jacob-pro commented 2 years ago

Oh no, that is an error I hoped not to see!

Thank you though for the logs, it is really helpful. Sorry it isn't working!

The problem is actually in a dependency so I will open an issue there - and I will update here when I can get it resolved.

mruac commented 2 years ago

So I figured out the issue only happens when showing the display on only one monitor while having an external monitor plugged in. When duplicating, extending or using without an external monitor, SSB works fine (it adjusts brightness of both displays when in extended or duplicated display modes) Hope this helps when diagnosing and fixing the issue!

I should mention that I use an external monitor with the laptop lid open, with the display set to show only on the external monitor. I'm not sure what happens if the laptop lid is closed in this case. (Due to my set up it is a bit of a hassle to close it)

jacob-pro commented 2 years ago

@mruac Thank you for the detailed explanation! I was able to get a fix merged upstream

Please can you try the latest release? https://github.com/jacob-pro/solar-screen-brightness/releases/tag/0.1.2

It is working fine for me now when having only one display enabled in windows settings - hopefully it will work for you too

mruac commented 2 years ago

Heyo - thanks for providing a fix! SSB can now adjust my external monitor just fine. Now it's a matter of getting it to work for real this time... I'll set up a separate issue explaining it.