HDMI-RX
Note
HDMI-RX is only available on Genio 1200-EVK.
Note
Command operations and test results presented in this chapter are based on the IoT Yocto v23.1 and Genio 1200-EVK board.
High-Definition Multimedia Interface Receiver (HDMI-RX)
The High-definition Multimedia Interface (HDMI) RX IP supports video data and audio packet data reception according to the HDMI standard specification. The HDMIRX module receives uncompressed digital data streams in TMDS format from an HDMI-compatible source device and decodes the video, audio and control data based on HDMI Specification 2.0b.
Architecture
- The three major drivers for the HDMI-RX:
HDMIRX driver - HDMIRX HW control
V4L2 capture device - for receiving video frame
ALSA audio source - for receiving audio bitstream
While HDMI timing(video) locked, a V4L2 capture device, named mdp-capture
, will be registered.
And also, ALSA source hdmi_rx
can be used for recording after HDMI-RX audio locked.
Features
The HDMIRX supports the following video features:
Deep Color mode: up to 10 bits
Maximum operating frequency: up to 594 MHz
Video color space options: RGB 4:4:4, YCbCr 4:2:2 (ITU BT.601 and BT.709), YCbCr 4:4:4 (ITU BT.601 and BT.709), and YCbCr 4:2:0
- SD mode resolutions:
720 x 480p @ 59.94/60 Hz
720 x 576p @ 50 Hz
- HD/FHD/UFHD mode resolutions:
1280 x 720p @ 59.94/60/50 Hz
1920 x 1080p @ 59.94/60/50 Hz
1920 x 1080p @ 23.97/24 Hz
1920 x 1080p @ 25 Hz
1920 x 1080p @ 29.97/30 Hz
3840 x 2160p @ 29.97/30 Hz
3840 x 2160p @ 59.94/60/50 Hz
The HDMIRX supports the following audio features:
Single Linear Pulse Code (LPC) S/PDIF IEC60958 (up to 192 kHz and up to 24 bits), 32 kHz, 44.1 kHz, 48 kHz, 88.2 kHz, 96 kHz, 176.4 kHz, 192 kHz
Multi-channel Pulse Code Modulation (PCM) input (maximum 8 channels)
Additionally, the HDMIRX supports the following features:
Internal Extended Display Identification Data (EDID), 512 bytes
Compatibility with Digital Visual Interface (DVI) 1.0
Single Hot-Plug Detect (HPD) line
HDMI-RX Tool
The hdmirx_tool
is an executable program that used for checking HDMIRX information.
- It includes following function:
Enable / disable HDMIRX
Check HDMI cable connection
Get device info
Check video signal (locked / unlocked)
Get video info
Check audio signal (locked / unlocked)
Get audio info
Retrieve HDMIRX events (via UEVENT)
Manual controlled with input key:
‘1’ to enable HDMIRX (HW power on)
‘2’ to disable HDMIRX (HW power off)
‘4’ to check cable status
‘3’ to get device info
‘6’ to check video lock status
‘5’ to get video info
‘8’ to check audio lock status
‘7’ to get audio info
‘a’/‘b’ to start/stop observing (notification via UEVENT)
Example – Observing “Cable Plug-out” flow
HDMI-RX Usage with GStreamer
On IoT Yocto, the HDMIRX video capture device is register as a V4L2 capture device. GStreamer is integrated to provide wrapper plugins over the V4L2 interface and to assist in setting up video processing pipelines.
Note
The input source of following examples is 4K60fps video and 48KHz-24bits-2ch audio.
The mdp-capture
device is registered as /dev/video5
and the ALSA device is hdmi_rx
.
Example: Capture Preview
The following examples use GStreamer v4l2src
plug-in for the HDMI-RX video capture device.
Note
The output format and size are MUST given in the command. Please refer to MDP Video Capture formats for the format list.
gst-launch-1.0 -v v4l2src device=/dev/video5 ! video/x-raw,width=3840,height=2160,format=YUY2 ! queue ! \
fpsdisplaysink video-sink=waylandsink text-overlay=false
Example: Video and Audio Recording
The following examples use GStreamer v4l2h264enc
plug-in for hardware-accelerated video encoding, alsasrc
for ALSA audio source to encode & mux a 10 seconds video.
gst-launch-1.0 -v v4l2src device=/dev/video5 num-buffers=600 ! video/x-raw,width=3840,height=2160,format=NV12 ! queue ! \
v4l2h264enc output-io-mode=dmabuf-import capture-io-mode=mmap ! queue ! h264parse ! qtmux name=mux ! filesink location=out_3840x2160.mp4 \
alsasrc device=hdmi_rx num-buffers=1000 ! audio/x-raw,format=S24LE,rate=48000,channels=2 ! audioconvert ! queue ! mux.audio_0
Example: Video Encoding with Snapshot
To encode 4K60fps video for 10 sec and do snapshot (by v4l2jpegenc
) every second.
gst-launch-1.0 -v v4l2src device=/dev/video5 io-mode=dmabuf num-buffers=600 ! video/x-raw,width=3840,height=2160,format=NV12 ! tee name=t \
t. ! queue ! videorate ! 'video/x-raw,framerate=1/1' ! v4l2jpegenc ! jpegparse ! multifilesink location=ss_%03d.jpeg \
t. ! queue ! v4l2h264enc output-io-mode=dmabuf-import capture-io-mode=mmap ! queue ! h264parse ! matroskamux ! filesink location=h264.mkv