I have to connect ADV7280-M (contained in the EVAL-ADV7280MEBZ board) board to Rock Pi 4B SoC. I have recompiled the kernel with added adv7180.c driver. The procedure for recompilation of the kernel I have taken from:
/dts-v1/; /plugin/; / { model = "ROCK PI 4B"; compatible = "rockchip,rockpi","rockchip,rk3399"; fragment@0 { target = ; __overlay__ { #address-cells = ; #size-cells = ; status = "okay"; adv7280@21 { compatible = "adi,adv7280-m"; reg = ; status = "okay"; pinctrl-names = "rockchip,camera_default"; port { adv7280_out: endpoint { remote-endpoint = ; data-lanes = ; }; }; }; }; }; fragment@1 { target = ; __overlay__ { status = "okay"; }; }; fragment@2 { target = ; __overlay__ { remote-endpoint = ; data-lanes = ; }; }; };
With that DT, i have obtained correct output of ?media-ctl -p? ? command, but when I try to start the streaming of data with:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=NV12,wid th=1920,height=1080, framerate=30/1 ! videoconvert ! x264enc tune= zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink h ost=172.19.1.1 port=5000
I get the following error and system crashes:
[ 246.739221] adv7180 4-0021: No active sensor [ 246.739613] rkisp1: open cif pipeline failed -32I have found, that the problem is caused by the fact that adv7180.c driver does not set the sd->entity.type to MEDIA_ENT_T_V4L2_SUBDEV_SENSOR, and the drivers/media/platform/rockchip/isp1/dev.c file checks it in lines 153-164:
/* find the subdev of active sensor */ sd = p->subdevs[0]; for (i = 0; i < p->num_subdevs; i++) { sd = p->subdevs[i]; if (sd->entity.type == MEDIA_ENT_T_V4L2_SUBDEV_SENSOR) break; } if (i == p->num_subdevs) { v4l2_warn(sd, "No active sensor\n"); return -EPIPE; }
The question is, if the adv7180.c should set this type. If not, then I shou ld define another pipeline element, corresponding to the analog video input . However, I couldn?t find any info how to do that. Therefore, I have modified the adv7180.c to set the required type. Unfortunately, it does not help, as my device fails the next check (lines 1
65-169 in dev.c):ctrl = v4l2_ctrl_find(sd->ctrl_handler, V4L2_CID_PIXEL_RATE); if (!ctrl) { v4l2_warn(sd, "No pixel rate control in subdev\n"); return -EPIPE; }
After an attempt to start streaming, I get
adv7180 4-0021: No pixel rate control in subdev
and the system crashes again.
Of course, I can add a fake PIXEL_RATE control to adv7180.c, but it does no t seem to be the right solution. Probably indeed, it is necessary to define a ``composite video input'' element in the pipeline, that would have the e ntity type set to MEDIA_ENT_T_V4L2_SUBDEV_SENSOR and would provide the V4L2 _CID_PIXEL_RATE control. I?ll appreciate any suggestions how to do it in the right way.
TIA & Regards, Wojtek