voc / decklink-debugger

Blackmagicdesign DeckLink input debugger
MIT License
23 stars 10 forks source link

Input switching doesn't work #1

Closed lukas2511 closed 6 years ago

lukas2511 commented 6 years ago

The debugger didn't detect any input until I switched it using a different tool. Interestingly it only really worked when i permanently saved the configuration to the card.

With this in mind I added the code for saving the configuration to the debugger and sure enough, it now finds the input even if a wrong input was selected before:

diff --git a/CaptureDelegate.cpp b/CaptureDelegate.cpp
index dcb6820..4f88a64 100644
--- a/CaptureDelegate.cpp
+++ b/CaptureDelegate.cpp
@@ -178,6 +178,8 @@ void CaptureDelegate::SelectNextConnection(void)
        }

        deckLinkConfiguration->SetInt(bmdDeckLinkConfigVideoInputConnection, m_activeConnection);
+       // dear googling people, this may damage your card over time if used in a loop, don't do this.
+       deckLinkConfiguration->WriteConfigurationToPreferences();
        assert(deckLinkConfiguration->Release() == 0);
 }

Unfortunately I guess this writes to the on-card EEPROM every second, so this is not a solution other for manual checks every now and then...

It kinda stinks like a firmware bug as from what I see in the code it shouldn't just reset the used device and other tools work fine with a temporarily changed input device. The only real difference I see is that this tool uses the input-detection feature, which probably no other tool I tried so far used. I guess it would be worth trying to just check for a fixed mode without changing anything else, if that works it would isolate the fault to the detection code in the firmware or sdk.

MaZderMind commented 6 years ago

@lukas2511 which version of desktopvideo did you try and on which card? I'll try to verify this on the MiniRecorder card.

We should probably open an topic in the decklink-forum, afaics neither ffmpeg nor gstreamer does call WriteConfigurationToPreferences so their Connector-Setting (-video_input for ffmpeg, connection for gstreamers decklinkvideosrc-Element, so they should also not work). Would you mind verifying this?

lukas2511 commented 6 years ago

I just tried the duplex branch, the code there seems to work.