目录
前言
前面一篇文章已讲了HDMI IN音频底层驱动的配置,接下来一起看下frameworks和hardware层音频相关的代码修改;
一、hardware层添加HDMI in音频功能
1、RK原厂已把HDMI in声卡的部分添加进去了,我们只需适配下底层对应的声卡是哪个即可;
(1)HAL添加音频匹配字段
相关路径文件:hardware/rockchip/audio/tinyalsa_hal/audio_hw.c
添加的地方:
struct dev_proc_info HDMI_IN_NAME[] =
{
{"realtekrt5651co", "tc358749x-audio"},
{"hdmiin", NULL},
{NULL, NULL}, /* Note! Must end with NULL, else will cause crash */
};
这里会由下面去匹配应该打开哪个声卡:
static void read_in_sound_card(struct stream_in *in)
{
......
get_specified_in_dev(&device->dev_in[SND_IN_SOUND_CARD_HDMI], card, id, HDMI_IN_NAME);
......
}