mt6735 连接蓝牙耳机播放视频时来电或挂断电话,有1s视频声音外放
时间:10-02
整理:3721RD
点击:
[Audio BT]连接蓝牙耳机播放视频时来电或挂断电话,有1s视频声音外放
[DESCRIPTION]
连接蓝牙耳机播放视频时来电或挂断电话,有1s视频声音外放
[SOLUTION]
1.AudiomtkPolicyManager::setPhoneState()->
if (isStateInCall(state)) {
for (size_t i = 0; i < mOutputs.size(); i++) {
AudioOutputDescriptor *desc = mOutputs.valueAt(i);
//take the biggest latency for all outputs
if (delayMs < (int)desc->mLatency*2) {
delayMs = desc->mLatency*2;
}
//mute STRATEGY_MEDIA on all outputs
if (desc->strategyRefCount(STRATEGY_MEDIA) != 0) {
setStrategyMute(STRATEGY_MEDIA, true, mOutputs.keyAt(i));
setStrategyMute(STRATEGY_MEDIA, false, mOutputs.keyAt(i), MUTE_TIME_MS,
getDeviceForStrategy(STRATEGY_MEDIA, true /*fROMCache*/));
}
}
}
修改为
#ifdef MTK_AUDIO
if ( (isStateInCall(state)) || (isStateInCall(oldState) && !isStateInCall(state)) ||
(state==AudioSystem::MODE_RINGTONE) ) {
#else
if (isStateInCall(state)) {
#endif
for (size_t i = 0; i < mOutputs.size(); i++) {
AudioOutputDescriptor *desc = mOutputs.valueAt(i);
//take the biggest latency for all outputs
if (delayMs < (int)desc->mLatency*2) {
delayMs = desc->mLatency*2;
}
//mute STRATEGY_MEDIA on all outputs
if (desc->strategyRefCount(STRATEGY_MEDIA) != 0) {
setStrategyMute(STRATEGY_MEDIA, true, mOutputs.keyAt(i));
setStrategyMute(STRATEGY_MEDIA, false, mOutputs.keyAt(i), MUTE_TIME_MS,
getDeviceForStrategy(STRATEGY_MEDIA, true /*fromCache*/));
}
}
}
2.AudioMTKPolicyManager::checkAndSetVolume()->添加红色code
// ALPS00554824 KH: If notifiaction is exist, FM should be mute
if ((stream == AudioSystem::FM) &&
(mOutputs.valueFor(output)->mRefCount[AudioSystem::NOTIFICATION]
|| mOutputs.valueFor(output)->mRefCount[AudioSystem::RING]
|| mOutputs.valueFor(output)->mRefCount[AudioSystem::ALARM]))
{
volume =0.0;
}
// ALPS001125976 Mute music at ringtone from BT to primary
if ((stream == AudioSystem::MUSIC) && (mPhoneState ==AudioSystem::MODE_RINGTONE)) {
volume =0.0;
}
或者直接申请patch:ALPS01125976
[DESCRIPTION]
连接蓝牙耳机播放视频时来电或挂断电话,有1s视频声音外放
[SOLUTION]
1.AudiomtkPolicyManager::setPhoneState()->
if (isStateInCall(state)) {
for (size_t i = 0; i < mOutputs.size(); i++) {
AudioOutputDescriptor *desc = mOutputs.valueAt(i);
//take the biggest latency for all outputs
if (delayMs < (int)desc->mLatency*2) {
delayMs = desc->mLatency*2;
}
//mute STRATEGY_MEDIA on all outputs
if (desc->strategyRefCount(STRATEGY_MEDIA) != 0) {
setStrategyMute(STRATEGY_MEDIA, true, mOutputs.keyAt(i));
setStrategyMute(STRATEGY_MEDIA, false, mOutputs.keyAt(i), MUTE_TIME_MS,
getDeviceForStrategy(STRATEGY_MEDIA, true /*fROMCache*/));
}
}
}
修改为
#ifdef MTK_AUDIO
if ( (isStateInCall(state)) || (isStateInCall(oldState) && !isStateInCall(state)) ||
(state==AudioSystem::MODE_RINGTONE) ) {
#else
if (isStateInCall(state)) {
#endif
for (size_t i = 0; i < mOutputs.size(); i++) {
AudioOutputDescriptor *desc = mOutputs.valueAt(i);
//take the biggest latency for all outputs
if (delayMs < (int)desc->mLatency*2) {
delayMs = desc->mLatency*2;
}
//mute STRATEGY_MEDIA on all outputs
if (desc->strategyRefCount(STRATEGY_MEDIA) != 0) {
setStrategyMute(STRATEGY_MEDIA, true, mOutputs.keyAt(i));
setStrategyMute(STRATEGY_MEDIA, false, mOutputs.keyAt(i), MUTE_TIME_MS,
getDeviceForStrategy(STRATEGY_MEDIA, true /*fromCache*/));
}
}
}
2.AudioMTKPolicyManager::checkAndSetVolume()->添加红色code
// ALPS00554824 KH: If notifiaction is exist, FM should be mute
if ((stream == AudioSystem::FM) &&
(mOutputs.valueFor(output)->mRefCount[AudioSystem::NOTIFICATION]
|| mOutputs.valueFor(output)->mRefCount[AudioSystem::RING]
|| mOutputs.valueFor(output)->mRefCount[AudioSystem::ALARM]))
{
volume =0.0;
}
// ALPS001125976 Mute music at ringtone from BT to primary
if ((stream == AudioSystem::MUSIC) && (mPhoneState ==AudioSystem::MODE_RINGTONE)) {
volume =0.0;
}
或者直接申请patch:ALPS01125976