Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I am trying to record audio through the vocoder interface to the evrc codec using brew 2.1. I have the vocoder configured with standard settings from the API reference doc: watermark=20, txReduction = 0, min rate = EIGHTH_RATE, max rate = FULL_RATE, overwirte = true, vocoder type = VOC_IS127..

Creating and configuring the ivocoder instance seems to work fine.. my readyCB callback function gets called, at which point I call IVOCODER_VocInStart() which returns SUCCESS and I post an event to the app (to tell it that the recorder was started). The event gets caught and I do nothing but output a debug message saying so and exit the event handler.. as soon as the app's handler returns control back to brew a "memory access" error occurs.. several of these errors are displayed in a row and then the device resets.

Since I can't use IVOCODER in the simulator, I can't attached the MSVC debugger to it.. and since it seems to be crashing somewere outside of my app's code I am at a loss. I'm assuming that I'm either mis-configuring something or maybe not properly initializing something that I'm supposed to.. I'd appreciate any suggestions as to how to go about tracking this down.

(I've tried using ISOUND to setup and configure the sound path before config'ing the vocoder.. that didn't appear to change anything).

I know I need to supply my own buffers to IVOCODER_VocInRead() if I ever get that far, but do I also need to explicitly allocate the memory that its using for the watermark queue? If so.. how do I do that?

Okay.. well I identified two of my problems:
because the AppLogger tool has a rather clunky interface, I was logging debug data to a debug file on the phone. Trying to use IFILE_Write() in that manner and the vocoder at the sametime led to the 'memory access' crash. Turning that off revealed a more disturbing problem..
As I mentioned, I was posting events to the app from the haveData callback after a group of frames have been read from the vocoder. It seems that calling IVOCODER_VocInRead() followed by ISHELL_PostEvent() from inside the callback
causes the phone to reset before the event is delivered. This happens even when I disgard the frames returned from the read and just post an event with no data.
I don't see any mention of event processing problems while the vocoder is operating anywhere in the SDK docs.. Is this supposed to be a bad thing to try to do?
My next test will be to just post an event from the haveData callback and if that works, do the read from the app's event handler.

Okay.. well I identified two of my problems:
because the AppLogger tool has a rather clunky interface, I was logging debug data to a debug file on the phone. Trying to use IFILE_Write() in that manner and the vocoder at the sametime led to the 'memory access' crash. Turning that off revealed a more disturbing problem..
As I mentioned, I was posting events to the app from the haveData callback after a group of frames have been read from the vocoder. It seems that calling IVOCODER_VocInRead() followed by ISHELL_PostEvent() from inside the callback
causes the phone to reset before the event is delivered. This happens even when I disgard the frames returned from the read and just post an event with no data.
I don't see any mention of event processing problems while the vocoder is operating anywhere in the SDK docs.. Is this supposed to be a bad thing to try to do?
My next test will be to just post an event from the haveData callback and if that works, do the read from the app's event handler.

grrr... yea, it seems I just can't post any events at all from the context of the haveData callback. pooh.

grrr... yea, it seems I just can't post any events at all from the context of the haveData callback. pooh.

Hi tmiller,
I was not able to reproduce your problem. I was successful in posting (ISHELL_PostEvent(...,EVT_USER, SOME_TEST_EVENT,NULL) from the haveData callback. There was no problem in receiving the posted event either. Please check your code for bugs.
---tamoghna

Hi tmiller,
I was not able to reproduce your problem. I was successful in posting (ISHELL_PostEvent(...,EVT_USER, SOME_TEST_EVENT,NULL) from the haveData callback. There was no problem in receiving the posted event either. Please check your code for bugs.
---tamoghna

Were you using a BREW 2.0 phone when you tried to reproduce it?
I know this thread is in the 2.1 forum but as is the case with another vocoder thread that I started, I believed at the time that I was working with phones running BREW 2.1, but I later rechecked the data sheets for the Kyocera 3250 and Soutec 9898 and as it turns out that both phones are 2.0..

Were you using a BREW 2.0 phone when you tried to reproduce it?
I know this thread is in the 2.1 forum but as is the case with another vocoder thread that I started, I believed at the time that I was working with phones running BREW 2.1, but I later rechecked the data sheets for the Kyocera 3250 and Soutec 9898 and as it turns out that both phones are 2.0..

Yes. I tested this on a BREW2.1 handset.

Yes. I tested this on a BREW2.1 handset.

I just retested on both of my BREW 2.0 handsets and it's still and issue... I will let you know if I ever get a hold of a BREW 2.1 phone to test it with.
Thanks for trying to help!

I just retested on both of my BREW 2.0 handsets and it's still and issue... I will let you know if I ever get a hold of a BREW 2.1 phone to test it with.
Thanks for trying to help!