|
发表于 2021-11-8 09:57:54
4401 浏览 0 回复
MT6762 设置了手机铃声并连了蓝牙耳机,接听来电,.....
[FAQ26373] 设置了手机铃声并连了蓝牙耳机,接听来电,声音从蓝牙耳机出来慢如何处理
[DESCRIPTION]
前提: 连接了蓝牙耳机,手机设置有来电铃声。
现象: 接听电话,声音先从听筒发出1-2秒,然后蓝牙耳机才听到声音。
原因: AudioPolicyManager::setPhoneState函数执行时间较长,可长达1.4秒。
BT module报告latency为210ms,setPhoneState函数参考latency值做了延时。
[SOLUTION]
AudioPolicyManager.cpp, 如下高亮两处修改可缩短AudioPolicyManager::setPhoneState函数的执行时间。
- 1.AudioPolicyManager.cpp如下修改,减少420ms
- 578 uint32_t AudioPolicyManager::updateCallRouting(const DeviceVector &rxDevices, uint32_t delayMs)
- 579 {
- 699 #if defined(MTK_AUDIO_FIX_DEFAULT_DEFECT)
- 700 delayMs = createRxPatch == 0 ? delayMs : 0;
- 701 #endif
- 702 mCallTxPatch = createTelephonyPatch(false /*isRx*/, txSourceDevice, delayMs);
- 703 }
- 704
- 705 return muteWaitMs;
- 706 }
- 2. AudioPolicyManager::checkOutputForAttributes
- 如下这处原本会sleep 210ms,加了判断条件!isInCall(),则不会再sleep 210ms
- #if defined(MTK_AUDIO_FIX_DEFAULT_DEFECT) //ALPS05357474
- if (!isInCall() && desc->isDuplicated() && (desc->subOutput1()->mFlags & AUDIO_OUTPUT_FLAG_PRIMARY) != 0
- && !(desc->subOutput1()->supportedDevices().filter(newDevices).isEmpty())
- && desc->subOutput1()->devices() != desc->subOutput1()->supportedDevices().filter(newDevices)) {
- ALOGD("%s Sleep %d, desc->subOutput1()->latency() = %d, desc->subOutput2()->latency() = %d,desc->subOutput1()->devices = %s -> newDevices %s, supported %s",
- __func__, desc->latency(), desc->subOutput1()->latency(), desc->subOutput2()->latency(),
- (desc->subOutput1()->devices()).toString().c_str(), (desc->subOutput1()->supportedDevices().filter(newDevices)).toString().c_str(),(desc->subOutput1()->supportedDevices()).toString().c_str());
- usleep(desc->latency() * 1000);
- }
- #endif
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|
手机微信同号:13682654092
|
|
|
|
|
登录或注册
|