HDMI-IN

The Neardi-3568 features an HDMI-IN port, which is converted by the RK628 chip and supports the standard HDMI 2.0 protocol. It has the following characteristics:

  • Supports multiple input interfaces such as HDMI 1.4/2.0, RGB, BT.1120, with a maximum resolution support of 4K@60fps.

  • Supports functions like HDCP 1.4, EDID, CEC, etc.

    ../../_images/rk3568_hdmiin.png

Using HDMI-IN with Android

The default version does not have HDMI-IN functionality. To enable it, flash the Neardi-3568 HDMIIN firmware from Baidu Netdisk For the flashing method, please refer to the chapter 《Using a USB Cable to Upgrade Firmware》.

After flashing, open the system Camera application to verify the HDMI-IN functionality.

Using HDMI-IN with Linux

The default node for Neardi-3568 HDMI-IN is /dev/video1

Execute the following commands in sequence, adjusting the resolution and format as needed:

media-ctl -d /dev/media0 --set-v4l2 '"rkisp-isp-subdev":0[fmt:UYVY2X8/1920x1080]'
media-ctl -d /dev/media0 --set-v4l2 '"rkisp-isp-subdev":0[crop:(0,0)/1920x1080]'
v4l2-ctl -d /dev/video1 --set-selection=target=crop,top=0,left=0,width=1920,height=1080
sudo gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! fpsdisplaysink

Successful execution result:

sudo gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,format=NV12,width=800,height=600, framerate=30/1 ! fpsdisplaysink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:09.1 / 99:99:99.
0:00:09.2 / 99:99:99.
0:02:31.0 / 99:99:99..

../../_images/hdmiin-display.png

FAQ

Where is the RK628 source code?

SDK/kernel/drivers/gpu/drm/rockchip/rk628

How to modify the frame rate in Gstreamer commands?

sudo gst-launch-1.0 v4l2src device=/dev/video1 ! videorate ! video/x-raw,format=NV12,width=800,height=600, framerate=60/1 ! fpsdisplaysink
<<<<

Change the value of framerate, where 60/1 represents 60 frames per second.

How to save the video file as mp4?

gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! mpph264enc ! h264parse ! mp4mux  ! filesink location=/home/neardi/hdmiin_output.mp4 -e

HDMI-IN is not displaying

Verify with v4l2-ctl capture

Scenario One:

v4l2-ctl -d /dev/video1  --set-fmt-video=width=1920,height=1080,pixelformat=NV12  --stream-mmap=3  --stream-skip=3  --stream-to=/hdmiin.out  --stream-count=1  --stream-poll

<<<<

If it returns <<<<, it indicates that the hardware and HDMI cable are normal. Next, check the topology structure and Format.

View topology structure:

media-ctl -p -d /dev/media0

View Format:

v4l2-ctl -d 1 -V

Scenario Two:

root@LPA3568:~# v4l2-ctl -d /dev/video1  --set-fmt-video=width=1920,height=1080,pixelformat=NV12  --stream-mmap=3  --stream-skip=3  --stream-to=/hdmiin.out  --stream-count=1  --stream-poll >/dev/null
The pixelformat 'NV24' is invalid
could not open /tmp/cif5.out for writing
            VIDIOC_STREAMON returned -1 (No such device)

If it returns returned -1 (No such device), check whether the RK628 chip is attached, as one version of the hardware removed the HDMI-IN functionality.

../../_images/rk3568_rk628.png

Scenario Three:

[ 2513.698723] rk628-combrxphy rk628-combrxphy: clk det over cnt:10, reg_0x6654:0x501f0000
[ 2513.699309] rk628-combrxphy rk628-combrxphy: clock detected failed, cfg resistance manual!
[ 2513.760930] rk628-combrxphy rk628-combrxphy: err, clk not stable, reg_0x6630:0x87000d, reg_0x6608:0x110100
[ 2513.761013] phy phy-rk628-combrxphy.9: phy poweron failed --> -22
[ 2513.761041] m00_b_rk628-csi rk628-csi: hdmi rxphy power on failed
[ 2513.926751] m00_b_rk628-csi rk628-csi: rk628_hdmirx_phy_setup hdmi rxphy lock failed, retry:2

Check if the input source has gone into sleep mode.

Scenario Four:

v4l2-ctl -d /dev/video1  --set-fmt-video=width=1920,height=1080,pixelformat=NV12  --stream-mmap=3  --stream-skip=3  --stream-to=/tmp/hdmiin.out  --stream-count=1  --stream-poll

select timeout

If it returns select timeout, check whether the HDMI-IN cable is securely connected or try a different cable.

View HDMI-IN configuration

neardi@LPA3568:~$ media-ctl -d /dev/media0 -p
Media controller API version 4.19.255

Media device information
------------------------
driver          rkisp-vir0
model           rkisp0
serial          
bus info        
hw revision     0x0
driver version  4.19.255

Device topology
- entity 1: rkisp-isp-subdev (4 pads, 7 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
   pad0: Sink
      [fmt:UYVY8_2X8/1920x1080 field:none
       crop.bounds:(0,0)/1920x1080
       crop:(0,0)/1920x1080]
       
   ...

- entity 67: rockchip-csi2-dphy0 (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev2
   pad0: Sink
      [fmt:UYVY8_2X8/3840x2160@10000/300000 field:none]
      <- "m00_b_rk628-csi rk628-csi":0 [ENABLED]
   pad1: Source
      [fmt:UYVY8_2X8/3840x2160@10000/300000 field:none]
      -> "rkisp-csi-subdev":0 [ENABLED]

- entity 70: m00_b_rk628-csi rk628-csi (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev3
   pad0: Source
      [fmt:UYVY8_2X8/3840x2160@10000/300000 field:none]
      [dv.caps:BT.656/1120 min:1x1@0 max:10000x10000@400000000 stds:CEA-861,DMT,CVT,GTF caps:interlaced,progressive,reduced-blanking,custom]
      [dv.detect:BT.656/1120 3840x2160p30 (4400x2250) stds: flags:]
      [dv.current:BT.656/1120 3840x2160p15 (4400x4490) stds: flags:]
      -> "rockchip-csi2-dphy0":0 [ENABLED]

The [dv.current:BT.656/1120 3840x2160p15 (4400x4490) stds: flags:] indicates the current resolution and frame rate.

If it returns [dv.query:no-lock],check whether the HDMI-IN cable is securely connected or try a different cable.