Hi,
I read some notes that I can run/call a DSP library from ARM (linux) side using xDAIS.
Is there anyone have done this and how did you do it?.
Thanks,
JT
JT,
I created an example application to call a DSPLIB app from ARM Linux via DSPLINK. It doesn't use XDAIS, but it sounds close to what you need:
http://wiki.davincidsp.com/index.php/Example_DSPLIB/DSPLink_Application_on_OMAP-L1x
This app will only run on OMAP-L1x. Porting it to other devices may be a fair amount of work, since you'd need to swap in another DSPLIB. (The library currently used by the app is only compatible with C674x DSPs.)
Since you're already using an XDAIS alg (great!), you might check this article:
http://tiexpressdsp.com/index.php/Getting_started_with_IUNIVERSAL
Chris
Hi Joe,
Thanks for the info., I have to stick on XDAIS since we have an existing engine/codec. Though, I was getting a hard time to find a documentation on adding a DSP library on XDAIS.
Any idea where to get a good info for adding library on XDAIS?
Hi Chris,
I should have mentioned the library that I want to put it in XDAIS. I want to use the TI's VLIB (Vision Library vlib.I64P) API to do vision tracking.
Do you think IUNIVERSAL is the right one to integrate the said library?.
I'm not familiar with VLIB, so others can trump me if they want.
IUNIVERSAL is pretty much "you're on your own to define whatever you want" and should work for you - but you have to spec the entire API. It _may_ be interesting to consider something like IVIDENC1 (Video Encode) which is already set up to take raw video buffers as input and generate a bitstream as output. Perhaps your "bitstream" output buffer(s) could contain details returned by VLIB?
Just my [barely educated] 2 cents. Trump away.
That's correct.
I've read using XDAIS can easily ported the existing DSP Library and no need to really understand the API when implementing it. This is what I need for now, I need to make the VLIB available to linux and make an funcation call after I've done implementation.
I'll check the IUNIVERSAL and looks like I could get more info.
John
In the old XDAIS, in order to put a DSP library you need to create a skeleton and stubs.
How about in IUNIVERSAL, is it required to create a skeleton and stubs too?
In short, no, you don't have to create these yourself.
Stubs/skels are only required if you're using Codec Engine, and running the alg 'remotely' (i.e. on a processor other than the one your app is on). In that case, _someone_ has to provide stubs/skels.
If you're using an XDM interface (e.g. IVIDENC1, IAUDDEC1, IUNIVERSAL, etc), Codec Engine provides the stubs/skels for you (and handles all the related, messy address translation and cache management). Your only requirement is to implement exactly that interface.
If you're inventing your own XDAIS-compliant interface, you can still create your own stubs/skels. But this is a headache, and exactly why we created IUNIVERSAL... so you have one less headache.
I'm kind a lost right now. I read a bunch of stuff and my mind is floating.... may be you can enlighten me up... :)
My goal is this:
I want to use the VLIB library. The VLIB provides only a vlib.I64P and .h (function prototype), no source code and no stubs/skels.
Since, I need to run the function remotely (DSP), I have to create a stubs/skels, am I right?.
1. Is it possible to create a skels/stubs even I don't have a source code?
2. If the library didn't pass in QualiTI, is it possible to use XDAIS even the said library is non-compliant?. If not, is there any other way to force it and use XDAIS interface?
3. Creating a stubs/skels is very painful, is there any other way that I could load, run the dsp library and take advantage of it without spending too much on how to create stubs/skels?.
There are a couple ways to skin it - here's what I'd try first... making this up as I go, and not compiling any of this, so cut me a little slack please...
Read this and refer to it often - http://tiexpressdsp.com/index.php/Getting_started_with_IUNIVERSAL . (Please edit it if you see issues or want to add your findings!)
Understand this as you'll be 'extending' the predefined structs - http://tiexpressdsp.com/index.php/Extending_data_structures_in_xDM
Assuming VLIB is "just a bunch of standard function calls", I might treat each fxn call as a UNIVERSAL_process() call. To differentiate which fxn to call, I might add an extended inArgs field called "functionIndex" so my alg knows which fxn to call. Function input args should be added to the extended inArgs struct. Output could be returned via the outArgs output struct. Any pointers should be passed via inBufs/outBufs/inOutBufs as appropriate.
So, concretely, let's say VLIB has 2 fxns:
You might create an extended MYIUNIVERSAL_InArgs like this:
typedef struct MYIUNIVERSAL_InArgs { IUNIVERSAL_InArgs base; XDAS_Int32 functionIndex; XDAS_Int32 arg1; XDAS_Int32 arg2;} MYIUNIVERSAL_InArgs;
And outArgs like this:
typedef struct MYIUNIVERSAL_OutArgs { IUNIVERSAL_OutArgs base; XDAS_Int32 result;} MYIUNIVERSAL_InArgs;
My implementation of IUNIVERSAL_Fxns::process() might look something like this...
switch (inArgs->functionIndex) { case MYIUNIVERSAL_MULTIPLYTHIS: outArgs->result = VLIB_multiplyThis(inArgs->arg1, inArgs->arg2); break; case MYIUNIVERSAL_SCALETHIS: outArgs->result = VLIB_scaleThis(inArgs->arg1, inOutBufs->descs[0].buf); // don't forget, since VLIB_scaleThis wrote into inOutBufs with the CPU, you // have to indicate this in the buffer descriptor! (so cache maintenance is done right) XDM_SETACCESSMODEWRITE(inOutBufs->descs[0].accessMask); break; ...}
Build and integrate your alg as the article describes. The call it from your app like this:
MYIUNIVERSAL_InArgs inArgs;MYIUNIVERSAL_OutArgs outArgs;inArgs->size = sizeof(inArgs);outArgs->size = sizeof(outArgs);inArgs->functionIndex = MYIUNIVERSAL_MULTIPLYTHIS;inArgs->arg1 = 3;inArgs->arg2 = 2;result = UNIVERSAL_process(hMyAlg, NULL /* inBufs */, NULL /* outBufs */, NULL /* inOutBufs */, &inArgs, &outArgs);/* result should have the output of calling VLIB_multiplyThis(3, 2) */
Hope that helps frame the story a bit.
Thanks for the info.
I checked the requirements for IUNIVERSAL and it's not compatible to my existing configuation.
I am using Montavista 2.6.10 kernel, dvsdk_1_30_01_41 and mv_pro-4.0.1
My follow up question with you is, do you have another idea to recommend in order to solve my problem?
I set my configurations correctly and able to compile the iuniversal_example and produced .x64P. I checked the codes of codec fir and randgen and the two have a source for the algorithm (xxx_ti_ialg.c).
I copied the randgen and called it videolib and updates all the .xdc, .bld, .xs etc and able to produced a videolib.I64P. The implementation of IUNIVERSAL_process is in the xxx_ti_ialg.c where I should call the VLIB functions.
Now, let say the two function above, VLIB_multiplyThis() and VLIB_scaleThis() are stored in vlib.I64P library. How do I link the vlib.I64P to videolib?
john
I was able to include the vlib.l64P by appending the archives library. I can generate an codec engine now...
-john
ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". TI AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY TI. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM TI.
Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.