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???