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

Not working after sleep mode #530

Closed
3 tasks done
dnnsppp opened this issue Aug 22, 2021 · 28 comments · Fixed by #550
Closed
3 tasks done

Not working after sleep mode #530

dnnsppp opened this issue Aug 22, 2021 · 28 comments · Fixed by #550
Assignees
Labels
Architecture: arm64 Issue only on arm64 macs (e.g. M1, Pro, Max…) Status: Done Work on this issue is complete. Will be available on next release Type: Bug Issue is a bug (e.g. Crash, …)

Comments

@dnnsppp
Copy link

dnnsppp commented Aug 22, 2021

Before opening the issue, have you...?

  • Searched for existing issues
  • Looked through the wiki
  • Updated MonitorControl to the latest version (if applicable)

Describe the bug

Hi there,

it’s perfect and works totally fine with the new Huawei MateView.
The only issue I have once in a while: Sometimes after my MacBook was in sleep the app is not working / responding.
Both, the function keys for brightness and sliders do not work anymore. After closing and opening the app again, everything works fine.

Anyone knows why this issue can occur?

Cheers
Dennis

Steps to reproduce

Occurs randomly

Expected behavior

This bug occurs randomly. Most of the time it works like magic.

Anything else?

No response

Environment Information (please complete the following information)

- macOS version: 11.5.2
- Mac model: M1, MacBook Pro
- MonitorControl version: 3.0.0 RC1
- Monitor(s): Huawei MateView, 28
- Apple Silicon/M1 (yes or no): yes
@waydabber
Copy link
Member

waydabber commented Aug 22, 2021

After sleep there is an approx. 5 seconds waiting period until all devices are safely resumed. During this time all DDC communications are blocked. After this period the app reloads the display configuration and then enables operation. During this time the brightness and volume OSD will have a lock symbol when you try to use the keyboard to control the display.

Are you sure that you are not trying to use the app within this approx. 5 seconds of safety time?

@waydabber waydabber self-assigned this Aug 22, 2021
@waydabber waydabber added Status: Feedback needed from issue reporter Waiting for issue reporter to provide feedback (see comments) Type: Question Issue is a question → Go to Discussions Tab labels Aug 22, 2021
@dnnsppp
Copy link
Author

dnnsppp commented Aug 22, 2021

I understand that but it does not work even after 10 seconds or 1 minute. I have to restart it.

@waydabber
Copy link
Member

Well, this is obviously not good then. :)

Could you try the following (whithout restarting the app):

  • If you open/close the lid - does it solve the problem?
  • If you connect/disconnect the display - does it solve the problem?

Also please can you send me the screenshot of the Displays tab when it works, and after sleep when it doesn't work?

After sleep if you try to use the brightness keys what happens? Do you see the macOS brightness OSD changing or do you see a lock symbol?

Thank you!

@waydabber waydabber added Type: Bug Issue is a bug (e.g. Crash, …) and removed Type: Question Issue is a question → Go to Discussions Tab labels Aug 22, 2021
@waydabber
Copy link
Member

waydabber commented Aug 22, 2021

Also, you might want to try to change the DDC read polling mode to 'None' - as the issue might be related that after sleep, the app receives erroneus information from the display about supported control ranges and that's why controls look disabled. Setting this option to 'None' will disable this functionality and allow a default control range.

Screen Shot 2021-08-22 at 17 00 09

(Note: you'll have to enable Advanced under General for these options)

@waydabber waydabber added Type: Monitor Issue Issue is specific to a monitor (or monitor related) and removed Type: Bug Issue is a bug (e.g. Crash, …) labels Aug 22, 2021
@dnnsppp
Copy link
Author

dnnsppp commented Aug 22, 2021

Thanks for your feedback. I will try it out and get back to you when I have more information on it.
What display tab are you referring to?

Cheers,
Dennis

@waydabber
Copy link
Member

Hi, I was thinking about the one that is visible on my screenshot above.

  • An other thing that you might try is that you turn off 'Use hardware DDC control' and see if the display is controlled that way (this might let us know if the problem lies with DDC or with display detection in general).

Sorry for the overwhelming amount of things to try. :)

@dnnsppp
Copy link
Author

dnnsppp commented Aug 22, 2021

I will try it out :)

Display tab: I have the same settings as you.

Haha, no problem!

@waydabber
Copy link
Member

Ok. But please look at the Displays tab when the application is in the state when it can't control the display. Also, in this mode you can try disabling Hardware control and also try opening/closing the lid to force a reconfiguration.

@dimitrij2k
Copy link

Same Problem here with LG 32UN880 Display and MacBook Air (M1).

Sometimes it work after sleep, sometimes I have to restart the app. Maybe its possible to "restart the service" of the app after sleep?! But I will try the DDC read polling later...

@waydabber
Copy link
Member

waydabber commented Aug 23, 2021

Hi, there is no service to talk of actually.

I'd need to know these details to understand things better:

  • If you open/close the lid when the app is in an unresponsive state - does it solve the problem?
  • If you connect/disconnect the display - does it solve the problem?
  • What is happening when you try to use the brightness keys? Does the OSD appear and how does it behave, does it have a Lock symbol or not?
  • If 'Use hardware DDC control' is off, then is the brightness changing via software (this might let us know if the problem lies with DDC or with display detection in general).
  • Does the issue happen with polling set to 'None'?
  • How does the Displays tab look before sleep and after sleep when the issue is happening?

Thank you very much for your help!

@dimitrij2k
Copy link

dimitrij2k commented Aug 23, 2021

I set the ddc to "none" and reconnected the Macbook a few times, put it into sleep and can't provoke the misbehavior. But I try the next couple days to reproduce the bug - hopefully the ddc setting was the fix and the problem is gone.

so far, MonitorControl is one of the most essential tools for the MacBook! Thanks a lot... you`re awesome!

EDIT: Error come back after long sleep period. I captured a video... I will upload it tomorrow....

@waydabber
Copy link
Member

Hi @dimitrij2k thank you! There is a five seconds delay after sleep to let everything settle and the display wake up properly (displays with slower firmares or CCFL backlights take a lot of time waking up).

Probably there should be some advanced settings to have the ability to fine tune things:

  • Wake-up wait period after sleep
  • Wait period after display reconfiguration
  • Show 'Redetect displays' option in the menu.

@dimitrij2k
Copy link

dimitrij2k commented Aug 24, 2021

@waydabber thank you, for your help. Even after a longer Period of waiting, the Control don't work. I created a Video, to show the misbehavior.

What I found out:

  • Boot MacBook Air (M1) and start Software - works
  • Connect/Reconnect USB-C Cable - works
  • Sleep/Wake-up (less then a some minutes) - works
  • Sleep/Wake-up after a longer Periode - don't work! (I think it was 30+ minutes of sleep)

The last Scenario is shown in the Video: https://youtu.be/gSTKxvRyGno

All the Questions will be replied soon...

UPDATE 2

Second try. Put the Macbook into sleep (cable connected) and after 15/20min it was there again.

If you open/close the lid - does it solve the problem?
**Yes, it solved the Problem! even after 5 hours sleep, the bug don't came back after open and close the lid once it was connected**

If you connect/disconnect the display - does it solve the problem?
What is happening when you try to use the brightness keys? Does the OSD appear and how does it behave, does it have a Lock symbol or not?
If 'Use hardware DDC control' is off, then is the brightness changing via software (this might let us know if the problem lies with DDC or with display detection in general).
Does the issue happen with polling set to 'None'?
How does the Displays tab look before sleep and after sleep when the issue is happening?

@waydabber
Copy link
Member

Thank you! I think after a longer sleep the 5 seconds of expected recovery period might not be enough for some setups. Thank you for your diligence regarding the other questions, hopefully those answers will help to further narrow down the problem.

@waydabber
Copy link
Member

@dimitrij2k
Copy link

Unfortunately I have a lot to do in my job, so I can't complete the "bug hunting". But open the lid and close it again seems (in the couple few days) to eliminate the problem. So it don't need to restart the app, to fix the problem. Very interesting! But I will answer all of your questions. hopefully this weekend!

@krissp
Copy link

krissp commented Aug 29, 2021

Thanks, @waydabber for looking into this

I also seem to be running into the described behavior/issue.

  • M1 MacBook Pro
  • MacOS 11.5.1
  • DELL U2520D with USB-C connection

So far, can confirm restarting the app, or opening/closing the lid re-enables brightness control after it's stuck following a long sleep.

Will also try to help you answer more of the debug questions from my setup... just waiting for it to get stuck again :)

@waydabber
Copy link
Member

Thank you for the info!

  • If you open/close the lid when the app is in an unresponsive state - does it solve the problem? - Yes
  • If you connect/disconnect the display - does it solve the problem? - Probably Yes
  • What is happening when you try to use the brightness keys? Does the OSD appear and how does it behave, does it have a Lock symbol or not? - Unknown
  • If 'Use hardware DDC control' is off, then is the brightness changing via software (this might let us know if the problem lies with DDC or with display detection in general). - Unknown
  • Does the issue happen with polling set to 'None'? - Unknown
  • How does the Displays tab look before sleep and after sleep when the issue is happening? - Unknown

It would be great if I could get the answers for the unknowns. The issue might be that after a long sleep simply a longer wait period is needed until the app reconfigures the display but other factors might be involved as well.

Btw. how long it takes from initiating wake to the desktop to appear normally with your setup after a long sleep?

@krissp
Copy link

krissp commented Aug 29, 2021

  • If you open/close the lid when the app is in an unresponsive state - does it solve the problem? - Yes
  • If you connect/disconnect the display - does it solve the problem? - Confirmed, yes
  • What is happening when you try to use the brightness keys? Does the OSD appear and how does it behave, does it have a Lock symbol or not? - For the external display, OSD does not appear – as if the brightness key press is completely unrecognized. This bit probably isn't relevant, but for what it's worth when I have the built-in display open, the built-in's brightness OSD appears and its control continues working as expected
  • If 'Use hardware DDC control' is off, then is the brightness changing via software (this might let us know if the problem lies with DDC or with display detection in general). - Interesting... brightness is not changing via software, and it actually seems like "Control method: Software" isn't working in any condition for this external display. It seems I need "Use hardware DCC control" checked for the control to work. Not sure if this helps out, but curiously, when operating under "Control method: Software", the behavior seems identical to the original issue described here (can't control brightness, and OSD does not appear when brightness keys are pressed)
  • Does the issue happen with polling set to 'None'? - edit: Yes, it still happens
  • How does the Displays tab look before sleep and after sleep when the issue is happening? - it looks the same before and after, see attached screenshot Screen Shot 2021-08-29 at 2 48 03 PM

Btw. how long it takes from initiating wake to the desktop to appear normally with your setup after a long sleep?

I'm going to need to pay closer attention and follow up on this. It doesn't feel noticeably long though (short sleep vs. long sleep), a couple of seconds (maybe less) to wake.

@waydabber
Copy link
Member

'Interesting... brightness is not changing via software, and it actually seems like "Control method: Software" isn't working in any condition for this external display.'

For this to work you also need to have 'Enable software dimming if required' enabled in General. This is now enabled by default but if you had an earlier beta it might be disabled due to settings saved. Can you check if this option is enabled? Thank you!

@krissp
Copy link

krissp commented Aug 29, 2021

You're right. I had an earlier beta and 'Enable software dimming [...]' was off. After taking care of that, brightness is now changing.

@waydabber
Copy link
Member

I didn't mean this to be a workaround, just mentioned the fact that probably this is the problem with that.

Opening/closing the lid or reconnecting the display both forces MC to redetect displays. The fact that this solves the problem probably means that for some reason MC does not properly detects the service port for the display after a long sleep as it might not be available yet (or maybe for some reason the service port changes). I'll have to look into this issue and try to replicate it.

@krissp
Copy link

krissp commented Aug 29, 2021

Yep, I walked that back shortly :) -- edited my previous comment after realizing that software dimming is literally just darkening colors.

@krissp
Copy link

krissp commented Aug 29, 2021

You mentioned "maybe for some reason the service port changes", any way I can help you check this?

@dimitrij2k
Copy link

I tried to make more tests today, but i cant get my Macbook run into the bug. I wanted to reproduce it, but it worked every time! Since i opened once the macbook while the bug comes up, it works now every time. I reboot a couple times my machine, but not run into the bug. Strange… but i will male more tests the next days…

@waydabber
Copy link
Member

Hi all, I experienced this problem myself as well today so at least I know what we are talking about. Problem is I can't seem to induce it again, especially in a controlled environment (so I can debug the code), but I'll try. :)

@waydabber waydabber added Type: Bug Issue is a bug (e.g. Crash, …) Architecture: arm64 Issue only on arm64 macs (e.g. M1, Pro, Max…) and removed Type: Monitor Issue Issue is specific to a monitor (or monitor related) Status: Feedback needed from issue reporter Waiting for issue reporter to provide feedback (see comments) labels Aug 31, 2021
@waydabber
Copy link
Member

Ok, I was able to reproduce the issue reliably and was able to debug it. The issue is that there are some instances when the display configuration changes with regards to the service port that the app uses to communicate with the display on Apple Silicon but macOS does not send a reconfiguration event so the app is trying to communicate using an outdated service port. This seems to happens whenever during sleep the display looses power or enters a deep sleep so the link between the mac and the display is severed, but the display cable remains attached during sleep.

I'll change the sobering logic (this happens after sleep) so the app always does a display reconfiguration no matter what.

@waydabber waydabber added the Status: In progress Issue currently being worked on label Aug 31, 2021
@waydabber
Copy link
Member

Here is an unsigned test build that should fix this issue if somebody would like to try it out. This requires you to click 'Open Anyway' in Preferences/Security. The source of this build is here - if you don't trust in unsigned builds and want to build it yourself. Thank you!

@waydabber waydabber added Status: Done Work on this issue is complete. Will be available on next release and removed Status: In progress Issue currently being worked on labels Aug 31, 2021
@waydabber waydabber added this to Needs triage in Bug tracking via automation Sep 1, 2021
@waydabber waydabber linked a pull request Sep 1, 2021 that will close this issue
waydabber added a commit that referenced this issue Sep 1, 2021
- Fixed not working after sleep mode for some on Apple Silicon Not working after sleep mode #530
- Fixed some LG and Samsung displays having problems with Mute (improved 'Enable Mute DDC command') - LG Monitor: have to unmute manually after muting #170
- Fixed app not working with multiple identical monitors on Intel - App does not work with multiple identical monitors #49
- Added 'Safe Mode' option - pressing the Shift key during startup resets preferences and disables DDC read.
- Upon first start if DDC is unreadable, default brightness/volume/contrast values are now set to a sensible 75% instead of 0%
- DDC write commands are issued twice on Intel (as it already was on Arm64) to improve stability on some setups.
- Make sure DDC communications don't happen in parallel when both slider menu and keyboard is used (this might have caused problems with some docks with multiple display outputs).
- Fixed volume control feedback audio (clicking sound) during key repeat (it should play on keyup only as this is the macOS standard).
- Fixed duplication of volume control feedback audio if there are multiple external displays and 'Change... for all screens' is enabled.
- Internal DDC library for Intel (based on the work of reitermarkus)
Bug tracking automation moved this from Needs triage to Closed Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture: arm64 Issue only on arm64 macs (e.g. M1, Pro, Max…) Status: Done Work on this issue is complete. Will be available on next release Type: Bug Issue is a bug (e.g. Crash, …)
Projects
Development

Successfully merging a pull request may close this issue.

4 participants