微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > mt6735 MT6592平台播放音乐时开启Visualizer音效,声音断续有杂音

mt6735 MT6592平台播放音乐时开启Visualizer音效,声音断续有杂音

时间:10-02 整理:3721RD 点击:
[Audio Hal]MT6592平台播放音乐时开启Visualizer音效,声音断续有杂音
[DESCRIPTION]
MT6592平台在mtk_HD_AUDIO_ARCHITECTURE为yes的情况下,播放音乐时开启Visualizer音效,声音断续有杂音。如果关
闭Visualizer音效,则没有问题。
[SOLUTION]
请修改/php?mod=tag&id=6090" target="_blank" class="relatedlink">Frameworks/av/media/libeffects/visualizer/EffectVisualizer.cpp如下:
1)添加以下函数:
static inline int32_t clamp32(int64_t sample)
{
// check overflow for both positive and negative values:
// all bits above short range must me equal to sign bit
if ((sample>>31) ^ (sample>>63))
sample = 0x7FFFFFFF ^ (sample>>63);
return sample;
}

2)修改以下函数:
int Visualizer_process(
......
if (inBuffer->raw != outBuffer->raw) {
if (pContext->mConfig.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE) {
for (size_t i = 0; i < outBuffer->frameCount*2; i++) {
#ifdef MTK_HD_AUDIO_ARCHITECTURE
outBuffer->s32 = clamp32(outBuffer->s32 + inBuffer->s32);
#else
outBuffer->s16 = clamp16(outBuffer->s16 + inBuffer->s16);
#endif
}
} else {
meMCPy(outBuffer->raw, inBuffer->raw, outBuffer->frameCount * 2 * sizeof(int16_t));
}
}
if (pContext->mState != VISUALIZER_STATE_ACTIVE) {
return -ENODATA;
}
return 0;
} // end Visualizer_process
如果修改之后OK问题,请申请patch:ALPS01268291

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top