mt6735 [Audio Driver]FM应用打开外放后耳机也能有声音
来源:互联网 发布:淘宝评论福利在哪里找 编辑:程序博客网 时间:2024/05/02 01:24
在 AudiomtkPolicyManager.cpp中添加如下代码, 搜索//add start,添加两个地方.
audio_devices_t AudioMTKPolicyManager::getDeviceForStrategy(routing_strategy strategy,
bool fROMCache)
#ifdef MTK_AUDIO
case STRATEGY_PROPRIETARY_ANLG_V2:
case STRATEGY_PROPRIETARY_ANLG:{
...
if (device2 == 0) {
device2 = mAvailableOutputDevices & AudioSystem:EVICE_OUT_SPEAKER;
}
// device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION, 0 otherwise
//add start
if(device2 == AudioSystem::DEVICE_OUT_SPEAKER){
ALOGD("xwxwxwxw device2 == mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER");
device2 |=AudioSystem::DEVICE_OUT_WIRED_HEADSET;
}
//add end
device |= device2;
if (device == 0) {
ALOGE("getDeviceForStrategy() speaker device not found");
}
break;
}
#endif
case STRATEGY_PROPRIETARY_DGTL_V2:
case STRATEGY_PROPRIETARY_DGTL: {
.......
if (device2 == 0) {
device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
}
// device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION or
// STRATEGY_ENFORCED_AUDIBLE, 0 otherwise
ALOGD(" getDeviceForStrategy() strategy %d, device %x device2 %x mDeviceForStrategy[strategy] %x+++",
strategy, device,device2,mDeviceForStrategy[strategy]);
//add start
if(device2 == AudioSystem::DEVICE_OUT_SPEAKER){
ALOGD("device2 == mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER");
device2 |=AudioSystem::DEVICE_OUT_WIRED_HEADSET;
}
//add end
ALOGD(" getDeviceForStrategy() strategy %d, device %x device2 %x ******", strategy, device,device2);
device |= device2;
ALOGD("getDeviceForStrategy() strategy %d, device %x device2 %x ----", strategy, device,device2);
if (device) break;
device = mDefaultOutputDevice;
if (device == 0) {
ALOGE("getDeviceForStrategy() no device found for STRATEGY_MEDIA");
}
}
break;
audio_devices_t AudioMTKPolicyManager::getDeviceForStrategy(routing_strategy strategy,
bool fROMCache)
#ifdef MTK_AUDIO
case STRATEGY_PROPRIETARY_ANLG_V2:
case STRATEGY_PROPRIETARY_ANLG:{
...
if (device2 == 0) {
device2 = mAvailableOutputDevices & AudioSystem:EVICE_OUT_SPEAKER;
}
// device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION, 0 otherwise
//add start
if(device2 == AudioSystem::DEVICE_OUT_SPEAKER){
ALOGD("xwxwxwxw device2 == mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER");
device2 |=AudioSystem::DEVICE_OUT_WIRED_HEADSET;
}
//add end
device |= device2;
if (device == 0) {
ALOGE("getDeviceForStrategy() speaker device not found");
}
break;
}
#endif
case STRATEGY_PROPRIETARY_DGTL_V2:
case STRATEGY_PROPRIETARY_DGTL: {
.......
if (device2 == 0) {
device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
}
// device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION or
// STRATEGY_ENFORCED_AUDIBLE, 0 otherwise
ALOGD(" getDeviceForStrategy() strategy %d, device %x device2 %x mDeviceForStrategy[strategy] %x+++",
strategy, device,device2,mDeviceForStrategy[strategy]);
//add start
if(device2 == AudioSystem::DEVICE_OUT_SPEAKER){
ALOGD("device2 == mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER");
device2 |=AudioSystem::DEVICE_OUT_WIRED_HEADSET;
}
//add end
ALOGD(" getDeviceForStrategy() strategy %d, device %x device2 %x ******", strategy, device,device2);
device |= device2;
ALOGD("getDeviceForStrategy() strategy %d, device %x device2 %x ----", strategy, device,device2);
if (device) break;
device = mDefaultOutputDevice;
if (device == 0) {
ALOGE("getDeviceForStrategy() no device found for STRATEGY_MEDIA");
}
}
break;
请参照修改,这样修改之后,FM应用打开外放时,耳机也能有声音。
资料转载于一牛网论坛 MT6735
阅读全文
0 0
- mt6735 [Audio Driver]FM应用打开外放后耳机也能有声音
- mt6735 [Audio Common] 播放FM录音,开始时声音很大
- mt6735 [Audio App]未插入耳机时进入收音机出现没有耳机提示框后,插入耳机FM能够自动播放
- 安装win7和Ubuntu双系统后,win7耳机没声音,外放有声音
- thinkpad 外放和耳机 声音分离设置
- 台式机插上耳机,声音仍然外放问题解决
- mt6735 [Audio APP]如何监听手机上面音乐 /FM等多媒体声音的播放/停止的动作?
- 笔记本电脑插入耳机只能外放,耳机没声音
- mt6735 [Audio Policy]连接蓝牙耳机,通话时声音路径切换到听筒或者喇叭,触屏时听不到触屏音
- ubuntu14.04下外放有声音,耳机没声音
- 解决Ubuntu 9.04 耳机有声音但外放无声问题
- Ubuntu 12.04 耳机外放同时有声音解决办法
- mt6735 [Audio Drv]使用外部PA耳机有 Pop音
- 插上耳机,电脑跟耳机都有声音(声音外放)解决办法
- mt6735 [Audio Loopback]产线加大MIC2测试声音
- Android 打开飞行模式和拔出耳机时自动退出FM Radio应用
- mt6735 [Audio Driver]工厂测试模式下如果调整音量
- 解决ubuntu12.04耳机有声音,外放没声音的问题
- mac 下android studio 获取开发版和发布版的sha1
- iOS多线程--彻底学会多线程之『GCD』
- synergy软件win10和ubuntu16.04局域网下使用一套键盘鼠标系统
- linux环境变量的配置(jdk)
- 11.15 作业
- mt6735 [Audio Driver]FM应用打开外放后耳机也能有声音
- 有赞 App 动态化配置中心实践
- shiro的架构
- 【自定义View】一起来画个风车吧~
- J2SE桌面小程序包含配置文件打成jar包引出的一系列问题(1)
- JSTree的使用
- iOS多线程--彻底学会多线程之『RunLoop』
- Python-day17
- 数据库帮助类