RK系列SDK -- 多路设备同时输出声音(Android)
16lz
2021-01-26
说明:本文只针对RK安卓系列SDK,需要多个输出设备同时工作都可以参考此修改处理,但不能保证所有场景都适用。
蓝牙和喇叭同时输出声音
//Android 7.1frameworks/av/services/audiopolicy/enginedefault/src/Engine.cppframeworks/av/services/audiopolicy$ git diff diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cppindex 58e198a..bdd18b2 100755--- a/services/audiopolicy/enginedefault/src/Engine.cpp+++ b/services/audiopolicy/enginedefault/src/Engine.cpp@@ -594,6 +594,15 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy, default: ALOGW("getDeviceForStrategy() unknown strategy: %d", strategy); break; }+ if ((device & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP)+ || (device & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES)+ || (device & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER)) {+ device |= AUDIO_DEVICE_OUT_SPEAKER;+ ALOGV("Bluetooth and speakers work together , device %x", device);+ } if (device == AUDIO_DEVICE_NONE) { ALOGV("getDeviceForStrategy() no device found for strategy %d", strategy);
更多相关文章
- Android4.0中蓝牙适配器state machine(状态机)的分析
- android资源文件中xliffg:g的用法
- Android蓝牙
- android uiautomator学习(一)创建工程
- Android(安卓)查看蓝牙日志
- Struts2中一流的方式输出
- Android(安卓)Arduino 蓝牙模块通信源代码
- Android(安卓)中文API (69) ―― BluetoothAdapter[蓝牙]
- android的Log输出