5 Replies Latest reply on Oct 7, 2020 12:04 AM by JayakrishnaT_76

    CX3 - change resolution on-the-fly

    omco_594686

      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.

        • 1. Re: CX3 - change resolution on-the-fly
          JayakrishnaT_76

          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

          • 2. Re: CX3 - change resolution on-the-fly
            omco_594686

            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.

            • 3. Re: CX3 - change resolution on-the-fly
              JayakrishnaT_76

              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

              • 4. Re: CX3 - change resolution on-the-fly
                omco_594686

                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

                • 5. Re: CX3 - change resolution on-the-fly
                  JayakrishnaT_76

                  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:

                   

                  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