Hi Stuart,

I'd suggest you first try the code on an x86 - much more benign 
platform.  When that works, port to the SM1000.  You want to avoid any 
actually debugging on target - for reasons you are experiencing.

I would suggest you do not create another instance of Codec 2 - suspect 
that would make you run out of memory.

Cheers,

David

On 30/01/16 21:04, Stuart Longland wrote:
> Hi all,
>
> I've spent an afternoon on a wild goose chase trying to figure out what
> causes the SM1000 to keel over when I try to decode some Codec2 audio
> that I have in a const static C array.
>
> This is being done in the main SM1000 firmware, so basically I create in
> addition to the FreeDV decoder running in FreeDV 1600 mode, I also have
> my own instance of the Codec2 decoder for menu prompts.
>
> This is wrapped up in a speech state machine.  Basically prompts to be
> spoken are broken out into "phrases" that are either silent pauses,
> sequences of digits or Codec2 rec.
>
> Right now I'm just focussing on playing a single recording.  My code is
> based on what I saw in c2dec.
>
> My first step currently is that I set the state machine up in Codec2
> 1300 mode.  (I had it at 1600 initially, then tried 3200, I note the
> FreeDV 1600 mode uses Codec2 1300, so I've now switched to that.)
>
> http://git.longlandclan.id.au/?p=for-upstream/freedv/codec2.git;a=blob;f=stm32/src/sm1000_main.c;h=4fd5573ff236cfa7a84eced74f14afe075a68914;hb=speech-debug#l296
>
> This is where I create the Codec2 decoder.
> http://git.longlandclan.id.au/?p=for-upstream/freedv/codec2.git;a=blob;f=stm32/src/speech.c;h=7d40d9028272e1132bbfad02ab00b56a981f7c1d;hb=speech-debug#l59
>
> The idea is that this state machine operates asynchronously, when
> there's "phrases" to be played back, you can call speech_next on the
> state machine to get the next sample.  Internally when it needs to
> decode a bit of audio, it fetches the next frame and feeds that to Codec2.
>
> http://git.longlandclan.id.au/?p=for-upstream/freedv/codec2.git;a=blob;f=stm32/src/speech.c;h=7d40d9028272e1132bbfad02ab00b56a981f7c1d;hb=speech-debug#l162
>
> Now it's here that things turn pear shaped.  In my current situation,
> speech_player->phrase_input_pos points to the first byte of a byte array
> containing a Codec2 audio sample.
>
> I'd expect that it would do its decoding, and plonk the samples in
> speech_player->samples_8k, which is a malloc'ed buffer for this purpose.
>
> As far as I know, it's big enough, I've tried doubling it and it hasn't
> made a difference.  Instead of getting audio placed here, the SM1000
> crashes.  I've traced the crash all the way to lpc_post_filter so far,
> and still I'm none the wiser.
>
> So I'm lost.  Is there something else that needs to be done with the
> Codec2 decoder before I try pumping it with data?
>
> Is there a limit to the number of instances that can be active (RAM
> permitting)?
>
> Regards,
>

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Freetel-codec2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freetel-codec2

Reply via email to