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

Reconsider need for macOS 10.14-specific DisplayLink vsync workaround? #33125

Closed
follower opened this issue Oct 28, 2019 · 3 comments · Fixed by #33783
Closed

Reconsider need for macOS 10.14-specific DisplayLink vsync workaround? #33125

follower opened this issue Oct 28, 2019 · 3 comments · Fixed by #33783

Comments

@follower
Copy link
Contributor

follower commented Oct 28, 2019

During research for #33116 I encountered suggestions that the underlying V-Sync issue was fixed in a subsequent minor OS point release. [1]

This made me wonder if the workaround added via b53f2d1 was still required.

My primary reason for asking is that I have suspicions that the DisplayLink-based workaround may be causing Godot editor and/or games to hang (when V-Sync is enabled) when my MacBook Pro on Mac OS X 10.9.5 goes to sleep automatically.

I did some preliminary investigations which suggested the DisplayLink thread may not survive the sleep/wake cycle but haven't had the chance to investigate properly.

Next steps:

  • Someone may wish to test if the DisplayLink patch is still necessary for 10.14+
  • At some point I may be able to dig deeper into the sleep issue I observed.

[1] e.g.

[2] Here are some other recent Mac OpenGL patches I noticed in other projects in case we encounter the same issues at some point:

[3] Random other semi-related links I encountered:


Edit: Link to Mac OS sleep-related issue which might be related: #28039


cc: @BastiaanOlij due to being author of the original patch

@bruvzg
Copy link
Member

bruvzg commented Oct 28, 2019

SDL have removed it in https://hg.libsdl.org/SDL/rev/1b6f67e84802

@BastiaanOlij
Copy link
Contributor

If Apple fixed the issue I don't see any reason why we shouldn't undo the DisplayLink fix. It really was just a bandaid imho.

@akien-mga akien-mga added this to the 3.2 milestone Nov 21, 2019
@akien-mga akien-mga changed the title [WIP] Reconsider need for macOS 10.14-specific DisplayLink vsync workaround? Reconsider need for macOS 10.14-specific DisplayLink vsync workaround? Nov 21, 2019
@follower
Copy link
Contributor Author

follower commented Mar 4, 2021

BTW in the unlikely case this information is useful to someone in future, as noted in the above issue, at some point I discovered that almost no CVDisplayLink implementations correctly handle a situation that can occur (via Fast User Switching) where the link is destroyed & then a new link created later:

"In macOS 10.4 and later, the display link thread is automatically stopped if the user employs Fast User Switching. The display link is restarted when switching back to the original user. "

-- https://developer.apple.com/documentation/corevideo/1457281-cvdisplaylinkstop?language=objc

As I understand it this was the cause of a Godot hang I encountered (at the time) of uncertain origin but turned out to be related to the use of Fast User Switching while Godot was running.

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

Successfully merging a pull request may close this issue.

5 participants