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.

  • Resolved

TM4C129XNCZAD: OPUS codec abort codification

Prodigy 150 points

Replies: 23

Views: 1960

Part Number: TM4C129XNCZAD

I'm running spma 076 example from Texas (codec OPUS) on TM4C129XNCZAD, when I'm encoding a wav file the process is aborted after the memory allocation.
Knowing that the encoder codes frame by frame, I noticed that after some frames coded the process is aborted. For that reason I think that the memory allocation is running without problems and the memory De-Allocation is not working properly. I think that because after some frames of encoding the system cannot allocate more memory for encoding the next frames.

Can someone help me solving this problem or identifying the reason of it.

Please see the link with the example that I use: www.ti.com/.../spma076.pdf

  • In reply to Joao Louro:

    Hello Joao,

    My colleague and I have finally been able to devote proper time to working on this issue in attempt to uncover how to solve the problem. The core of the issue is definitely that the heap is running out of space, which is why your increase of the heap allowed the result to process further.

    The problem has shown up because you are processing the data in an atypical way for Opus. The whole idea behind Opus is so try and do the encoding in real time, and the processor running the Opus library should be reading out chunks of data, encoding it, and then sending the result back. This is the principle of how the example provided by TI works with the SD Card.

    What you are doing with storing the whole data in the MCU memory and processing from that is not how the Opus library or the TI example was intended to be used.

    Because of that, for us the root cause of why the heap is running out of space is unclear, but one potential theory could be that there is a memory leak due to the Opus source code which surfaces only when trying to do an application like what you are attempting. That would be a question you could direct towards the Opus Codec group (Xith), and see if they are aware of any possible memory leaks with the source code provided by them.

    Our stress tests for Opus including encoding 3 minute long files via Ethernet with the MCU handling both the Ethernet Stack and the Opus encoding has shown no issues with memory when the heap and stack are configured per the app note.

    Unfortunately, from our end at TI, there isn't much else we can offer regarding this issue because
    1) It deviates heavily from the intention of Opus encoding and why we chose to make the Opus example+App Note
    2) The issue seems to be due to the Opus source code, as we have not seen any issues with the heap for any of the stress tests done that is applicable to the Opus example we offered.

    Best Regards,

    Ralph Jacobi

  • In reply to Ralph Jacobi:

    Hello Raph

    Thank you for your help.

    Can you please send me the project solution for the "3 minute long files via Ethernet with the MCU handling both the Ethernet Stack and the Opus encoding". I want to test this implementation and make further remarks afterwards.

    Thanks,
    João
  • In reply to Joao Louro:

    Hello Joao,

    Certainly, you can find all the details in this TI Design including software: www.ti.com/.../TIDM-TM4C129POEAUDIO

    Best Regards,

    Ralph Jacobi

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.