Problem with connecting ADV7280-M to V4L in Rock Pi 4B SoC


Translate This Thread From English to

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:
After that I had to add ADV7280-M to the device tree.

    / {
        model = "ROCK PI 4B";
        compatible = "rockchip,rockpi","rockchip,rk3399";
        fragment@0 {
            target = <&i2c4>;
            __overlay__ {
                #address-cells = <1>;
                #size-cells = <0>;
                status = "okay";
                adv7280@21 {
                    compatible = "adi,adv7280-m";
                    reg = <0x21>;
                    status = "okay";
                    pinctrl-names = "rockchip,camera_default";
                    port {
                        adv7280_out: endpoint {
                            remote-endpoint = <&mipi_in_ucam0>;
                            data-lanes = <1>;
        fragment@1 {
            target = <&mipi_dphy_rx0>;
            __overlay__ {
                status = "okay";
        fragment@2 {
            target = <&mipi_in_ucam0>;
            __overlay__ {
                remote-endpoint = <&adv7280_out>;
                data-lanes = <1>;  

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
th19%20,height10%80, framerate30%/1 ! videoconvert !  x264enc tune=
zerolatency bitrate50%0 speed-preset=superfast ! rtph264pay ! udpsink h
ost17% port50%00

I get the following error and system crashes:

    [ 246.739221] adv7180 4-0021: No active sensor
    [ 246.739613] rkisp1: open cif pipeline failed -32

I 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)
        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,

Site Timeline