×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Question MdaAudioInputStream

    Hello everyone,

    I have a simple audio recording application using MdaAudioInputStream that works as it should on emulator. When I try to run it on my phone the MaoscBufferCopied is never called. Any ideas what the problem could be? I'm using Nokia E75 to test the application.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: MdaAudioInputStream

    Check the logfile of the emulator http://wiki.forum.nokia.com/index.php/Epocwind.out, there may be some related warning messages.

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Question Re: MdaAudioInputStream

    Quote Originally Posted by wizard_hu_ View Post
    Check the logfile of the emulator http://wiki.forum.nokia.com/index.php/Epocwind.out, there may be some related warning messages.
    Thanks,

    I checked the Epocwind.out file but I didn't notice any warnings about platform security I did notice one error. Any other way I could pinpoint the reason for MaoscBufferCopied not being called?

    When I quit application I get this error (look at 90.050):
    Code:
        89.600	44720310:CMMFDevSoundAdaptation::CBody::RecordData()>ENTR
        89.600	44720310:CMMFDevSoundAdaptation::CBody::RecordData()>EXIT
        89.850	44720310:CMMFDevSoundAdaptation::CBody::EmptyThisHwBuffer(CMMFBuffer &)>ENTR
        89.850	CMMFDevSoundSession[0x44720238]::BufferToBeEmptied - Exit [0]
        89.850	44720310:CMMFDevSoundAdaptation::CBody::EmptyThisHwBuffer(CMMFBuffer &)>EXIT
        90.045	44720310:CMMFDevSoundAdaptation::CBody::Stopped()>ENTR
        90.045	44720310:CMMFDevSoundAdaptation::CBody::UpdateBytesPlayed()>ENTR
        90.045	44720310:CMMFDevSoundAdaptation::CBody::UpdateBytesPlayed()>EXIT
        90.050	44720310:CMMFDevSoundAdaptation::CBody::UpdatePolicyState()>ENTR
        90.050	44720310:CMMFDevSoundAdaptation::CBody::UpdatePolicyState()>EXIT
        90.050	44720310:CMMFDevSoundAdaptation::CBody::Stopped()>EXIT
        90.050	44720310:CMMFDevSoundAdaptation::CBody::Error(int)>ENTR
        90.050	44720310:CMMFDevSoundAdaptation::CBody::Error(int)>EXIT
       102.220	26020310:CMMFDevSoundAdaptation::CBody::SetPrioritySettings(const TMMFPrioritySettings &)>ENTR
       102.220	26020310:CMMFDevSoundAdaptation::CBody::SetPrioritySettings(const TMMFPrioritySettings &)>EXIT
       102.220	26020310:CMMFDevSoundAdaptation::CBody::MaxVolume()>ENTR
       102.220	26020310:CMMFDevSoundAdaptation::CBody::MaxVolume()>ENTR
       102.220	26020310:CMMFDevSoundAdaptation::CBody::SetDeviceVolume(int)>ENTR
       102.220	26020310:CMMFDevSoundAdaptation::CBody::SetDeviceVolume(int)>EXIT
       102.225	26020310:CMMFDevSoundAdaptation::CBody::PlayToneSequenceL(const TDesC8 &)>ENTR
       102.250	3e480310:CMMFDevSoundAdaptation::CBody::~CBody()>ENTR
       102.250	3e480310:CMMFDevSoundAdaptation::CBody::~CBody()>EXIT
       102.250	44720310:CMMFDevSoundAdaptation::CBody::~CBody()>ENTR

    This is what's going on when I start recording on emulator:

    Code:
        64.015	26020310:CMMFDevSoundAdaptation::CBody::SetPrioritySettings(const TMMFPrioritySettings &)>ENTR
        64.015	26020310:CMMFDevSoundAdaptation::CBody::SetPrioritySettings(const TMMFPrioritySettings &)>EXIT
        64.015	26020310:CMMFDevSoundAdaptation::CBody::MaxVolume()>ENTR
        64.015	26020310:CMMFDevSoundAdaptation::CBody::MaxVolume()>ENTR
        64.020	26020310:CMMFDevSoundAdaptation::CBody::SetDeviceVolume(int)>ENTR
        64.020	26020310:CMMFDevSoundAdaptation::CBody::SetDeviceVolume(int)>EXIT
        64.020	26020310:CMMFDevSoundAdaptation::CBody::PlayToneSequenceL(const TDesC8 &)>ENTR
        64.030	44720310:CMMFDevSoundAdaptation::CBody::SetClientConfig(const TMMFClientConfig &)>ENTR
        64.030	44720310:CMMFDevSoundAdaptation::CBody::InitializeL(MDevSoundAdaptationObserver &, TFourCC, TMMFState)>ENTR
        64.045	44720310:CMMFDevSoundAdaptation::CBody::InitializeL(MDevSoundAdaptationObserver &, TUid, TMMFState)>ENTR
        64.045	44720310:CMMFDevSoundAdaptation::CBody::InitializeFormat(TPckgBuf<RMdaDevSound::TSoundFormatsSupported> &, TPckgBuf<RMdaDevSound::TCurrentSoundFormat> &)>ENTR
        64.045	44720310:CMMFDevSoundAdaptation::CBody::InitializeFormat(TPckgBuf<RMdaDevSound::TSoundFormatsSupported> &, TPckgBuf<RMdaDevSound::TCurrentSoundFormat> &)>EXIT
        64.050	44720310:CMMFDevSoundAdaptation::CBody::InitializeHwDevice()>ENTR
        64.055	44720310:CMMFDevSoundAdaptation::CBody::InitializeHwDevice()>EXIT
        64.055	44720310:CMMFDevSoundAdaptation::CBody::InitializeL(MDevSoundAdaptationObserver &, TUid, TMMFState)>EXIT
        64.055	44720310:CMMFDevSoundAdaptation::CBody::InitializeL(MDevSoundAdaptationObserver &, TFourCC, TMMFState)>EXIT
        64.055	44720310:CMMFDevSoundAdaptation::CBody::Config() const>ENTR
        64.055	44720310:CMMFDevSoundAdaptation::CBody::SetConfigL(const TMMFCapabilities &)>ENTR
        64.055	44720310:CMMFDevSoundAdaptation::CBody::SetConfigL(const TMMFCapabilities &)>EXIT
        64.075	44720310:CMMFDevSoundAdaptation::CBody::Config() const>ENTR
        64.075	44720310:CMMFDevSoundAdaptation::CBody::SetConfigL(const TMMFCapabilities &)>ENTR
        64.075	44720310:CMMFDevSoundAdaptation::CBody::SetConfigL(const TMMFCapabilities &)>EXIT
        64.075	44720310:CMMFDevSoundAdaptation::CBody::MaxGain()>ENTR
        64.080	44720310:CMMFDevSoundAdaptation::CBody::SetGain(int)>ENTR
        64.080	44720310:CMMFDevSoundAdaptation::CBody::SetDeviceRecordLevel(int)>ENTR
        64.080	44720310:CMMFDevSoundAdaptation::CBody::SetDeviceRecordLevel(int)>EXIT
        64.080	44720310:CMMFDevSoundAdaptation::CBody::SetGain(int)>EXIT
        64.080	44720310:CMMFDevSoundAdaptation::CBody::SetPrioritySettings(const TMMFPrioritySettings &)>ENTR
        64.080	44720310:CMMFDevSoundAdaptation::CBody::SetPrioritySettings(const TMMFPrioritySettings &)>EXIT
        64.080	44720310:CMMFDevSoundAdaptation::CBody::RecordInitL()>ENTR
        64.085	44720310:CMMFDevSoundAdaptation::CBody::RequestPolicy()>ENTR
        64.100	44720310:CMMFDevSoundAdaptation::CBody::RequestPolicy()>EXIT
        64.100	44720310:CMMFDevSoundAdaptation::CBody::RecordInitL()>EXIT
        64.105	44720310:CMMFDevSoundAdaptation::CBody::StartRecordDataL()>ENTR
        64.110	44720310:CMMFDevSoundAdaptation::CBody::SetRecordFormat(TPckgBuf<RMdaDevSound::TCurrentSoundFormat> &)>ENTR
        64.110	44720310:CMMFDevSoundAdaptation::CBody::SetRecordFormat(TPckgBuf<RMdaDevSound::TCurrentSoundFormat> &)>EXIT
        64.110	44720310:CMMFDevSoundAdaptation::CBody::SetDeviceRecordLevel(int)>ENTR
        64.115	44720310:CMMFDevSoundAdaptation::CBody::SetDeviceRecordLevel(int)>EXIT
        64.440	44720310:CMMFDevSoundAdaptation::CBody::StartRecordDataL()>EXIT
        64.740	44720310:CMMFDevSoundAdaptation::CBody::EmptyThisHwBuffer(CMMFBuffer &)>ENTR
        64.740	CMMFDevSoundSession[0x44720238]::CreateChunk [0]
        64.740	CMMFDevSoundSession[0x44720238]::BufferToBeEmptied - Exit [0]
        64.740	44720310:CMMFDevSoundAdaptation::CBody::EmptyThisHwBuffer(CMMFBuffer &)>EXIT
        64.740	44720310:CMMFDevSoundAdaptation::CBody::RecordData()>ENTR
        64.740	44720310:CMMFDevSoundAdaptation::CBody::RecordData()>EXIT
        64.990	44720310:CMMFDevSoundAdaptation::CBody::EmptyThisHwBuffer(CMMFBuffer &)>ENTR

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: MdaAudioInputStream

    Ok, the point was about checking capabilities, apparently you have UserEnvironment, so that part is fine.
    Note that there is an audio streaming example, you could check if it works. Tools, Docs & Code above, Documentation, Symbian C++, Multimedia (you need the one which says it uses CMdaAudioInputStream too).

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Question Re: MdaAudioInputStream

    Quote Originally Posted by wizard_hu_ View Post
    Ok, the point was about checking capabilities, apparently you have UserEnvironment, so that part is fine.
    Note that there is an audio streaming example, you could check if it works. Tools, Docs & Code above, Documentation, Symbian C++, Multimedia (you need the one which says it uses CMdaAudioInputStream too).
    I know. Problem is, when I import the example in Carbide via bld.inf file I can't build it. The file icons_aif_scalable_dc.mk is missing. So I copied the methods. Do I have to use active classes and create a separate thread for playback, recording and gui? Right now I just call record from gui in handle command like this:

    Code:
    iAudioPlayer->RecordL(iCoeEnv->FsSession(), KRecordedStream);

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: MdaAudioInputStream

    No, CMdaAudioXy API-s have their own active objects internally, and they do not need any threading magic.
    It sounds strange if the example does not build, but you can remove icon-stuff after all (comment the offending line in bld.inf, remove localisable resource magic from _reg.rss - only app_name should remain -, and comment the related resource in the .rss. If the .mbg is included there, comment that line too).

  7. #7
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Re: MdaAudioInputStream

    Quote Originally Posted by wizard_hu_ View Post
    No, CMdaAudioXy API-s have their own active objects internally, and they do not need any threading magic.
    It sounds strange if the example does not build, but you can remove icon-stuff after all (comment the offending line in bld.inf, remove localisable resource magic from _reg.rss - only app_name should remain -, and comment the related resource in the .rss. If the .mbg is included there, comment that line too).
    Thanks, that helped compile the example and in it recording works as it should, which gives me plenty of time to slowly figure out why my program wasn't working as it should.

  8. #8
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Question Re: MdaAudioInputStream

    I have another question.

    I now have a working version of MMdaAudioInputStream and MMdaAudioOutputStream. They both work separately. What I need, is for them to work simultaniously. Is that possible? If I create one instance of AudioSreamEngine class:

    Code:
    class CAudioStreamEngine : public CBase, MMdaAudioInputStreamCallback, MMdaAudioOutputStreamCallback
    I get an error when I try to call record and play at the same time in AppUI:

    case EAudioStreamCmdRecord&Play:
    {
    iEngine->Record();
    iEngine->Play();
    break;
    }

    According to comments the error occures when Play is called because stream is in use. What's the easiest way to simultaniously call MDAAudioInput and MDAAudioOutput streams? Are they sharing some buffers which prevent them from being called at the same time? I also tried creating two instances of the same class in AppUI:

    Code:
    iEngine = CAudioStreamEngine::NewL( this ); 
    iEngine2 = CAudioStreamEngine::NewL( this );
    But that just threw out Audio Stream: memory full error as soon as the constructor for iEngine2 was called.

    Could anyone point me in the right direction for using Input and Output streams at the same time so I can record audio from the microphone at the same time as I play another audio stream from the speaker?

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: MdaAudioInputStream

    Yes, they can be used simultaneously. However you can not open them at the same time (that results in KErrServerBusy). If you open the 2nd one from OpenComplete of the other, that will work.

  10. #10
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Question Re: MdaAudioInputStream

    Quote Originally Posted by wizard_hu_ View Post
    Yes, they can be used simultaneously. However you can not open them at the same time (that results in KErrServerBusy). If you open the 2nd one from OpenComplete of the other, that will work.
    I tried to do what you suggested. I called Record in AppUI then at the end of MaiscOpenComplete I called iOutputStream->Open(&iStreamSettings);. The idea being that if I start recording before playing I should capture every frame of the playback.

    Now, MaoscOpenComplete goes through without error, even iOutputStream->WriteL(iCPtr); is completed without traping any error. But when I get to MaoscBufferCopied I get the error -14 which, if I'm not mistaken is KErrInUse: A requested resource is already in exclusive use.

    Do you have any idea what could be causing this? I have a separate buffer for playback and record, both playback and record work standalone. Any ideas on what else could I try?

  11. #11
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Smile Re: MdaAudioInputStream

    Well... finally made this work. So if anyone is interested, here's how I did it.

    I created two HBufC8 buffers, one for input stream, one for output stream. At first I had a HBufC8 buffer for input stream while output stream was a TFixedArray which pas passed to get frame by casting it to TPtr8 descriptor.

    After I had two identical HBufC8 buffers I could get simultanious recording and playback but only if I started playback and then opened InputStream in MaoscOpenComplete. For some reason I couldn't get it to work vice versa, by starting recording and then opening OutputStream in MaiscOpenComplete.

    No idea why, but to be honest I'm just glad it works.

Similar Threads

  1. MdaAudioInputStream on Borland C++ Builder
    By will_so in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2003-09-29, 09:42
  2. urgent help needed:::Usind MdaAudioInputStream......?
    By techno2003 in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-09-18, 05:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •