sabaatworld / HyperionScreenCap

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

[Feature request] Add enable/disable-toggle to individual capture sources #33

Closed laurens94 closed 3 years ago

laurens94 commented 5 years ago

I have two monitors and each monitor has a Raspberry Pi which is running Hyperion. Whenever I use monitor 0 and monitor 1 is not in use, Hyperion Screen Capture gives the following output in the logs and stops capturing:

2019-09-26 13:21:38 [INFO] [3] HyperionScreenCap.Helper.HyperionTask.InitScreenCapture:0 - HyperionTask[ConfigurationId: 800033]: Initializing screen capture
2019-09-26 13:21:38 [ERROR] [3] HyperionScreenCap.Helper.HyperionTask.StartCapture:0 - HyperionTask[ConfigurationId: 800033]: Exception in screen capture attempt: 29
System.Exception: Failed to initialize screen capture: HRESULT: [0x887A0002], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_NOT_FOUND/NotFound], Message: The object was not found. If calling IDXGIFactory::EnumAdaptes, there is no adapter with the specified ordinal.
 ---> SharpDX.SharpDXException: HRESULT: [0x887A0002], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_NOT_FOUND/NotFound], Message: The object was not found. If calling IDXGIFactory::EnumAdaptes, there is no adapter with the specified ordinal.

   at SharpDX.Result.CheckError()
   at SharpDX.DXGI.Adapter.GetOutput(Int32 outputIndex)
   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()
2019-09-26 13:21:38 [INFO] [3] HyperionScreenCap.Helper.HyperionTask.StartCapture:0 - HyperionTask[ConfigurationId: 800033]: Will re-initialize screen capture on retry
2019-09-26 13:21:38 [ERROR] [3] HyperionScreenCap.Helper.HyperionTask.StartCapture:0 - HyperionTask[ConfigurationId: 800033]: Max screen capture attempts reached. Giving up.
2019-09-26 13:21:38 [ERROR] [3] HyperionScreenCap.NotificationUtils.Error:0 - Error notification: Failed to initialize screen capture: HRESULT: [0x887A0002], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_NOT_FOUND/NotFound], Message: The object was not found. If calling IDXGIFactory::EnumAdaptes, there is no adapter with the specified ordinal.

A workaround now is to delete the capture source of monitor 1 and reconfigure it when I need it again.

Having a checkbox to enable/disable each capture source would fix this.

It could be placed left from the ID column:

afbeelding

laurens94 commented 4 years ago

Quick & dirty fix: change HyperionTask.cs line 168:

afbeelding

sabaatworld commented 3 years ago

I have implemented this feature and code is pushed out. Will include in next release.

sabaatworld commented 3 years ago

New release is out now. Please open another issue if it does not work.