Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc

    SOLVED IMX462 struggling to get V4L2 working on astroberry (buster 5.10.103-v7l+)

    VEYE MIPI camera
    2
    10
    1003
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      salamander last edited by

      Hello,

      I have tried to follow the guide on http://wiki.veye.cc/index.php/V4L2_mode_for_Raspberry_Pi, but unfortunatelly i did not managed to get it to work.

      I will post some info about my system and steps that I tried:
      lsb_release -a ... Raspbian GNU/Linux 10 (buster)
      uname -a ... Linux astroberry 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux
      Camera and I2C is enabled in raspi-config
      I do not use the display, raspberry is controlled via vnc
      Software toolkit is downloaded, when i try veye_raspivid -t 5000 -o ~/test.h264, video is recorded, camera works
      ./enable_i2c_vc.sh was executed

      ./camera_i2c_config
      setting GPIO for board revsion: c03114
      4B(1G/2G/4G/8G)
      Set state of 133 to 1
      Use i2c-10 for the sensor (-y 10)

      ./veye_mipi_i2c.sh -r -f hdver
      hardware version is 0x 6

      ./veye_mipi_i2c.sh -w -f videoformat -p1 NTSC
      w videoformat is NTSC

      ./veye_mipi_i2c.sh -r -f cameramode
      r cameramode is 0x 0

      ./veye_mipi_i2c.sh -r -f boardmodel
      Board model is VEYE-MIPI-IMX327S

      ./veye_mipi_i2c.sh -r -f sensorid
      r sensor id is IMX 462; ONE board

      For V4L2 installation i followed the staps according to the guide:
      wget https://github.com/veyeimaging/raspberrypi_v4l2/releases/latest/download/raspberrypi_v4l2.tgz
      tar -xzvf raspberrypi_v4l2.tgz
      cd raspberrypi_v4l2/release/
      chmod +x *
      sudo ./install_driver.sh veyecam2m

      After restart I tried:
      dmesg | grep veye ... no reponse (empty text)
      ls /dev/video0
      ls: cannot access '/dev/video0': No such file or directory
      cannot open it in vlc as well

      I have tried to compile drivers locally, same result as with precompiled drivers. I have found same verson as as my system in the pre-compiled drivers.

      This is the content of the boot/config.txt

      For more options and information see

      http://rpf.io/configtxt

      Some settings may impact device functionality. See link above for details

      uncomment if you get no picture on HDMI for a default "safe" mode

      #hdmi_safe=1

      uncomment this if your display has a black border of unused pixels visible

      and your display can output without overscan

      #disable_overscan=1

      uncomment the following to adjust overscan. Use positive numbers if console

      goes off screen, and negative if there is too much border

      #overscan_left=16
      #overscan_right=16
      #overscan_top=16
      #overscan_bottom=16

      uncomment to force a console size. By default it will be display's size minus

      overscan.

      #framebuffer_width=1280
      #framebuffer_height=720

      uncomment if hdmi display is not detected and composite is being output

      hdmi_force_hotplug=1

      uncomment to force a specific HDMI mode (this will force VGA)

      hdmi_group=2
      hdmi_mode=82

      uncomment to force a HDMI mode rather than DVI. This can make audio work in

      DMT (computer monitor) modes

      #hdmi_drive=2

      uncomment to increase signal to HDMI, if you have interference, blanking, or

      no display

      #config_hdmi_boost=4

      uncomment for composite PAL

      #sdtv_mode=2

      #uncomment to overclock the arm. 700 MHz is the default.
      #arm_freq=800

      Uncomment some or all of these to enable the optional hardware interfaces

      dtparam=i2c_arm=on
      dtparam=i2s=on
      dtparam=spi=on

      Uncomment this to enable infrared communication.

      #dtoverlay=gpio-ir,gpio_pin=17
      #dtoverlay=gpio-ir-tx,gpio_pin=18

      Additional overlays and parameters are documented /boot/overlays/README

      Enable audio (loads snd_bcm2835)

      #dtparam=audio=on

      [pi4]

      Enable DRM VC4 V3D driver on top of the dispmanx display stack

      #dtoverlay=vc4-fkms-v3d
      max_framebuffers=2

      [all]
      #dtoverlay=vc4-fkms-v3d
      enable_uart=1
      gpu_mem=128
      hdmi_force_hotplug=1
      hdmi_group=2
      hdmi_mode=82
      start_x=1
      dtoverlay=w1-gpio
      dtparam=i2c_vc=on
      gpu_mem=400
      dtoverlay=veyecam2m,media-controller=0

      Is there something iam missing??

      Thank you for the help in advance!

      veye_xumm 1 Reply Last reply Reply Quote 0
      • veye_xumm
        veye_xumm @salamander last edited by

        @salamander
        I think this is a dts bug, and have fixed it.
        https://github.com/veyeimaging/raspberrypi_v4l2/releases/tag/v1.05

        S 1 Reply Last reply Reply Quote 0
        • veye_xumm
          veye_xumm @salamander last edited by

          @salamander
          There is a dts error. Please refer to the new release version here.
          https://github.com/veyeimaging/raspberrypi_v4l2/releases/tag/v1.04

          S 1 Reply Last reply Reply Quote 0
          • S
            salamander @veye_xumm last edited by

            @veye_xumm Thank you for checking. I have tried the updated drivers. Its not working, but least the driver tries to start. I have tried to compile driver locally, but it is the same result.

            astroberry@astroberry:~ $ dmesg | grep veye
            [ 6.583170] veyecam2m: loading out-of-tree module taints kernel.
            [ 6.716455] veyecam2m 10-003b: probe failed
            [ 31.844086] veyecam_vana: disabling
            [ 31.844103] veyecam_vddl: disabling
            [ 31.844116] veyecam_vdig: disabling

            What could be still wrong?

            veye_xumm 1 Reply Last reply Reply Quote 0
            • veye_xumm
              veye_xumm @salamander last edited by

              @salamander I think the driver works. Please check your hardware connection to find why it probe failed.

              S 1 Reply Last reply Reply Quote 0
              • S
                salamander @veye_xumm last edited by

                @veye_xumm

                OK, I have tested something that worked before to check the camera function and connection:

                ./veye_raspivid -t 5000 -o ~/tes1t.h264
                camera num -1
                Hardare version: c03114
                mmal: mmal_component_enable w 1920 h 1080 fps 30

                raspipreview_create com
                mmal: Splitter has 4 output port,you could use num 2,3 for extend

                It does not do more at this point, just stops there and no video is recorded. Camera is responding to the I2C commands however.

                I have tried to uninstall the V4L2 driver and restart and after that recording works:
                I have just executed this one command after the raspberry was restarted (no I2C commands to configure, etc)
                ./veye_raspivid -t 5000 -o ~/tes1t.h264
                camera num -1
                Hardare version: c03114
                mmal: mmal_component_enable w 1920 h 1080 fps 30

                raspipreview_create com
                mmal: Splitter has 4 output port,you could use num 2,3 for extend
                mmal: running now!!
                mmal: running stop!! 0

                Video is recorded as expected.

                Are there maybe some logs somewhere to see more exactly vhy the V4L2 diver refuses to work? Also when the V4L2 is active, should it prevent the camera to be used othewise, for example to record the video or stream?

                Thank you

                veye_xumm 1 Reply Last reply Reply Quote 0
                • veye_xumm
                  veye_xumm @salamander last edited by

                  @salamander
                  Hi,

                  V4l2 mode and Legacy mode are not supported at the same time, see this page for details.
                  http://wiki.veye.cc/index.php/Raspberry_Pi_Application_Note_Index

                  Based on your description, I think the mipi data channel is ok.
                  But i2c can't access to camera correctly. Are you using rpi 4b?
                  Try

                  i2cdetect -y 10
                  

                  See if there is a device with 0x3b address?

                  S 2 Replies Last reply Reply Quote 0
                  • S
                    salamander @veye_xumm last edited by

                    @veye_xumm
                    Thank you for the further information. Yes Iam using rpi 4b.
                    I have tried the i2cdetect fresh after start of the respberry
                    astroberry@astroberry:~ $ i2cdetect -y 10
                    0 1 2 3 4 5 6 7 8 9 a b c d e f
                    00: -- -- -- -- -- -- -- -- -- -- -- -- --
                    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    70: -- -- -- -- -- -- -- --
                    No device is found with 3b address.

                    However when I execute the:
                    astroberry@astroberry:~/raspberrypi/i2c_cmd/bin $ ./camera_i2c_config
                    setting GPIO for board revsion: c03114
                    4B(1G/2G/4G/8G)
                    Set state of 133 to 1
                    Use i2c-10 for the sensor (-y 10)

                    Then the i2cdetect finds the device:
                    astroberry@astroberry:~ $ i2cdetect -y 10
                    0 1 2 3 4 5 6 7 8 9 a b c d e f
                    00: -- -- -- -- -- -- -- -- -- -- -- -- --
                    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    30: -- -- -- -- -- -- -- -- -- -- -- 3b -- -- -- --
                    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
                    70: -- -- -- -- -- -- -- --

                    However the dmesg still shows:
                    astroberry@astroberry:~ $ dmesg | grep veye
                    [ 6.523877] veyecam2m: loading out-of-tree module taints kernel.
                    [ 6.646795] veyecam2m 10-003b: probe failed
                    [ 31.835106] veyecam_vana: disabling
                    [ 31.835117] veyecam_vddl: disabling
                    [ 31.835125] veyecam_vdig: disabling

                    Do I need to add the camera_i2c_config somewhere manually that it is executed at every startup before starting of the driver?

                    I have tested various i2c settings and all seems to reponds as expected so the i2c but definitely works.

                    On the first day when I got the camera, I was by mistake using the ./cs_mipi_i2c.sh, which is for the CS series, but that was never getting me some proper response. Could it be however that something is misconfigured? I tried for example the ./cs_mipi_i2c.sh -w -f sysreset at that time.

                    1 Reply Last reply Reply Quote 0
                    • S
                      salamander @veye_xumm last edited by

                      @veye_xumm Hello, I have continued with the debugging turned on the TRACE in the driver and added few debug messages.

                      It looks like the driver does not get correct response to this:
                      ret = veyecam2m_read_reg(veyecam2m, VEYECAM2M_MODEL_ID_ADDR, &device_id);
                      if (ret) {
                      dev_err(&client->dev, "probe failed \n");
                      return -ENODEV;
                      }

                      I have read about the http://wiki.veye.cc/index.php/RaspberryPI_I2C_confilict_problem ..is this still problem (iam not using DSI display)?. Also this solution recommends to rewire the I2C. At which I2C bus the V4L2 driver actually expects to have the module?

                      I have also tried to disable the i2c_arm in the startup config, but no help either.

                      veye_xumm 1 Reply Last reply Reply Quote 0
                      • veye_xumm
                        veye_xumm @salamander last edited by

                        @salamander
                        I think this is a dts bug, and have fixed it.
                        https://github.com/veyeimaging/raspberrypi_v4l2/releases/tag/v1.05

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          salamander @veye_xumm last edited by

                          @veye_xumm Perfect, thank you very much for your support. It is now working.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post