Custom MIPI-CSI Camera Integration

Hi,

We are working on a custom camera outputting RGB888 (24 bits) format over MIPI-CSI on 2 lanes connected to Jetson TX1 running 28.1.

While we could make it work over v4l2src plugin, when we try running with nvcamerasrc, it is not working and the nvcamera daemon outputs following error.
tV4LPixelType: pixel type 0x1000 invalid                                      
setActiveBufferMemory: 2                                                        
INPUT: Width 768 Height 576 pixelformat RG10                                    
writeFrameRate: INPUT frameLength:625, frameRate:50.000000                      
writeGain:      INPUT gainCtrl:100 analogGain:1.000000                          
writeExposure:  INPUT coarseTime:615, expTime:0.019680                          
updateOutputSettings:   OUTPUT frameLength:625, frameRate:50.000000             
updateOutputSettings:   OUTPUT analogGain:1.000000                              
updateOutputSettings:   OUTPUT coarseTime:615, expTime:0.019680                 
apply:-----------------------                                                   
NvPclSettingsApply: Reading PCL settings                                        
PowerServiceUtils:calculateReqClock: entered                                    
PowerServiceHw:addRequest: table size: before: 0, after:1                       
        request table for VI 0:                                                 
        req[0]: guID=0, stageID=SensorCapture                                   
        req[0]: inW=768, inH=576, inBpp = 10, fps=50                            
        req[0]: outW=768, outH=576, outBpp=10                                   
        req[0]: out1W=0, out1H=0, out1Bpp=0                                     
        req[0]: out2W=0, out2H=0, out2Bpp=0                                     
        req[0]: clock=32450000, pixelRate=29500000, timeout=900                 
        req[0]: isoBw=40562, timeout=900                                        
        req[0]: non_isoBw=0, timeout=900                                        
PowerServiceHw:addRequest: table size: before: 0, after:1                       
        request table for CSI 0:                                                
        req[0]: guID=0, stageID=SensorCapture                                   
        req[0]: inW=768, inH=576, inBpp = 10, fps=50                            
        req[0]: outW=768, outH=576, outBpp=10                                   
        req[0]: out1W=0, out1H=0, out1Bpp=0                                     
        req[0]: out2W=0, out2H=0, out2Bpp=0                                     
        req[0]: clock=0, pixelRate=29500000, timeout=900                        
        req[0]: isoBw=0, timeout=900                                            
        req[0]: non_isoBw=0, timeout=900                                        
PowerServiceHwVi:setIso: m_bwVal_Iso=40562                                      
PowerServiceHw:setClock: PowerServiceHw[1]: requested_clock_Hz=32450000         
PowerServiceCore:setCameraBw: totalIsoBw=40562                                  
NvPclSettingsUpdate: Sending Updated Settings through PCL                       
NvPclSettingsApply: Applying last settings through PCL                          
apply:+++++++++++++++++++++++                                                   
apply:-----------------------                                                   
NvPclSettingsApply: Reading PCL settings                                        
SCF: Error NotImplemented: Unsupported sensor type (in src/components/CaptureSet
upEngineImpl.cpp, function chooseGenInstFunc(), line 126)                       
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngineI
mpl.cpp, function doGetInstructions(), line 1798)                               
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function getInstructionList(), line 262)                                   
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function setupCC(), line 186)                                              
SCF: Error NotImplemented:  (propagating from src/api/Session.cpp, function capt
ure(), line 811)                                                                
disposing CC 0 Session 0                                                        
SCF: Error NotImplemented: Unsupported sensor type (in src/components/CaptureSet
upEngineImpl.cpp, function chooseGenInstFunc(), line 126)                       
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngineI
mpl.cpp, function doGetInstructions(), line 1798)                               
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function getInstructionList(), line 262)                                   
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function setupCC(), line 186)                                              
SCF: Error NotImplemented:  (propagating from src/api/Session.cpp, function capt
ure(), line 811)                                                                
disposing CC 0 Session 0                                                        
SCF: Error NotImplemented: Unsupported sensor type (in src/components/CaptureSet
upEngineImpl.cpp, function chooseGenInstFunc(), line 126)                       
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngineI
mpl.cpp, function doGetInstructions(), line 1798)                               
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function getInstructionList(), line 262)                                   
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function setupCC(), line 186)                                              
SCF: Error NotImplemented:  (propagating from src/api/Session.cpp, function capt
ure(), line 811)                                                                
disposing CC 0 Session 0                                                        
SCF: Error NotImplemented: Unsupported sensor type (in src/components/CaptureSet
upEngineImpl.cpp, function chooseGenInstFunc(), line 126)                       
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngineI
mpl.cpp, function doGetInstructions(), line 1798)                               
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function getInstructionList(), line 262)                                   
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function setupCC(), line 186)                                              
SCF: Error NotImplemented:  (propagating from src/api/Session.cpp, function capt
ure(), line 811)                                                                
disposing CC 0 Session 0                                                        
SCF: Error NotImplemented: Unsupported sensor type (in src/components/CaptureSet
upEngineImpl.cpp, function chooseGenInstFunc(), line 126)                       
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngineI
mpl.cpp, function doGetInstructions(), line 1798)                               
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function getInstructionList(), line 262)                                   
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function setupCC(), line 186)                                              
SCF: Error NotImplemented:  (propagating from src/api/Session.cpp, function capt
ure(), line 811)                                                                
disposing CC 0 Session 0                                                        
SCF: Error NotImplemented: Unsupported sensor type (in src/components/CaptureSet
upEngineImpl.cpp, function chooseGenInstFunc(), line 126)                       
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngineI
mpl.cpp, function doGetInstructions(), line 1798)                               
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function getInstructionList(), line 262)                                   
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function setupCC(), line 186)                                              
SCF: Error NotImplemented:  (propagating from src/api/Session.cpp, function capt
ure(), line 811)                                                                
disposing CC 0 Session 0                                                        
SCF: Error NotImplemented: Unsupported sensor type (in src/components/CaptureSet
upEngineImpl.cpp, function chooseGenInstFunc(), line 126)                       
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngineI
mpl.cpp, function doGetInstructions(), line 1798)                               
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function getInstructionList(), line 262)                                   
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function setupCC(), line 186)                                              
SCF: Error NotImplemented:  (propagating from src/api/Session.cpp, function capt
ure(), line 811)                                                                
disposing CC 0 Session 0                                                        
SCF: Error NotImplemented: Unsupported sensor type (in src/components/CaptureSet
upEngineImpl.cpp, function chooseGenInstFunc(), line 126)                       
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngineI
mpl.cpp, function doGetInstructions(), line 1798)                               
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function getInstructionList(), line 262)                                   
SCF: Error NotImplemented:  (propagating from src/components/CaptureSetupEngine.
cpp, function setupCC(), line 186)                                              
SCF: Error NotImplemented:  (propagating from src/api/Session.cpp, function capt
ure(), line 811)                                                                
disposing CC 0 Session 0

Further in another mode, we will need to extract only 8 bit green channel of the incoming data 24 bit data and output it as MEDIA_BUS_FMT_Y8_1X8. Is it possible to use the VI for this purpose? If so, how?

Thanks in advance.

@kumar81
Sorry to tell nvcamerasrc didn’t support RGB888 yet.

Thank you ShaneCCC.

Is there a way to leverage the “8-bit raw or DPCM 14-8-14/12-8-12/10-8-10” conversion mentioned in the “Supported CSI to VI Data Formats” of the TX1 manual? We could align our intensity byte to the necessary location from the camera.

And when we run using v4l2src as below, we see occasional break in the video flow. What could be the reason?

gst-launch-1.0 -v v4l2src device=/dev/video0 ! ‘video/x-raw,framerate=(fraction)50/1,format=RGB’ ! videoconvert ! xvimagesink

What do you mean “we see occasional break in the video flow”

Well, there were jumps in the stream. It got solved by running TX1 with maximum performance.

Now we are really interested in extracting only 8 bits of our input stream. Any pointers in that regard will be very helpful.

@kumar81
Sorry, I don’t understand what your mean? Could you have more detail information.

We are receiving MIPI packets in RGB888 format. We would like to know if the VI engine can extract only the Green byte and store it in system memory.

@kumar81
VI engine didn’t support it. But you can do post processing.

Can you provide pointers for the same ShaneCCC?

You can write gstreamer element to do what you want after you receive the frame data.

OK Thank you ShaneCCC, we are hoping to avoid the software manipulation.

BTW I have another question. As mentioned earlier, we are interested only in 8-bit intensity data from our camera. If we can make the camera to output RAW 8-bit MIPI packets, will it possible to get just these WxH bytes over v4l2src? Is this feature available today?

Reason I am asking is that in the vi_video_formats array, the RAW8 inputs are manipulated as Bayer format. But we will send only the Y, and the same has to be stored in memory without any processing.

@kumar81
It’s could possible but you may need to modify the vi driver to support it. Please check the TRM YUV Pixel Data “YUV Pixel Data Formatting”.

Thank you Shane, we will look in to it.