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

Getting Error: No Displays Detected try dropping screen option #171

Open
NirmanSonawane opened this issue Aug 26, 2020 · 8 comments
Open
Labels

Comments

@NirmanSonawane
Copy link

Describe the bug
In Mac os 10.15.5, when i call screenshot({
format: 'png',
filename: path.join('check.png')
})
I am getting Error: No Displays Detected try dropping screen option

Expected behavior
The screenshot should get captured

Screenshots
system_profiler SPDisplaysDataType; output
Screenshot 2020-08-26 at 12 02 10 PM

Environment (please complete the following information):

  • OS: [Mac]
  • Engine [Electron]
  • Version [10.15.5]

Additional context
Add any other context about the problem here.

@bencevans
Copy link
Owner

Hi @NirmanSonawane have you given it the Mac permission #156 (comment)

@NirmanSonawane
Copy link
Author

Hi @NirmanSonawane have you given it the Mac permission #156 (comment)

yes

@NirmanSonawane
Copy link
Author

NirmanSonawane commented Aug 26, 2020

In my other machine, it is getting captured,
the only difference is that in the machine in which it is not working
the system_profiler SPDisplaysDataType output
has no display params
and the one in which it is working has display info
I am not able to figure out why

@bencevans
Copy link
Owner

🤔 Hmmm, I'm really not sure. From a quick browse I can only find this StackExchange question that has some familiarity to this issue and a suggestion that the graphics card needs to be replaced and 'Apple increased the warranty on the graphics card because of a too high number of failures on the specific card' - https://apple.stackexchange.com/questions/12366/graphic-cards-issue

@bencevans
Copy link
Owner

@NirmanSonawane did you find anything further?

@NirmanSonawane
Copy link
Author

@NirmanSonawane did you find anything further?

Nope, I had to remove the main display detection code and directly execute the screencapture process
For now, it works for me, will have to check with multiple displays attached though

@quentinwendegass
Copy link

Hey, I'm running into the same issue where no physical screen is connected to our Mac mini. We use a HDMI dummy plug to simulate a connected display so the GPU isn't throttled, but system_profiler SPDisplaysDataType doesn't return any displays unfortunately with this plug. When I use the screencapture tool directly I can take a screenshot without problems.

Maybe an option could be added to ignore how many screens are available and just try to execute the screencapture command? Or maybe this could be the default behavior when no screens are available (not sure which implications that would have)?

@ArtemAvramenko
Copy link

ArtemAvramenko commented Sep 27, 2022

@bencevans I have tested all possible scenarios with and without physical displays enabled, with one and two monitors, via VNC, and via Chrome Remote Desktop. When a monitor is connected, gpu.Displays returns it in the list.

With remote access and physical monitors unplugged, this method returns nothing. This problem became especially critical after office workers switched to remote work.

Nevertheless, capturescreenshot works if you specify a single file name. So it will be enough just to add a fallback:

if (displayinfos.length === 0) {
  displayinfos.push({ name: 'Remote', primary: true })
}

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

No branches or pull requests

4 participants