AnsweredAssumed Answered

Accessing VisualDSP library from uClinux application

Question asked by skstrobel on Mar 6, 2012
Latest reply on Mar 8, 2012 by skstrobel

I suppose the subject line above is enough to get me flamed, but here it goes anyway


My employer is considering licensing a 3rd party audio processing routine that is not available in source-code form;  it is typically provided as a library. The library is currently available for (and highly optimized for) the VisualDSP toolchain.  Our application is compiled with bfin-linux-uclibc-g++ and makes use of lots of things not available in the VisualDSP (such as the Qt libraries).  So I want to know what my options are for getting them to work together. 


Getting the vendor to port the C library to the uClinux compiler and provide us with the resulting library is probably the most straightforward option (there is documentation for doing so [1]), but it would be rather expensive to get them to do so.


Directly linking against their object file is probably impossible for a variety of reasons including the linker file formats being incompatible and the ABI differences [2] [3].


If their code was somehow loaded into memory, maybe as a binary blob with known address offsets for the function entry points, I suppose it might be possible to make wrapper functions that would use inline assembly to arrange the arguments on the stack to match the VisualDSP ABI and call them (I think the library API is pretty simple, with functions that accept pointers to input and output buffers and to a structure with control and state variables).  Even then, any system calls their library might make would be a problem.  I don't think it does any memory allocation, so maybe those things could be linked in before generating the blob.


If the assembly code generated by the VisualDSP compiler (or disassembled from a library file) was ported to the GNU assembler, it might have the same problems as the binary blob option, but could be edited to fix those problems.


Any suggestions or recommendations would be appreciated, even if it is just to say that the only good option is to get the vendor to port the C code   Thanks.




[1] - Porting VDSP++ Algorithms to Linux:[]=vdsp


[2] - "None of this information will help you link VDSP++ object files with gcc object files, or allow you to run VDSP++ objects in a Linux environment." -[]=vdsp


[3] - "The GCC compiler is not run or link time compatible with any other compiler for the Blackfin processor. This includes, but is not limited to, VDSP++." -[]=abi


[4] - Porting VisualDSP assembly code to the GNU assembler:[]=vdsp