2024-07-01 06:25 AM - last edited on 2024-07-03 06:10 AM by Peter BENSCH
Good afternoon.
I observe very strange behavior when the first few images received from the camera are normal, and then subsequent images are always shifted by 4 bytes.
Initial data:
1. I am using a STM32MP157A-EV1 device with a screen and camera on board.
2. I use the official Distribution-Package firmware based on tag: openstlinux-5.10-dunfell-mp1-21-11-17
3. To work with the camera I use the following example: https://www.kernel.org/doc/html/v4.11/media/uapi/v4l/capture.c.html
Receiving images in STREAMING_ON mode, via MMAP.
4. In the process_image function I print the first few bytes of each image.
Output:
root@stm32mp15-eval:~# ./visorik-v4l-example
process_image 0
FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - good
process_image 1
FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - good
process_image 2
FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - good
process_image 3
FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - good
process_image 4
04 D8 FF E0 FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - bad, shift appears
process_image 5
04 D8 FF E0 FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - bad, shift appears
process_image 6
04 D8 FF E0 FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - bad, shift appears
process_image 7
04 D8 FF E0 FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - bad, shift appears
process_image 8
04 D8 FF E0 FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - bad, shift appears
process_image 9
04 D8 FF E0 FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 00 00 00 00 00 FF DB 00 43 00 04 03 03 04 03 03 04 04 03 04 05 04 04 05 06 0A ... - bad, shift appears
root@stm32mp15-eval:~#
The issue reproduced in 100% cases.
At the same time, if I run the Camera preview application from the Distribution-Package, the video stream on the monitor looks normal, without shifts.
Thanks for helping.