Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bytesperline calculation for libcamera0.2 #140

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

KapJI
Copy link
Contributor

@KapJI KapJI commented Mar 1, 2024

For libcamera0.2 configuration.stride is already set to some incorrect value and configurations->validate() doesn't update it if it's not 0.

For libcamera0.1 it was set to 0. So set it to 0 manually to make sure configurations->validate() computes the correct value.

Before:

device/buffer_list.c: CAMERA:capture: Using: 1920x1080/YUYV, buffers=3, bytesperline=3840, sizeimage=0.0MiB
device/buffer_list.c: CAMERA:capture:1: Using: 2304x1296/BG10, buffers=3, bytesperline=5760, sizeimage=0.0MiB
ERROR V4L2 v4l2_videodevice.cpp:1697 /dev/video13[26:out]: Failed to queue buffer 0: Invalid argument
ERROR RPISTREAM rpi_stream.cpp:276 Failed to queue buffer for ISP Input

After:

device/buffer_list.c: CAMERA:capture: Using: 1920x1080/YUYV, buffers=3, bytesperline=3840, sizeimage=0.0MiB
device/buffer_list.c: CAMERA:capture:1: Using: 2304x1296/BG10, buffers=3, bytesperline=2880, sizeimage=0.0MiB

Tested both with libcamera0.1 and libcamera0.2 on raspberry pi 4. Errors are gone and streaming works fine with libcamera0.2 finally.

Thanks to @tom-ard for help with debugging.

Fixes #139

@arcadien
Copy link

arcadien commented Mar 2, 2024

fixes #138

@arcadien
Copy link

arcadien commented Mar 2, 2024

Thanks for the debug!

@automiketic
Copy link

I just came to say thanks @KapJI ! I spent the last 4 hours troubleshooting my camera then found this. I made the change and instantly I'm up and running!. @ayufan please pull this ASAP. I found my way here from crowsnest and it was not an easy journey lol.

@ayufan ayufan merged commit 6deb9c5 into ayufan:main Mar 8, 2024
10 checks passed
@KapJI KapJI deleted the libcamera0.2 branch March 8, 2024 08:16
@ETE-Design
Copy link

@ayufan Can you pls. "Merge" this again? Seems like the files to download Expired - Or even better make a new "Release"

@DropbearNinja
Copy link

Where do you set configuration.stride = 0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The camera-streamer compiled based on libcamera0.2 cannot run normally
6 participants