This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Codec Engine Opening and Closing.

I have created a Codec Engine DSP server in Linux that contains several algorithms that need to be called from an application that never ends.  I have a couple of questions.

1.  Should I open and close the handle to the engine for each Algorithm or should I open the Codec Engine and never close it?

 

Currently my application is built in Linux with no DSP algorithms.

1.  Should I add the algorithm create, process, and control functions to my existing Linux application and then build it with the necessary DSP tools?

2.  Or should each algorithm be a separate application that my current application calls?

Thanks.

 

 

  • You have several options as we support lots of different use cases, so I'll just try to provide general guidance.  You can put your system together lots of ways - some harder than others.

    dmarsh10 said:
    1.  Should I open and close the handle to the engine for each Algorithm or should I open the Codec Engine and never close it?

    Up to you and how you want to structure your app.

    If each alg is managed by different Linux threads, we typically recommend an Engine_open() call for each thread.  Each individual Engine Handle isn't thread-protected, so you can't have multiple threads using the same Engine Handle in concurrent calls.  As a result, we typically suggest each thread call Engine_open() to get their own thread-specific Engine handle, and use that Engine handle to create() algs that thread manages.

    If all algs are managed by one Linux thread, you just need one Engine handle, and therefore one call to Engine_open().  This same Engine handle can be provided to each of your alg's create() fxns.

    dmarsh10 said:
    1.  Should I add the algorithm create, process, and control functions to my existing Linux application and then build it with the necessary DSP tools?

    Given your already built Server, you should use Engine.createFromServer() in your app's cfg script.

    dmarsh10 said:
    2.  Or should each algorithm be a separate application that my current application calls?

    While you could do that, it's probably not worth the effort.  For multi-process access to the Server, you'd have to leverage LAD.  If you can put all your alg usage in the same process (perhaps leveraging multiple threads), that's an easier system to put together.

    Chris