rk平台android12修改dp和喇叭同时输出声音

客户的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);
相关推荐
__Witheart__2 天前
适用于Android内核boot.img生成流程
android·rockchip
__Witheart__3 天前
版型关联的设备树查询方式
android·rockchip
Amonter11 天前
TB-RK3399Pro移植ubuntu 26.04及烧录
linux·ubuntu·rockchip·rk3399pro
Amonter18 天前
RK3399ProD移植主线Linux内核
linux·rockchip·rk3399pro
浆果020719 天前
NanoTrack C++ — RK3588 实时目标跟踪
c++·目标跟踪·rk3588
__Witheart__1 个月前
RK 3588 Ubuntu SDK 编译 Linux Header(标头)
linux·ubuntu·rockchip
__Witheart__1 个月前
RK 3588 Ubuntu SDK 编译流程
ubuntu·rockchip
楼兰公子1 个月前
为 RK3588 构建 Debian 14 (forky) 根文件系统镜像,集成 BusyBox 1.38
rk3588·buildroot
__Witheart__1 个月前
make menuconfig 使用全流程
linux·ubuntu·rockchip
__Witheart__1 个月前
Ubuntu 根文件系统开发流程及注意事项
linux·ubuntu·rockchip