AER version: 16.0.0.1
Platfrom: c5517
I have a system with two microphones and have followed the template of the example/simulation to create two instances of the AER, initialize/open the mss module and modify the aer processing as shown in the example.
In the course of my debugging/tuning, I would like to force the mss to pick one mic channel over the other at initialization time. Again based on the examples/documentation I am doing the following, where gActiveMic is set to 1.
tint aaer_mmic_init(void)
{
mssControl_t mss_ctl_cfg;
tint stat;
if (gActiveMic>=AER_HF_NUM_MIC)
{
stat =mss_ERR_INVALIDPAR;
return stat;
}
/* Set the passed hands-free mic instance as the active instance for AER */
stat = aerActivate (gAppAerInst[gActiveMic], NULL);
/* Set the hands-free mic as the selected source for MSS */
mss_ctl_cfg.valid_bitfield = mss_CTL_SELECT_SRC;
mss_ctl_cfg.source.group = mss_SRC_MIC_FIXED;
mss_ctl_cfg.source.index = gActiveMic;
stat = mssControl (gAppMssInst, &mss_ctl_cfg);
if (1==doFreeze)
{
// DEBUG: freeze selection, should keep mic at the one selected above.
mss_ctl_cfg.valid_bitfield = mss_CTL_MODES;
mss_ctl_cfg.modes.mask = mss_CTL_MODES_FREEZE;
mss_ctl_cfg.modes.value = mss_CTL_MODES_FREEZE;
}
return stat;
} /* aaer_mmic_init */
The end result of the above code is that the first time through my main audio thread the call to mms control function, which evaluates the current mic and compares it to the active mic reports that the current mic is 0 and immediately switches to mic 0.
// Checks for change in active mic and activates the aer for the newly selected mic.
// returns the active mic.
tint aaer_mmic_control(tint* p_the_current_active_mic)
{
tint stat;
/* Get selected mic information from MSS */
mssDebugStat(gAppMssInst, &mss_dbg);
/* Check if a different mic has just been selected */
if(mss_dbg.cur_src.index != *p_the_current_active_mic)
{
/* Activate the AER instance for the newly selected mic */
stat = aerActivate(gAppAerInst[mss_dbg.cur_src.index],gAppAerInst[*p_the_current_active_mic]);
*p_the_current_active_mic =mss_dbg.cur_src.index;
}
return stat;
} /* aaer_mmic_control */
In looking at mms debug information in aaer_mmic_init( ), before and after the call to the mms_control( ) function it shows
mms_dbg.cur_src.group = 0;
mss_dbg.cur_src.index = 0;
mms_dbg.new_src.group = 29504
mms_dbg.new_src.index = -7534
It shows these same values on the first call to aaer_mmic_control( ) function
What is the proper way to manually select a microphone with the mss?
Why after this call to mmsControl
/* Set the hands-free mic as the selected source for MSS */
mss_ctl_cfg.valid_bitfield = mss_CTL_SELECT_SRC;
mss_ctl_cfg.source.group = mss_SRC_MIC_FIXED;
mss_ctl_cfg.source.index = 1;
stat = mssControl (gAppMssInst, &mss_ctl_cfg);
does the mss_dbg info show that the current mic is 0?
-Shawn