xanderfrangos / twinkle-tray

Easily manage the brightness of your monitors in Windows from the system tray
https://twinkletray.com
MIT License
5.45k stars 179 forks source link

⭐ [TESTERS NEEDED] v1.14.0 Beta #296

Closed xanderfrangos closed 2 years ago

xanderfrangos commented 2 years ago

Hi all,

The next version of Twinkle Tray (v1.14.0) has had significant changes since v1.13.11. I'm looking for people to help test out this update and find any major issues before release.

Here's the current changelog for v1.14.0:

New features & improvements:

  • Added a Windows 11 UI, available as an option for both Windows 10 & 11 users. Additionally, there have been several small tweaks to the UI to better reflect the Windows 10/11 UI.
  • Added settings to show contrast, volume, and power options for supported displays. You can find these features in the new "DDC/CI Features" settings menu.
  • Added an option for idle detection. Your displays can automatically dim after a set amount of time.
  • Added an option to hide your laptop/tablet's display from the brightness flyout when closed or disabled.
  • Updated process for reading monitor info to improve accuracy and responsiveness.
  • Restored WMIC code from v1.13.10 and improved handling of WMIC/WMI failures. (Special thanks to @DustRaider8 and @rp1231 for helping debug the issue.)

Other information:

  • By default, Twinkle Tray no longer gets the latest brightness for DDC/CI displays. This is to prevent issues with some displays and reduce visual glitches. If you would like to restore the old behavior, it's available in the "DDC/CI Features" menu in Settings.
  • I have chosen to go with an emulated "Mica" material over "Acrylic" for Windows 11, as implementing Acrylic with rounded corners is currently impossible in Electron.
  • The "Mica" effect in the Windows 11 UI currently only works on the main display. It also does not correctly detect slideshow wallpapers. If you use slideshow wallpapers, I recommend turning off the Mica effect.

If you'd like to help out, you can download the v1.14.0 beta here: Download Twinkle Tray v1.14.0-beta7

Please let me know if you run into any issues or weirdness with it. If you do try out the beta, please subscribe to this issue so I can notify you of updates. Thanks!

rp1231 commented 2 years ago

@xanderfrangos

The problem doesn't resolve itself by turning of the contrast slider, but it does resolve itself after I turn it off and restart the app.

Here's the raw monitor data when it's not working: { "4&160c887b&2&UID265988": { "id": "\\\\?\\DISPLAY#LGD046F#4&160c887b&2&UID265988", "key": "4&160c887b&2&UID265988", "num": 0, "brightness": 0, "brightnessMax": 100, "brightnessRaw": 0, "type": "wmi", "connector": "unknown", "min": 0, "max": 100, "hwid": [ "DISPLAY", "LGD046F", "4&160c887b&2&UID265988" ], "name": "Display 1", "serial": "0" }, "4&160c887b&2&UID206395": { "id": "\\\\?\\DISPLAY#DELA0B5#4&160c887b&2&UID206395", "key": "4&160c887b&2&UID206395", "num": 1, "brightness": 100, "brightnessMax": 100, "brightnessRaw": 100, "type": "ddcci", "connector": "hdmi", "min": 0, "max": 100, "hwid": [ "\\\\?\\DISPLAY", "DELA0B5", "4&160c887b&2&UID206395", "{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}" ], "name": "DELL S2415H", "serial": "8CN3Y4BI0M8L", "features": { "luminance": [ 100, 100 ], "brightness": false, "contrast": [ 100, 100 ], "powerState": [ 1, 255 ], "volume": false }, "brightnessType": 16, "brightnessValues": [ 100, 100 ] } } Note: I compared the raw data when from when it is working and not working, and the raw data during both times is identical.

rp1231 commented 2 years ago

I have my laptop screen off at the moment, which is why it might show "0" as a value.

xanderfrangos commented 2 years ago

@rp1231 Huh, sounds like something is breaking pretty badly on the flyout itself... I've built a version of Twinkle Tray with extra logging enabled here: https://1drv.ms/u/s!AiWKFpjcSKRQhtdtBQvOsTSv2G1ctg?e=OHvEPZ

Once you've installed that version, can you start Twinkle Tray from the command prompt ("%LocalAppData%\Programs\twinkle-tray\Twinkle Tray.exe" should start it) and paste the log here? Have the contrast slider enabled and try clicking the tray icon before grabbing the log. Hopefully that'll be enough to figure out where it's busted.

rp1231 commented 2 years ago

@xanderfrangos I did that and just copied the text from cmd. Is there a more sophisticated way to get the log?

Anyways, I got a few errors when I clicked on the tray icon with the contrast slider enabled. Have attached the log file. The most relevant errors are at line 22, 75 and 97 log.txt .

xanderfrangos commented 2 years ago

Perfect, thanks! I think I know what's going on from the errors. I'll look at it more when I'm done with work.

That's the best I have for logging at the moment. I should probably just spit it out to a file automatically. 😅

xanderfrangos commented 2 years ago

@rp1231 Give this version a try and let me know if it resolves the contrast slider issue: https://1drv.ms/u/s!AiWKFpjcSKRQhtducj0NqeuFJljBlA?e=syFrdv

rp1231 commented 2 years ago

Yep, this one's working great!

GieltjE commented 2 years ago

When the pc resumes after sleep or when the monitor returns from sleep (power saver mode), the monitor brightness setting is applied again (e.g. monitor is set 33% but twinkletray to 100%, after resume the monitor is on 33% again). Is this a new bug or is this intended behaviour?

xanderfrangos commented 2 years ago

When the pc resumes after sleep or when the monitor returns from sleep (power saver mode), the monitor brightness setting is applied again (e.g. monitor is set 33% but twinkletray to 100%, after resume the monitor is on 33% again). Is this a new bug or is this intended behaviour?

Many monitors will revert to the settings set using the OSD when waking up or being turned back on. Twinkle Tray will attempt to restore the brightness values when Windows resumes from sleep/hibernation. However, if the monitor doesn't wake up in time then the brightness values can't be set. Additionally, there is no way I have found to specifically detect when a monitor wakes up.

Since I've implemented Idle Detection in v1.14.0, I may be able to piggyback off of that to determine when might be a good time to try to restore the last known brightness, but that would still not work 100% of the time.

If you're seeing this discrepancy more with v1.14.0 than earlier versions, it could be a difference in timings (ex. re-applying brightness 3s after Windows wakes up vs 10s). I tweak the numbers a lot. Let me know if that's the case.

xanderfrangos commented 2 years ago

I've updated the beta one more time with various fixes, including some potential improvements to re-applying brightness after waking up. My plan is to publish v1.14.0 on Friday night (EST) if no more major issues pop up.

pc-v2 commented 2 years ago

Even though I have disabled idle timeout, it still dimming after 60sec image image image

Is this a new method for idle detection? I've got a bit confusion here since updating to beta 5

{
  "isDev": false,
  "userClosedIntro": true,
  "theme": "default",
  "icon": "fluent",
  "updateInterval": 500,
  "openAtLogin": true,
  "brightnessAtStartup": true,
  "killWhenIdle": false,
  "remaps": {},
  "hotkeys": {
    "all__dir1": {
      "monitor": "all",
      "accelerator": "Control+Up",
      "direction": 1,
      "active": true
    },
    "all__dir-1": {
      "monitor": "all",
      "accelerator": "Control+Down",
      "direction": -1,
      "active": true
    }
  },
  "hotkeyPercent": 5,
  "adjustmentTimes": [
    {
      "brightness": 30,
      "hour": 7,
      "minute": 30,
      "am": "AM",
      "monitors": {}
    },
    {
      "brightness": 40,
      "hour": 12,
      "minute": 30,
      "am": "PM",
      "monitors": {}
    },
    {
      "brightness": 20,
      "hour": 6,
      "minute": 30,
      "am": "PM",
      "monitors": {}
    }
  ],
  "adjustmentTimeIndividualDisplays": false,
  "checkTimeAtStartup": true,
  "order": [],
  "monitorFeatures": {
    "GSM5BD3": {
      "powerState": false,
      "contrast": false
    }
  },
  "checkForUpdates": true,
  "dismissedUpdate": "v1.13.11",
  "language": "system",
  "settingsVer": "v1.14.0-beta5",
  "names": {},
  "analytics": true,
  "scrollShortcut": true,
  "useAcrylic": true,
  "useNativeAnimation": false,
  "sleepAction": "ps_ddcci",
  "hotkeysBreakLinkedLevels": true,
  "enableSunValley": true,
  "isWin11": true,
  "windowsStyle": "win11",
  "hideClosedLid": false,
  "getDDCBrightnessUpdates": true,
  "detectIdleTime": "0",
  "disableWMIC": false,
  "disableWMI": true,
  "disableWin32": false,
  "autoDisabledWMI": true,
  "disableOverlay": false,
  "uuid": "45e9e737-3aac-4122-827b-9093909a3e44",
  "branch": "master"
}
pc-v2 commented 2 years ago

it's still dimming when watching videos, even with disabling idle detection

pc-v2 commented 2 years ago

solved: i need to use wmic

fhoshino commented 2 years ago

beta5 gives me CPU usage spikes especially when using chrome, have no idea why, going back to 1.13 resloves the problem.

xanderfrangos commented 2 years ago

@pc-v2 Fixed idle detection always running in beta6 (just uploaded). Thanks for catching that. FYI I do not currently have a way to detect if the user is watching a video, so it's running even if you have YouTube going.

@fhoshino Weird. Could you share your settings from the debug menu (bottom left of the Setting window)?

fhoshino commented 2 years ago
{
  "isDev": false,
  "userClosedIntro": true,
  "theme": "dark",
  "icon": "icon",
  "updateInterval": 500,
  "openAtLogin": true,
  "brightnessAtStartup": true,
  "killWhenIdle": false,
  "remaps": {
    "\\\\?\\DISPLAY#BNQ78E1#4&38b8daf7&0&UID50727680#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}": {
      "min": 0,
      "max": 100
    }
  },
  "hotkeys": {},
  "hotkeyPercent": 10,
  "adjustmentTimes": [],
  "adjustmentTimeIndividualDisplays": false,
  "checkTimeAtStartup": true,
  "order": [
    {
      "id": "\\\\?\\DISPLAY#BNQ78E1#4&38b8daf7&0&UID50727680#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}",
      "order": 0
    },
    {
      "id": "DISPLAY\\LEN40A2\\4&38b8daf7&0&UID67568640_0",
      "order": 1
    }
  ],
  "monitorFeatures": {
    "BNQ78E1": {
      "contrast": true
    }
  },
  "checkForUpdates": false,
  "dismissedUpdate": "",
  "language": "system",
  "settingsVer": "v1.14.0-beta6",
  "names": {},
  "analytics": false,
  "scrollShortcut": true,
  "useAcrylic": false,
  "useNativeAnimation": false,
  "sleepAction": "ps",
  "hotkeysBreakLinkedLevels": true,
  "enableSunValley": true,
  "isWin11": false,
  "windowsStyle": "win10",
  "hideClosedLid": false,
  "getDDCBrightnessUpdates": false,
  "detectIdleTime": 0,
  "disableWMIC": false,
  "disableWMI": false,
  "disableWin32": false,
  "autoDisabledWMI": false,
  "disableOverlay": false,
  "uuid": "99d0e2b8-b879-4b3a-8ea3-97baf43c8b27",
  "branch": "master",
  "features": {
    "luminance": true,
    "brightness": true,
    "gain": false,
    "contrast": false,
    "powerState": false,
    "volume": false
  },
  "linkedLevelsActive": false
}
xanderfrangos commented 2 years ago

@pc-v2 I actually did not fix the idle issue, so now there's a beta7. I guess this is what happens when I try to program before coffee. 😅

xanderfrangos commented 2 years ago

Hi all, I've released v1.14.0 to GitHub for non-Windows Store users. I'm sure there are still a few bugs to work out, but I'm hoping having a larger pool of users will help get them identified sooner. Feel free to use this issue to post any bugs you encounter with the release version of v1.14.0. I'm going to hold off on uploading to the Windows Store for at least a few days in case there's something serious that slipped through.

@fhoshino I haven't been able to reproduce the issue, but hopefully if it's a common enough issue I'll get feedback from more people to figure out why you're experiencing the CPU spike.

xanderfrangos commented 2 years ago

v1.14.3 is now available for all Windows Store users! I think it's finally time to close this issue. Thanks again for your help and patience, everyone.