6/01/2012

How to capture PCM data with LPA mode on Android build?

QCT provide LPA feature on Android build.



but PCM flow of LPA mode is different from normal playback.



Normal playback : decoded PCM data -> Stagefright/Opencore -> Audioflinger -> Audio HAL -> PCM out driver -> DSP -> ADIE

LPA playback : decoded PCM data -> Opencore with custom MIO -> PMEM (LPA PCM out driver) -> DSP -> ADIE



As a PCM path, PCM data is not sent to Audioflinger and used custom MIO for LPA mode



You we need to capture the PCM in custom MIO(Android_audio_lpadecode.cpp) as below.



void AndroidAudioLPADecode::writeAudioLPABuffer(uint8* aData, uint32 aDataLen, PVMFCommandId cmdId, OsclAny* aContext, PVMFTimestamp aTimestamp, int32 pmem_fd)
{
int fd;
// queue up buffer and signal audio thread to process it
fd = ::open("/data/lpa_dump.pcm",O_WRONLY | O_APPEND ); // we need to make file in /data/lpa_dump.pcm
if( fd<0)
{
LOGE("NO lpa_dump.pcm file");
}
else
{
::write(fd,aData,aDataLen);
::close(fd);
}



PCM data will be sent to AndroidAudioLPADecode::writeAudioLPABuffer() in Android_audio_lpadecode.cpp

No comments:

Post a Comment