×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2005
    Location
    Spain
    Posts
    8

    Full Duplex Audio fail with KErrDied Error

    Hi all!

    I have seen and tested the Full Duplex Example provided by Nokia, and now I'm trying to add full duplex audio to my application.

    I have two different classes, CAudioPlayer and CAudioRecorder with a CMMFDevSound member object each one.

    I can initialize both without problems. The callback function InitializeComplete() is called with KErrNone error.

    But now, if I start the player ( with PlayInitL() ), and then the recorder ( RecordInitL() ), the player works correctly ( the callback BufferToBeFilled() is called ), but in the recorder object I get a RecordError(KErrDied) error instead the BufferToBeEmptied() expected.

    If I switch the order of the calls, the result is similar. Always fails the last one.

    I have tried changing the priorities, but no success.

    Any idea?
    Should I put play and record in different threads??

    I forget to say I'm working with S60 2nd Edition (Nokia N70).
    In S60 3rd Edition (Nokia N80) I have the same classes CAudioPlayer and CAudioRecorder working properly.

    Thank you all.

  2. #2
    Registered User
    Join Date
    Dec 2005
    Location
    Spain
    Posts
    8

    Re: Full Duplex Audio fail with KErrDied Error

    I have the solution, but I don't understand exactly why it works.

    This is the code to set the CMMFDevSound priorities:
    Code:
    // Settings
    iPrioritySettings.iPriority = 99;
    iPrioritySettings.iPref = EMdaPriorityPreferenceTime;
    iPrioritySettings.iState = EMMFStateRecording;
    iMMFDevSound->SetPrioritySettings( iPrioritySettings );

    The key of my problem is the iPref value.

    I noticed that the FullDuplexEx uses the values KAudioPrefOutput for the player and KAudioPrefInput for the recorder.
    This values are defined in the example:
    Code:
    #define KAudioPrefOutput            0x01350001
    #define KAudioPrefInput             0x01360001
    This values are quite weird, but they make my app work.

    I have tried my app with different values for iPref, and I concluded that the app crashes (with KErrDied error) when the value is the same for the player and the recorder.

    According with the doc of the CMMFDevSound, the values for the iPref setting defined in mmf\common\mmfbase.h are:
    Code:
    enum TMdaPriorityPreference
    {
        EMdaPriorityPreferenceNone = 0x00000000,
        EMdaPriorityPreferenceTime = 0x00000001,
        EMdaPriorityPreferenceQuality = 0x00000002,
        EMdaPriorityPreferenceTimeAndQuality = EMdaPriorityPreferenceTime|EMdaPriorityPreferenceQuality
    };
    I suppose that only the 2 less significant bits define the priority, and in the example the more significant bytes are changed to make it different in the player and the recorder. But i can't imagine why.

    Any idea???

Similar Threads

  1. error LNK2019: unresolved external symbol ???
    By wgarnett in forum Symbian
    Replies: 3
    Last Post: 2009-09-28, 06:53
  2. Replies: 0
    Last Post: 2007-01-28, 13:47
  3. Replies: 0
    Last Post: 2002-09-24, 13:11

Posting Permissions

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