Toybrick

标题: TB-RV1126D开发板mipi摄像头抓图 [打印本页]

作者: 我是流氓我怕谁    时间: 2021-7-29 10:09
标题: TB-RV1126D开发板mipi摄像头抓图
1 接入摄像头开机。
2 抓取1080p图像:
sudo v4l2-ctl -d /dev/video19 --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap=3 --stream-to=/tmp/NV12_1920_1080.out --stream-count=1

3 抓取4k图像:
sudo media-ctl -d /dev/media1 --set-v4l2 '"m01_f_imx317 1-001a":0[fmt:SRGGB10_1X10/3840x2160]'
sudo media-ctl -d /dev/media1 --set-v4l2 '"rkisp-isp-subdev":0[fmt:SRGGB10_1X10/3840x2160]'
sudo media-ctl -d /dev/media1 --set-v4l2 '"rkisp-isp-subdev":0[crop0,0)/3840x2160]'

sudo media-ctl -d /dev/media1 -l '"rkisp_rawrd0_m":0->"rkisp-isp-subdev":0[0]'
sudo media-ctl -d /dev/media1 -l '"rkisp_rawrd2_s":0->"rkisp-isp-subdev":0[0]'
sudo media-ctl -d /dev/media1 -l '"rkisp_rawrd1_l":0->"rkisp-isp-subdev":0[0]'
sudo media-ctl -d /dev/media1 -l '"rkisp-csi-subdev":2->"rkisp_rawwr0":0[0]'
sudo media-ctl -d /dev/media1 -l '"rkisp-csi-subdev":3->"rkisp_rawwr1":0[0]'
sudo media-ctl -d /dev/media1 -l '"rkisp-csi-subdev":4->"rkisp_rawwr2":0[0]'
sudo media-ctl -d /dev/media1 -l '"rkisp-csi-subdev":5->"rkisp_rawwr3":0[0]'


sudo v4l2-ctl -d /dev/video19 --set-fmt-video=width=3840,height=2160,pixelformat=NV12 --stream-mmap=3 --stream-to=/tmp/NV12.out --stream-count=1


作者: HQF    时间: 2021-7-29 19:07
[root@RV1126_RV1109:/]# v4l2-ctl -d /dev/video19 --set-fmt-video=width=1920,heig
ht=1080,pixelformat=NV12 --stream-mmap=3 --stream-to=/tmp/NV12_1920_1080.out --s
tream-count=1
[  286.775151] clk_mipicsi_out2io_fracdiv p_rate(297000000) is low than rate(24000000)*20, use integer or half-div
[  287.871773] rkispp-vir0: waiting on params stream on event timeout
[  287.872090] rkisp rkisp-vir0: can not get first iq setting in stream on
[  287.873416] rockchip-mipi-dphy-rx ff4b0000.csi-dphy: stream on:1
[  287.873451] rockchip-mipi-dphy-rx: data_rate_mbps 720
[  287.874567] imx317 1-001a: imx317_s_stream: on: 1, 1920x1080@30
[  287.926135] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926169] rkisp-vir0: MIPI error: packet: 0x01010000
[  287.926181] rkisp-vir0: MIPI error: packet: 0x01010000
[  287.926191] rkisp-vir0: MIPI error: packet: 0x01110000
[  287.926201] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926211] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926221] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926231] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926240] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926255] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926268] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926280] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926292] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926305] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926318] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926330] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926342] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926354] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926367] rkisp-vir0: MIPI error: packet: 0x00100000
[  287.926379] rkisp-vir0: MIPI error: packet: 0x00100000


这个怎么改啊,还像是CLK有问题,但我不清楚在那里改
作者: HQF    时间: 2021-7-29 19:24
设备数如下:其他没做修改
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2020 Rockchip Electronics Co., Ltd.
*/
/dts-v1/;
#include "rv1126.dtsi"
#include "rv1126-toybrick.dtsi"
#include "rv1126-toybrick-imx317.dtsi"
/ {
        model = "Rockchip RV1126 Toybrick Board";
        compatible = "rockchip,rv1126-toybrick-linux", "rockchip,rv1126";

        chosen {
                bootargs = "earlycon=uart8250,mmio32,0xff570000 console=ttyFIQ0 root=PARTUUID=614e0000-0000 rootwait snd_aloop.index=7";
        };

        leds {
                compatible = "gpio-leds";
                led@1 {
                        gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_LOW>;
                        label = "blue";
                        default-state = "on";
                        linux,default-trigger = "default-on";
                        pinctrl-names = "default";
                        pinctrl-0 = <&work_led>;
                };
        };
};

&pinctrl {
        leds {

                work_led: work-led {
                        rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };

};

&rkvenc_opp_table {
        /*
         * max IR-drop values on different freq condition for this board!
         */
        rockchip,board-irdrop = <
             /* MHz        MHz        uV */
                500        594        50000
        >;
};

/**
* Model: TB-RV1126D
* ----------------------------------------------------------------
* supply         |  domain  |  net         | source  |  voltage  |
*-----------------------------------------------------------------
* pmuio0-supply  |  PMUIO0  |  VCC3V3_SYS  | BULK4   |  3.3V     |
* pmuio1-supply  |  PMUIO1  |  VCC3V3_SYS  | BULK4   |  3.3V     |
* vccio1-supply  |  VCCIO1  |  VCC_1V8     | LDO4    |  1.8V     |
* vccio2-supply  |  VCCIO2  |  VCCIO_FLASH | LDO4    |  1.8V     |
* vccio3-supply  |  VCCIO3  |  VCC_1V8     | LDO4    |  1.8V     |
* vccio4-supply  |  VCCIO4  |  VCC_1V8     | LDO4    |  1.8V     |
* vccio5-supply  |  VCCIO5  |  VCC_3V3     | SWOUT2  |  3.3V     |
* vccio6-supply  |  VCCIO6  |  VCC_1V8     | LDO4    |  1.8V     |
* vccio7-supply  |  VCCIO7  |  VCC_1V8     | LDO4    |  1.8V     |
* ---------------------------------------------------------------
*/

&pmu_io_domains {
        status = "okay";

        pmuio0-supply = <&vcc3v3_sys>;
        pmuio1-supply = <&vcc3v3_sys>;
        vccio1-supply = <&vcc_1v8>;
        vccio2-supply = <&vccio_sd>;
        vccio3-supply = <&vcc_1v8>;
        vccio4-supply = <&vcc_1v8>;
        vccio5-supply = <&vcc_3v3>;
        vccio6-supply = <&vcc_3v3>;
        vccio7-supply = <&vcc_3v3>;
};

&pwm0 {
    status = "disabled";
};

&pwm1 {
        status = "disabled";
};

&pwm3 {
    status = "okay";
};

&u2phy0 {
    vup-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_LOW>;
};

&reserved_memory  {
        linux,cma {
                size = <0x8000000>;
        };
};

&wireless_wlan {
        /*
         * V1.0 WIFI_WAKE_HOST is GPIO2_A2
         * V1.1 WIFI_WAKE_HOST from GPIO2_A2 to GPIO1_D5
         */
        WIFI,host_wake_irq = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>;
};

&gmac {
        tx_delay = <0x2e>;
        rx_delay = <0x20>;
};

作者: troy    时间: 2021-8-2 10:13
HQF 发表于 2021-7-29 19:24
设备数如下:其他没做修改
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*

你用的是官方的固件吗?如果不是官方的固件,可以重烧官方的固件试一下。这个错误日志看起来有点像clock的问题,或者摄像头接触不良。
作者: HQF    时间: 2021-8-2 10:34
troy 发表于 2021-8-2 10:13
你用的是官方的固件吗?如果不是官方的固件,可以重烧官方的固件试一下。这个错误日志看起来有点像clock ...

官方固件也是同样的错误,摄像头坏了吗?

作者: troy    时间: 2021-8-2 11:14
HQF 发表于 2021-8-2 10:34
官方固件也是同样的错误,摄像头坏了吗?

重新插拔下摄像头试试有没有效果,是不是摄像头没插好。
作者: hankyao    时间: 2021-8-16 15:01
HQF知道是什么问题了吗,我也遇到了同样的问题
作者: Consti10    时间: 2021-9-8 19:39
Hello,

What "iqfile" were you using for the imx317 ? The github repo is missing an iqfile for the imx317 for rv1126 (https://github.com/rockchip-toyb ... evelop-11.0/iqfiles)
So I am wondering how you were able to get an image after isp with imx317 on rv1126 - isn't that impossible ?

Were you actually able to create a video stream with imx317 on toybrick rv1126 board ?


作者: xinxin    时间: 2021-11-25 17:08
绝对官方的
作者: xinxin    时间: 2021-11-25 17:09
重新插拔几次了
作者: qiqi    时间: 2022-2-18 10:52
请问RV1126D开发板接mipi摄像头,除了用这个命令,可以用opencv抓图吗?
作者: troy    时间: 2022-2-18 10:59
qiqi 发表于 2022-2-18 10:52
请问RV1126D开发板接mipi摄像头,除了用这个命令,可以用opencv抓图吗?

你可以实际测试一下,以前我试过好像OpenCV对接有点问题,VideoCapture好像会报错。
作者: qiqi    时间: 2022-2-21 12:07
这个结果是抓到图像还是抓取失败啊
toybrick@debian10:~/camera$ sudo v4l2-ctl -d /dev/video19 --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap=3 --stream-to=/tmp/NV12_1920_1080.out --stream-count=1
[sudo] password for toybrick:
[ 6963.055866] rkisp-vir0: check video link or isp input
[ 6963.058584] rkisp-vir0: check video link
[ 6963.061754] rockchip-mipi-dphy-rx ff4b0000.csi-dphy: stream on:1
[ 6963.061811] rockchip-mipi-dphy-rx: data_rate_mbps 720
[ 6963.062829] imx317 1-001a: imx317_s_stream: on: 1, 1920x1080@30
<[ 6963.169591] imx317 1-001a: imx317_s_stream: on: 0, 1920x1080@30
[ 6963.170061] rockchip-mipi-dphy-rx ff4b0000.csi-dphy: stream on:0




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3