Hi again!
I bet you're all getting sick of me so I appologise for bothering you all 
again. I am trying to convert my project from a single thread into multiple 
threads using the encode demo as a guide. My stucture is almost the same except 
I have no writer thread and my video thread captures JPEGs instead of encoding 
video (I'll deal with changing the name of the thread later!). I succesfully 
modified the video thread removing anything related to encoding video or 
interacting with the writer thread, so essentially all it does for now is get 
buffers from the capture thread and send them back. This runs fine and simply 
displays the video from the camera on screen with a slightly modified OSD. The 
porblem is now when I try and insert the code responsible for capturing JPEGs 
into the video thread. During the initialisation I get the error "can't set dyn 
params 0x0" which comes from the function in bold below:

    /* Reset, load, and start DSP Engine */
    CE = Engine_open(engineName, NULL, NULL);

    if (CE == NULL) {
        ERR("Failed to open codec engine %s\n", engineName);
        cleanup(THREAD_FAILURE);
    }

    DBG("Codec Engine opened in video thread\n");

// allocate and initialize image encoder on the engine
  enc = IMGENC_create( CE, encoderName, &imgParams );
  if ( enc == NULL ) {
    ERR("error: can't open codec %s\n", encoderName);
    cleanup(THREAD_FAILURE);
  }

  jstatus = IMGENC_control( enc, XDM_SETPARAMS, 
                           (IMGENC_DynamicParams*)(&dynParams),
                           (IMGENC_Status*)(&imgStatus) );
  if ( jstatus == IALG_EFAIL ) {
    ERR("error: can't set dyn params 0x%x\n", (int)(imgStatus.extendedError) );
    cleanup(THREAD_FAILURE);
  }

This is part of the output I get when running the code:
@0x000b15aa:[T:0x4265fb60] ti.sdo.ce.image.IMGENC - IMGENC_create> return 
(0x2c398)                                                                       
      
@0x000b1643:[T:0x4265fb60] ti.sdo.ce.image.IMGENC - IMGENC_control> Enter 
(handle=0x2c398, id=1, params=0x29358, status=0x299f4                           
      
@0x000b1702:[T:0x4265fb60] ti.sdo.ce.image.IMGENC - IMGENC_control> return (-1) 
-- FAILED                                                                       
Video Chain Debug: Checking video standard                                      
Video Chain Error: error: can't set dyn params 0x0   

This is the same part the output from my project running as a single thread:
@0x000e07c7:[T:0x402c8568] ti.sdo.ce.image.IMGENC - IMGENC_create> return 
(0x282f0)                                                                       
      
@0x000e085f:[T:0x402c8568] ti.sdo.ce.image.IMGENC - IMGENC_control> Enter 
(handle=0x282f0, id=1, params=0x25338, status=0x259d0   

In both programs the params are set up as below (above the value shown for 
params is different in each case, is this the value or the address where the 
params are stored?)
// image dynamic parameters
IMGENC_DynamicParams dynParams = {
  sizeof(IIMGENC_DynamicParams),  // size
  0,                              // numAU
  XDM_YUV_422ILE,                 // inputChromaFormat                  
  480,                            // inputHeight
  720,                            // inputWidth
  0,                              // captureWidth
  XDM_ENCODE_AU,                  // generateHeader
  73                              // qValue
};



Below is the full output when running my app. Can anyone think why the function 
might fail like that? There are no errors or warning when I compile.
Thanks again,
Euan



Video Chain Debug: NTSC selected                                                
Video Chain started.                                                            
Video Chain Debug: Codec Engine initialized                                     
Video Chain Debug: Logging not initialized                                      
@0x000c91d3:[T:0x40ac9b60] OP - daemon> thread created.                         
Video Chain Debug: Pause object opened                                          
Video Chain Debug: Init rendezvous opened for 1 threads                         
Video Chain Debug: Cleanup rendezvous opened for 1 threads                      
Video Chain Debug: Priming rendezvous opened for 2 threads                      
@0x000cba72:[T:0x412c9b60] OM - Memory_getPhysicalAddress> 
Enter(virtAddr=0x412ca000)                                                      
                     
@0x000cbb6f:[T:0x412c9b60] OM - Memory__getPhysicalAddress> 
Enter(virtAddr=0x412ca000, size=1)                                              
                    
@0x000cbc1a:[T:0x412c9b60] OM - Memory__getPhysicalAddress> returning 
physAddr=0x0                                                                    
          
@0x000cbcbd:[T:0x412c9b60] OM - Memory_getPhysicalAddress> return (0x86800000)  
Video Chain Debug: Display buffer 0 mapped to 0x412ca000 has physical address 
0x86800000                                                                      
  
@0x000cdb56:[T:0x412c9b60] OM - Memory_getPhysicalAddress> 
Enter(virtAddr=0x413c9000)                                                      
                     
@0x000cdc14:[T:0x412c9b60] OM - Memory__getPhysicalAddress> 
Enter(virtAddr=0x413c9000, size=1)                                              
                    
@0x000cdcb9:[T:0x412c9b60] OM - Memory__getPhysicalAddress> returning 
physAddr=0x0                                                                    
          
@0x000cdd54:[T:0x412c9b60] OM - Memory_getPhysicalAddress> return (0x868ff000)  
Video Chain Debug: Display buffer 1 mapped to 0x413c9000 has physical address 
0x868ff000                                                                      
  
@0x000cfbd1:[T:0x412c9b60] OM - Memory_getPhysicalAddress> 
Enter(virtAddr=0x414c8000)                                                      
                     
@0x000cfc95:[T:0x412c9b60] OM - Memory__getPhysicalAddress> 
Enter(virtAddr=0x414c8000, size=1)                                              
                    
@0x000cfd35:[T:0x412c9b60] OM - Memory__getPhysicalAddress> returning 
physAddr=0x0                                                                    
          
@0x000cfdcf:[T:0x412c9b60] OM - Memory_getPhysicalAddress> return (0x869fe000)  
Video Chain Debug: Display buffer 2 mapped to 0x414c8000 has physical address 
0x869fe000                                                                      
  
Video Chain Debug: Video display device initialized.                            
Video Chain Debug: Display thread created                                       
Video Chain Debug: captureWidth = 720, captureHeight = 480                      
Video Chain Debug: Capture thread created                                       
@0x000d0708:[T:0x4265fb60] CE - Engine_open('jpegencdec', 0x0, 0x4265f554)      
@0x000d0819:[T:0x4265fb60] CE - rserverOpen('./jpegencdecCombo.x64P'), count = 0
@0x000d08d3:[T:0x4265fb60] OP - Process_create> 
Enter(imageName='./jpegencdecCombo.x64P', attrs=0x4265f558)                     
                                
Video Chain Debug: Set the capture input to id 0                                
Video Chain Debug: Control thread created                                       
Video Chain Debug: OSD successfully initialized                                 
Video Chain Debug: OSD transparency initialized                                 
@0x000d2897:[T:0x402c8568] CE - Engine_open('jpegencdec', 0x0, 0xbefff754)      
@0x000d29a9:[T:0x40ac9b60] OP - Process_create_d> Enter(proc=0x2c2d0)           
@0x000d2a57:[T:0x40ac9b60] OP - Process_create_d> Initializing DSP PROC...      
@0x000d32f4:[T:0x40ac9b60] OP - Process_create_d> Attaching to DSP PROC...      
@0x000d39cb:[T:0x40ac9b60] OP - Process_create_d> Opening MSGQ pool...          
@0x000d3caf:[T:0x40ac9b60] OP - Process_create_d> Loading 
./jpegencdecCombo.x64P on DSP (1 args)...                                       
                      
Video Chain Debug: Entering display main loop.                                  
@0x000de2a5:[T:0x40ac9b60] OP - Process_create_d> Starting DSP PROC...          
@0x000df040:[T:0x40ac9b60] OP - Process_create_d> Opening remote transport...   
@0x000df2cb:[T:0x40ac9b60] OP - Process_create_d> return (1)                    
@0x000df43d:[T:0x4265fb60] OP - Process_create> return (0x2c2d0)                
@0x000df4f5:[T:0x4265fb60] CE - rserverOpen('./jpegencdecCombo.x64P'): 0x2966c 
done.                                                                           
 
@0x000df5d9:[T:0x4265fb60] OC - Comm_create> Enter(queueName='jpegencdec', 
queue=0x2c2b0, attrs=0x0)                                                       
     
@0x000df84d:[T:0x4265fb60] OC - Comm_create> return (0x2c338)                   
@0x000df91b:[T:0x4265fb60] OC - Comm_alloc> Enter(poolId=0x0, msg=0x2c2bc, 
size=576)                                                                       
     
@0x000dfa13:[T:0x4265fb60] OC - Comm_alloc> msg=0x427f6900, returning (0)       
@0x000dfab9:[T:0x4265fb60] OC - Comm_locate> Enter(queueName='rmsq', 
queue=0x2c2ac)                                                                  
           
@0x000e1a0f:[T:0x4265fb60] OC - Comm_locate> return (0)                         
@0x000e1ad7:[T:0x4265fb60] CE - checkServer(0x2c2a0)                            
@0x000e1ba9:[T:0x4265fb60] OC - Comm_put> Enter(queue=0x0, msg=0x427f6900)      
@0x000e1c7e:[T:0x4265fb60] OC - Comm_put> return (0)                            
@0x000e1d5b:[T:0x4265fb60] OC - Comm_get> Enter(queue=0x10000, msg=0x4265f550, 
timeout=-1)                                                                     
 
@0x000e1e22:[T:0x4265fb60] OC - Comm_get> return (0)                            
Video Chain Debug: Codec Engine opened in video thread                          
@0x000e1f15:[T:0x4265fb60] ti.sdo.ce.image.IMGENC - IMGENC_create> Enter 
(server=0x2c2a0, name='jpegenc', params=0x29378)                                
       
@0x000e1ff2:[T:0x4265fb60] CV - VISA_create(0x2c2a0, 'jpegenc', 0x29378, 0x828, 
'ti.sdo.ce.image.IIMGENC')                                                      
@0x000e20e2:[T:0x4265fb60] CE - Engine_createNode(0x2c2a0, 'jpegenc', 828, 
0x29378)                                                                        
     
@0x000e2191:[T:0x4265fb60] OC - Comm_create> Enter(queueName='gppfromnode', 
queue=0x2c3c0, attrs=0x0)                                                       
    
@0x000e23f6:[T:0x4265fb60] OC - Comm_create> return (0x2c3e0)                   
@0x000e250b:[T:0x4265fb60] OC - Comm_put> Enter(queue=0x0, msg=0x427f6900)      
@0x000e25f1:[T:0x4265fb60] OC - Comm_put> return (0)                            
@0x000e26b2:[T:0x4265fb60] OC - Comm_get> Enter(queue=0x10000, msg=0x4265f504, 
timeout=-1)                                                                     
 
@0x000e27c3:[T:0x4265fb60] OC - Comm_get> return (0)                            
@0x000e2856:[T:0x4265fb60] OC - Comm_put> Enter(queue=0x0, msg=0x427f6900)      
@0x000e2914:[T:0x4265fb60] OC - Comm_put> return (0)                            
@0x000e29e4:[T:0x4265fb60] OC - Comm_get> Enter(queue=0x10000, msg=0x4265f504, 
timeout=-1)                                                                     
 
@0x000e2ab0:[T:0x4265fb60] OC - Comm_get> return (0)                            
@0x000e2b3a:[T:0x4265fb60] CE - Engine_createNode> created node(stdIn=0x2, 
stdOut=0x10001, msgq=0x2c3e0, algName='jpegenc', rmsNode=0x8fa46480, 
algHandle=0x8fa46560)                                                           
                
@0x000e2c37:[T:0x4265fb60] CE - Engine_createNode> Returning 0x2c3b8            
@0x00136193:[T:0x4265fb60] OC - Comm_alloc> Enter(poolId=0x0, msg=0x2c3a4, 
size=828)                                                                       
     
@0x00136290:[T:0x4265fb60] OC - Comm_alloc> msg=0x427f7900, returning (0)       
@0x00136351:[T:0x4265fb60] CV - VISA_create> remote codec created 
(name='jpegenc', localQueueID=0x10001, remoteQueueID=0x0002)                    
              
@0x00136424:[T:0x4265fb60] ti.sdo.ce.image.IMGENC - IMGENC_create> return 
(0x2c398)                                                                       
      
@0x001364bf:[T:0x4265fb60] ti.sdo.ce.image.IMGENC - IMGENC_control> Enter 
(handle=0x2c398, id=1, params=0x29358, status=0x299f4                           
      
@0x0013657d:[T:0x4265fb60] ti.sdo.ce.image.IMGENC - IMGENC_control> return (-1) 
-- FAILED                                                                       
Video Chain Debug: Checking video standard                                      
Video Chain Error: error: can't set dyn params 0x0                              
@0x00136929:[T:0x402c8568] CE - rserverOpen('./jpegencdecCombo.x64P'), count = 1
@0x00136a12:[T:0x402c8568] CE - rserverOpen('./jpegencdecCombo.x64P'): 0x2966c 
done.                                                                           
 
@0x00136acb:[T:0x402c8568] OC - Comm_create> Enter(queueName='jpegencdec', 
queue=0x2c308, attrs=0x0)                                                       
     
@0x00136e7b:[T:0x402c8568] OC - Comm_create> return (0x2c3f0)                   
@0x00136f43:[T:0x402c8568] OC - Comm_alloc> Enter(poolId=0x0, msg=0x2c314, 
size=576)                                                                       
     
@0x00137012:[T:0x402c8568] OC - Comm_alloc> msg=0x427f8900, returning (0)       
@0x001370ad:[T:0x402c8568] OC - Comm_locate> Enter(queueName='rmsq', 
queue=0x2c304)                                                                  
           
Video Chain Debug: NTSC camera detected                                         
@0x00139743:[T:0x402c8568] OC - Comm_locate> return (0)                         
@0x00139808:[T:0x402c8568] CE - checkServer(0x2c2f8)                            
@0x001398ce:[T:0x402c8568] OC - Comm_put> Enter(queue=0x0, msg=0x427f8900)      
@0x0013999d:[T:0x402c8568] OC - Comm_put> return (0)                            
@0x00139b2e:[T:0x402c8568] OC - Comm_get> Enter(queue=0x10002, msg=0xbefff750, 
timeout=-1)                                                                     
 
@0x00139c08:[T:0x402c8568] OC - Comm_get> return (0)                            
Video Chain Debug: Codec Engine opened in control thread                        
Video Chain Debug: Setting capture cropping (720x480)                           
Capturing 720x480 video (cropped to 720x480)                                    
Video Chain Debug: 3 capture buffers were successfully allocated.               
Video Chain Debug: Capture driver buffer 0 at physical address 1116102656 
mapped to virtual address 0x86e00000                                            
      
Video Chain Debug: Capture driver buffer 1 at physical address 1116987392 
mapped to virtual address 0x86f00000                                            
      
Video Chain Debug: Capture driver buffer 2 at physical address 1117872128 
mapped to virtual address 0x86400000                                            
      
Video Chain Debug: Video capture initialized and started                        
Video Chain Debug: Entering capture main loop.                                  
Video Chain Debug: MSP430 library initialized                                   
Video Chain Debug: User interface created                                       
Command [ 'help' for usage ] > Video Chain Debug: Entering control main loop.   
@0x0016f942:[T:0x402c8568] CE - Engine_close(0x2c2f8)                           
@0x0016f9eb:[T:0x402c8568] OC - Comm_free> Enter (msg=0x427f8900)               
@0x0016faa3:[T:0x402c8568] OC - Comm_free> return (0)                           
@0x0016fb48:[T:0x402c8568] OC - Comm_delete> Enter (comm=0x2c3f0)               
@0x0016fddb:[T:0x402c8568] OC - Comm_delete> return                             
@0x0016fe96:[T:0x402c8568] OC - Comm_release> Enter(queue=0x0)                  
@0x0016ff42:[T:0x402c8568] OC - Comm_release> return (0)                        
@0x0016ffd0:[T:0x402c8568] CE - rserverClose(0x2966c), count = 2                
@0x00170059:[T:0x402c8568] CE - rserverClose(0x2966c) done.                     
@0x0017057f:[T:0x40ac9b60] OP - daemon> thread terminating                      
@0x00170735:[T:0x402c8568] OT - Thread_join> Enter (task=0x2c0c8)               
@0x001707fe:[T:0x402c8568] OT - Thread_join> Exit (task=0x2c0c8)   
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to