1 2 Previous Next 26 Replies Latest reply on Sep 19, 2019 2:21 AM by RashiV_61

    cb failure in cx3 high-speed

    user_3936656

      hi:

      The same resolution(2500*1025) works correct under supper-speed, but it does not work correct under high t-speed

      Cx3 is in USB2.0 mode: if the acmap viewing software is not turned on, cx3 can normally parse Mipi information, Vsync and Hsync are able to parse normal waveforms, but as soon as I open amcap, log output

      CB failure

      AplnStop: SMState = 0x5

      AplnStrt: SMState = 0x1

      Both Vsync and Hsync of cx3 failed. Desrc and USB3.0 compare, some requests are consistent, in this case, how to debug, need to add DMA Buf? Are there any other configurations?

      attch is Screensnot

        • 1. Re: cb failure in cx3 high-speed
          KandlaguntaR_36

          Hello,

           

          USB 2.0 can support upto 30 ~ 35 MBps.

           

          What are the fps and bytes per pixel you are trying to stream in USB 2.0 @ 2500*1025

           

          Regards,

          Sridhar

          • 2. Re: cb failure in cx3 high-speed
            user_3936656

            Hi  kandlaguntaR  thanks your reply, in Resolution 2500*1025  is 8fps ,Raw8 .

            in usb3.0 print log

            • 3. Re: cb failure in cx3 high-speed
              user_3936656

              Hi KandlaguntaR:

              2500*1025 @8fps  sensor output  Raw8 

              this is my highSpeed dsrcconfig

               

                  0x59, 0x55, 0x59, 0x32,             /*MEDIASUBTYPE_YUY2 GUID: 32595559-0000-0010-8000-00AA00389B71 */

                  0x00, 0x00, 0x10, 0x00,

                  0x80, 0x00, 0x00, 0xAA,

                  0x00, 0x38, 0x9B, 0x71,

               

                  0x10,                               /* Number of bits per pixel: 16*/

                  

                  0x1E,                               /* Descriptor size */

                  CX3_CS_INTRFC_DESCR,                /* Descriptor type*/

                  0x05,                               /* Subtype:  frame interface*/

                  0x01,                               /* Frame Descriptor Index: 1 */

                  0x00,                               /* No Still image capture method supported */

                  0xE2,0x04,                          /* Width in pixel:  1250 */

                  0x01,0x04,                         /* Height in pixel: 1025 */

                  0x00,0x71,0xc6,0x09,             /* Min bit rate (bits/s): 1250 x 1025 x 8 x 16 = 164000000 */

                  0x00,0xE2,0x8C,0x13,             /* Max bit rate (bits/s): Fixed rate so same as Min */

                  0xC4,0x19,0x27,0x00,             /* Maximum video or still frame size in bytes(Deprecated): 1250 x 1025 x 2 */

                  0xd0,0x12,0x13,0x00,             /* Default frame interval (in 100ns units): (1/30)x10^7 */

                  0x01,                               /* Frame interval type : No of discrete intervals */

                  0xd0,0x12,0x13,0x00,             /* Frame interval 3: Same as Default frame interval */

               

               

              uint8_t const gl5MProbeCtrl_HS[CX3_UVC_MAX_PROBE_SETTING] = {

              0x00, 0x00,                         /* bmHint : No fixed parameters */

              0x01,                               /* Use 1st Video format index */

              0x01,                               /* Use 1st Video frame index */

              0xd0,0x12,0x13,0x00,              /* Desired frame interval in 100ns = (1/15)x10^7 */

              0x00, 0x00,                         /* Key frame rate in key frame/video frame units */

              0x00, 0x00,                         /* PFrame rate in PFrame / key frame units */

              0x00, 0x00,                         /* Compression quality control */

              0x00, 0x00,                         /* Window size for average bit rate */

              0x00, 0x00,                         /* Internal video streaming i/f latency in ms */

              0x00, 0xC6, 0x99, 0x00,             /* Max video frame size in bytes = 1250 x 1025x 2 */

              //0xC4,0x19,0x27,0x00,             /* Maximum video or still frame size in bytes(Deprecated): 1250 x 1025 x 2 */

              0x00, 0xC0, 0x00, 0x00              /* No. of bytes device can rx in single payload: 36KB 90 */

               

              };

               

               

               

              this highspeedconfig  is correct?

              • 4. Re: cb failure in cx3 high-speed
                RashiV_61

                Hello,

                 

                The video bandwidth you working on exceeds the bandwidth supported by Usb high speed

                2500*1025*8*2 = ~41 MBps

                and USB high speed could support around 30-35 MBps

                If you want to work for the same resolution you can either lower the fps or the bits/pixel which is 16 bits (2 bytes) in your case.

                 

                The changes in descriptors and the probe control structure( 1250*1025) are different from the resolution that you are working on(2500*1025). Please confirm.

                On which resolution you want to work?

                 

                Also, let me know the buffer size you are using.

                 

                For 2500*1025 @ 5fps

                    /* Class specific Uncompressed VS Frame Descriptor 1 - 1080p@30fps */

                    0x1E,                               /* Descriptor size */

                    CX3_CS_INTRFC_DESCR,                /* Descriptor type*/

                    0x05,                               /* Subtype: Uncompressed frame interface*/

                    0x01,                               /* Frame Descriptor Index: 1 */

                    0x00,                               /* No Still image capture supported */

                    0xC4, 0x09,                         /* Width in pixel:  2500 */

                    0x01, 0x04,                         /* Height in pixel: 1025 */

                    0x40, 0x0D, 0x38, 0x0C,             /* Min bit rate (bits/s): 1025 x 2500 x 2 x 5 x 8 = 205000000 */

                    0x40, 0x0D, 0x38, 0x0C,             /* Max bit rate (bits/s): Fixed rate so same as Min */

                    0x88, 0x33, 0x4E, 0x00,             /* Maximum video or still frame size in bytes(Deprecated): 2500 x 1025 x 2 */

                    0x80, 0x84, 0x1E, 0x00,             /* Default frame interval (in 100ns units): (1/5)x10^7 */

                    0x01,                               /* Frame interval type : No of discrete intervals */

                    0x80, 0x84, 0x1E, 0x00,             /* Frame interval 3: Same as Default frame interval */

                 

                 

                Probe Control

                uint8_t const gl5MProbeCtrl_HS[CX3_UVC_MAX_PROBE_SETTING] = {

                0x00, 0x00,                         /* bmHint : No fixed parameters */

                0x01,                               /* Use 1st Video format index */

                0x01,                               /* Use 1st Video frame index */

                0x80,0x84,0x1E,0x00,              /* Desired frame interval in 100ns = (1/5)x10^7 */

                0x00, 0x00,                         /* Key frame rate in key frame/video frame units */

                0x00, 0x00,                         /* PFrame rate in PFrame / key frame units */

                0x00, 0x00,                         /* Compression quality control */

                0x00, 0x00,                         /* Window size for average bit rate */

                0x00, 0x00,                         /* Internal video streaming i/f latency in ms */

                0x88, 0x33, 0x4E, 0x00,             /* Max video frame size in bytes = 2500 x 1025 x 2 */

                0x00, 0xC0, 0x00, 0x00              /* No. of bytes device can rx in single payload: 36KB 90 */ (If you are using buffer size of 36 KB)

                 

                Please confirm, the same settings are done on the sensor side also.

                If this still doesn't work. Let me know the errors (debug prints) and probe the FV, LV , PCLK lines.

                 

                Regards,

                Rashi

                • 5. Re: cb failure in cx3 high-speed
                  user_3936656

                  hi RashiV:

                     I've changed the parameters above, and here's my log output。My GPIF bus is 16 bits, my sensor (mt9p031) outputs RAW8 bits    .clk  frequency=96.15M

                       hsync:

                  • 6. Re: cb failure in cx3 high-speed
                    user_3936656

                    HI  RashiV_61

                     

                    i set  sensor(mt9p031)  h-blanking =3000 , then  Continuous output log

                    • 7. Re: cb failure in cx3 high-speed
                      RashiV_61

                      Hello,

                       

                      Is your problem solved by increasing the horizontal blanking?

                      If not solved, What is the fps you are setting? Where do you get the cb failure? DMA call back or the GPIF call back?Also, probe the FV line and share the traces.

                      You can use 16 bit as output data format. config_util.png

                      The CX3 configuration utility gives the option You can also refer to the KBA.Streaming RAW10 Format Input Data to 16/24-bit Output Format in CX3 MIPI CSI-2 - KBA224387 which shows the packing of RAW10 data to 16/ 24 bit

                       

                      Please refer this thread, which had a problem for commit buffer failure https://community.cypress.com/message/207887?et=watches.email.thread#207887    Re: Is "2592x1944x1 byte in High speed(USB 2.0)" possible with FX3?

                       

                      Regards,

                      Rashi

                      • 8. Re: cb failure in cx3 high-speed
                        user_3936656

                        hi:

                        i set  sensor(mt9p031)  h-blanking =3000 , then  Continuous output log,but  amcap  is  blank screen

                        • 9. Re: cb failure in cx3 high-speed
                          RashiV_61

                          Hello,

                           

                          The debug prints you shared shows that the fps = 0. Please probe the FV, LV and PCLK and share the traces, to check whether these signals are coming proper.

                          What is the output format of the stream? YUY?

                           

                          Regards,

                          Rashi

                          • 10. Re: cb failure in cx3 high-speed
                            user_3936656

                            HI: RashiV

                              Attachment is CX3 three test point waveform, log iscontinuous output, but FPS is 0  .the output format of the stream is YUY2

                            • 11. Re: cb failure in cx3 high-speed
                              RashiV_61

                              Hello,

                               

                              Can you share the code snippet that is counting the FPS or Can you share the firmware? I do not the sensor files.

                              Are you using firmware in the sdk or a customize firmware?

                               

                              From the traces, the FPS nearly 7fps (1/136ms). What is the fps you set to the sensor?

                               

                              Regards,

                              Rashi

                              • 12. Re: cb failure in cx3 high-speed
                                user_3936656

                                Hi Rashi,

                                Thanks for your reply.

                                My sensor used the following setting source ;  I'm Create projects with cx3 configuration tools and then added the sensor configuration. and everything else was the default value.

                                 

                                IICWrite3(client, REG_MT9P031_ROWSTART, 54); //ROW_WINDOW_START_REG

                                Delay(10000);

                                IICWrite3(client, REG_MT9P031_COLSTART, 16 );

                                Delay(10000);

                                IICWrite3(client, REG_MT9P031_HEIGHT, MAX_CAPTURE_HEIGHT - 1); //ROW_WINDOW_SIZE_REG=1025

                                Delay(10000);

                                IICWrite3(client, REG_MT9P031_WIDTH, MAX_CAPTURE_WIDTH - 1); //COL_WINDOW_SIZE_REG=2500

                                Delay(10000);

                                IICWrite3(client, REG_MT9P031_HBLANK, 3000); //=

                                Delay(10000);

                                IICWrite3(client, REG_MT9P031_VBLANK, 25); //=

                                Delay(10000);

                                IICWrite3(client, REG_MT9P031_SHUTTER_WIDTH_L,0x400); //0x400 //SHUTTER_WIDTH_LOW (INTEG_TIME_REG = 1024)

                                IICWrite3(client, REG_MT9P031_ROW_ADDR_MODE, 0x0000); // 0x22 ROW_MODE, ROW_SKIP=1. ROW_BIN=1

                                IICWrite3(client, REG_MT9P031_COL_ADDR_MODE, 0x0000); // 0x23 COL_MODE, COL_SKIP=1. COL_BIN=1

                                IICWrite3(client, REG_MT9P031_READ_MODE2, 0x0060); // 0x20 READ_MODE_2, COL_SUM

                                IICWrite3(client, REG_MT9P031_SHUTTER_WIDTH_U, 0x0000); // 0x08 (1) SHUTTER_WIDTH_HI

                                IICWrite3(client, REG_MT9P031_SHUTTER_DELAY, 0x0000); // 0x0C (1) SHUTTER_DELAY_REG

                                IICWrite3(client, REG_MT9P031_RESTART, 0x0001);

                                IICWrite3(client ,REG_MT9P031_PCLK_CTRL, 0x600);

                                 

                                in usbsrc.

                                  /* Class specific Uncompressed VS format descriptor */

                                    0x1B,                               /* Descriptor size */

                                    CX3_CS_INTRFC_DESCR,                /* Class-specific VS interface Type */

                                    0x04,                               /* Subtype : VS_FORMAT */

                                    0x01,                               /* Format desciptor index */

                                    0x01,                               /* Number of Frame Descriptors that follow this descriptor: 3 */

                                   

                                    0x59, 0x55, 0x59, 0x32,             /*MEDIASUBTYPE_YUY2 GUID: 32595559-0000-0010-8000-00AA00389B71 */

                                    0x00, 0x00, 0x10, 0x00,

                                    0x80, 0x00, 0x00, 0xAA,

                                    0x00, 0x38, 0x9B, 0x71,

                                    0x10,                               /* Number of bits per pixel: 16*/

                                    0x01,                               /* Optimum Frame Index for this stream: 2 (720p) */

                                    0x00,                               /* X dimension of the picture aspect ratio; Non-interlaced */

                                    0x00,                               /* Y dimension of the pictuer aspect ratio: Non-interlaced */

                                    0x00,                               /* Interlace Flags: Progressive scanning, no interlace */

                                    0x00,                               /* duplication of the video stream restriction: 0 - no restriction */

                                 

                                    /* Class specific Uncompressed VS Frame Descriptor 1 - 1080p@30fps */

                                    0x1E,                               /* Descriptor size */

                                    CX3_CS_INTRFC_DESCR,                /* Descriptor type*/

                                    0x05,                               /* Subtype: Uncompressed frame interface*/

                                    0x01,                               /* Frame Descriptor Index: 1 */

                                    0x00,                               /* No Still image capture supported */

                                    0xE2,0x04,                         /* Width in pixel:  2500 */

                                    0x01, 0x04,                         /* Height in pixel: 1025 */

                                   // 0x40, 0x0D, 0x38, 0x0C,             /* Min bit rate (bits/s): 1025 x 2500 x 2 x 5 x 8 = 205000000 */

                                    0xA0, 0x06, 0x1C, 0x06, /* Min bit rate (bits/s): 1025 x 1250 x 2 x 5 x 8 = 102,500,000 */

                                    0x40, 0x0D, 0x38, 0x0C,             /* Max bit rate (bits/s): Fixed rate so same as Min */

                                    0x88, 0x33, 0x4E, 0x00,             /* Maximum video or still frame size in bytes(Deprecated): 2500 x 1025 x 2 */

                                    0x80, 0x84, 0x1E, 0x00,             /* Default frame interval (in 100ns units): (1/5)x10^7 */

                                    0x01,                               /* Frame interval type : No of discrete intervals */

                                    0x80, 0x84, 0x1E, 0x00,             /* Frame interval 3: Same as Default frame interval */

                                 

                                 

                                   /* Still image descriptor -YUV with QVGA resolution */

                                0x0b, /*Size of this descriptor*/

                                0x24, /*CS_INTERFACE descriptor type*/

                                0x03, /*VS_STILL_IMAGE_FRAME descriptor subtype*/

                                0x00, /*If method 3 is used, endpoint address is mentioned here*/

                                0x01, //No of frame Resolutions Follows

                                 

                                /* UVC Probe Control Setting - 5M*/

                                uint8_t const gl5MProbeCtrl_HS[CX3_UVC_MAX_PROBE_SETTING] = {

                                    0x00, 0x00,                         /* bmHint : No fixed parameters */

                                    0x01,                               /* Use 1st Video format index */

                                    0x01,                               /* Use 1st Video frame index */

                                   // 0x80,0x96,0x98,0x00,             /* Desired frame interval in 100ns = (1/30)x10^7 */

                                    0x80,0x84,0x1E,0x00, /* Desired frame interval in 100ns = (1/5)x10^7 */

                                    0x00, 0x00,                         /* Key frame rate in key frame/video frame units */

                                    0x00, 0x00,                         /* PFrame rate in PFrame / key frame units */

                                    0x00, 0x00,                         /* Compression quality control */

                                    0x00, 0x00,                         /* Window size for average bit rate */

                                    0x00, 0x00,                         /* Internal video streaming i/f latency in ms */

                                    //0xc4,0x19,0x27,0x00,             /* Max video frame size in bytes = 2500 x 1025 x 1 */

                                    0x88, 0x33, 0x4E, 0x00, /* Max video frame size in bytes = 2500 x 1025 x 2 */

                                #ifdef CX3_UVC_1_0_SUPPORT

                                    0x00, 0x90, 0x00, 0x00              /* No. of bytes device can rx in single payload: 36KB */

                                #else

                                    /* UVC 1.1 Probe Control has additional fields from UVC 1.0 */

                                    //0x00, 0x90, 0x00, 0x00,             /* No. of bytes device can rx in single payload: 36KB */

                                    0x00, 0x90, 0x00, 0x00,

                                    0x00, 0x60, 0xE3, 0x16,             /* Device Clock */

                                    0x00,                               /* Framing Information - Ignored for uncompressed format*/

                                    0x00,                               /* Preferred payload format version */

                                    0x00,                               /* Minimum payload format version */

                                    0x00                                /* Maximum payload format version */

                                #endif

                                };

                                #endif

                                • 13. Re: cb failure in cx3 high-speed
                                  RashiV_61

                                  Hello,

                                   

                                  Thank you for sharing. These settings seems fine.

                                  Please share the firmware files (.c file,.h file, .cyfx)

                                   

                                  Regards,

                                  Rashi

                                  • 14. Re: cb failure in cx3 high-speed
                                    user_3936656

                                    Hi  Rashi:

                                         the  firmware files  in  attach.

                                    1 2 Previous Next