Switching the formats in the camera fails to launch streaming in the iMX8Mplus platform

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Switching the formats in the camera fails to launch streaming in the iMX8Mplus platform

5,770 Views
koilarulraj
Contributor III

HI,

We have supported UYVY, SRGB10 formats from the camera and using iMX8MPlus kit for the evaluation.

After booting of the kit, if we first launch either UYVY or SRGB10, the stream works without any issues in the format. But when we try to switch between the format, the stream stops.

We have debugged the camera MIPI signals. It is correctly configuring with the required format and MIPI signal activity is proper in the camera.

But the iMX8Mplus platform not supporting the switching between the different formats. Is there any patches to resolve this issue?

We are using following kernel.
kernel : v6.1.55
Yocto : mickledore

Thanks.

0 Kudos
Reply
31 Replies

4,706 Views
joanxie
NXP TechSupport
NXP TechSupport

what bsp do you use? it seems you change the source code by yourself, how about testing the default bsp? I tested on 6.6.23 bsp with os08a20 camera, I couldn't reproduce this issue

joanxie_0-1729647151811.png

 

0 Kudos
Reply

4,723 Views
koilarulraj
Contributor III

Hi @joanxie,

Thanks for your reply.

We are using v4l2-ctl to switch between formats.

For example,
After boot, first if we try to stream RAW10 format as given below, the stream works.

# v4l2-ctl -d 3 -v width=4208,height=3124,pixelformat='BA10' --stream-mmap


[ 56.755600] streamdb[0]=0, mode=8
[ 56.755618] streamdb[1]=1, mode=8
[ 56.758971] streamdb[2]=2, mode=8
[ 56.762301] streamdb[3]=3, mode=8
[ 56.765634] streamdb[4]=4, mode=8
[ 56.768962] streamdb[5]=5, mode=8
[ 56.772291] streamdb[6]=6, mode=8
[ 56.775607] streamdb[7]=7, mode=8
[ 56.778934] streamdb[8]=8, mode=8
[ 56.782265] Index = 0x0008 , format = 0x30314142, width = 4208, height = 3124, frate num = 20
[ 56.834770] input fmt BA10
[ 56.837510] output fmt BA10
<<<<<<<<<<<<<<<<<<<<<< 20.00 fps
<<<<<<<<<<<<<<<<<<<< 20.00 fps
<<<<<<<<<<<<<<<<<<<< 20.00 fps
<<<<<<<<<<<<<<<<<<<< 20.00 fps
<<<<<<<^C
root@ucm-imx8m-plus:~#

Then, I tried to stream the UYVY format as given below. But the system sets all the configuration in the platform and camera but stops without streaming. There is frame done interrupt in the platform.

# v4l2-ctl -d 3 -v width=4192,height=3120,pixelformat='UYVY' --stream-mmap
[ 96.384454] streamdb[0]=0, mode=4
[ 96.384471] streamdb[1]=1, mode=4
[ 96.387840] streamdb[2]=2, mode=4
[ 96.391173] streamdb[3]=3, mode=4
[ 96.394504] streamdb[4]=4, mode=4
[ 96.397832] Index = 0x0004 , format = 0x59565955, width = 4192, height = 3120, frate num = 13
[ 96.463186] bypass csc
[ 96.465562] input fmt YUV4
[ 96.468283] output fmt UYVY

The platform gives no error. But it is not able to receive the frames properly during the format switch. We have confirmed on the camera side that the requested format is configured and MIPI activity is proper in the camera hardware.

Kindly let us know in case any other additional information is needed.

Thanks.

0 Kudos
Reply

4,338 Views
joanxie
NXP TechSupport
NXP TechSupport

if you boot up the board, firstly you test 'UYVY' , is it ok? the same issue when you capture raw10 after uyvy?

0 Kudos
Reply

4,307 Views
koilarulraj
Contributor III
Hi,
Any inputs on this issue? Anticipating your positive response on this matter.

Thanks.
0 Kudos
Reply

3,158 Views
joanxie
NXP TechSupport
NXP TechSupport

how do you switch the streaming and what kind of errors do you get? pls share more detailed information and steps

0 Kudos
Reply

2,733 Views
Olivia
Contributor I
Hi Joanxie,
I am using v4l2-ctl command to switch between the formats, I am able switch between Y8 to Y10 and Y10 to Y8. But I am not able to switch to Y12 from (Y8 and Y10) and vice-versa.

Below command I had used to switch from Y8 to Y10 and Y10 to Y12. After switching to Y12 format I am not getting Frames.

v4l2-ctl --device=/dev/video3 --set-fmt-video=pixelformat=GREY --stream-mmap --stream-count=20 --stream-to=raw_video_output.raw
<<<<<<<<<< 8.16 fps
<<<<<<<< 8.16 fps
<<
root@imx8mp-var-dart:~# v4l2-ctl --device=/dev/video3 --set-fmt-video=pixelformat="Y10 " --stream-mmap --stream-count=20 --stream-to=raw_video_output.raw
<<<<<<<<< 9.39 fps, dropped buffers: 2
<<<<<<< 9.39 fps, dropped buffers: 2
<<<<
root@imx8mp-var-dart:~# v4l2-ctl --device=/dev/video3 --set-fmt-video=pixelformat="Y12 " --stream-mmap --stream-count=20 --stream-to=raw_video_output.raw


0 Kudos
Reply

1,561 Views
joanxie
NXP TechSupport
NXP TechSupport

sorry for my delay, I've taken annual leave recently, I never tested raw12 on imx8mp before, you can check your MIPI_CSIS_ISPCFG_ALIGN_32BIT and MIPI_CSIS_CMN_CTRL_HDR_MODE, besides of these, you also can check pixel mode in your driver, I don't know if your raw12 works or not, if not, you can refer to the link as below, I also suggest that you can add more debug information to check where stuck 

https://community.nxp.com/t5/i-MX-Processors/Confusion-of-MIPI-CSI2-ISI-drivers-for-IMX8MP/td-p/1958...

0 Kudos
Reply

1,365 Views
joanxie
NXP TechSupport
NXP TechSupport

I'm taking my annual leave this week, I will check this when I come back to office, it seems this issue is related to your own code, I need double check it

0 Kudos
Reply

777 Views
Olivia
Contributor I
I will await your response once you return to the office. Please let me know if you need any additional information from my end to help with the review.
0 Kudos
Reply

729 Views
koilarulraj
Contributor III

Hi @joanxie,

Sure, We will wait for your reply.

Please find the missed patch in the previous message. (nxp_imx8mplus_two_format_kernel.patch). Kindly check this and share your suggestion.

 

Thanks.

0 Kudos
Reply

632 Views
koilarulraj
Contributor III

Hi @joanxie,

Any update on the issue?

Thanks.

0 Kudos
Reply