RK3568 android13 HDMI和SPK同时有声音
Index: base/services/core/java/com/android/server/WiredAccessoryManager.java =================================================================== --- base/services/core/java/com/android/server/WiredAccessoryManager.java (revision 2786) +++ base/services/core/java/com/android/server/WiredAccessoryManager.java (working copy) @@ -565,8 +565,8 @@ updateBit(maskAndState, BIT_LINEOUT, status, ExtconInfo.EXTCON_LINE_OUT); } - updateBit(maskAndState, BIT_HDMI_AUDIO, status, "hdmi0"); - updateBit(maskAndState, BIT_HDMI_AUDIO_1, status, "hdmi1"); + // 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"); Index: rockchip/audio/tinyalsa_hal/audio_hw.c =================================================================== --- rockchip/audio/tinyalsa_hal/audio_hw.c (revision 2786) +++ rockchip/audio/tinyalsa_hal/audio_hw.c (working copy) @@ -1209,7 +1209,8 @@ for (int i = 0; i < out->num_configs; ++i) { ALOGD("%s: i = %d, device = 0x%x", __FUNCTION__, i, out->devices[i]); - if (out->devices[i] == AUDIO_DEVICE_OUT_AUX_DIGITAL) { + // if (out->devices[i] == AUDIO_DEVICE_OUT_AUX_DIGITAL) { + if (1) { audio_devices_t route_device = out->devices[i]; route_pcm_card_open(adev->dev_out[SND_OUT_SOUND_CARD_HDMI].card, getRouteFromDevice(route_device)); if (adev->owner[SOUND_CARD_HDMI] == NULL) { @@ -1240,10 +1241,14 @@ } } - if (out->devices[i] == AUDIO_DEVICE_OUT_SPEAKER || - out->devices[i] == AUDIO_DEVICE_OUT_WIRED_HEADSET || - out->devices[i] == AUDIO_DEVICE_OUT_WIRED_HEADPHONE || - out->devices[i] == AUDIO_DEVICE_OUT_BUS) { + // if (out->devices[i] == AUDIO_DEVICE_OUT_SPEAKER || + // out->devices[i] == AUDIO_DEVICE_OUT_WIRED_HEADSET || + // out->devices[i] == AUDIO_DEVICE_OUT_WIRED_HEADPHONE || + // out->devices[i] == AUDIO_DEVICE_OUT_BUS) { + if (out->devices[i] == AUDIO_DEVICE_OUT_SPEAKER || + out->devices[i] == AUDIO_DEVICE_OUT_WIRED_HEADSET || + out->devices[i] == AUDIO_DEVICE_OUT_WIRED_HEADPHONE || + out->devices[i] == AUDIO_DEVICE_OUT_ALL) { audio_devices_t route_device = out->devices[i]; route_pcm_card_open(adev->dev_out[SND_OUT_SOUND_CARD_SPEAKER].card, getRouteFromDevice(route_device)); card = adev->dev_out[SND_OUT_SOUND_CARD_SPEAKER].card;