IMX519 only works once then needs to be unplugged + "Embedded data buffer parsing failed"

I am a backer of the quad camera Kickstarter https://www.kickstarter.com/projects/arducam/high-resolution-autofocus-camera-module-for-raspberry-pi/comments

I finally got around to trying out the camera but I am running into some issues.

The first issue is that although I see a feed of the four cameras, I can only use it once before I need to unplug it. For example, I can capture an image with the four cameras but if I try to repeat the same libcamera command, it will keep giving me a device timeout error. The only way I can avoid this issue is by unplugging the cameras and replugging it back in.

I recorded a video of what this looks like: https://www.youtube.com/watch?v=foo7pPA1b8A

And here’s what the logs look like:

(base) alan@raspberrypi:~ $ libcamera-still 
[0:00:33.681144127] [1579]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0+147-057299d0-dirty (2024-01-24T08:51:15+00:00)
[0:00:33.729480182] [1582]  WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[0:00:33.731331182] [1582]  INFO RPI vc4.cpp:452 Registered camera /base/soc/i2c0mux/i2c@1/imx519@1a to Unicam device /dev/media4 and ISP device /dev/media0
[0:00:33.731412645] [1582]  INFO RPI pipeline_base.cpp:1167 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Made X/EGL preview window
Mode selection for 2328:1748:12:P
    SRGGB10_CSI2P,1280x720/0 - Score: 5319.24
    SRGGB10_CSI2P,1920x1080/0 - Score: 3319.24
    SRGGB10_CSI2P,2328x1748/0 - Score: 1000
    SRGGB10_CSI2P,3840x2160/0 - Score: 1648.24
    SRGGB10_CSI2P,4656x3496/0 - Score: 2019
Stream configuration adjusted
[0:00:34.978537904] [1579]  INFO Camera camera.cpp:1183 configuring streams: (0) 2328x1748-YUV420 (1) 2328x1748-SRGGB10_CSI2P
[0:00:34.978989978] [1582]  INFO RPI vc4.cpp:616 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 2328x1748-SRGGB10_1X10 - Selected unicam format: 2328x1748-pRAA
[0:00:35.452420293] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:35.519110978] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:35.585681681] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:35.652344292] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:35.719010070] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:35.785653496] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:35.852319255] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:35.919011403] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:35.985757126] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.053216681] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.119362496] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.186073033] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.252378811] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.319029107] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.385702051] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.452378736] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.519043644] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.585715236] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.652394125] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.719039440] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.785709144] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.852381940] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.919051162] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:36.985732532] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.052432162] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.119148217] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.185727273] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.252498014] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.319178125] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.385804347] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.452483643] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.519135236] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.585799588] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.652467995] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.719147773] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.786074476] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.852553439] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.919213124] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:37.986097643] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.052519513] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.119710050] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.185830421] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.253133680] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.319730698] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.386461846] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.452605494] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.519621920] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.586356272] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.653182976] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.719465550] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.785976309] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.852646513] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.919321105] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:38.985982198] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.052798494] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.119319624] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.185985605] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.252643642] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.319316642] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.385952420] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.452665031] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.519230586] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.585875401] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.652574957] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.719335179] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.786011086] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.852695142] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.919324882] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:39.985997142] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:40.052656771] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:40.119223216] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
[0:00:40.185881512] [1609] ERROR IPARPI cam_helper.cpp:257 Embedded data buffer parsing failed
(base) alan@raspberrypi:~ $ libcamera-still 
[0:00:42.420074900] [1631]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0+147-057299d0-dirty (2024-01-24T08:51:15+00:00)
[0:00:42.470681066] [1634]  WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[0:00:42.472542122] [1634]  INFO RPI vc4.cpp:452 Registered camera /base/soc/i2c0mux/i2c@1/imx519@1a to Unicam device /dev/media4 and ISP device /dev/media0
[0:00:42.472614474] [1634]  INFO RPI pipeline_base.cpp:1167 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Made X/EGL preview window
Mode selection for 2328:1748:12:P
    SRGGB10_CSI2P,1280x720/0 - Score: 5319.24
    SRGGB10_CSI2P,1920x1080/0 - Score: 3319.24
    SRGGB10_CSI2P,2328x1748/0 - Score: 1000
    SRGGB10_CSI2P,3840x2160/0 - Score: 1648.24
    SRGGB10_CSI2P,4656x3496/0 - Score: 2019
Stream configuration adjusted
[0:00:42.959141825] [1631]  INFO Camera camera.cpp:1183 configuring streams: (0) 2328x1748-YUV420 (1) 2328x1748-SRGGB10_CSI2P
[0:00:42.959575751] [1634]  INFO RPI vc4.cpp:616 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 2328x1748-SRGGB10_1X10 - Selected unicam format: 2328x1748-pRAA
[0:00:44.183610102] [1634]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[14:cap]: Dequeue timer of 1000000.00us has expired!
[0:00:44.183760417] [1634] ERROR RPI pipeline_base.cpp:1422 Camera frontend has timed out!
[0:00:44.183799232] [1634] ERROR RPI pipeline_base.cpp:1423 Please check that your camera sensor connector is attached securely.
[0:00:44.183838473] [1634] ERROR RPI pipeline_base.cpp:1424 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!

The second issue is, as you can see from the logs, I get this repeating “Embedded data buffer parsing failed” error. I’m not sure what this mean and what the implications are.


Here’s some more information about my set up.

Where did you get the camera module(s)?
Kickstarter

Model number of the product(s)?
Arducam 16MP Autofocus Quad-Camera Kit for Raspberry Pi

What hardware/platform were you working on?
Raspberry Pi 4 Model B/4GB running Bookworm

(base) alan@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Instructions you have followed. (link/manual/etc.)
https://docs.arducam.com/Raspberry-Pi-Camera/Multi-Camera-CamArray/quick-start/#imx519-multi-camera-kit

The dmesg log from your hardware?

(base) alan@raspberrypi:~ $ dmesg | grep -E "imx477|imx219|arducam|imx519"
[    8.728311] imx519 10-001a: Device found is imx519
[    8.729070] imx519 10-001a: Consider updating driver imx519 to match on endpoints

Troubleshooting attempts you’ve made?

  • Unplugging and replugging in camarray HAT
  • Reinstalling my operating system and reinstalling everything
  • Purchasing and trying out new data cables

I also want to mention that on my journey to learn how to use my Raspberry Pi and quad cam, there was a time when I could reliably use the quad cam. It would still give me the data buffer errors but I could still use the quad cam. I could not get the quad cam to focus properly though. I still have this issue. In any case, this was before I had to reinstall the Pi operating system. After I did that, I could not get quad cam working consistently anymore.


Possible related topics:

  • (Regarding only usable once) 16 MP quad array only works once then needs to be powercycled - #3 by onilx
    I tried using an additional power source for the Camarray HAT. It did not seem to do anything.

  • (Regarding the data buffer) IMX519 output purple static on quad hat
    I tried installing the low speed driver and I did not see a change. I do not know how to uninstall my original driver though. Perhaps it was using the same driver.
    However, I’m not using the 15-meter cable extension kit that they mention. I see people mentioning that you need the low speed driver when you use the extension kit but I am not.

Reverting back from Bookworm to Bullseye fixed the camera only working once issue.

I still have the data buffer issue as well as trouble autofocusing.

@Alan-Cha

Please give me more information

uname -a
dpkg -l | grep libcamera

@Edward

alan@raspberrypi:~ $ uname -a
dpkg -l | grep libcamera
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux
ii  libcamera-apps                        1.2.1-1                          arm64        libcamera-apps
ii  libcamera-dev:arm64                   0~git20230724+ad9428b4-1         arm64        complex camera support library (development files)
ii  libcamera0:arm64                      0~git20230724+ad9428b4-1         arm64        complex camera support library
ii  python3-libcamera                     0~git20230720+bde9b04f-1         arm64        complex camera support library (Python 3 bindings)

Let me know what else you need!

@Edward Forgive me if this comes off as pushy but I just wanted to mention that I’m still looking for a solution. Please let me know if you can help! Thank you so much.

As a reminder, the main issue I’m having right now is that the multicam array is not able to autofocus. I still get a lot of data buffer error messages but it doesn’t seem to affect the usability of the multicam array.

I want to know if the device time out error is solved or not.
Regarding the autofocus problem and data buffer error messages, I suggest that you can try the steps below:

#upgrade to the latest kernal version
sudo apt upgrade
# Install the libcamera
wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps

@Dion

Yes. This has been resolved. The solution was to reinstall the operating system and rollback from Bookworm to Bullseye.

Sadly, this did not fix anything. I am still unable to autofocus and get the data buffer error messages.


Can you suggest how to test autofocus? I’ve only tried using the --autofocus-mode option. For example:

libcamera-still -t 0 --autofocus-mode auto
libcamera-still -t 0 --autofocus-mode continuous
libcamera-still -t 0 --autofocus-mode manual

Here are some sample shots using

libcamera-still -o test.jpg



It seems like the camera in the bottom right is usually more in focus. I can see it initially focus upon running libcamera-still but it doesn’t seem to focus on my face, rather it focuses on the background.

But after running @Dion suggested commands, I started to occasionally see this behavior:

Where all but the bottom right camera is in focus.

I also want to point out that the color balance of the bottom left camera is off. Is there anyway I can recalibrate the cameras?

Hi,
Please run the command below to close the embedded data buffer error messages.

export LIBCAMERA_NOTPARSE_EMBEDDED_DATA=1

According to your need, I suggest that you can try the manual focus:

# Use keyboard to control focus
# "a" add the lens position, "d" decrease the lens position, the minimum unit of step adjustment is 1
libcamera-still -t 0 --autofocus-mode manual -k 

Because there are four cameras sharing the same i2c control, sometimes one camera is less responsive than the other three cameras, and both situations occur. This problems can not be solved by the software.

@Dion

export LIBCAMERA_NOTPARSE_EMBEDDED_DATA=1

This command resolved the data buffer error message I was receiving.


However, I’m still not happy with the autofocus behavior.

# Use keyboard to control focus
# "a" add the lens position, "d" decrease the lens position, the minimum unit of step adjustment is 1
libcamera-still -t 0 --autofocus-mode manual -k

This command allowed me to decrease and increase the lens position. I can see that all the lenses can be moved. I can also see that the f key can be used to trigger autofocus. However, there seems to be an issue with the bottom right camera.

There are two outcomes when I trigger autofocus. Either the bottom right is in focus and all other cameras are out of focus or all other cameras are in focus and the bottom right is out of focus. Is there something wrong with the camera module?

Are the individual cameras supposed to independently focus? Or are their focus tied together? As in they must all focus up close or far away?

I also cannot seem to get continuous autofocus mode to work. It never triggers an autofocus cycle. Do you have any ideas to resolve this?

@Edward @Dion I was wondering if I could still get some help with this.

The only issue I have now is focusing. The cam array seems to be inconsistent. When I take a photo, either one camera is in focus, the other three are in focus, or none are in focus. This inconsistency is unacceptable for my use case.

To clarify, are you suggesting that this is a hardware problem and there is nothing to do at this point? Is this a typical issue? Should I contact someone for a replacement? Because otherwise, I cannot use my camarray.