完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
先把packages/apps/Settings/src/com/android/settings/notification/NotificationSettings.java中如下部分注释掉。Setting把UI打开。
mSoundDevices = findPreference(KEY_SOUND_DEVICES); 161 /*paul change if(!"box".equals(SystemProperties.get("ro.target.product","tablet"))){ 162 // getPreferenceScreen().removePreference(mSoundDevices); 163 // getPreferenceScreen().removePreference(soundmange); 164 // soundmange = null; 165 // mSoundDevices = null; 166 // Log.d(TAG,"remove SoundDevices======"); 167 */ //paul change } 168 /*$_rbox_$_modify_$_zhangxueguang_$_end_$_20120409_$*/ 169 } 将如下补丁打入hardware/rockchip/audio/tinyalsa_hal/audio_hw.c文件中。 diff --git a/tinyalsa_hal/audio_hw.c b/tinyalsa_hal/audio_hw.c index 6cc0a1c..3b38f9f 100755 --- a/tinyalsa_hal/audio_hw.c +++ b/tinyalsa_hal/audio_hw.c @@ -509,6 +509,10 @@ static int start_output_stream(struct stream_out *out) /*BOX hdmi & codec use the same i2s,so only config the codec card*/ out->device &= ~AUDIO_DEVICE_OUT_SPEAKER; } + property_get("persist.audio.currentplayback", value, ""); + if (8 == atoi(value)) { + out->device = AUDIO_DEVICE_OUT_SPDIF; + } #endif ALOGD("Audio HAL start_output_stream out->device = 0x%x",out->device); route_pcm_open(getRouteFromDevice(out->device)); 并且在 hardware/rockchip/audio/tinyalsa_hal/audio_hw.h中定义“BOX_HAL”这个宏。 驱动中rk3288.dtsi如下部分对原来的进行替换 spdif: rockchip-spdif@0xff8b0000 { compatible = "rockchip-spdif"; //reg = <0xff8b0000 0x10000>; //8channel reg = <0xff880000 0x10000>;//2channel clocks = <&clk_spdif>, <&clk_spdif_8ch>,<&clk_gates10 10>; clock-names = "spdif_mclk","spdif_8ch_mclk","spdif_hclk"; interrupts = dmas = <&pdma0 2>; //dmas = <&pdma0 2>; //2channel //#dma-cells = <1>; dma-names = "tx"; pinctrl-names = "default"; pinctrl-0 = <&spdif_tx>; }; rk3288-tb_8846.dts中 format = "i2s"注释去掉。 154 rockchip-hdmi-i2s { 155 status = "okay"; 156 compatible = "rockchip-hdmi-i2s"; 157 dais { 158 dai0 { 159 audio-codec = <&codec_hdmi_i2s>; 160 audio-controller = <&i2s>; 161 format = "i2s"; 162 //continuous-clock; 163 //bitclock-inversion; 164 //frame-inversion; 165 //bitclock-master; 166 //frame-master; 167 }; 168 }; 169 }; 然后将附件中audio_policy.conf push到/etc目录下。 audio_policy.conf内容如下 # Global configuration section: lists input and output devices always present on the device # as well as the output device selected by default. # Devices are designated by a string that corresponds to the enum in audio.h global_configuration { attached_output_devices AUDIO_DEVICE_OUT_SPEAKER default_output_device AUDIO_DEVICE_OUT_SPEAKER attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX } # audio hardware module section: contains descriptors for all audio hw modules present on the # device. Each hw module node is named after the corresponding hw module library base name. # For instance, "primary" corresponds to audio.primary. # The "primary" module is mandatory and must include at least one output with # AUDIO_OUTPUT_FLAG_PRIMARY flag. # Each module descriptor contains one or more output profile descriptors and zero or more # input profile descriptors. Each profile lists all the parameters supported by a given output # or input stream category. # The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding # to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "n". audio_hw_modules { primary { outputs { primary { sampling_rates 44100|48000 channel_masks AUDIO_CHANNEL_OUT_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_SPDIF flags AUDIO_OUTPUT_FLAG_PRIMARY } spdif_passthrough { sampling_rates 44100|48000 channel_masks AUDIO_CHANNEL_OUT_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_OUT_SPDIF flags AUDIO_OUTPUT_FLAG_DIRECT } hdmi { sampling_rates 44100|48000|192000 channel_masks AUDIO_CHANNEL_OUT_5POINT1|AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_7POINT1 formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_OUT_AUX_DIGITAL flags AUDIO_OUTPUT_FLAG_DIRECT } } inputs { primary { sampling_rates 8000|11025|16000|22050|32000|44100|48000 channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET } } } a2dp { outputs { a2dp { sampling_rates 44100 channel_masks AUDIO_CHANNEL_OUT_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_OUT_ALL_A2DP } } } u*** { outputs { u***_accessory { sampling_rates 44100 channel_masks AUDIO_CHANNEL_OUT_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_OUT_USB_ACCESSORY } u***_device { sampling_rates dynamic channel_masks dynamic formats dynamic devices AUDIO_DEVICE_OUT_USB_DEVICE } } inputs { u***_device { sampling_rates dynamic channel_masks AUDIO_CHANNEL_IN_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_IN_USB_DEVICE } } } r_submix { outputs { submix { sampling_rates 48000 channel_masks AUDIO_CHANNEL_OUT_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX } } inputs { submix { sampling_rates 48000 channel_masks AUDIO_CHANNEL_IN_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_IN_REMOTE_SUBMIX } } } } 原作者:胡杨122 |
|
相关推荐
1个回答
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
626 浏览 0 评论
887 浏览 1 评论
784 浏览 1 评论
1997 浏览 1 评论
3242 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 19:08 , Processed in 0.472719 second(s), Total 40, Slave 34 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号