Skip to content

Kernel update to change time to jiffies broke our cameras #68

Closed

Description

@kquinnyst

We created a custom device tree overlay for our cameras to use libcamera & CM3+. The most recent kernel update made it so we could not detect any cameras.
We reviewed the code in rpi-6.1.y/arch/arm/boot/dts/overlays and discovered we need to include link-frequency to our custom overlays.
We use i2c_vc and i2c_arm to be our i2c buses for the camera as we don't use the default pins. Also tried using i2c0 & i2c1 as to not enable the mux to no avail.
When we included the link-frequency it didn't just work like it did before. i2c_vc seems to be breaking now.

Now with i2c_vc enabled we can't detect any cameras.
With i2c_vc disabled and i2c_arm=on we are able to detect 1 camera, but we'd really like to detect both.
Previously we used both of these i2c buses without a problem.
When we swap cam0 and cam1 i2c buses it will detect the other camera, but won't take a photo and libcamera hangs forever.

Our .dtsi file is the same as yours - https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/imx708.dtsi commit dbb9efdf61fe1c4459774d69839ea877d25fe743
& our kq_gpio.h is https://github.com/torvalds/linux/blob/master/include/dt-bindings/gpio/gpio.h

Our dts file varies slightly to enable support for 2 cameras.
It is below our relevant portion of /boot/config.txt

/boot/config.txt - with i2c_vc=on & i2c_arm=on I.E. how we used to see 2 cameras

[all]
enable_uart=1
dtparam=i2c_arm=on
dtparam=watchdog=on
dtoverlay=disable-bt
arm_64bit=0
dtparam=i2c_vc=on
dtparam=cam0_reg
dtparam=cam0_reg_gpio=20
dtparam=cam1_reg
dtparam=cam1_reg_gpio=22
#dtoverlay=imx219-st,cam0
#dtoverlay=imx219-st,cam1
dtoverlay=imx708-st,cam0
dtoverlay=imx708-st,cam1
dtoverlay=i2c-rtc-gpio,ds3231,i2c_gpio_sda=4,i2c_gpio_scl=5

Our custom overlay imx708-st.dts

// SPDX-License-Identifier: GPL-2.0-only
// Definitions for IMX708 camera module on VC I2C bus
/dts-v1/;
/plugin/;

// #include <dt-bindings/gpio/gpio.h>
#include "kq_gpio.h"

/{
        compatible = "brcm,bcm2835";

        clk_frag: fragment@1 {
                target = <&cam1_clk>;
                __overlay__ {
                        status = "okay";
                        clock-frequency = <24000000>;
                };
        };

        reg_frag: fragment@3 {
                target = <&cam1_reg>;
                cam_reg: __overlay__ {
                        startup-delay-us = <70000>;
                        off-on-delay-us = <30000>;
                        regulator-min-microvolt = <2700000>;
                        regulator-max-microvolt = <2700000>;
                };
        };

        fragment@4 {
                target = <&cam_node>;
                __overlay__ {
                        lens-focus = <&vcm_node>;
                };
        };

        i2c_frag: fragment@100 {
                target = <&i2c_vc>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";

                        #include "imx708.dtsi"
                };
        };

        csi_frag: fragment@101 {
                target = <&csi0>;
                csi: __overlay__ {
                        status = "okay";
                        brcm,media-controller;

                        port {
                                csi_ep: endpoint {
                                        remote-endpoint = <&cam_endpoint>;
                                        clock-lanes = <0>;
                                        data-lanes = <1 2>;
                                        clock-noncontinuous;
                                };
                        };
                };
        };

        __overrides__ {
                rotation = <&cam_node>,"rotation:0";
                orientation = <&cam_node>,"orientation:0";
                media-controller = <&csi>,"brcm,media-controller?";
                cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
                       <&csi_frag>, "target:0=",<&csi0>,
                       <&clk_frag>, "target:0=",<&cam0_clk>,
                       <&reg_frag>, "target:0=",<&cam0_reg>,
                       <&cam_node>, "clocks:0=",<&cam0_clk>,
                       <&cam_node>, "VANA1-supply:0=",<&cam0_reg>,
                       <&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
                cam1 = <&i2c_frag>, "target:0=",<&i2c_arm>,
                       <&csi_frag>, "target:0=",<&csi1>,
                       <&clk_frag>, "target:0=",<&cam1_clk>,
                       <&reg_frag>, "target:0=",<&cam1_reg>,
                       <&cam_node>, "clocks:0=",<&cam1_clk>,
                       <&cam_node>, "VANA1-supply:0=",<&cam1_reg>,
                       <&vcm_node>, "VDD-supply:0=",<&cam1_reg>;
                vcm = <&vcm_node>, "status",
                      <0>, "=4";
                link-frequency = <&cam_endpoint>,"link-frequencies#0";
        };
};

&cam_node {
        status = "okay";
};

&cam_endpoint {
        remote-endpoint = <&csi_ep>;
};

&vcm_node {
        status = "okay";
};

Activity

  1. naushir commented on Jul 12, 2023

    @naushir
    Collaborator

    @6by9 for visibility.

  2. naushir commented on Jul 12, 2023

    @naushir
    Collaborator

    When we swap cam0 and cam1 i2c buses it will detect the other camera, but won't take a photo and libcamera hangs forever.

    Can you share some libcamera/console logs when you start your application to try and determine what happens in this case?

  3. 6by9 commented on Jul 12, 2023

    @6by9
    Collaborator

    We use i2c_vc and i2c_arm to be our i2c buses for the camera as we don't use the default pins. Also tried using i2c0 & i2c1 as to not enable the mux to no avail.

    What GPIOs do you use for the I2C?

    I suspect you want to use i2c0if as the base BSC0 controller, not i2c0 or i2c_csi_dsi which are the alternate pinmux settings for 0&1 and 28&29 (on a CM3) respectively.

    What kernel were you working with before? 5.15 and 6.1 both validate that the link frequency in the imx708 node is present and valid https://github.com/raspberrypi/linux/blob/rpi-5.15.y/drivers/media/i2c/imx708.c#L1856-L1861

  4. 6by9 commented on Jul 12, 2023

    @6by9
    Collaborator

    When we swap cam0 and cam1 i2c buses it will detect the other camera, but won't take a photo and libcamera hangs forever.

    Can you share some libcamera/console logs when you start your application to try and determine what happens in this case?

    Did you swap the from &csi1 to &csi0 (or vice versa) too?

  5. kquinnyst commented on Jul 12, 2023

    @kquinnyst
    Author

    pins -

    dtoverlay=i2c1,pins_2_3
    dtoverlay=i2c0,pins_0_1
    

    imx708-st.dts with i2cs flipped

    // SPDX-License-Identifier: GPL-2.0-only
    // Definitions for IMX708 camera module on VC I2C bus
    /dts-v1/;
    /plugin/;
    
    // #include <dt-bindings/gpio/gpio.h>
    #include "kq_gpio.h"
    
    /{
            compatible = "brcm,bcm2835";
    
            clk_frag: fragment@1 {
                    target = <&cam1_clk>;
                    __overlay__ {
                            status = "okay";
                            clock-frequency = <24000000>;
                    };
            };
    
            reg_frag: fragment@3 {
                    target = <&cam1_reg>;
                    cam_reg: __overlay__ {
                            startup-delay-us = <70000>;
                            off-on-delay-us = <30000>;
                            regulator-min-microvolt = <2700000>;
                            regulator-max-microvolt = <2700000>;
                    };
            };
    
            fragment@4 {
                    target = <&cam_node>;
                    __overlay__ {
                            lens-focus = <&vcm_node>;
                    };
            };
    
            i2c_frag: fragment@100 {
                    target = <&i2c_vc>;
                    __overlay__ {
                            #address-cells = <1>;
                            #size-cells = <0>;
                            status = "okay";
    
                            #include "imx708.dtsi"
                    };
            };
    
            csi_frag: fragment@101 {
                    target = <&csi0>;
                    csi: __overlay__ {
                            status = "okay";
                            brcm,media-controller;
    
                            port {
                                    csi_ep: endpoint {
                                            remote-endpoint = <&cam_endpoint>;
                                            clock-lanes = <0>;
                                            data-lanes = <1 2>;
                                            clock-noncontinuous;
                                    };
                            };
                    };
            };
    
            __overrides__ {
                    rotation = <&cam_node>,"rotation:0";
                    orientation = <&cam_node>,"orientation:0";
                    media-controller = <&csi>,"brcm,media-controller?";
                    cam0 = <&i2c_frag>, "target:0=",<&i2c_arm>,
                           <&csi_frag>, "target:0=",<&csi0>,
                           <&clk_frag>, "target:0=",<&cam0_clk>,
                           <&reg_frag>, "target:0=",<&cam0_reg>,
                           <&cam_node>, "clocks:0=",<&cam0_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam0_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
                    cam1 = <&i2c_frag>, "target:0=",<&i2c_vc>,
                           <&csi_frag>, "target:0=",<&csi1>,
                           <&clk_frag>, "target:0=",<&cam1_clk>,
                           <&reg_frag>, "target:0=",<&cam1_reg>,
                           <&cam_node>, "clocks:0=",<&cam1_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam1_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam1_reg>;
                    vcm = <&vcm_node>, "status",
                          <0>, "=4";
                    link-frequency = <&cam_endpoint>,"link-frequencies#0";
            };
    };
    
    &cam_node {
            status = "okay";
    };
    
    &cam_endpoint {
            remote-endpoint = <&csi_ep>;
    };
    
    &vcm_node {
            status = "okay";
    };

    Console output
    $ libcamera-jpeg --list-cameras

    Available cameras
    -----------------
    0 : imx708_noir [4608x2592] (/base/soc/i2c@7e804000/imx708@1a)
        Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
                                 2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
                                 4608x2592 [14.35 fps - (0, 0)/4608x2592 crop
    

    $ time libcamera-jpeg -o test.jpg

    Preview window unavailable
    ^C
    libcamera-jpeg -o test.jpg  0.08s user 0.10s system 0% cpu 20.050 total
    
  6. kquinnyst commented on Jul 12, 2023

    @kquinnyst
    Author

    Did you swap the from &csi1 to &csi0 (or vice versa) too?
    Yes we tried this, but we weren't able to get the other camera visible with either configuration. Perhaps there is a way in which this is possible I can continue to investigate if you think it would be helpful

  7. naushir commented on Jul 12, 2023

    @naushir
    Collaborator

    Could you run LIBCAMERA_LOG_LEVELS=*:0 libcamera-hello -t 0 -n and post the console log output from that?

  8. 6by9 commented on Jul 12, 2023

    @6by9
    Collaborator

    dtoverlay=i2c1,pins_2_3
    dtoverlay=i2c0,pins_0_1

    https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/README#L2189-L2199

            Do NOT use in conjunction with dtparam=i2c_vc=on. From the 5.4 kernel
            onwards the base DT includes the use of i2c_mux_pinctrl to expose two
            muxings of BSC0 - GPIOs 0&1, and whichever combination is used for the
            camera and display connectors. This overlay disables that mux and
            configures /dev/i2c0 to point at whichever set of pins is requested.
            dtparam=i2c_vc=on will try and enable the mux, so combining the two
            will cause conflicts.
    
  9. kquinnyst commented on Jul 12, 2023

    @kquinnyst
    Author

    With i2cs still flipped -
    $ LIBCAMERA_LOG_LEVELS=*:0 libcamera-hello -t 0 -n

    [0:11:40.698296049] [1074] DEBUG IPAModule ipa_module.cpp:329 ipa_rpi.so: IPA module /usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so is signed
    [0:11:40.698524747] [1074] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module '/usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so'
    [0:11:40.698651466] [1074] DEBUG IPAModule ipa_module.cpp:329 ipa_vimc.so: IPA module /usr/lib/arm-linux-gnueabihf/libcamera/ipa_vimc.so is signed
    [0:11:40.698736361] [1074] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module '/usr/lib/arm-linux-gnueabihf/libcamera/ipa_vimc.so'
    [0:11:40.698848445] [1074]  INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70
    [0:11:40.699313444] [1075] DEBUG Camera camera_manager.cpp:108 Starting camera manager
    [0:11:40.709425523] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "bcm2835-codec" created from /dev/media3
    [0:11:40.709536669] [1075] DEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device /dev/media3 due to 5 missing dependencies
    [0:11:40.712269949] [1075] DEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies for media device /dev/media3 found
    [0:11:40.712382605] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media3: bcm2835-codec
    [0:11:40.712789740] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "bcm2835-isp" created from /dev/media0
    [0:11:40.712874844] [1075] DEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device /dev/media0 due to 4 missing dependencies
    [0:11:40.713571042] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "bcm2835-isp" created from /dev/media1
    [0:11:40.713670365] [1075] DEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device /dev/media1 due to 4 missing dependencies
    [0:11:40.715970624] [1075] DEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies for media device /dev/media0 found
    [0:11:40.716064947] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media0: bcm2835-isp
    [0:11:40.718401092] [1075] DEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies for media device /dev/media1 found
    [0:11:40.718525050] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media1: bcm2835-isp
    [0:11:40.718977862] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "unicam" created from /dev/media2
    [0:11:40.719066873] [1075] DEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device /dev/media2 due to 4 missing dependencies
    [0:11:40.721506142] [1075] DEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies for media device /dev/media2 found
    [0:11:40.721603695] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media2: unicam
    [0:11:40.722213486] [1075] DEBUG Camera camera_manager.cpp:151 Found registered pipeline handler 'PipelineHandlerRPi'
    [0:11:40.722371663] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:312 Successful match for media device "unicam"
    [0:11:40.722482965] [1075] DEBUG DeviceEnumerator device_enumerator.cpp:312 Successful match for media device "bcm2835-isp"
    [0:11:40.722857548] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Exposure (0x00980911)
    [0:11:40.723129423] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Horizontal Flip (0x00980914)
    [0:11:40.723215673] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Vertical Flip (0x00980915)
    [0:11:40.723277860] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Wide Dynamic Range (0x009a0915)
    [0:11:40.723332704] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Camera Orientation (0x009a0922)
    [0:11:40.723402548] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Camera Sensor Rotation (0x009a0923)
    [0:11:40.723461610] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Vertical Blanking (0x009e0901)
    [0:11:40.723662183] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Horizontal Blanking (0x009e0902)
    [0:11:40.723730256] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Analogue Gain (0x009e0903)
    [0:11:40.723787444] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Red Pixel Value (0x009e0904)
    [0:11:40.723841558] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Green (Red) Pixel Value (0x009e0905)
    [0:11:40.723896923] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Blue Pixel Value (0x009e0906)
    [0:11:40.723951662] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Green (Blue) Pixel Value (0x009e0907)
    [0:11:40.724004996] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Notify Gains (0x009e0909)
    [0:11:40.724070725] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Link Frequency (0x009f0901)
    [0:11:40.724135308] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Pixel Rate (0x009f0902)
    [0:11:40.724191193] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Test Pattern (0x009f0903)
    [0:11:40.724265568] [1075] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Digital Gain (0x009f0905)
    [0:11:40.726251453] [1075] DEBUG CameraSensor camera_sensor.cpp:390 'imx708_noir': No static test pattern map for 'imx708_noir'
    [0:11:40.810417612] [1075] DEBUG V4L2 v4l2_device.cpp:635 'dw9807 1-000c': Control: Focus, Absolute (0x009a090a)
    [0:11:40.821381409] [1075] DEBUG IPAManager ipa_manager.cpp:303 IPA module /usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so signature is valid
    [0:11:40.821628128] [1075] DEBUG IPAProxy raspberrypi_ipa_proxy.cpp:45 initializing raspberrypi proxy: loading IPA from /usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so
    [0:11:40.834166195] [1075] DEBUG RPiBlackLevel black_level.cpp:41  Read black levels red 4096 green 4096 blue 4096
    [0:11:40.834765726] [1075] DEBUG RPiAgc agc.cpp:246 Agc
    [0:11:40.834843486] [1075] DEBUG RPiAgc agc.cpp:183 AgcConfig
    [0:11:40.835881871] [1075] DEBUG RPiAlsc alsc.cpp:138 Read calibrations_Cr calibration for ct 3000
    [0:11:40.836257183] [1075] DEBUG RPiAlsc alsc.cpp:138 Read calibrations_Cr calibration for ct 5000
    [0:11:40.836635985] [1075] DEBUG RPiAlsc alsc.cpp:138 Read calibrations_Cb calibration for ct 3000
    [0:11:40.837021766] [1075] DEBUG RPiAlsc alsc.cpp:138 Read calibrations_Cb calibration for ct 5000
    [0:11:40.837520933] [1075] DEBUG RPiSharpen sharpen.cpp:45 Read threshold 1 strength 1 limit 1
    [0:11:40.838720151] [1075] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video0[13:cap]: Opened device platform:3f800000.csi: unicam: unicam
    [0:11:40.839008849] [1075] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video1[14:cap]: Opened device platform:3f800000.csi: unicam: unicam
    [0:11:40.839098849] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Red Balance (0x0098090e)
    [0:11:40.839165255] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Blue Balance (0x0098090f)
    [0:11:40.839221557] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Colour Correction Matrix (0x009819e1)
    [0:11:40.839277651] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Lens Shading (0x009819e2)
    [0:11:40.839331140] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Black Level (0x009819e3)
    [0:11:40.839534682] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Green Equalisation (0x009819e4)
    [0:11:40.839594057] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Gamma (0x009819e5)
    [0:11:40.839649890] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Denoise (0x009819e6)
    [0:11:40.839705932] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Sharpen (0x009819e7)
    [0:11:40.839761140] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Defective Pixel Correction (0x009819e8)
    [0:11:40.839818484] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Colour Denoise (0x009819e9)
    [0:11:40.839876140] [1075] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Digital Gain (0x009f0905)
    [0:11:40.839975619] [1075] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video13[15:out]: Opened device platform:bcm2835-isp: bcm2835-isp: bcm2835-isp
    [0:11:40.840376869] [1075] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video14[16:cap]: Opened device platform:bcm2835-isp: bcm2835-isp: bcm2835-isp
    [0:11:40.840721296] [1075] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video15[17:cap]: Opened device platform:bcm2835-isp: bcm2835-isp: bcm2835-isp
    [0:11:40.841045723] [1075] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video16[18:cap]: Opened device platform:bcm2835-isp: bcm2835-isp: bcm2835-isp
    [0:11:40.841190566] [1075] DEBUG RPiDelayedControls delayed_controls.cpp:103 Set a delay of 3 and priority write flag 0 for Horizontal Blanking
    [0:11:40.841285566] [1075] DEBUG RPiDelayedControls delayed_controls.cpp:103 Set a delay of 3 and priority write flag 1 for Vertical Blanking
    [0:11:40.841351504] [1075] DEBUG RPiDelayedControls delayed_controls.cpp:103 Set a delay of 2 and priority write flag 0 for Exposure
    [0:11:40.841427754] [1075] DEBUG RPiDelayedControls delayed_controls.cpp:103 Set a delay of 2 and priority write flag 0 for Analogue Gain
    [0:11:40.841677493] [1075]  INFO RPI raspberrypi.cpp:1476 Registered camera /base/soc/i2c@7e804000/imx708@1a to Unicam device /dev/media2 and ISP device /dev/media0
    [0:11:40.841775670] [1075] DEBUG Camera camera_manager.cpp:163 Pipeline handler "PipelineHandlerRPi" matched
    [0:11:40.841852858] [1075] DEBUG RPI raspberrypi.cpp:1253 Unable to acquire a Unicam instance
    [0:11:40.841921399] [1075] DEBUG Camera camera_manager.cpp:151 Found registered pipeline handler 'SimplePipelineHandler'
    [0:11:40.841992754] [1075] DEBUG Camera camera_manager.cpp:151 Found registered pipeline handler 'PipelineHandlerUVC'
    [0:11:40.842059316] [1075] DEBUG Camera camera_manager.cpp:151 Found registered pipeline handler 'PipelineHandlerVimc'
    [0:11:40.842606555] [1074] DEBUG RPI raspberrypi.cpp:628 Try color space sYCC
    [0:11:40.842762857] [1074] DEBUG Camera camera.cpp:969 streams configuration: (0) 800x600-NV12
    [0:11:40.843043482] [1074] DEBUG RPI raspberrypi.cpp:628 Try color space sYCC
    [0:11:40.843246711] [1074] DEBUG RPI raspberrypi.cpp:628 Try color space sYCC
    [0:11:40.843338326] [1074]  INFO Camera camera.cpp:1028 configuring streams: (0) 2304x1296-YUV420
    [0:11:40.843461659] [1075] DEBUG RPI raspberrypi.cpp:170 Format: 1536x864 fmt SRGGB10 Score: 3400 (best 3400)
    [0:11:40.843568795] [1075] DEBUG RPI raspberrypi.cpp:170 Format: 2304x1296 fmt SRGGB10 Score: 1000 (best 1000)
    [0:11:40.843644159] [1075] DEBUG RPI raspberrypi.cpp:170 Format: 4608x2592 fmt SRGGB10 Score: 1900 (best 1000)
    [0:11:40.843953951] [1075]  INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c@7e804000/imx708@1a - Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected unicam format: 2304x1296-pBAA
    [0:11:40.844339159] [1075] DEBUG RPI raspberrypi.cpp:883 Setting ISP Output0 to 2304x1296-YU12
    [0:11:40.844552284] [1075] DEBUG RPI raspberrypi.cpp:897 Stream ISP Output0 has color space sYCC
    [0:11:40.844624627] [1075] DEBUG RPI raspberrypi.cpp:963 Setting ISP Output1 (internal) to 1152x648-YU12
    [0:11:40.846221606] [1075] DEBUG IPARPI raspberrypi.cpp:1503 Applying AGC Exposure: 19987.54us (Shutter lines: 1496, AGC requested 20000.00us) Gain: 1 (Gain Code: 0)
    [0:11:40.846630876] [1075] DEBUG RPI raspberrypi.cpp:1019 Setting embedded data format.
    [0:11:40.861074203] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 4 buffers requested.
    [0:11:40.861295713] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.861400297] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.861482015] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.861564307] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.861645922] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 0 buffers requested.
    [0:11:40.862531755] [1074] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:11:40.862665400] [1074] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:11:40.862723213] [1074] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:11:40.862769567] [1074] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:11:40.862867952] [1074] DEBUG Camera camera.cpp:1181 Starting capture
    [0:11:40.863737848] [1079] DEBUG RPiAf af.cpp:756 setMode: 2
    [0:11:40.864023108] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AfMode = 2
    [0:11:40.864196181] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AfSpeed = 0
    [0:11:40.864375660] [1079] DEBUG RPiAf af.cpp:681 setSpeed: 0
    [0:11:40.864539931] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Saturation = 1.000000
    [0:11:40.864726701] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Contrast = 1.000000
    [0:11:40.864894930] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Brightness = 0.000000
    [0:11:40.865063576] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Sharpness = 1.000000
    [0:11:40.865231597] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: ExposureValue = 0.000000
    [0:11:40.865426128] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AeExposureMode = 0
    [0:11:40.865593003] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AfRange = 0
    [0:11:40.865754878] [1079] DEBUG RPiAf af.cpp:674 setRange: 0
    [0:11:40.865905868] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AeMeteringMode = 0
    [0:11:40.866068315] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
    [0:11:40.866243784] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AwbMode = 0
    [0:11:40.866417482] [1079] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: NoiseReductionMode = 3
    [0:11:40.866613211] [1079] DEBUG RPiAgc agc.cpp:522 ev 1 fixedShutter 0.00us fixedAnalogueGain 0
    [0:11:40.866803003] [1079] DEBUG RPiAgc agc.cpp:554 exposureMode normal constraintMode normal meteringMode centre-weighted
    [0:11:40.866975086] [1079] DEBUG RPiAgc agc.cpp:869 Output written, total exposure requested is 0.00us
    [0:11:40.867140398] [1079] DEBUG RPiAgc agc.cpp:871 Camera exposure update: shutter time 1000.00us analogue gain 1
    [0:11:40.867476752] [1079] DEBUG RPiAlsc alsc.cpp:308 AWB results found, using 4000
    [0:11:40.867674148] [1079] DEBUG RPiAlsc alsc.cpp:454 ct is 4000, interpolating between 3000 and 5000
    [0:11:40.867867481] [1079] DEBUG RPiAlsc alsc.cpp:454 ct is 4000, interpolating between 3000 and 5000
    [0:11:40.868378314] [1079] DEBUG RPiAf af.cpp:224 switchMode: statsRegion: 0,0,4608,2592
    [0:11:40.868925814] [1079] DEBUG RPiAf af.cpp:306 Recomputed weights:
    [0:11:40.869180658] [1079] DEBUG RPiAf af.cpp:315    0 0 0 0
    [0:11:40.869438105] [1079] DEBUG RPiAf af.cpp:315    0 384 384 0
    [0:11:40.869762116] [1079] DEBUG RPiAf af.cpp:315    0 0 0 0
    [0:11:40.869944459] [1079] DEBUG IPARPI raspberrypi.cpp:1503 Applying AGC Exposure: 988.69us (Shutter lines: 74, AGC requested 1000.00us) Gain: 1 (Gain Code: 0)
    [0:11:40.870243209] [1079] DEBUG IPARPI raspberrypi.cpp:336 Drop 7 frames on startup
    [0:11:40.881718829] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video0[13:cap]: 4 buffers requested.
    [0:11:40.881899871] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.881968725] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.882027058] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.882085183] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.882140912] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video0[13:cap]: 0 buffers requested.
    [0:11:40.882208725] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video0[13:cap]: 4 buffers requested.
    [0:11:40.882253360] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video0[13:cap]: Prepared to import 4 buffers
    [0:11:40.883517526] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video1[14:cap]: 4 buffers requested.
    [0:11:40.883689870] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.883763724] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.883846745] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.970081184] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.970210559] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video1[14:cap]: 0 buffers requested.
    [0:11:40.970282121] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video1[14:cap]: 4 buffers requested.
    [0:11:40.970327642] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video1[14:cap]: Prepared to import 4 buffers
    [0:11:40.970679621] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video13[15:out]: 8 buffers requested.
    [0:11:40.970832694] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video13[15:out]: Prepared to import 8 buffers
    [0:11:40.974401963] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 1 buffers requested.
    [0:11:40.974579619] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.974645922] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 0 buffers requested.
    [0:11:40.974952432] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 10 buffers requested.
    [0:11:40.975014255] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video14[16:cap]: Prepared to import 10 buffers
    [0:11:40.977142535] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video15[17:cap]: 1 buffers requested.
    [0:11:40.977335347] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.977411962] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video15[17:cap]: 0 buffers requested.
    [0:11:40.978245503] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video15[17:cap]: 1 buffers requested.
    [0:11:40.978337274] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video15[17:cap]: Prepared to import 1 buffers
    [0:11:40.978822586] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video16[18:cap]: 1 buffers requested.
    [0:11:40.979040503] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.979128524] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video16[18:cap]: 0 buffers requested.
    [0:11:40.979433784] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video16[18:cap]: 1 buffers requested.
    [0:11:40.979643315] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video16[18:cap]: Prepared to import 1 buffers
    [0:11:40.979726961] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.979872377] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.979971596] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.980078107] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.980141752] [1075] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:11:40.980214044] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for Unicam Image
    [0:11:40.980334304] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 0
    [0:11:40.980434981] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 1 for Unicam Image
    [0:11:40.980488627] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 1
    [0:11:40.980545242] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 2 for Unicam Image
    [0:11:40.980589929] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 2
    [0:11:40.980648731] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 3 for Unicam Image
    [0:11:40.980696023] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 3
    [0:11:40.980750762] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for Unicam Embedded
    [0:11:40.980797742] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 0
    [0:11:40.980857012] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 1 for Unicam Embedded
    [0:11:40.980901596] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 1
    [0:11:40.980953158] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 2 for Unicam Embedded
    [0:11:40.980997637] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 2
    [0:11:40.981052377] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 3 for Unicam Embedded
    [0:11:40.981095606] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 3
    [0:11:40.981147012] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 4 for ISP Output0
    [0:11:40.981193366] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video14[16:cap]: Queueing buffer 0
    [0:11:40.981261179] [1075] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:11:40.981301596] [1075] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:11:40.981386075] [1075] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:11:40.981482064] [1075] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:11:40.981546960] [1075] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:11:40.981617897] [1075] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:11:40.981658627] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for ISP Output1
    [0:11:40.981765658] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video15[17:cap]: Queueing buffer 0
    [0:11:40.981864616] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for ISP Stats
    [0:11:40.981918783] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video16[18:cap]: Queueing buffer 0
    [0:11:41.195219830] [1075] DEBUG Timer timer.cpp:95 Starting timer 0x75013020: deadline 0:15:25.345178893
    [0:11:41.195709257] [1075] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:11:41.195808528] [1075] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:11:41.195857434] [1075] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:11:41.195902278] [1075] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:11:41.195960872] [1075] DEBUG Event event_dispatcher_poll.cpp:216 next timer 0x75013020 expires in 224.149234063
    [0:11:41.196051549] [1075] DEBUG Event event_dispatcher_poll.cpp:216 next timer 0x75013020 expires in 224.149132917
    [0:15:25.377908427] [1075]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[13:cap]: Dequeue timer of 224150000.00us has expired!
    [0:15:25.378120093] [1075] ERROR RPI raspberrypi.cpp:1984 Unicam has timed out!
    [0:15:25.378197645] [1075] ERROR RPI raspberrypi.cpp:1985 Please check that your camera sensor connector is attached securely.
    [0:15:25.378279520] [1075] ERROR RPI raspberrypi.cpp:1986 Alternatively, try another cable and/or sensor.
    [0:15:25.390859410] [1075] DEBUG Request request.cpp:122 Request(0:X:0/1:0)
    ERROR: Device timeout detected, attempting a restart!!!
    [0:15:25.391216754] [1074] DEBUG Camera camera.cpp:1225 Stopping capture
    [0:15:25.391354306] [1075] DEBUG Request request.cpp:122 Request(1:X:0/1:0)
    [0:15:25.391478264] [1075] DEBUG Request request.cpp:122 Request(2:X:0/1:0)
    [0:15:25.391574566] [1075] DEBUG Request request.cpp:122 Request(3:X:0/1:0)
    [0:15:25.392391962] [1074] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:15:25.392535243] [1074] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:15:25.392633055] [1074] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:15:25.392722482] [1074] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:15:25.392870555] [1074] DEBUG Camera camera.cpp:1181 Starting capture
    [0:15:25.393327534] [1158] DEBUG RPiAf af.cpp:756 setMode: 2
    [0:15:25.393503003] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AfMode = 2
    [0:15:25.393593524] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AfSpeed = 0
    [0:15:25.393680867] [1158] DEBUG RPiAf af.cpp:681 setSpeed: 0
    [0:15:25.393749982] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Saturation = 1.000000
    [0:15:25.393877742] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Contrast = 1.000000
    [0:15:25.393974201] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Brightness = 0.000000
    [0:15:25.394067117] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AwbMode = 0
    [0:15:25.394153367] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Sharpness = 1.000000
    [0:15:25.394251440] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: ExposureValue = 0.000000
    [0:15:25.394347482] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AeExposureMode = 0
    [0:15:25.394434825] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AfRange = 0
    [0:15:25.394520034] [1158] DEBUG RPiAf af.cpp:674 setRange: 0
    [0:15:25.394588419] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AeMeteringMode = 0
    [0:15:25.394677065] [1158] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
    [0:15:25.394798575] [1158] DEBUG RPiAgc agc.cpp:522 ev 1 fixedShutter 0.00us fixedAnalogueGain 0
    [0:15:25.394929409] [1158] DEBUG RPiAgc agc.cpp:554 exposureMode normal constraintMode normal meteringMode centre-weighted
    [0:15:25.395016023] [1158] DEBUG RPiAgc agc.cpp:869 Output written, total exposure requested is 0.00us
    [0:15:25.395109461] [1158] DEBUG RPiAgc agc.cpp:871 Camera exposure update: shutter time 1000.00us analogue gain 1
    [0:15:25.395226127] [1158] DEBUG RPiAlsc alsc.cpp:308 AWB results found, using 4000
    [0:15:25.395369565] [1158] DEBUG RPiAf af.cpp:224 switchMode: statsRegion: 0,0,4608,2592
    [0:15:25.395451179] [1158] DEBUG RPiAf af.cpp:306 Recomputed weights:
    [0:15:25.395521283] [1158] DEBUG RPiAf af.cpp:315    0 0 0 0
    [0:15:25.395589460] [1158] DEBUG RPiAf af.cpp:315    0 384 384 0
    [0:15:25.395654721] [1158] DEBUG RPiAf af.cpp:315    0 0 0 0
    [0:15:25.395733939] [1158] DEBUG IPARPI raspberrypi.cpp:1503 Applying AGC Exposure: 988.69us (Shutter lines: 74, AGC requested 1000.00us) Gain: 1 (Gain Code: 0)
    [0:15:25.396105293] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for Unicam Image
    [0:15:25.396231075] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 0
    [0:15:25.396355554] [1075] DEBUG Timer timer.cpp:95 Starting timer 0x75013020: deadline 0:19:09.546346022
    [0:15:25.396461283] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 1 for Unicam Image
    [0:15:25.396598054] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 1
    [0:15:25.396741960] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 2 for Unicam Image
    [0:15:25.396877272] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 2
    [0:15:25.397014928] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 3 for Unicam Image
    [0:15:25.397150189] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 3
    [0:15:25.397283991] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for Unicam Embedded
    [0:15:25.397419512] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 0
    [0:15:25.397561022] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 1 for Unicam Embedded
    [0:15:25.397691282] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 1
    [0:15:25.397826751] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 2 for Unicam Embedded
    [0:15:25.397957272] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 2
    [0:15:25.398095397] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 3 for Unicam Embedded
    [0:15:25.398225240] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 3
    [0:15:25.398361751] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for ISP Output1
    [0:15:25.398492532] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video15[17:cap]: Queueing buffer 0
    [0:15:25.398634303] [1075] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for ISP Stats
    [0:15:25.398764042] [1075] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video16[18:cap]: Queueing buffer 0
    [0:15:25.399031334] [1075] DEBUG Timer timer.cpp:95 Starting timer 0x75013020: deadline 0:19:09.549021282
    [0:15:25.673066624] [1075] DEBUG Timer timer.cpp:95 Starting timer 0x75013020: deadline 0:19:09.823038134
    [0:15:25.673634280] [1075] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:15:25.673816988] [1075] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:15:25.673953915] [1075] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:15:25.674095894] [1075] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:15:25.674230790] [1075] DEBUG Event event_dispatcher_poll.cpp:216 next timer 0x75013020 expires in 224.148817552
    [0:15:25.674418915] [1075] DEBUG Event event_dispatcher_poll.cpp:216 next timer 0x75013020 expires in 224.148628386
    
  10. kquinnyst commented on Jul 12, 2023

    @kquinnyst
    Author
    Do NOT use in conjunction with dtparam=i2c_vc=on. From the 5.4 kernel
            onwards the base DT includes the use of i2c_mux_pinctrl to expose two
            muxings of BSC0 - GPIOs 0&1, and whichever combination is used for the
            camera and display connectors. This overlay disables that mux and
            configures /dev/i2c0 to point at whichever set of pins is requested.
            dtparam=i2c_vc=on will try and enable the mux, so combining the two
            will cause conflicts.
    

    Yes we dug into the readme as well, we commented out i2c_vc=on and that is the only configuration where we can get a working camera so I think you're on the right track. We used i2c0 (which shouldn't enable the mux), it doesn't work to detect both cameras either
    dtoverlay=i2c1,pins_2_3
    dtoverlay=i2c0,pins_0_1
    and
    #dtparam=i2c_arm=on
    #dtparam=i2c_vc=on
    are equivelant but with dtparam=i2c_vc=on we get no cameras, whereas we can use dtoverlay=i2c0,pins_0_1 we can still get our one camera to connect & take photos (when the i2cs aren't flipped)

  11. 6by9 commented on Jul 12, 2023

    @6by9
    Collaborator

    Drop back to basic level diagnostics (not libcamera).

    # Power on the cameras
    raspi-gpio set 20,22 op,dh
    # Check pin muxing
    raspi-gpio get 0-3,28-29,44-45
    # Check I2C controllers registered
    i2cdetect -l
    # Check devices on those I2C controllers
    sudo i2cdetect -y 0
    sudo i2cdetect -y 1
    

    Only 0&1 should report as SDA0/SCL0.
    i2cdetect -l should report i2c-1 bcm2835 (i2c@7e804000) and i2c-0 bcm2835 (i2c@7e205000). There should not be entries relating to i2c-22-mux
    i2c-detect should report the imx708 sensor on address 0x1a, the VCM on address 0x0c, and probably 0x64 as well.

  12. kquinnyst commented on Jul 12, 2023

    @kquinnyst
    Author

    i2cs are not flipped for this - relevant code

    cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
                           <&csi_frag>, "target:0=",<&csi0>,
                           <&clk_frag>, "target:0=",<&cam0_clk>,
                           <&reg_frag>, "target:0=",<&cam0_reg>,
                           <&cam_node>, "clocks:0=",<&cam0_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam0_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
                    cam1 = <&i2c_frag>, "target:0=",<&i2c_arm>,
                           <&csi_frag>, "target:0=",<&csi1>,
                           <&clk_frag>, "target:0=",<&cam1_clk>,
                           <&reg_frag>, "target:0=",<&cam1_reg>,
                           <&cam_node>, "clocks:0=",<&cam1_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam1_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam1_reg>;
    

    $ raspi-gpio get

    BANK0 (GPIO 0 to 27):
    GPIO 0: level=1 fsel=4 alt=0 func=SDA0
    GPIO 1: level=1 fsel=4 alt=0 func=SCL0
    GPIO 2: level=1 fsel=4 alt=0 func=SDA1
    GPIO 3: level=1 fsel=4 alt=0 func=SCL1
    GPIO 4: level=1 fsel=0 func=INPUT
    GPIO 5: level=1 fsel=0 func=INPUT
    GPIO 6: level=1 fsel=0 func=INPUT
    GPIO 7: level=1 fsel=0 func=INPUT
    GPIO 8: level=1 fsel=0 func=INPUT
    GPIO 9: level=0 fsel=0 func=INPUT
    GPIO 10: level=0 fsel=0 func=INPUT
    GPIO 11: level=0 fsel=0 func=INPUT
    GPIO 12: level=0 fsel=0 func=INPUT
    GPIO 13: level=0 fsel=0 func=INPUT
    GPIO 14: level=1 fsel=4 alt=0 func=TXD0
    GPIO 15: level=1 fsel=4 alt=0 func=RXD0
    GPIO 16: level=0 fsel=0 func=INPUT
    GPIO 17: level=0 fsel=0 func=INPUT
    GPIO 18: level=1 fsel=0 func=INPUT
    GPIO 19: level=0 fsel=0 func=INPUT
    GPIO 20: level=0 fsel=1 func=OUTPUT
    GPIO 21: level=0 fsel=0 func=INPUT
    GPIO 22: level=0 fsel=1 func=OUTPUT
    GPIO 23: level=0 fsel=0 func=INPUT
    GPIO 24: level=0 fsel=0 func=INPUT
    GPIO 25: level=0 fsel=0 func=INPUT
    GPIO 26: level=0 fsel=0 func=INPUT
    GPIO 27: level=0 fsel=0 func=INPUT
    BANK1 (GPIO 28 to 45):
    GPIO 28: level=0 fsel=0 func=INPUT
    GPIO 29: level=0 fsel=0 func=INPUT
    GPIO 30: level=0 fsel=0 func=INPUT
    GPIO 31: level=0 fsel=0 func=INPUT
    GPIO 32: level=0 fsel=0 func=INPUT
    GPIO 33: level=0 fsel=0 func=INPUT
    GPIO 34: level=1 fsel=0 func=INPUT
    GPIO 35: level=0 fsel=0 func=INPUT
    GPIO 36: level=1 fsel=0 func=INPUT
    GPIO 37: level=0 fsel=0 func=INPUT
    GPIO 38: level=1 fsel=0 func=INPUT
    GPIO 39: level=0 fsel=0 func=INPUT
    GPIO 40: level=0 fsel=0 func=INPUT
    GPIO 41: level=0 fsel=0 func=INPUT
    GPIO 42: level=0 fsel=0 func=INPUT
    GPIO 43: level=0 fsel=0 func=INPUT
    GPIO 44: level=0 fsel=0 func=INPUT
    GPIO 45: level=0 fsel=0 func=INPUT
    

    $ raspi-gpio set 20,22 op,dh
    Unknown argument "op,dh"
    $ raspi-gpio set 20 op
    $ raspi-gpio set 22 dh
    $ raspi-gpio get 0-3,28-29,44-45

    GPIO 0: level=1 fsel=4 alt=0 func=SDA0
    GPIO 1: level=1 fsel=4 alt=0 func=SCL0
    GPIO 2: level=1 fsel=4 alt=0 func=SDA1
    GPIO 3: level=1 fsel=4 alt=0 func=SCL1
    GPIO 28: level=0 fsel=0 func=INPUT
    GPIO 29: level=0 fsel=0 func=INPUT
    GPIO 44: level=0 fsel=0 func=INPUT
    GPIO 45: level=0 fsel=0 func=INPUT
    

    $ sudo i2cdetect -l

    i2c-1   i2c             bcm2835 (i2c@7e804000)                  I2C adapter
    i2c-2   i2c             bcm2835 (i2c@7e805000)                  I2C adapter
    i2c-0   i2c             bcm2835 (i2c@7e205000)                  I2C adapter
    

    $ sudo i2cdetect -y 0

         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    

    sudo i2cdetect -y 1

         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- UU -- -- --
    10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    
  13. kquinnyst commented on Jul 12, 2023

    @kquinnyst
    Author

    $ raspi-gpio set 20 op dh
    $ raspi-gpio set 22 op dh
    $ sudo i2cdetect -y 1

         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- UU -- -- --
    10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    

    $ sudo i2cdetect -y 0

         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- 0c -- -- --
    10: -- -- -- -- -- -- -- -- -- -- 1a -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    
  14. kquinnyst commented on Jul 12, 2023

    @kquinnyst
    Author

    Linux UCSD-ORG04-G 6.1.32-v7+ armv7l GNU/Linux -- not working
    Linux UCSD-ORG04-1 6.1.19-v7+ armv7l GNU/Linux -- working (without jiffies update)

    imx708-st from working raspberry pi (UCSD-ORG04-1) that sees both cameras (without jiffies update)

    // SPDX-License-Identifier: GPL-2.0-only
    // Definitions for IMX708 camera module on VC I2C bus
    /dts-v1/;
    /plugin/;
    
    // #include <dt-bindings/gpio/gpio.h>
    #include "kq_gpio.h"
    
    /{
    	compatible = "brcm,bcm2835";
    
    	clk_frag: fragment@1 {
    		target = <&cam1_clk>;
    		__overlay__ {
    			status = "okay";
    			clock-frequency = <24000000>;
    		};
    	};
    
    	reg_frag: fragment@3 {
    		target = <&cam0_reg>;
    		cam_reg: __overlay__ {
    			startup-delay-us = <70000>;
    			off-on-delay-us = <30000>;
    			regulator-min-microvolt = <2700000>;
    			regulator-max-microvolt = <2700000>;
    		};
    	};
    
    	fragment@4 {
    		target = <&cam_node>;
    		__overlay__ {
    			lens-focus = <&vcm_node>;
    		};
    	};
    
    	i2c_frag: fragment@100 {
    		target = <&i2c_vc>;
    		__overlay__ {
    			#address-cells = <1>;
    			#size-cells = <0>;
    			status = "okay";
    
    			#include "imx708.dtsi"
    		};
    	};
    
    	csi_frag: fragment@101 {
    		target = <&csi0>;
    		csi: __overlay__ {
    			status = "okay";
    			brcm,media-controller;
    
    			port {
    				csi_ep: endpoint {
    					remote-endpoint = <&cam_endpoint>;
    					clock-lanes = <0>;
    					data-lanes = <1 2>;
    					clock-noncontinuous;
    				};
    			};
    		};
    	};
    
    	__overrides__ {
    		rotation = <&cam_node>,"rotation:0";
    		orientation = <&cam_node>,"orientation:0";
    		media-controller = <&csi>,"brcm,media-controller?";
    		cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
    		       <&csi_frag>, "target:0=",<&csi0>,
    		       <&clk_frag>, "target:0=",<&cam0_clk>,
    		       <&reg_frag>, "target:0=",<&cam0_reg>,
    		       <&cam_node>, "clocks:0=",<&cam0_clk>,
    		       <&cam_node>, "VANA1-supply:0=",<&cam0_reg>,
    		       <&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
    		cam1 = <&i2c_frag>, "target:0=",<&i2c_arm>,
    		       <&csi_frag>, "target:0=",<&csi1>,
    		       <&clk_frag>, "target:0=",<&cam1_clk>,
    		       <&reg_frag>, "target:0=",<&cam1_reg>,
    		       <&cam_node>, "clocks:0=",<&cam1_clk>,
    		       <&cam_node>, "VANA1-supply:0=",<&cam1_reg>,
    		       <&vcm_node>, "VDD-supply:0=",<&cam1_reg>;
    		vcm = <&vcm_node>, "status",
    		      <0>, "=4";
    	};
    };
    
    &cam_node {
    	status = "okay";
    };
    
    &cam_endpoint {
    	remote-endpoint = <&csi_ep>;
    };
    
    &vcm_node {
    	status = "okay";
    };

    relevant /boot/config.txt from working pi before kernel update (without jiffies update)

    [all]
    enable_uart=1
    dtparam=i2c_arm=on
    dtparam=watchdog=on
    dtoverlay=disable-bt
    arm_64bit=0
    dtparam=i2c_vc=on
    dtparam=cam0_reg
    dtparam=cam0_reg_gpio=20
    dtparam=cam1_reg
    dtparam=cam1_reg_gpio=22
    #dtoverlay=imx219-st,cam0
    #dtoverlay=imx219-st,cam1
    dtoverlay=imx708-st,cam0
    dtoverlay=imx708-st,cam1
    dtoverlay=i2c-rtc-gpio,ds3231,i2c_gpio_sda=4,i2c_gpio_scl=5
    
  15. 6by9 commented on Jul 12, 2023

    @6by9
    Collaborator

    I presume by "jiffies update" you're referring to raspberrypi/linux#5416, but whatever.

    Looking at the history, I'd guess that it's raspberrypi/linux#5428 that is causing you issues.

    Both sensors are showing up via i2cdetect, so it's a configuration issue somewhere.

    Is there anything useful in the kernel log (dmesg)?
    Or in the firmware log from processing device tree (sudo vcdbg log msg)?
    If you look in /proc/device-tree, do you find your sensor as (from memory) /proc/device-tree/soc/i2c@..../imx708, or /proc/device-tree/soc/i2c0-mux/i2c@0/imx708

    If it's the sensor on i2c-0 (GPIOs 0&1) that isn't loading, then as I've said in #68 (comment) I think you want to use &i2c0if, not &i2c_vc.
    The order of the the commands in config.txt will matter if you use dtoverlay=i2c0,pins_0_1, as it updates where the alias for i2c_vc points.

    Although I'm now confused as to whether you want the i2c0 mux or not - your "working" configuration still includes dtparam=i2c_vc=on, and not the dtoverlay=i2c0,pins_0_1 that you'd previously mentioned.

  16. naushir commented on Jul 13, 2023

    @naushir
    Collaborator

    According to your libcamera logs, the device driver had no problems talking to the sensor over I2C. However this bit in the logs:

    [0:15:25.378120093] [1075] ERROR RPI raspberrypi.cpp:1984 Unicam has timed out!
    [0:15:25.378197645] [1075] ERROR RPI raspberrypi.cpp:1985 Please check that your camera sensor connector is attached securely.
    [0:15:25.378279520] [1075] ERROR RPI raspberrypi.cpp:1986 Alternatively, try another cable and/or sensor.
    [0:15:25.390859410] [1075] DEBUG Request request.cpp:122 Request(0:X:0/1:0)
    ERROR: Device timeout detected, attempting a restart!!!
    

    suggest that Unicam has seen no activity from the sensor while streaming. @6by9 commented earlier in #68 (comment) - have you swapped the CSI2 endpoints around?

  17. kquinnyst commented on Jul 13, 2023

    @kquinnyst
    Author

    dmesg

    [   10.852018] i2c-bcm2835 3f805000.i2c: Got unexpected interrupt (from firmware?)
    [   10.886720] imx708 1-001a: camera module ID 0x0381
    [   10.891441] imx708 1-001a: Consider updating driver imx708 to match on endpoints
    

    sudo vcdbg log msg

    Failed to allocate -201253077 bytes for message buffer
    

    I guess I just found it interesting that when we use i2c_vc in our updated Pi we don't see any cameras, but with i2c0 we can see one camera on i2c_arm.

    ls /proc/device-tree/soc/i2c@7e205000

    '#address-cells'   clocks       dw9817@c    interrupts   phandle     pinctrl-names  '#size-cells'
     clock-frequency   compatible   imx708@1a   name         pinctrl-0   reg             status
    

    ls /proc/device-tree/soc/i2c@7e804000/

    \#address-cells  compatible       interrupts       pinctrl-0        \#size-cells
    clock-frequency  dw9817@c/        name             pinctrl-names    status
    clocks           imx708@1a/       phandle          reg
    

    How would I use i2c0if instead?

  18. kquinnyst commented on Jul 13, 2023

    @kquinnyst
    Author

    Tried this to swap to i2c0if - edited

    // SPDX-License-Identifier: GPL-2.0-only
    // Definitions for IMX708 camera module on VC I2C bus
    /dts-v1/;
    /plugin/;
    
    // #include <dt-bindings/gpio/gpio.h>
    #include "kq_gpio.h"
    
    /{
            compatible = "brcm,bcm2835";
    
            clk_frag: fragment@1 {
                    target = <&cam1_clk>;
                    __overlay__ {
                            status = "okay";
                            clock-frequency = <24000000>;
                    };
            };
    
            reg_frag: fragment@3 {
                    target = <&cam1_reg>;
                    cam_reg: __overlay__ {
                            startup-delay-us = <70000>;
                            off-on-delay-us = <30000>;
                            regulator-min-microvolt = <2700000>;
                            regulator-max-microvolt = <2700000>;
                    };
            };
    
            fragment@4 {
                    target = <&cam_node>;
                    __overlay__ {
                            lens-focus = <&vcm_node>;
                    };
            };
    
            i2c_frag: fragment@100 {
                    target = <&i2c0if>;
                    __overlay__ {
                            #address-cells = <1>;
                            #size-cells = <0>;
                            status = "okay";
    
                            #include "imx708.dtsi"
                    };
            };
    
            csi_frag: fragment@101 {
                    target = <&csi0>;
                    csi: __overlay__ {
                            status = "okay";
                            brcm,media-controller;
    
                            port {
                                    csi_ep: endpoint {
                                            remote-endpoint = <&cam_endpoint>;
                                            clock-lanes = <0>;
                                            data-lanes = <1 2>;
                                            clock-noncontinuous;
                                    };
                            };
                    };
            };
    
            __overrides__ {
                    rotation = <&cam_node>,"rotation:0";
                    orientation = <&cam_node>,"orientation:0";
                    media-controller = <&csi>,"brcm,media-controller?";
                    cam0 = <&i2c_frag>, "target:0=",<&i2c0if>,
                           <&csi_frag>, "target:0=",<&csi0>,
                           <&clk_frag>, "target:0=",<&cam0_clk>,
                           <&reg_frag>, "target:0=",<&cam0_reg>,
                           <&cam_node>, "clocks:0=",<&cam0_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam0_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
                    cam1 = <&i2c_frag>, "target:0=",<&i2c_arm>,
                           <&csi_frag>, "target:0=",<&csi1>,
                           <&clk_frag>, "target:0=",<&cam1_clk>,
                           <&reg_frag>, "target:0=",<&cam1_reg>,
                           <&cam_node>, "clocks:0=",<&cam1_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam1_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam1_reg>;
                    vcm = <&vcm_node>, "status",
                          <0>, "=4";
                    link-frequency = <&cam_endpoint>,"link-frequencies#0";
            };
    };
    
    &cam_node {
            status = "okay";
    };
    
    &cam_endpoint {
            remote-endpoint = <&csi_ep>;
    };
    
    &vcm_node {
            status = "okay";
    };

    compiled & rebooted to
    $ libcamera-hello --list-cameras
    No cameras available!

  19. kquinnyst commented on Jul 13, 2023

    @kquinnyst
    Author

    Tried this configuration of i2c0if as well to no avail No Cameras Detected

    // SPDX-License-Identifier: GPL-2.0-only
    // Definitions for IMX708 camera module on VC I2C bus
    /dts-v1/;
    /plugin/;
    
    // #include <dt-bindings/gpio/gpio.h>
    #include "kq_gpio.h"
    
    /{
            compatible = "brcm,bcm2835";
    
            clk_frag: fragment@1 {
                    target = <&cam1_clk>;
                    __overlay__ {
                            status = "okay";
                            clock-frequency = <24000000>;
                    };
            };
    
            reg_frag: fragment@3 {
                    target = <&cam1_reg>;
                    cam_reg: __overlay__ {
                            startup-delay-us = <70000>;
                            off-on-delay-us = <30000>;
                            regulator-min-microvolt = <2700000>;
                            regulator-max-microvolt = <2700000>;
                    };
            };
    
            fragment@4 {
                    target = <&cam_node>;
                    __overlay__ {
                            lens-focus = <&vcm_node>;
                    };
            };
    
            i2c_frag: fragment@100 {
                    target = <&i2c_vc>;
                    __overlay__ {
                            #address-cells = <1>;
                            #size-cells = <0>;
                            status = "okay";
    
                            #include "imx708.dtsi"
                    };
            };
    
            csi_frag: fragment@101 {
                    target = <&csi0>;
                    csi: __overlay__ {
                            status = "okay";
                            brcm,media-controller;
    
                            port {
                                    csi_ep: endpoint {
                                            remote-endpoint = <&cam_endpoint>;
                                            clock-lanes = <0>;
                                            data-lanes = <1 2>;
                                            clock-noncontinuous;
                                    };
                            };
                    };
            };
    
            __overrides__ {
                    rotation = <&cam_node>,"rotation:0";
                    orientation = <&cam_node>,"orientation:0";
                    media-controller = <&csi>,"brcm,media-controller?";
                    cam0 = <&i2c_frag>, "target:0=",<&i2c0if>,
                           <&csi_frag>, "target:0=",<&csi0>,
                           <&clk_frag>, "target:0=",<&cam0_clk>,
                           <&reg_frag>, "target:0=",<&cam0_reg>,
                           <&cam_node>, "clocks:0=",<&cam0_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam0_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
                    cam1 = <&i2c_frag>, "target:0=",<&i2c_arm>,
                           <&csi_frag>, "target:0=",<&csi1>,
                           <&clk_frag>, "target:0=",<&cam1_clk>,
                           <&reg_frag>, "target:0=",<&cam1_reg>,
                           <&cam_node>, "clocks:0=",<&cam1_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam1_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam1_reg>;
                    vcm = <&vcm_node>, "status",
                          <0>, "=4";
                    link-frequency = <&cam_endpoint>,"link-frequencies#0";
            };
    };
    
    &cam_node {
            status = "okay";
    };
    
    &cam_endpoint {
            remote-endpoint = <&csi_ep>;
    };
    
    &vcm_node {
            status = "okay";
    };
  20. kquinnyst commented on Jul 13, 2023

    @kquinnyst
    Author

    Swapping CSI endpoints

    Code

    // SPDX-License-Identifier: GPL-2.0-only
    // Definitions for IMX708 camera module on VC I2C bus
    /dts-v1/;
    /plugin/;
    
    // #include <dt-bindings/gpio/gpio.h>
    #include "kq_gpio.h"
    
    /{
            compatible = "brcm,bcm2835";
    
            clk_frag: fragment@1 {
                    target = <&cam1_clk>;
                    __overlay__ {
                            status = "okay";
                            clock-frequency = <24000000>;
                    };
            };
    
            reg_frag: fragment@3 {
                    target = <&cam1_reg>;
                    cam_reg: __overlay__ {
                            startup-delay-us = <70000>;
                            off-on-delay-us = <30000>;
                            regulator-min-microvolt = <2700000>;
                            regulator-max-microvolt = <2700000>;
                    };
            };
    
            fragment@4 {
                    target = <&cam_node>;
                    __overlay__ {
                            lens-focus = <&vcm_node>;
                    };
            };
    
            i2c_frag: fragment@100 {
                    target = <&i2c_vc>;
                    __overlay__ {
                            #address-cells = <1>;
                            #size-cells = <0>;
                            status = "okay";
    
                            #include "imx708.dtsi"
                    };
            };
    
            csi_frag: fragment@101 {
                    target = <&csi0>;
                    csi: __overlay__ {
                            status = "okay";
                            brcm,media-controller;
    
                            port {
                                    csi_ep: endpoint {
                                            remote-endpoint = <&cam_endpoint>;
                                            clock-lanes = <0>;
                                            data-lanes = <1 2>;
                                            clock-noncontinuous;
                                    };
                            };
                    };
            };
    
            __overrides__ {
                    rotation = <&cam_node>,"rotation:0";
                    orientation = <&cam_node>,"orientation:0";
                    media-controller = <&csi>,"brcm,media-controller?";
                    cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
                           <&csi_frag>, "target:0=",<&csi1>,
                           <&clk_frag>, "target:0=",<&cam0_clk>,
                           <&reg_frag>, "target:0=",<&cam0_reg>,
                           <&cam_node>, "clocks:0=",<&cam0_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam0_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
                    cam1 = <&i2c_frag>, "target:0=",<&i2c_arm>,
                           <&csi_frag>, "target:0=",<&csi0>,
                           <&clk_frag>, "target:0=",<&cam1_clk>,
                           <&reg_frag>, "target:0=",<&cam1_reg>,
                           <&cam_node>, "clocks:0=",<&cam1_clk>,
                           <&cam_node>, "VANA1-supply:0=",<&cam1_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam1_reg>;
                    vcm = <&vcm_node>, "status",
                          <0>, "=4";
                    link-frequency = <&cam_endpoint>,"link-frequencies#0";
            };
    };
    
    &cam_node {
            status = "okay";
    };
    
    &cam_endpoint {
            remote-endpoint = <&csi_ep>;
    };
    
    &vcm_node {
            status = "okay";
    };

    recompile & reboot

    $ libcamera-hello --list-cameras

    Available cameras
    -----------------
    0 : imx708_noir [4608x2592] (/base/soc/i2c@7e804000/imx708@1a)
        Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
                                 2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
                                 4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]

    $ time libcamera-jpeg -o test.jpg

    Preview window unavailable
    ^C
    libcamera-jpeg -o test.jpg  0.09s user 0.07s system 0% cpu 40.521 total
    

    $ LIBCAMERA_LOG_LEVELS=*:0 libcamera-hello -t 0 -n

    [0:02:28.544782174] [833] DEBUG IPAModule ipa_module.cpp:329 ipa_rpi.so: IPA module /usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so is signed
    [0:02:28.545087383] [833] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module '/usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so'
    [0:02:28.545256811] [833] DEBUG IPAModule ipa_module.cpp:329 ipa_vimc.so: IPA module /usr/lib/arm-linux-gnueabihf/libcamera/ipa_vimc.so is signed
    [0:02:28.545381655] [833] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module '/usr/lib/arm-linux-gnueabihf/libcamera/ipa_vimc.so'
    [0:02:28.545531343] [833]  INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70
    [0:02:28.545987959] [834] DEBUG Camera camera_manager.cpp:108 Starting camera manager
    [0:02:28.555707315] [834] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "bcm2835-codec" created from /dev/media2
    [0:02:28.555817523] [834] DEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device /dev/media2 due to 5 missing dependencies
    [0:02:28.558579043] [834] DEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies for media device /dev/media2 found
    [0:02:28.558675502] [834] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media2: bcm2835-codec
    [0:02:28.559066076] [834] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "bcm2835-isp" created from /dev/media0
    [0:02:28.559149253] [834] DEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device /dev/media0 due to 4 missing dependencies
    [0:02:28.559947798] [834] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "bcm2835-isp" created from /dev/media1
    [0:02:28.560070298] [834] DEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device /dev/media1 due to 4 missing dependencies
    [0:02:28.562696297] [834] DEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies for media device /dev/media0 found
    [0:02:28.562795203] [834] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media0: bcm2835-isp
    [0:02:28.565243180] [834] DEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies for media device /dev/media1 found
    [0:02:28.565344170] [834] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media1: bcm2835-isp
    [0:02:28.565693390] [834] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "unicam" created from /dev/media3
    [0:02:28.565767974] [834] DEBUG DeviceEnumerator device_enumerator_udev.cpp:95 Defer media device /dev/media3 due to 4 missing dependencies
    [0:02:28.568161107] [834] DEBUG DeviceEnumerator device_enumerator_udev.cpp:320 All dependencies for media device /dev/media3 found
    [0:02:28.568256055] [834] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media3: unicam
    [0:02:28.568976422] [834] DEBUG Camera camera_manager.cpp:151 Found registered pipeline handler 'PipelineHandlerRPi'
    [0:02:28.569113610] [834] DEBUG DeviceEnumerator device_enumerator.cpp:312 Successful match for media device "unicam"
    [0:02:28.569205121] [834] DEBUG DeviceEnumerator device_enumerator.cpp:312 Successful match for media device "bcm2835-isp"
    [0:02:28.569559705] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Exposure (0x00980911)
    [0:02:28.569987467] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Horizontal Flip (0x00980914)
    [0:02:28.570094186] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Vertical Flip (0x00980915)
    [0:02:28.570153145] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Wide Dynamic Range (0x009a0915)
    [0:02:28.570206166] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Camera Orientation (0x009a0922)
    [0:02:28.570278510] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Camera Sensor Rotation (0x009a0923)
    [0:02:28.570337260] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Vertical Blanking (0x009e0901)
    [0:02:28.570421635] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Horizontal Blanking (0x009e0902)
    [0:02:28.570503146] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Analogue Gain (0x009e0903)
    [0:02:28.570589084] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Red Pixel Value (0x009e0904)
    [0:02:28.570671740] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Green (Red) Pixel Value (0x009e0905)
    [0:02:28.570794918] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Blue Pixel Value (0x009e0906)
    [0:02:28.570942679] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Green (Blue) Pixel Value (0x009e0907)
    [0:02:28.571030439] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Notify Gains (0x009e0909)
    [0:02:28.571123721] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Link Frequency (0x009f0901)
    [0:02:28.571224190] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Pixel Rate (0x009f0902)
    [0:02:28.571309399] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Test Pattern (0x009f0903)
    [0:02:28.571486378] [834] DEBUG V4L2 v4l2_device.cpp:635 'imx708_noir': Control: Digital Gain (0x009f0905)
    [0:02:28.574357794] [834] DEBUG CameraSensor camera_sensor.cpp:390 'imx708_noir': No static test pattern map for 'imx708_noir'
    [0:02:28.663253043] [834] DEBUG V4L2 v4l2_device.cpp:635 'dw9807 1-000c': Control: Focus, Absolute (0x009a090a)
    [0:02:28.674452924] [834] DEBUG IPAManager ipa_manager.cpp:303 IPA module /usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so signature is valid
    [0:02:28.674687717] [834] DEBUG IPAProxy raspberrypi_ipa_proxy.cpp:45 initializing raspberrypi proxy: loading IPA from /usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so
    [0:02:28.687175363] [834] DEBUG RPiBlackLevel black_level.cpp:41  Read black levels red 4096 green 4096 blue 4096
    [0:02:28.688083126] [834] DEBUG RPiAgc agc.cpp:246 Agc
    [0:02:28.688170575] [834] DEBUG RPiAgc agc.cpp:183 AgcConfig
    [0:02:28.689113495] [834] DEBUG RPiAlsc alsc.cpp:138 Read calibrations_Cr calibration for ct 3000
    [0:02:28.689474173] [834] DEBUG RPiAlsc alsc.cpp:138 Read calibrations_Cr calibration for ct 5000
    [0:02:28.690131519] [834] DEBUG RPiAlsc alsc.cpp:138 Read calibrations_Cb calibration for ct 3000
    [0:02:28.690785844] [834] DEBUG RPiAlsc alsc.cpp:138 Read calibrations_Cb calibration for ct 5000
    [0:02:28.691265116] [834] DEBUG RPiSharpen sharpen.cpp:45 Read threshold 1 strength 1 limit 1
    [0:02:28.692608819] [834] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video0[13:cap]: Opened device platform:3f800000.csi: unicam: unicam
    [0:02:28.693379499] [834] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video1[14:cap]: Opened device platform:3f800000.csi: unicam: unicam
    [0:02:28.693533041] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Red Balance (0x0098090e)
    [0:02:28.693608666] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Blue Balance (0x0098090f)
    [0:02:28.693666843] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Colour Correction Matrix (0x009819e1)
    [0:02:28.693725177] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Lens Shading (0x009819e2)
    [0:02:28.693780646] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Black Level (0x009819e3)
    [0:02:28.693880438] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Green Equalisation (0x009819e4)
    [0:02:28.694279606] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Gamma (0x009819e5)
    [0:02:28.694361325] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Denoise (0x009819e6)
    [0:02:28.694426221] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Sharpen (0x009819e7)
    [0:02:28.694503773] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Defective Pixel Correction (0x009819e8)
    [0:02:28.694594451] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Colour Denoise (0x009819e9)
    [0:02:28.694685805] [834] DEBUG V4L2 v4l2_device.cpp:635 /dev/video13[15:cap]: Control: Digital Gain (0x009f0905)
    [0:02:28.694822941] [834] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video13[15:out]: Opened device platform:bcm2835-isp: bcm2835-isp: bcm2835-isp
    [0:02:28.695172109] [834] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video14[16:cap]: Opened device platform:bcm2835-isp: bcm2835-isp: bcm2835-isp
    [0:02:28.695414974] [834] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video15[17:cap]: Opened device platform:bcm2835-isp: bcm2835-isp: bcm2835-isp
    [0:02:28.695617214] [834] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video16[18:cap]: Opened device platform:bcm2835-isp: bcm2835-isp: bcm2835-isp
    [0:02:28.695751694] [834] DEBUG RPiDelayedControls delayed_controls.cpp:103 Set a delay of 3 and priority write flag 0 for Horizontal Blanking
    [0:02:28.695846851] [834] DEBUG RPiDelayedControls delayed_controls.cpp:103 Set a delay of 3 and priority write flag 1 for Vertical Blanking
    [0:02:28.695916434] [834] DEBUG RPiDelayedControls delayed_controls.cpp:103 Set a delay of 2 and priority write flag 0 for Exposure
    [0:02:28.695985757] [834] DEBUG RPiDelayedControls delayed_controls.cpp:103 Set a delay of 2 and priority write flag 0 for Analogue Gain
    [0:02:28.696265706] [834]  INFO RPI raspberrypi.cpp:1476 Registered camera /base/soc/i2c@7e804000/imx708@1a to Unicam device /dev/media3 and ISP device /dev/media0
    [0:02:28.696391227] [834] DEBUG Camera camera_manager.cpp:163 Pipeline handler "PipelineHandlerRPi" matched
    [0:02:28.696473259] [834] DEBUG RPI raspberrypi.cpp:1253 Unable to acquire a Unicam instance
    [0:02:28.696519092] [834] DEBUG Camera camera_manager.cpp:151 Found registered pipeline handler 'SimplePipelineHandler'
    [0:02:28.696581020] [834] DEBUG Camera camera_manager.cpp:151 Found registered pipeline handler 'PipelineHandlerUVC'
    [0:02:28.696649301] [834] DEBUG Camera camera_manager.cpp:151 Found registered pipeline handler 'PipelineHandlerVimc'
    [0:02:28.697448627] [833] DEBUG RPI raspberrypi.cpp:628 Try color space sYCC
    [0:02:28.697634461] [833] DEBUG Camera camera.cpp:969 streams configuration: (0) 800x600-NV12
    [0:02:28.697958993] [833] DEBUG RPI raspberrypi.cpp:628 Try color space sYCC
    [0:02:28.698219723] [833] DEBUG RPI raspberrypi.cpp:628 Try color space sYCC
    [0:02:28.698350869] [833]  INFO Camera camera.cpp:1028 configuring streams: (0) 2304x1296-YUV420
    [0:02:28.698920351] [834] DEBUG RPI raspberrypi.cpp:170 Format: 1536x864 fmt SRGGB10 Score: 3400 (best 3400)
    [0:02:28.699117955] [834] DEBUG RPI raspberrypi.cpp:170 Format: 2304x1296 fmt SRGGB10 Score: 1000 (best 1000)
    [0:02:28.699183997] [834] DEBUG RPI raspberrypi.cpp:170 Format: 4608x2592 fmt SRGGB10 Score: 1900 (best 1000)
    [0:02:28.699505509] [834]  INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c@7e804000/imx708@1a - Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected unicam format: 2304x1296-pBAA
    [0:02:28.699863114] [834] DEBUG RPI raspberrypi.cpp:883 Setting ISP Output0 to 2304x1296-YU12
    [0:02:28.700329834] [834] DEBUG RPI raspberrypi.cpp:897 Stream ISP Output0 has color space sYCC
    [0:02:28.700439054] [834] DEBUG RPI raspberrypi.cpp:963 Setting ISP Output1 (internal) to 1152x648-YU12
    [0:02:28.702480571] [834] DEBUG IPARPI raspberrypi.cpp:1503 Applying AGC Exposure: 19987.54us (Shutter lines: 1496, AGC requested 20000.00us) Gain: 1 (Gain Code: 0)
    [0:02:28.703220834] [834] DEBUG RPI raspberrypi.cpp:1019 Setting embedded data format.
    [0:02:28.717530101] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 4 buffers requested.
    [0:02:28.717723904] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.717814164] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.717877498] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.717960259] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.718024530] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 0 buffers requested.
    [0:02:28.718930314] [833] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:02:28.719068127] [833] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:02:28.719130419] [833] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:02:28.719181044] [833] DEBUG Request request.cpp:361 Created request - cookie: 0
    [0:02:28.719292867] [833] DEBUG Camera camera.cpp:1181 Starting capture
    [0:02:28.719917921] [838] DEBUG RPiAf af.cpp:756 setMode: 2
    [0:02:28.720078026] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AfMode = 2
    [0:02:28.720137141] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AfSpeed = 0
    [0:02:28.720191360] [838] DEBUG RPiAf af.cpp:681 setSpeed: 0
    [0:02:28.720228912] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Saturation = 1.000000
    [0:02:28.720304277] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Contrast = 1.000000
    [0:02:28.720354590] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Brightness = 0.000000
    [0:02:28.720403236] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: Sharpness = 1.000000
    [0:02:28.720450267] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: ExposureValue = 0.000000
    [0:02:28.720527455] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AeExposureMode = 0
    [0:02:28.720574799] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AfRange = 0
    [0:02:28.720619955] [838] DEBUG RPiAf af.cpp:674 setRange: 0
    [0:02:28.720683393] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AeMeteringMode = 0
    [0:02:28.720749487] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
    [0:02:28.720829539] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: AwbMode = 0
    [0:02:28.720896414] [838] DEBUG IPARPI raspberrypi.cpp:816 Request ctrl: NoiseReductionMode = 3
    [0:02:28.720991363] [838] DEBUG RPiAgc agc.cpp:522 ev 1 fixedShutter 0.00us fixedAnalogueGain 0
    [0:02:28.721087821] [838] DEBUG RPiAgc agc.cpp:554 exposureMode normal constraintMode normal meteringMode centre-weighted
    [0:02:28.721172353] [838] DEBUG RPiAgc agc.cpp:869 Output written, total exposure requested is 0.00us
    [0:02:28.721244749] [838] DEBUG RPiAgc agc.cpp:871 Camera exposure update: shutter time 1000.00us analogue gain 1
    [0:02:28.721328603] [838] DEBUG RPiAlsc alsc.cpp:308 AWB results found, using 4000
    [0:02:28.721415791] [838] DEBUG RPiAlsc alsc.cpp:454 ct is 4000, interpolating between 3000 and 5000
    [0:02:28.721508239] [838] DEBUG RPiAlsc alsc.cpp:454 ct is 4000, interpolating between 3000 and 5000
    [0:02:28.721642719] [838] DEBUG RPiAf af.cpp:224 switchMode: statsRegion: 0,0,4608,2592
    [0:02:28.721710688] [838] DEBUG RPiAf af.cpp:306 Recomputed weights:
    [0:02:28.721767771] [838] DEBUG RPiAf af.cpp:315    0 0 0 0
    [0:02:28.721824855] [838] DEBUG RPiAf af.cpp:315    0 384 384 0
    [0:02:28.721884647] [838] DEBUG RPiAf af.cpp:315    0 0 0 0
    [0:02:28.721948814] [838] DEBUG IPARPI raspberrypi.cpp:1503 Applying AGC Exposure: 988.69us (Shutter lines: 74, AGC requested 1000.00us) Gain: 1 (Gain Code: 0)
    [0:02:28.722063970] [838] DEBUG IPARPI raspberrypi.cpp:336 Drop 7 frames on startup
    [0:02:28.737356522] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video0[13:cap]: 4 buffers requested.
    [0:02:28.737576627] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.737664700] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.737749180] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.737830430] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.737909284] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video0[13:cap]: 0 buffers requested.
    [0:02:28.738005691] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video0[13:cap]: 4 buffers requested.
    [0:02:28.738079597] [834] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video0[13:cap]: Prepared to import 4 buffers
    [0:02:28.739436789] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video1[14:cap]: 4 buffers requested.
    [0:02:28.739610853] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.739687988] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.739744291] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.770110070] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.770281998] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video1[14:cap]: 0 buffers requested.
    [0:02:28.770396165] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video1[14:cap]: 4 buffers requested.
    [0:02:28.770475540] [834] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video1[14:cap]: Prepared to import 4 buffers
    [0:02:28.771085230] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video13[15:out]: 8 buffers requested.
    [0:02:28.771281220] [834] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video13[15:out]: Prepared to import 8 buffers
    [0:02:28.777246188] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 1 buffers requested.
    [0:02:28.777533533] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.777651398] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 0 buffers requested.
    [0:02:28.778424838] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video14[16:cap]: 10 buffers requested.
    [0:02:28.778653745] [834] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video14[16:cap]: Prepared to import 10 buffers
    [0:02:28.781744068] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video15[17:cap]: 1 buffers requested.
    [0:02:28.782240163] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.782523445] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video15[17:cap]: 0 buffers requested.
    [0:02:28.783892513] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video15[17:cap]: 1 buffers requested.
    [0:02:28.784051524] [834] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video15[17:cap]: Prepared to import 1 buffers
    [0:02:28.784767411] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video16[18:cap]: 1 buffers requested.
    [0:02:28.784938766] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.785028350] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video16[18:cap]: 0 buffers requested.
    [0:02:28.785452101] [834] DEBUG V4L2 v4l2_videodevice.cpp:1254 /dev/video16[18:cap]: 1 buffers requested.
    [0:02:28.785545747] [834] DEBUG V4L2 v4l2_videodevice.cpp:1521 /dev/video16[18:cap]: Prepared to import 1 buffers
    [0:02:28.785643196] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.785812207] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.785921061] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.786023770] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.786155854] [834] DEBUG Buffer framebuffer.cpp:346 Buffer is contiguous
    [0:02:28.786275906] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for Unicam Image
    [0:02:28.786388094] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 0
    [0:02:28.786521584] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 1 for Unicam Image
    [0:02:28.786601636] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 1
    [0:02:28.786691897] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 2 for Unicam Image
    [0:02:28.786767574] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 2
    [0:02:28.786850908] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 3 for Unicam Image
    [0:02:28.786925648] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video0[13:cap]: Queueing buffer 3
    [0:02:28.787015023] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for Unicam Embedded
    [0:02:28.787092055] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 0
    [0:02:28.787179294] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 1 for Unicam Embedded
    [0:02:28.787254503] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 1
    [0:02:28.787340337] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 2 for Unicam Embedded
    [0:02:28.787412056] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 2
    [0:02:28.787498306] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 3 for Unicam Embedded
    [0:02:28.787573202] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video1[14:cap]: Queueing buffer 3
    [0:02:28.787660182] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 4 for ISP Output0
    [0:02:28.787739453] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video14[16:cap]: Queueing buffer 0
    [0:02:28.787847422] [834] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:02:28.787916068] [834] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:02:28.787977058] [834] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:02:28.788040235] [834] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:02:28.788099454] [834] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:02:28.788161069] [834] DEBUG RPISTREAM rpi_stream.cpp:131 No buffers available for ISP Output0
    [0:02:28.788223100] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for ISP Output1
    [0:02:28.788302944] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video15[17:cap]: Queueing buffer 0
    [0:02:28.788419195] [834] DEBUG RPISTREAM rpi_stream.cpp:238 Queuing buffer 0 for ISP Stats
    [0:02:28.788499039] [834] DEBUG V4L2 v4l2_videodevice.cpp:1693 /dev/video16[18:cap]: Queueing buffer 0
    [0:02:28.968429165] [834] DEBUG Timer timer.cpp:95 Starting timer 0x75013020: deadline 0:06:13.118372758
    [0:02:28.968646978] [834] DEBUG Event event_dispatcher_poll.cpp:216 next timer 0x75013020 expires in 224.149742030
    [0:02:28.969361668] [834] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:02:28.969513908] [834] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:02:28.969606095] [834] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:02:28.969694012] [834] DEBUG RPI raspberrypi.cpp:1207 queueRequestDevice: New request.
    [0:02:28.969778804] [834] DEBUG Event event_dispatcher_poll.cpp:216 next timer 0x75013020 expires in 224.148602964
    
  21. 6by9 commented on Jul 13, 2023

    @6by9
    Collaborator

    TBH There's little point in throwing the logs from all your experiments on here.
    I have a CM3 set up here to recreate it, and will report back.

  22. 6by9 commented on Jul 13, 2023

    @6by9
    Collaborator

    So the reason for the breakage is raspberrypi/linux@dbb9efd
    The regulators have been renamed based on upstream review and requested changes.

    Your overlay therefore doesn't amend the regulator for cam0 appropriately, therefore the sensor doesn't get powered up, and fails to probe.

    pi@raspberrypi:/proc/device-tree $ sudo cat /sys/kernel/debug/regulator/regulator_summary 
     regulator                      use open bypass  opmode voltage current     min     max
    ---------------------------------------------------------------------------------------
     regulator-dummy                  1    1      0 unknown     0mV     0mA     0mV     0mV 
        phy-vcc                       0                                 0mA     0mV     0mV
     cam1-reg                         0    2      0 unknown  2700mV     0mA  2700mV  2700mV 
        1-001a-vana1                  0                                 0mA     0mV     0mV
        1-000c-VDD                    0                                 0mA     0mV     0mV
     cam0-reg                         0    1      0 unknown  2700mV     0mA  2700mV  2700mV 
        0-000c-VDD                    0                                 0mA     0mV     0mV
     cam-dummy-reg                    1    3      0 unknown     0mV     0mA     0mV     0mV 
        1-001a-vddl                   0                                 0mA     0mV     0mV
        1-001a-vdig                   0                                 0mA     0mV     0mV
        1-001a-vana2                  0                                 0mA     0mV     0mV
     3v3                              1    0      0 unknown  3300mV     0mA  3300mV  3300mV 
     5v0                              1    0      0 unknown  5000mV     0mA  5000mV  5000mV 
    

    Amend your overlay overrides to

           __overrides__ {
                    rotation = <&cam_node>,"rotation:0";
                    orientation = <&cam_node>,"orientation:0";
                    media-controller = <&csi>,"brcm,media-controller?";
                    cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
                           <&csi_frag>, "target:0=",<&csi0>,
                           <&clk_frag>, "target:0=",<&cam0_clk>,
                           <&reg_frag>, "target:0=",<&cam0_reg>,
                           <&cam_node>, "clocks:0=",<&cam0_clk>,
                           <&cam_node>, "vana1-supply:0=",<&cam0_reg>,  <<<<<<<<<<<<<
                           <&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
                    cam1 = <&i2c_frag>, "target:0=",<&i2c_arm>,
                           <&csi_frag>, "target:0=",<&csi1>,
                           <&clk_frag>, "target:0=",<&cam1_clk>,
                           <&reg_frag>, "target:0=",<&cam1_reg>,
                           <&cam_node>, "clocks:0=",<&cam1_clk>,
                           <&cam_node>, "vana1-supply:0=",<&cam1_reg>, <<<<<<<<<<<<<<
                           <&vcm_node>, "VDD-supply:0=",<&cam1_reg>;
                    vcm = <&vcm_node>, "status",
                          <0>, "=4";
                    link-frequency = <&cam_endpoint>,"link-frequencies#0";
            };
    
  23. 6by9 commented on Jul 13, 2023

    @6by9
    Collaborator

    For reference, my complete overlay is

    // SPDX-License-Identifier: GPL-2.0-only
    // Definitions for IMX708 camera module on VC I2C bus
    /dts-v1/;
    /plugin/;
    
    #include <dt-bindings/gpio/gpio.h>
    //#include "kq_gpio.h"
    
    /{
            compatible = "brcm,bcm2835";
    
            clk_frag: fragment@1 {
                    target = <&cam1_clk>;
                    __overlay__ {
                            status = "okay";
                            clock-frequency = <24000000>;
                    };
            };
    
            reg_frag: fragment@3 {
                    target = <&cam1_reg>;
                    cam_reg: __overlay__ {
                            startup-delay-us = <70000>;
                            off-on-delay-us = <30000>;
                            regulator-min-microvolt = <2700000>;
                            regulator-max-microvolt = <2700000>;
                    };
            };
    
            fragment@4 {
                    target = <&cam_node>;
                    __overlay__ {
                            lens-focus = <&vcm_node>;
                    };
            };
    
            i2c_frag: fragment@100 {
                    target = <&i2c_vc>;
                    __overlay__ {
                            #address-cells = <1>;
                            #size-cells = <0>;
                            status = "okay";
    
                            #include "imx708.dtsi"
                    };
            };
    
            csi_frag: fragment@101 {
                    target = <&csi0>;
                    csi: __overlay__ {
                            status = "okay";
                            brcm,media-controller;
    
                            port {
                                    csi_ep: endpoint {
                                            remote-endpoint = <&cam_endpoint>;
                                            clock-lanes = <0>;
                                            data-lanes = <1 2>;
                                            clock-noncontinuous;
                                    };
                            };
                    };
            };
    
            __overrides__ {
                    rotation = <&cam_node>,"rotation:0";
                    orientation = <&cam_node>,"orientation:0";
                    media-controller = <&csi>,"brcm,media-controller?";
                    cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
                           <&csi_frag>, "target:0=",<&csi0>,
                           <&clk_frag>, "target:0=",<&cam0_clk>,
                           <&reg_frag>, "target:0=",<&cam0_reg>,
                           <&cam_node>, "clocks:0=",<&cam0_clk>,
                           <&cam_node>, "vana1-supply:0=",<&cam0_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
                    cam1 = <&i2c_frag>, "target:0=",<&i2c_arm>,
                           <&csi_frag>, "target:0=",<&csi1>,
                           <&clk_frag>, "target:0=",<&cam1_clk>,
                           <&reg_frag>, "target:0=",<&cam1_reg>,
                           <&cam_node>, "clocks:0=",<&cam1_clk>,
                           <&cam_node>, "vana1-supply:0=",<&cam1_reg>,
                           <&vcm_node>, "VDD-supply:0=",<&cam1_reg>;
                    vcm = <&vcm_node>, "status",
                          <0>, "=4";
                    link-frequency = <&cam_endpoint>,"link-frequencies#0";
            };
    };
    
    &cam_node {
            status = "okay";
    };
    
    &cam_endpoint {
            remote-endpoint = <&csi_ep>;
    };
    
    &vcm_node {
            status = "okay";
    };
    

    and nearly your config.txt entries (just the regulator GPIOs changed)

    enable_uart=1
    dtparam=i2c_arm=on
    dtparam=watchdog=on
    dtoverlay=disable-bt
    arm_64bit=0
    dtparam=i2c_vc=on
    dtparam=cam0_reg
    dtparam=cam0_reg_gpio=22
    dtparam=cam1_reg
    dtparam=cam1_reg_gpio=24
    #dtoverlay=imx219-st,cam0
    #dtoverlay=imx219-st,cam1
    dtoverlay=imx708,cam0
    dtoverlay=imx708,cam1
    #dtoverlay=i2c-rtc-gpio,ds3231,i2c_gpio_sda=4,i2c_gpio_scl=5
    
  24. 6by9 commented on Jul 13, 2023

    @6by9
    Collaborator
    pi@raspberrypi:~ $ libcamera-hello --list-cameras
    Available cameras
    -----------------
    0 : imx708_wide [4608x2592] (/base/soc/i2c@7e804000/imx708@1a)
        Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
                                 2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
                                 4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]
    
    1 : imx708 [4608x2592] (/base/soc/i2c0mux/i2c@0/imx708@1a)
        Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
                                 2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
                                 4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]
    
  25. kquinnyst commented on Jul 13, 2023

    @kquinnyst
    Author

    Y'all are amazing thank you so much!

    libcamera-jpeg --list-cameras

    Available cameras
    -----------------
    0 : imx708_noir [4608x2592] (/base/soc/i2c0mux/i2c@0/imx708@1a)
        Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
                                 2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
                                 4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]
    1 : imx708_noir [4608x2592] (/base/soc/i2c@7e804000/imx708@1a)
        Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
                                 2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
                                 4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions