I am having trouble using the Clear() function on my audio record queues.
After I stop the recorder that is using the android simple buffer queues
I perform a clear operation. Calling clear does not seem to make an impact
on the state of the queue.
Code is below with the output it produces.
I am using OPENSL ES 1.0.1. Running Android 4.3 on my device.
I am using this compiler arm-linux-androideabi-gcc (GCC) 4.6 20120106 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.

Others have reoorted problems with is on the web. Is this a known bug? Is there
a workaround for it? Any help would be appreciated.

Other than the queues dribbling away after a while, my applications is working relatively well.

Thanks
Chuck

// In case already recording, stop recording and clear buffer queue
result = (*recorderRecord)->SetRecordState(recorderRecord, SL_RECORDSTATE_STOPPED);
if (SL_RESULT_SUCCESS != result) {
printf("SetRecordState failed at begin of OpenSL_startRecording()() result=%d\n", result);
return;
}
else {
printf("SetRecordState succeeded at begin of OpenSL_startRecording()() result=%d\n", result);
}

SLBufferQueueState recorder_buffer_queue_state;
result = (*recorderBufferQueue)->GetState(recorderBufferQueue, &recorder_buffer_queue_state);
if (SL_RESULT_SUCCESS != result) {
printf("GetState failed at begin of OpenSL_startRecording()() result=%d\n", result);
return;
}
else {
printf("BEFORE recorder_buffer_queue_state.count = %u\n", recorder_buffer_queue_state.count);
printf("BEFORE recorder_buffer_queue_state.playIndex = %u\n", recorder_buffer_queue_state.playIndex);
}

result = (*recorderBufferQueue)->Clear(recorderBufferQueue);
if (SL_RESULT_SUCCESS != result) {
printf("Clear failed at begin of OpenSL_startRecording()() result=%d\n", result);
return;
}
else {
printf("Clear succeeded at begin of OpenSL_startRecording()() result=%d\n", result);
}

result = (*recorderBufferQueue)->GetState(recorderBufferQueue, &recorder_buffer_queue_state);
if (SL_RESULT_SUCCESS != result) {
printf("GetState failed at begin of OpenSL_startRecording()() result=%d\n", result);
return;
}
else {
printf("AFTER recorder_buffer_queue_state.count = %u\n", recorder_buffer_queue_state.count);
printf("AFTER recorder_buffer_queue_state.playIndex = %u\n", recorder_buffer_queue_state.playIndex);
}

OUTPUT FROM ABOVE CODE
************************
SetRecordState succeeded at begin of OpenSL_startRecording()() result=0
BEFORE recorder_buffer_queue_state.count = 1
BEFORE recorder_buffer_queue_state.playIndex = 167
Clear succeeded at begin of OpenSL_startRecording()() result=0
AFTER recorder_buffer_queue_state.count = 1
AFTER recorder_buffer_queue_state.playIndex = 167