Hi,
We are working with the AM/DM37X Evaluation module from Mistral and Android ICS 4.0.3. We have a problem with audio capture. If we run the Sound Recorder application that comes with android, the first two seconds are not recorded. Also, if we run other similar sound capturing applications, like Sound Meter, the first seconds are not recorder.
After checking Android's LogCat, we noticed that during the first seconds it was constantly printing the following error:
E/audio_hw_primary(1158): cannot open pcm_in driver: cannot set hw params: Invalid argument
After a period of time, it would stop printing the error and start recording. We also noticed, that it stopped the error just after the Mixer thread released a lock and went to sleep:
I/AudioFlinger(1158): Audio hardware entering standby, mixer 0x15378, mSuspended 0
I/AudioFlinger(1158): releaseWakeLock_l() AudioOut_1
I/AudioFlinger(1158): MixerThread 0x15378 TID 1234 going to sleep
I/audio_hw_primary(1158): in_read(0x20020, 0x1bf68, 4096)
I/audio_hw_primary(1158): start_input_stream(0x20020)
I/audio_hw_primary(1158): start_input_stream: opened pcm device:
We thought that maybe the mixer was locking some resource needed by the recorder. We disable all the touch sounds in the system setting, so that there was no mixer trying to mix sounds in the system. After this change the Sound Recorder application worked just fine from the very beginning, and if we activated the touch sounds again it had the same problem. We also tried a VOIP program, but the problem was worse, if it was able to play the sounds during a call then it didn't capture due to the same problem, and viceversa.
The system is also printing this error form once in a while.
E/audio_hw_primary(1158): Route MIXER CTRL name: HeadsetR Mixer AudioR2
E/audio_hw_primary(1158): Route MIXER CTRL name: HeadsetL Mixer AudioL2
E/audio_hw_primary(1158): Route MIXER CTRL name: Headset Playback Volume
E/audio_hw_primary(1158): Route MIXER CTRL name: Analog Left AUXL Capture Switch
Attached are the LogCat result for both situations, with the touch sounds enabled and disabled.
6761.SoundRecorderGood_Touch_Sounds_Disabled.txt
6523.SounRecorder_Touch_Sounds_Enabled.txt