欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 房产 > 家装 > RK3229 ADNROID9 hdmi与耳机口同出声音

RK3229 ADNROID9 hdmi与耳机口同出声音

2024/11/30 20:37:42 来源:https://blog.csdn.net/suifen_/article/details/142216789  浏览:    关键词:RK3229 ADNROID9 hdmi与耳机口同出声音

声卡0怎么配置才能跟HDMI同时输出一样的声音,下面是具体描述:
1、硬件连接
声卡0的连接是芯片的ADC音频输出脚直接接到DA芯片输出


2、cat /proc/asound/cards
0 [rockchiprk3229 ]: rockchip_rk3229 - rockchip,rk3229
rockchip,rk3229
1 [rockchiphdmi ]: rockchip_hdmi - rockchip,hdmi
rockchip,hdmi
2 [ROCKCHIPSPDIF ]: ROCKCHIP_SPDIF - ROCKCHIP,SPDIF
ROCKCHIP,SPDIF

3、具体修改

frameworks/base$ git diff ./
diff --git a/services/core/java/com/androidrver/WiredAccessoryManager.java b/services/core/java/com/androidrver/WiredAccessoryManager.java
index bf6299cffdb3..67d9f972a07a 100644
--- a/services/core/java/com/androidrver/WiredAccessoryManager.java
+++ b/services/core/java/com/androidrver/WiredAccessoryManager.java
@@ -55,7 +55,7 @@ import java.util.Locale;*/final class WiredAccessoryManager implements WiredAccessoryCallbacks {private static final String TAG = WiredAccessoryManager.class.getSimpleName();
-    private static final boolean LOG = false;
+    private static final boolean LOG = true;private static final int BIT_HEADSET = (1 << 0);private static final int BIT_HEADSET_NO_MIC = (1 << 1);
@@ -408,6 +408,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, 0);if (uei.checkSwitchExists()) {retVal.add(uei);
@@ -420,6 +421,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {}}+           */return retVal;}@@ -530,7 +532,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {// new state will be like STATE=MICROPHONE=1\nHEADPHONE=0updateBit(maskAndState, BIT_HEADSET_NO_MIC, status, "HEADPHONE") ;updateBit(maskAndState, BIT_HEADSET, status,"MICROPHONE") ;
-            updateBit(maskAndState, BIT_HDMI_AUDIO, status,"HDMI") ;
+            // updateBit(maskAndState, BIT_HDMI_AUDIO, status,"HDMI") ;updateBit(maskAndState, BIT_DP_AUDIO, status,"DP");updateBit(maskAndState, BIT_LINEOUT, status,"LINE-OUT") ;if (LOG) Slog.v(TAG, "mask " + maskAndState[0] + " state " + maskAndState[1]);tinyalsa_hal$ vim audio_hw.c
lxt@ubuntu101:~/audio/tinyalsa_hal$ git diff ./
diff --git a/tinyalsa_hal/audio_hw.c b/tinyalsa_hal/audio_hw.c
index fb1471e..dfec724 100755
--- a/tinyalsa_hal/audio_hw.c
+++ b/tinyalsa_hal/audio_hw.c
@@ -994,7 +994,7 @@ static int start_output_stream(struct stream_out *out)out->device &= ~(AUDIO_DEVICE_OUT_AUX_DIGITAL | AUDIO_DEVICE_OUT_SPDIF);#endif-    if (out->device & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
+    //if (out->device & AUDIO_DEVICE_OUT_AUX_DIGITAL) {audio_devices_t route_device = out->device & AUDIO_DEVICE_OUT_AUX_DIGITAL;route_pcm_card_open(adev->dev_out[SND_OUT_SOUND_CARD_HDMI].card, getRouteFromDevice(route_device));@@ -1037,7 +1037,7 @@ static int start_output_stream(struct stream_out *out)ALOGD("The current HDMI is DVI mode");out->device |= AUDIO_DEVICE_OUT_SPEAKER;}
-    }
+    //}if (out->device & (AUDIO_DEVICE_OUT_SPEAKER |AUDIO_DEVICE_OUT_WIRED_HEADSET |

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com