0%

Android HDMI和喇叭同时输出声音

因为HDMI I2S & CODEC I2S 在芯片内部都是同一个I2S,因此CODEC有声音时候,也有声音通过I2S 发送到HDMI,这样取消掉HDMI Audio 检测即可实现HDMI和codec 喇叭同时输出。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff --git a/services/java/com/android/server/WiredAccessoryManager.java b/services/java/com/android/server/WiredAccessoryManager.java

index c8d3510..2fb231e 100644

--- a/services/java/com/android/server/WiredAccessoryManager.java

+++ b/services/java/com/android/server/WiredAccessoryManager.java

@@ -374,7 +374,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {

//

// If the kernel does not have an "hdmi_audio" switch, just fall back on the older

// "hdmi" switch instead.

- uei = new UEventInfo(NAME_HDMI_AUDIO, BIT_HDMI_AUDIO, 0);

+/* uei = new UEventInfo(NAME_HDMI_AUDIO, BIT_HDMI_AUDIO, 0);

if (uei.checkSwitchExists()) {

retVal.add(uei);

} else {

@@ -385,7 +385,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {

Slog.w(TAG, "This kernel does not have HDMI audio support");

}

}
+*/
return retVal;
}