sabaatworld / HyperionScreenCap

Screen capture program for Hyperion ambilight. Updated to support DirectX 11, multiple displays and multiple Hyperion servers.
MIT License
118 stars 18 forks source link

System.Exception: Failed to initialize screen capture: HRESULT: [0x80070057] #39

Open marianaghub opened 3 years ago

marianaghub commented 3 years ago

Hi, I can't make the ambilights work with this Hyperion Screen Cap. I tested it with the android app "Hyperion Grabber" and it connected to my pi4, working as expected.

However, when I begin the connection to my windows 10, I can see for a short time the LED lights colour change to white and my computer's current screen shows on the Hyperion LED visualization tab port 8090. Then I get the error "Failed to initialize screen capture: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: Incorrect parameter", my LED lights go back to the preset 'background colour" and my computer's current screen stops showing on Hyperion's "LED visualization".

I have a dell Inspiron 5000, I installed all dependencies recommended and also set up the screen scale to 100%, but it still doesn't work. Also, at the short time I can see the screen in "LED visualization", it looks like it's receiving two screens, one covering the whole area and a smaller one inside. I attached the log file.

monitors

screen2

hyperion-screen-capture - Copia.log

I'll be glad if we can find a solution, Thanks!

sabaatworld commented 3 years ago

For reference, I found this doc which describes this error: https://docs.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgioutput1-duplicateoutput

I think what's happening is that you laptop might be using the Intel card normally and as soon as you run Hyperion Screen Capture, it may be trying to use Nvidia card. This application would still continue to use the Intel card and it will fail.

As a temporary solution, try disabling graphics auto-switching and choose either Intel or the Nvidia card.

I probably cannot do it right now but we need to add a feature to this application which would automatically switch between different graphic cards.

GitEm420 commented 3 years ago

Hey Guys,

I'm having the same issue with the same error. The app crashes after only a few short minutes of working.

Here is the log file

System.Exception: Failed to initialize screen capture: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect. ---> SharpDX.SharpDXException: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.

at SharpDX.Result.CheckError() in C:\projects\sharpdx\Source\SharpDX\Result.cs:line 195 at SharpDX.DXGI.Output1.DuplicateOutput(IUnknown deviceRef) in C:\projects\sharpdx\Source\SharpDX.DXGI\Generated\DESKTOP_APP\Interfaces.cs:line 3770 at HyperionScreenCap.DX11ScreenCapture.InitDesktopDuplicator() at HyperionScreenCap.DX11ScreenCapture.Initialize() at HyperionScreenCap.Helper.HyperionTask.InitScreenCapture() --- End of inner exception stack trace --- at HyperionScreenCap.Helper.HyperionTask.InitScreenCapture() at HyperionScreenCap.Helper.HyperionTask.StartCapture() 2020-12-10 23:01:26 [INFO] [7] HyperionScreenCap.Helper.HyperionTask.StartCapture:0 - HyperionTask[ConfigurationId: a1825c]: Will re-initialize screen capture on retry 2020-12-10 23:01:26 [INFO] [7] HyperionScreenCap.Helper.HyperionTask.StartCapture:0 - HyperionTask[ConfigurationId: a1825c]: Waiting before next screen capture attempt 2020-12-10 23:01:27 [INFO] [7] HyperionScreenCap.Helper.HyperionTask.InitScreenCapture:0 - HyperionTask[ConfigurationId: a1825c]: Initializing screen capture 2020-12-10 23:01:27 [ERROR] [7] HyperionScreenCap.Helper.HyperionTask.StartCapture:0 - HyperionTask[ConfigurationId: a1825c]: Exception in screen capture attempt: 28

I have disabled HDCP and I'm not sure what else to try. Please let me know if there is a work around or when this enhancement will be released.

Thanks very much in advance.

Monitor info image

sabaatworld commented 3 years ago

Did you try switching of graphic card auto switching?

marianaghub commented 3 years ago

Nope, nothing has changed, same problems happened.

I first tried disabling one of the graphic cards, the problem persisted. I also attempted changing performance modes, following the link below, but also didn't have any progress.

https://pureinfotech.com/set-gpu-app-windows-10/#:~:text=Click%20the%20Options%20button.&text=Set%20the%20graphics%20preference%20you,is%20your%20integrated%20graphics%20processor.

error2-01-21