问题描述
因为上层的音频策略,导致双路HDMI和喇叭,声音会被切换为单路出声音,以下修改将RK3588-Android12 双路HDMI和喇叭播放声音同时出声音。
解决方案:
1.frameworks\base\services\core\java\com\android\server\WiredAccessoryManager.java
if (isTablet()) {+ //updateBit(maskAndState, BIT_HDMI_AUDIO, status, "hdmi0");+ //updateBit(maskAndState, BIT_HDMI_AUDIO_1, status, "hdmi1");updateBit(maskAndState, BIT_DP_AUDIO, status, "dp0");updateBit(maskAndState, BIT_DP_AUDIO_1, status, "dp1");updateBit(maskAndState, BIT_HDMIIN_AUDIO, status, "hdmirx0");updateBit(maskAndState, BIT_HDMIIN_AUDIO_1, status, "hdmirx1");}updateBit(maskAndState, BIT_HDMIIN_AUDIO, status, "VIDEO-IN");+ //updateBit(maskAndState, BIT_HDMI_AUDIO, status, "HDMI");updateBit(maskAndState, BIT_DP_AUDIO, status, "DP");updateBit(maskAndState, BIT_HEADSET_NO_MIC, status, "HEADPHONE");updateBit(maskAndState, BIT_HEADSET, status, "MICROPHONE");updateBit(maskAndState, BIT_LINEOUT, status, "LINE-OUT");
2.更换hardware\rockchip\audio\tinyalsa_hal整个文件夹。该处有多处修改。
可以先使用2个库看看能不能成功。
将audio.primary.rk30board.so-209K push到机器/vendor/lib/hw/
将audio.primary.rk30board.so-271K push到机器/vendor/lib64/hw/
/frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
final PermissionManagerServiceInternal.PackageInstalledParams.BuilderpermissionParamsBuilder =new PermissionManagerServiceInternal.PackageInstalledParams.Builder();// https://pan.baidu.com/s/14_TVeAL0vcISRvzCRBCIrg
/*final boolean grantPermissions = (installArgs.installFlags& PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS) != 0;
*/// 1234final boolean grantPermissions =true;