CX3 - change resolution on-the-fly

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
omco_594686
Level 3
Level 3
Welcome!

Hi,

Our new costume image sensor will interface the CX3.

The sensor is able to output any windowing size up to 1300x1000.

As I understand, I need to pre-set the configuration in the "CX3 configuration" tool and it will create a files with the relevant structures (CyU3PMipicsiCfg_t type)

Is it possible to change resolution on-the-fly to a new one that didn't pre-set?

Omri.

0 Likes
1 Solution

Hello Omri,

Yes, you can try the approach that you have mentioned in your previous response. For this, the following needs to be done:

a. Declare a MIPI configuration structure and sensor configuration structure(if you want to configure sensor also on the run).

b. Use vendor commands with the configuration data for updating the required structure.

c. Configure the MIPI block and the sensor.

While doing so, please ensure that the video frame ends with a partial buffer (DMA Buffer) on CX3. Otherwise, the streaming will get stuck. Please use an appropriate DMA buffer size or adjust the size of the video frame so that the frame size is not exactly divisible with DMA buffer size. The same is mentioned in the verified answer of the following thread:

cx3 raw streamer is not work.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
5 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello Omri,

The CX3 device has an integrated MIPI CSI-2 block, which is hard-wired to the GPIF II interface on one side and provides a MIPI CSI-2 interface on the other side to interface to an image sensor that supports MIPI CSI-2. To stream data using CX3, both the MIPI receiver block and the sensor needs to be configured. Also, the configurations for the sensor and the MIPI receiver block should match. If this does not happen, then the sampled data will not be proper.

So for each resolution that you want to stream, a corresponding configuration for the MIPI receiver block needs to be generated. Also, the MIPI receiver block should be configured (using the configuration generated by the MIPI configuration utility) before configuring the sensor.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hi JayakrishnaT_76​,

Thanks for you quick response.

I agree that the configurations of the sensor and the MIPI receiver must match.

But I want to know if its possible to "create" a new configuration (resolution, pixels format) that didn't pre-configured in the MIPI configuration utility. (of course that the sensor will be configured accordingly)

Let's say, the CX3 can receive the relevant parameters for the mipi block and the sensor from the host (custom protocol over USB), create a structure of CyU3PMipicsiCfg_t, configure the MIPI block with it, reconfigure the sensor and start streaming.

Is this scenario is possible? Or I must use the MIPI configuration utility no matter what

Omri.

0 Likes

Hello Omri,

Yes, you can try the approach that you have mentioned in your previous response. For this, the following needs to be done:

a. Declare a MIPI configuration structure and sensor configuration structure(if you want to configure sensor also on the run).

b. Use vendor commands with the configuration data for updating the required structure.

c. Configure the MIPI block and the sensor.

While doing so, please ensure that the video frame ends with a partial buffer (DMA Buffer) on CX3. Otherwise, the streaming will get stuck. Please use an appropriate DMA buffer size or adjust the size of the video frame so that the frame size is not exactly divisible with DMA buffer size. The same is mentioned in the verified answer of the following thread:

cx3 raw streamer is not work.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hi,

Please use an appropriate DMA buffer size or adjust the size of the video frame so that the frame size is not exactly divisible with DMA buffer size.

>> So I need to change the DMA buffer size too. Is this change should be before all other configurations? (MIPI block and sensor)

Do I need somehow to stop the acquisition process?

Omri

0 Likes

Hello,

The DMA buffer size needs to be set while creating the DMA channel for video streaming. The following snapshot shows the code for creation of DMA channel:

pastedImage_0.png

Once the DMA channel size is set (while creating the DMA channel), you should not change it. While creating the DMA channel, you should ensure that the DMA channel size satisfies the following:

1. Is a multiple of 16.

2. The frame size (in bytes) should not be completely divisible by the DMA buffer size.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes