Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/configs/example_rack_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ rackConfig:
# [ avSyncController: optional] - Specifiec AVSyncController for the slot
# supported types:
# [type: "SyncOne2", port: "/dev/ttyACM0", extended_mode (optional): true|false, audio_input (optional): "AUTO|EXTERNAL|INTERNAL", speaker_distance (optional): "1.5"]

# [ hdmiAnalyserController: optional ] - Specifies an HDMI Analyser/Generator for the slot
# supported types:
# [type: "m42h", host: "192.168.0.50", port (optional): 22, user (optional): "qd", passwd (optional): "qd", card (optional): 4 ]
# [type: "manual-hdmi-controller", address: "127.0.0.1", username: "", password: "", port: "7722", sink_control_port: 8085, source_control_port: 8086, device: sink]
# [type: "virtual-hdmi-controller", address: "127.0.0.1", username: "", password: "", port: "7722", sink_control_port: 8085, source_control_port: 8086, device: sink]
Comment thread
thanushreevani marked this conversation as resolved.
- pi2:
ip: "192.168.99.1"
description: "local pi4"
Expand Down
247 changes: 246 additions & 1 deletion framework/core/hdmiAnalyserController.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

from framework.core.logModule import logModule
from framework.core.hdmiAnalyserModules.m42h import M42hController
from framework.core.hdmiAnalyserModules.virtualHdmiController import virtualHdmiController
from framework.core.hdmiAnalyserModules.manualHdmiController import manualHdmiController


class HDMIAnalyserController():
Comment thread
thanushreevani marked this conversation as resolved.
Expand All @@ -43,8 +45,12 @@ class HDMIAnalyserController():

Supported types:
``m42h`` – Teledyne LeCroy Quantumdata M42h 96G Video Analyser/Generator.
``manual-hdmi-controller`` – SSH-based controller for manual HDMI device
interaction via a control port.
``virtual-hdmi-controller`` – SSH-based controller for virtual HDMI device
interaction via a control port (used in simulation/test environments).

Rack-config example::
Rack-config example (m42h)::

hdmiAnalyserController:
type: "m42h"
Expand All @@ -53,12 +59,26 @@ class HDMIAnalyserController():
user: "qd" # optional, defaults to "qd"
passwd: "qd" # optional, defaults to "qd"
card: 4 # optional card number

Rack-config example (manual-hdmi-controller / virtual-hdmi-controller)::

hdmiAnalyserController:
type: "manual-hdmi-controller" # or "virtual-hdmi-controller"
address: "192.168.0.51"
port: 22
username: "admin"
password: "secret"
prompt: "~#"
device: "hdmi" # used to resolve <device>_control_port
source_control_port: 8080 # optional, defaults to 8080
sink_control_port: 8081
"""

def __init__(self, log: logModule, config: dict):
self._log = log
self.controllerType = config.get("type")
self.host = config.get("host")
self.devicetype=config.get("device", "")

if self.controllerType == "m42h":
self.hdmiAnalyser = M42hController(
Expand All @@ -68,6 +88,27 @@ def __init__(self, log: logModule, config: dict):
passwd=config.get("passwd", "qd"),
card=config.get("card"),
)
elif self.controllerType == "manual-hdmi-controller":
#if self.controllerType == "manual-hdmi-controller":
Comment thread
thanushreevani marked this conversation as resolved.
Comment thread
thanushreevani marked this conversation as resolved.
self.hdmiAnalyser = manualHdmiController(self._log,
Comment thread
thanushreevani marked this conversation as resolved.
host=config.get("address", ""),
port=config.get("port", 22),
Comment thread
thanushreevani marked this conversation as resolved.
user=config.get("username", ""),
passwd=config.get("password", ""),
prompt=config.get('prompt', '~#'),
control_port=config.get(f'{self.devicetype}_control_port', 8080),
device=self.devicetype,
)
elif self.controllerType == "virtual-hdmi-controller":
self.hdmiAnalyser = virtualHdmiController(self._log,
host=config.get("address", ""),
port=config.get("port", 22),
user=config.get("username", ""),
passwd=config.get("password", ""),
prompt=config.get('prompt', '~#'),
control_port=config.get(f'{self.devicetype}_control_port', 8080),
device=self.devicetype,
)
else:
raise ValueError(
f"Unsupported hdmiAnalyserController type: '{self.controllerType}'"
Expand Down Expand Up @@ -191,3 +232,207 @@ def set_hdcp_mode(self, mode: str):
def snapshot(self) -> dict:
self._log.info("Taking analyser snapshot")
return self.hdmiAnalyser.snapshot()

# ── HDMI output ─────────────────────────────────────────────────────

def sendEDIDRead(self, port: int, data: list):
"""
Send an EDID read event for the HDMI output port.

Args:
port (int): HDMI output port number.
data (list): EDID data bytes.

Returns:
bool: True if message/event handled successfully.
"""
return self.hdmiAnalyser.sendEDIDRead(port, data)
Comment thread
thanushreevani marked this conversation as resolved.

def sendFrameRateChanged(self, port: int):
"""
Send a frame rate changed event for the HDMI output port.

Args:
port (int): HDMI output port number.

Returns:
bool: True if message/event handled successfully.
"""
return self.hdmiAnalyser.sendFrameRateChanged(port)
Comment thread
thanushreevani marked this conversation as resolved.

def setHDCPStatus(self, port: int, status: str, version: str):
"""
Set HDCP status for the HDMI output port.

Args:
port (int): HDMI output port number.
status (str): HDCP status string.
version (str): HDCP version string.

Returns:
bool: True if message/event handled successfully.
"""
return self.hdmiAnalyser.setHDCPStatus(port, status, version)
Comment thread
thanushreevani marked this conversation as resolved.

def setHotplugState(self, port: int, connected: bool, version: str = "VERSION_2_X"):
"""
Set hotplug state for the HDMI output port.

Args:
port (int): HDMI output port number.
connected (bool): True if connected, False if disconnected.
version (str): HDCP version string. Defaults to "VERSION_2_X".

Returns:
bool: True if message/event handled successfully.
"""
return self.hdmiAnalyser.setHotplugState(port, connected, version)

def setHDCPVersion(self, port: int, hdcp_version: str):
"""
Set the HDCP version for the HDMI input port.

Args:
port (int): HDMI input port number.
hdcp_version (str): HDCP version string. (VERSION_1_X, VERSION_2_X, UNDEFINED)
Returns:
bool: True if HDCP version set successfully.
"""
return self.hdmiAnalyser.setHDCPVersion(port, hdcp_version)

def validateEdid(self, port: int, expected_edid: list):
"""
Validate the EDID data for the HDMI input port.

Args:
port (int): HDMI input port number.
expected_edid (list): Expected EDID data bytes.
Returns:
bool: True if EDID data matches expected values.
"""
return self.hdmiAnalyser.validateEdid(port, expected_edid)

def sendAudioInfoFrame(self, port: int, data: list):
"""
Send an Audio Info Frame message to the HDMI input port.

Args:
port (int): HDMI input port number.
data (list): Audio info frame data bytes.

Returns:
bool: True if message sent successfully.
"""
return self.hdmiAnalyser.sendAudioInfoFrame(port, data)

def sendAVIInfoFrame(self, port: int, data: list):
"""
Send an AVI Info Frame message to the HDMI input port.

Args:
port (int): HDMI input port number.
data (list): AVI info frame data bytes.

Returns:
bool: True if message sent successfully.
"""
return self.hdmiAnalyser.sendAVIInfoFrame(port, data)

def sendDRMInfoFrame(self, port: int, data: list):
"""
Send a DRM Info Frame message to the HDMI input port.

Args:
port (int): HDMI input port number.
data (list): DRM info frame data bytes.

Returns:
bool: True if message sent successfully.
"""
return self.hdmiAnalyser.sendDRMInfoFrame(port, data)

def setSignalStatus(self, port: int, signal_state: str):
"""
Set the signal status for the HDMI input port.

Args:
port (int): HDMI input port number.
signal_state (str): Signal state string (e.g., 'LOCKED', 'NO_SIGNAL').

Returns:
bool: True if message sent successfully.
"""
return self.hdmiAnalyser.setSignalStatus(port, signal_state)

def sendSPDInfoFrame(self, port: int, data: list):
"""
Send an SPD Info Frame message to the HDMI input port.

Args:
port (int): HDMI input port number.
data (list): SPD info frame data bytes.

Returns:
bool: True if message sent successfully.
"""
return self.hdmiAnalyser.sendSPDInfoFrame(port, data)

def sendVSIFInfoFrame(self, port: int, data: list):
"""
Send a Vendor Specific Info Frame message to the HDMI input port.

Args:
port (int): HDMI input port number.
data (list): Vendor specific info frame data bytes.

Returns:
bool: True if message sent successfully.
"""
return self.hdmiAnalyser.sendVSIFInfoFrame(port, data)

def SetVIC(self, port: int, vic: str):
"""
Set the Video Identification Code (VIC) for the HDMI input port.

Args:
port (int): HDMI input port number.
vic (str): Video Identification Code string.

Returns:
bool: True if message sent successfully.
"""
return self.hdmiAnalyser.SetVIC(port, vic)

def setVRRStatus(self, port: int, vrrActive: bool,M_CONST: bool, fastVActive: bool, frameRate: float):
"""
Abstract method to set the Variable Refresh Rate (VRR) status for the HDMI input port.

Args:
port (int): HDMI input port number.
vrrActive (bool): VRR enabled status.
M_CONST (bool): M_CONST status.
fastVActive (bool): Fast V Active status.
frameRate (float): Frame rate value.

Returns:
bool: True if message sent successfully.
"""
return self.hdmiAnalyser.setVRRStatus(port, vrrActive, M_CONST, fastVActive, frameRate)

def start(self):
"""
Start the HDMI controller.

Returns:
None
"""
return self.hdmiAnalyser.start()

def stop(self):
"""
Stop the HDMI controller.

Returns:
None
"""
return self.hdmiAnalyser.stop()
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#** *****************************************************************************
# *
# * If not stated otherwise in this file or this component's LICENSE file the
# * following copyright and licenses apply:
# *
# * Copyright 2026 RDK Management
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *
#** ******************************************************************************

hdmiinput:
command: audioinfo_frame
description: Sends the audioinfo frame to HDMI input ports
params:
port: 0
data: [0x84, 0x01, 0x0A, 0x70, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#** *****************************************************************************
# *
# * If not stated otherwise in this file or this component's LICENSE file the
# * following copyright and licenses apply:
# *
# * Copyright 2026 RDK Management
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *
#** ******************************************************************************

hdmiinput:
command: aviinfo_frame
description: Sends the AV InfoFrame to HDMI input ports
params:
port: 0
data: [0x82, 0x02, 0x0D, 0x6F, 0x10, 0x18, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#** *****************************************************************************
# *
# * If not stated otherwise in this file or this component's LICENSE file the
# * following copyright and licenses apply:
# *
# * Copyright 2026 RDK Management
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *
#** ******************************************************************************

hdmiinput:
command: connection_status
description: Sends the connection status of HDMI input ports.
params:
port: 0
connected: true
Loading