客户的rk3588主板android12系统,要求接上type-c 进行dp输出显示以后,dp端和主板端都有声音。rk原有系统默认是接上dp显示以后,主板的喇叭声音会被切掉,导致没有声音。要让喇叭和dp同时输出声音需要做如下修改:
--- a/frameworks/av/services/audiopolicy/enginedefault/src/Engine.cpp
+++ b/frameworks/av/services/audiopolicy/enginedefault/src/Engine.cpp
@@ -366,6 +366,8 @@ DeviceVector Engine::getDevicesForStrategyInt(legacy_strategy strategy,
}
if ((devices2.isEmpty()) && (strategy != STRATEGY_SONIFICATION)) {
devices2 = availableOutputDevices.getDevicesFromType(AUDIO_DEVICE_OUT_SPDIF);
+ DeviceVector devices_add = availableOutputDevices.getDevicesFromType(AUDIO_DEVICE_OUT_SPEAKER);
+ devices2.add(devices_add);
}
if ((devices2.isEmpty()) && (strategy != STRATEGY_SONIFICATION)) {
devices2 = availableOutputDevices.getDevicesFromType(AUDIO_DEVICE_OUT_SPDIF_1);