This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

VPSS exception when using two VIP instances in camera link

Other Parts Discussed in Thread: DM385, SYSBIOS

Hi,

I am trying to create a use case where I connect two sensors to the DM385 using IPNC RDK. One sensor is parallel and the other is MIPI.

I've modified the low power tri-streaming use case and added another VIP Instance to the camera link:

cameraPrm.numVipInst = 2

Second stream was defined as follows:

pCameraInstPrm = &cameraPrm.vipInst[1];

pCameraInstPrm->vipInstId = 1; 
pCameraInstPrm->videoDecoderId = MultiCh_getSensorId(gUI_mcfw_config.sensorId); 
pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_UV;

pCameraInstPrm->sensorOutWidth = 1920;
pCameraInstPrm->sensorOutHeight = 1080;

pCameraInstPrm->standard = SYSTEM_STD_1080P_30;

pCameraInstPrm->numOutput = 1;

/* Second stream */
pCameraOutPrm = &pCameraInstPrm->outParams[1];
pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_UV;
pCameraOutPrm->scEnable = FALSE;

/* When VS is enabled then scOutWidth/scOutHeight cannot be equal to sensorOutWidth/sensorOutHeight */
if(cameraPrm.vsEnable == 0)
{
pCameraOutPrm->scOutWidth = 1920;
pCameraOutPrm->scOutHeight = 1080;
}
else
{
pCameraOutPrm->scOutWidth = 1600;
pCameraOutPrm->scOutHeight = 900;
}

pCameraOutPrm->outQueId = 1;

Basically, the use case looks like this:

									  SENSOR        SENSOR               	     
                                ________||____________||______                
                                |	                        |                 
                                |         CAMERA LINK       |                 
								|___________________________|                 
							      |                 |       
							      |                 |       
                                  |                 |           
                                  |			        |	   
                                  |			        |	   
                                  |		            |	   
					            MERGE---------------|	   
                                  |                    
                                  |                  
                                  |                  
                             IPCM3OUT(VPS)                  
                                  |                  
                                  |                  
                             IPCM3IN(VID)                  
                                  |                   
                                  |	                    
                               H264ENC                
                                  |
                                  |
                              BITSOUT (VID)
                                  |
                                  |
                              BITSIN (A8)

I've also made some modifications to cameraLink_drv to support creating a sensor handle for every VIP instance.

During runtime, usecase setup seems to work fine as well as camera link initialization and capture driver initialization. However, shortly after, there is an exception in m3vpss. I've traced the exception's source using the registers R13-R15 and the m3vpss .map file and found that the error is a usage error in ti_sysbios_knl_Task_exit__E 

[m3vpss ] Unhandled Exception:
[m3vpss ] Exception occurred in ThreadType_Task
[m3vpss ] handle: 0x8e58e938.
[m3vpss ] stack base: 0x8eda3320.
[m3vpss ] stack size: 0x4000.
[m3vpss ] R0 = 0x00000001 R8 = 0x00000000
[m3vpss ] R1 = 0x8e58e938 R9 = 0x00000000
[m3vpss ] R2 = 0x00000002 R10 = 0x8e584a40
[m3vpss ] R3 = 0x8de68a15 R11 = 0xffffffff
[m3vpss ] R4 = 0xbebebebe R12 = 0x8ee27598
[m3vpss ] R5 = 0x00000000 SP(R13) = 0x8eda7338
[m3vpss ] R6 = 0x00000000 LR(R14) = 0x8de3c525
[m3vpss ] R7 = 0x00000000 PC(R15) = 0x00000000
[m3vpss ] PSR = 0x20000000
[m3vpss ] ICSR = 0x0440f803
[m3vpss ] MMFSR = 0x00
[m3vpss ] BFSR = 0x00
[m3vpss ] UFSR = 0x0002
[m3vpss ] HFSR = 0x40000000
[m3vpss ] DFSR = 0x00000000
[m3vpss ] MMAR = 0xe000ed34
[m3vpss ] BFAR = 0xe000ed38
[m3vpss ] AFSR = 0x00000000
[m3vpss ] Terminating Execution...

I have added numerous debug prints in various places and so far I can't find any lead about where to find the cause of this problem. I've also tried using a similar usecase where there is a null link right after the second camera output and experienced the same problems (although the exception happened in Utils_mbxSendMsg this time). 

Can anyone share some knowledge about this issue? Any support from TI regarding this issue? 

Thanks,

Eli

  • I think camera link supports only one capture instance. capture link supports multi instance capture.

     

    Regards,

    Brijesh

  • Thanks for your reply Brijesh,


    I've went over the documentation and indeed capture link supports multiple input ports. The problem is that it does not support Bayer RAW input format if I'm not mistaken.
    I've read in the documentation that it is possible to use MIPI and CPI interfaces simultaneously on this platform, and this has been confirmed by some members here that implemented such a use case.
    I made a small modification to the link_api by changing SYSTEM_CAMERA_INST_MAX from 1 to 2 to allow my use case.

    If this is not possible - how else can I setup a use case that gets video from both sensor interfaces at the same time?

  • Hi,
    VIP can capture raw bayer data, but from parallel input. We could treat input data as if it is yuv data and capture it in memory in 16 bit container. but it supports only parallel input. where as camera link can support MIPI. So what is your sensor output? Then you could decide on the module to be used.
    Regards,Brijesh
  • Both sensors output 10-bit bayer raw.

    If I understand you correctly, you're suggesting the following use case:

    									MIPI SENSOR       PARALLEL SENSOR               	     
                                    ________||_______      ______||_______                
                                    |	            |     |              |                 
                                    |  CAMERA LINK  |     | CAPTURE LINK |     
    								|_______________|     |______________|                 
    							      |                          |       
    							      |                 		 |       
                                      |                 		 |           
                                      |			        		 |	   
                                      |			        		 |	   
                                      |		            		 |	   
    					            MERGE------------------------|	   
                                      |                    
                                      |                  
                                      |                  
                                 IPCM3OUT(VPS)                  
                                      |                  
                                      |                  
                                 IPCM3IN(VID)                  
                                      |                   
                                      |	                    
                                   H264ENC                
                                      |
                                      |
                                  BITSOUT (VID)
                                      |
                                      |
                                  BITSIN (A8)

    If that is the case, the parallel sensor should go into parallel port CAM_D[0-9] as previously?

  • What is your sensor output interface? Is it parallel or sensor or both?Regards,
    Brijesh
  • One sensor is MIPI, and one sensor is parallel. Both output 10-bit bayer RAW.
  • To clarify, I am using the CSI-2 interface and the parallel camera input interfaces
  • ok,
    What you could do is, you could use camera link for capture from MIPI sensor and capture link to capture over parallel interface. In this way, you will be able to capture from both the sensor.
    Are you using IPNC RDK? which release version? Because MIPI capture support is not available in all releases. Please contact your local TI representative to get IPNC release with MIPI support.
    Regards,Brijesh
  • I am using IPNC RDK 3.5

    We have MIPI support available from previously integrating a MIPI sensor to the platform.

    We also have a copy of IPNC RDK 3.8 which officially supports MIPI sensors.

    How do I configure capture link to use the CPI sensor interface? All the available options listed in system API are as follows:

    #define  SYSTEM_CAPTURE_INST_VIP0_PORTA   (0u) 
      Capture instance - VIP0 - Port A. 
     
    #define  SYSTEM_CAPTURE_INST_VIP0_PORTB   (1u) 
      Capture instance - VIP0 - Port B. 
     
    #define  SYSTEM_CAPTURE_INST_VIP1_PORTA   (2u) 
      Capture instance - VIP1 - Port A. 
     
    #define  SYSTEM_CAPTURE_INST_VIP1_PORTB   (3u) 
      Capture instance - VIP1 - Port B. 
     
    #define  SYSTEM_CAPTURE_INST_MAX   (4u) 
      Capture instance - MAX instances. 
     
    

  • Again, this depends on which pins your sensor output is connected to. If it is connected to CPI pins, it is difficult, i would suggest using Vip pins to connect sensor output. Then you could use capture link to capture sensor data on vip port.
    Regards,Brijesh
  • Thanks for your answer, my sensor is indeed connected to the CPI pins and changing the board layout is not an option currently.
    Is there any other solution I can use then?

    You mentioned that camera link does not support multiple VIP instances, but in the code it has the numVipInst option and the VipInst[] member CameraLink_CreateParams is an array of size:
    /** \brief Camera instance - MAX instances */
    #define SYSTEM_CAMERA_INST_MAX (2u)

    What is the puprose of defining multiple VIP instances other than receiving input from two video sources simultaneously?
  • Hi Brijesh,

    I have an update regarding this issue: we are able to connect the following pins to the parallel sensor:
    VIN[0]A_D[16] - VIN[0]A_D[23]
    VIN[0]A_CLK
    VIN[0]A_VSYNC
    VIN[0]A_HSYNC

    Will this allow us to use 8-bit Bayer RAW capture? If so, how can this be configured?

    Eli
  • Hi Eli,

     

    D16 to D23 lines are used only for the 24bit capture, if you want 8bit capture, you need to use either D0 to D7 lines or D8 to D15 lines. For more than 8bit mode, you need to use D0 to D16 lines.  The other configurations are not supported in Hardware.

     

    Regards,

    Brijesh

  • I see,
    In that case, we have to use two instances of camera link to use CPI and MIPI sensor interfaces.

    How could I debug and solve the crash I'm experiencing when trying to use two VIP instances in camera link? The MCFW API guide seems to indicate that this is indeed possible, otherwise what is the purpose of the multiple vip instance IDs in camera link?
    Is there any support from TI regarding this issue?