bitfocus / companion-module-bmd-teranex

MIT License
1 stars 5 forks source link

Add support for Teranex Mini Optical to HDMI 12G (and others) #14

Open peternewman opened 1 year ago

peternewman commented 1 year ago

I don't know if this should go in here or a different module?

Here's what it spews when you first connect for it (sorry for the wonky formatting), it's also on port 9995 rather than the one the others use:

PROTOCOL PREAMBLE:
                  Version: 0.1

                              TERANEX MINI DEVICE:
                                                  Model: Optical to HDMI
                                                                        Label: O                                                                                                             ptical to HDMI
              Smart Panel: false
                                Unique ID: 1A2B0C0DE164
                                                       Number of LUTs: 2

                                                                        NETWORK:
                                                                               D                                                                                                             ynamic IP: 0
            Static address: 192.168.10.150
                                          Static subnet: 255.255.255.0
                                                                      Static gat                                                                                                             eway: 192.168.10.1
                  Current address: 0.0.0.0
                                          Current subnet: 0.0.0.0
                                                                 Current gateway                                                                                                             : 0.0.0.0

         VIDEO INPUT:
                     Digital Input: Auto

                                        AUDIO OUTPUT:
                                                     Sample rate conversion: fal                                                                                                             se
  Swap channels 3 and 4: false
                              XLR format: Analog
                                                Timecode enabled: false
                                                                       Gain: XLR                                                                                                              Analog Left 64
               Gain: XLR Analog Right 64
                                        Assign: XLR Analog Stereo SDI Stereo 1-2
                                                                               R                                                                                                             outing: XLR Analog Stereo SDI Stereo 1-2
                                        Gain: XLR AES/EBU Stereo 1-2 64
                                                                       Gain: XLR                                                                                                              AES/EBU Stereo 3-4 64
                      Assign: XLR AES/EBU Quad SDI Quad 1-4
                                                           Routing: XLR AES/EBU                                                                                                              Quad SDI Quad 1-4
                 Assign: HDMI Oct SDI Oct 1-8
                                             Routing: HDMI Oct SDI Oct 1-8

                                                                          VIDEO                                                                                                              OUTPUT:
       HDMI clamping: true
                          HDMI resync: true
                                           Lut on loop: false
                                                             Lut selection: none

                                                                               L                                                                                                             UT 0:
     Lut Name: Monochrome
                         Lut Kind: 3Dx33x10b

                                            LUT 1:
                                                  Lut Name: Blackmagic 4.6K Film                                                                                                              to Rec709
          Lut Kind: 3Dx33x10b

                             END PRELUDE:

Is that enough info or does more want gathering?

peternewman commented 1 year ago

There's also some stuff here: https://github.com/Tedcharlesbrown/Pixera-TCB/blob/main/00-Pixera/01-Control/v1.9.149/Drivers/BlackmagicDesign/TeranexMini.json

Or: https://github.com/kasperskaarhoj/SKAARHOJ-Open-Engineering/blob/master/ArduinoLibs/ClientBMDTeranex/ClientBMDTeranex.cpp

peternewman commented 1 year ago

To be clear, I'm happy to have a go at adding this support, it's really more a case of whether the Teranex standards converters, which I assume this was written for: https://www.blackmagicdesign.com/products/teranex

Are more or less different than: https://www.blackmagicdesign.com/products/teranexmini

And potentially some of the others listed at the bottom of Broadcast Converters here (which also feature the Teranex name): https://www.blackmagicdesign.com/products

Obviously the protocol seems to match and there will be some other commonality, but maybe the number of different models and presumably range of different controls and parameters means they should be a different module?

peternewman commented 11 months ago

I've got some initial actions and feedbacks working fine already, so this is probably time where a decision needs to be made regarding splitting into two different modules, for the newer Teranex Mini 1/3 rack width units or not. Otherwise if they're staying combined, I see you mentioned some auto-detect code @krocheck, could you point to where that is in another module please?

          Ugh ... I can probably do it.  My code from other BMD devices should let us auto-detect.

_Originally posted by @krocheck in https://github.com/bitfocus/companion-module-bmd-teranex/pull/6#discussion_r441067891_

Julusian commented 11 months ago

I think it would make sense to split these out. Perhaps this one should be renamed to teranex-standards-converter with a new teranex-mini module.
The difference is port number is the key thing to me that says they should be different. Otherwise it will be a mess to either autodetect the port, or will require the user to choose which will half defeat the aim of autodetection.

Do they have any functional overlap?

My code from other BMD devices should let us auto-detect.

Various other modules do autodetection, how this works depends on the format of the data the device responds with. In this case, you could do this from the Model: Optical to HDMI line, or ideally looking at later fragments to discover features, such as the presence of the Lut selection property suggests the device has a selectable lut.
The latter option should be prefered if possible, as it means not yet released models will potentially partially work before the module is updated for them

peternewman commented 11 months ago

Thanks, that makes sense. Would you mind creating a teranex-mini repo and I'll modify the code I'd tweaked in here to just do Teranex Mini.

The difference is port number is the key thing to me that says they should be different. Otherwise it will be a mess to either autodetect the port, or will require the user to choose which will half defeat the aim of autodetection.

The only counter to this would be the Bonjour/Avahi stuff which could auto-populate this info to solve that problem...

Do they have any functional overlap?

I don't really know for sure, I'm sure there will be some basic logical stuff, in terms of output format etc, but whether the actual choices overlap is a different question...

I guess the only challenge with doing it based on properties rather than models is that if different units have say Digital Input with different options, and the preamble doesn't tell you what options it has, only the currently selected one...

peternewman commented 9 months ago

Various other modules do autodetection, how this works depends on the format of the data the device responds with. In this case, you could do this from the Model: Optical to HDMI line, or ideally looking at later fragments to discover features, such as the presence of the Lut selection property suggests the device has a selectable lut. The latter option should be prefered if possible, as it means not yet released models will potentially partially work before the module is updated for them

I've taken the most extreme version of this possible I think @Julusian whereby all actions/variables/feedback/presets are generated almost on the fly depending on what it finds on the Telnet data. So as soon as it matches day Video Input-Digital Input, it will generate the associated stuff for that from one central config file (as personally I found when adding that one thing having to edit five or six files was a bit of a hassle and lots of almost boilerplate code). I'd appreciate if you've got time to take a look: https://github.com/bitfocus/companion-module-bmd-teranex-mini/pull/1