RK3399-HDMI音频
背景
- Platform: RK3399
- OS: Android7.1.2
- Kernel: v4.4.103
主要针对HDMI-OUT, HDMI-IN这里不做讨论
内核HDMI声卡驱动
HDMI相关的声卡驱动官方已支持,只需修改DTS配置:
dts:
hdmi_sound: hdmi-sound {
status = "disabled";
compatible = "simple-audio-card";
simple-audio-card,format = "i2s";
simple-audio-card,mclk-fs = <256>;
simple-audio-card,name = "rockchip,hdmi";
simple-audio-card,cpu {
sound-dai = <&i2s2>;
};
simple-audio-card,codec {
sound-dai = <&hdmi>;
};
};
&hdmi_sound {
status = "okay";
};
&i2s2 {
status = "okay";
};
查看ALSA device list是否有对应声卡,及相应编号
HAL
tinyAlsa处理
out->stream.write = out_write;
添加处理:
- 读取HDMI的连接状态及相应参数,RK3399对应的节点路径为
/sys/class/drm/card0-HDMI-A-1/
, 下面有audioformat
和status
等一些属性 pcm_open
打开HDMI声卡pcm_write
处理相应输出音频数据
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 DD'Notes!
评论