Vincent,

Thanks for your help.  I have another question I wanted to ask you or anyone 
else who can help.

Let's say I want to typecast the input buffer to my dec codec as this:

// message format
struct MyMessage
{
    unsigned char    data1;

    unsigned short   data2;

    unsigned int     data3;

    unsigned int     data4;

    unsigned char    buf[105];
} __attribute__ ((packed));

In my ARM application, I allocated the input buffer from the CMEMK pool like 
this:

    inBuf = (XDAS_Int8 *)Memory_contigAlloc(sizeof(struct MyMessage), 
Memory_DEFAULTALIGNMENT);

and set ((struct MyMessage *)inBuf)->buf with some values.  When I called 
SPHENC_process with 
that buffer, my vendor specific function "MYDEC_TI_process" in my dec codec 
doesn't see the 
same values in (struct MyMessage *)inBufs->bufs[0])->buf:

XDAS_Int32 MYDEC_TI_process(ISPHDEC_Handle h, XDM_BufDesc *inBufs,
                                         XDM_BufDesc *outBufs, ISPHDEC_InArgs 
*inArgs, ISPHDEC_OutArgs *outArgs)
{
    // do processing on ((struct AudioMessage *)inBufs->bufs[0])->buf;

    return (ISPHDEC_EOK);    
}

Is there a memory alignment, typecasting, or indianess issue?  Also, I had to 
comment out the 
__attribute__ ((packed)) or else the DSP compiler won't compile correctly.  
Please advise.  Thanks!

Regards,
Andy


----- Original Message ----
From: "Wan, Vincent" <[EMAIL PROTECTED]>
To: Andy Ngo <[EMAIL PROTECTED]>
Cc: davinci-linux-open-source <[email protected]>
Sent: Friday, January 26, 2007 5:21:05 PM
Subject: RE: Linking/mapping data to IRAM or L1SDRAM on the DSP




 
 


<!--
 _filtered {font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
text-decoration:underline;}
p
        {
margin-right:0in;

margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle18
        {
font-family:Arial;
color:navy;}
 _filtered {
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {}
-->






Hi Andy,
 

  
 

You can try this:
 

  
 

In package.bld, set the lopts (linker
options) in the addExecutable call:         
 

     
 

  
 

    ….
 

         

 

   
if (targ.os == "Linux") {
 

       
libraries = "-lm";
 

   
}
 

   
else {
 

       
libraries = "";
 

   
}
 

                                                                

 

    Pkg.addExecutable(name,
targ, plat, {
 

       
cfgScript: cfg,
 

       
lopts: libraries,  
 

  
 

    ….
 

  
 

Fyi, there is also something called copts
that allows you to set compiler flags.
 

  
 

Alternatively, if you are more comfortable
with makefiles, you can take a look at the video_copy/dualcpu example to see
how you can directly specify –lm, etc. next to the rule for app.out,
where –lphread is specified.
 

  
 

Best regards,
 

Vincent
 

  
 










From: Andy Ngo
[mailto:[EMAIL PROTECTED] 

Sent: Thursday, January 25, 2007
2:16 PM

To: Wan, Vincent

Cc: davinci-linux-open-source

Subject: Re: Linking/mapping data
to IRAM or L1SDRAM on the DSP
 




  
 





Hi Vincent,
 




 
 

Thanks
for you help.  I have another question that maybe you can help.  I
want to add
 

a
library (i.e. mylib.a) to the ARM application but I couldn't figure it
out.  I know I need
 

to
modify the package.bld file.  For example, in the
dvevm_1_10/codec_engine_1_02/examples/apps/speech_copy folder, I see all the
 

source
files are added in package.bld via Pkg.addobjects).  How do I add my
library 
 

and
other system libraries (like -lm -lc -ldl -rt).  Otherwise, I have to
manually modify
 

the
package.mak that automatically gets generated (my changes get wiped out if I
 

modify
package.bld again).
 

 
 

Thanks!
 

 
 

Regards,
 

Andy
 



  
 






 
 













_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to