-
音频框图概述
| Front End PCMs | SoC DSP | Back End DAIs | Audio devices |*************
PCM0 <------------> * * <----DAI0-----> Codec Headset
* *
PCM1 <------------> * * <----DAI1-----> Codec Speakers/Earpiece
* DSP *
PCM2 <------------> * * <----DAI2-----> MODEM
* *
PCM3 <------------> * * <----DAI3-----> BT
* *
* * <----DAI4-----> DMIC
* *
* * <----DAI5-----> FM
*************
1
2
3
4
5
6
7
8
9
10
11
自己见解:
音频路由配置文件 mixer_paths_pahu.xml
结构是是
…
…
<path name="audio-ull-playback usb-headset">
<ctl name="USB_AUDIO_RX Audio Mixer MultiMedia8" value="1" />
</path>
<path name="audio-ull-playback speaker-and-bt-sco">
<path name="audio-ull-playback bt-sco" />
<path name="audio-ull-playback" />
</path>
其中PATH中包含着PATH,最基本的PATH(也就是不包含PATH的,包含着一个 或多个
其中每个PATH是一个USECASE
USECASE在文件中定义:
primary-hal/hal/audio_hw.c 中的
const char * const use_case_table[AUDIO_USECASE_MAX] = {
[USECASE_AUDIO_PLAYBACK_DEEP_BUFFER] = “deep-buffer-playback”,
[USECASE_AUDIO_PLAYBACK_LOW_LATENCY] = “low-latency-playback”,
[USECASE_AUDIO_PLAYBACK_WITH_HAPTICS] = “audio-with-haptics-playback”,
[USECASE_AUDIO_PLAYBACK_HAPTICS] = “haptics-playback”,
[USECASE_AUDIO_PLAYBACK_ULL] = “audio-ull-playback”,
[USECASE_AUDIO_PLAYBACK_MULTI_CH] = “multi-channel-playback”,
[USECASE_AUDIO_PLAYBACK_OFFLOAD] = “compress-offload-playback”,
//Enabled for Direct_PCM
[USECASE_AUDIO_PLAYBACK_OFFLOAD2] = “compress-offload-playback2”,
[USECASE_AUDIO_PLAYBACK_OFFLOAD3] = “compress-offload-playback3”,
[USECASE_AUDIO_PLAYBACK_OFFLOAD4] = “compress-offload-playback4”,
[USECASE_AUDIO_PLAYBACK_OFFLOAD5] = “compress-offload-playback5”,
[USECASE_AUDIO_PLAYBACK_OFFLOAD6] = “compress-offload-playback6”,
[USECASE_AUDIO_PLAYBACK_OFFLOAD7] = “compress-offload-playback7”,
[USECASE_AUDIO_PLAYBACK_OFFLOAD8] = “compress-offload-playback8”,
[USECASE_AUDIO_PLAYBACK_OFFLOAD9] = “compress-offload-playback9”,
[USECASE_AUDIO_PLAYBACK_FM] = “play-fm”,
[USECASE_AUDIO_PLAYBACK_MMAP] = “mmap-playback”,
[USECASE_AUDIO_PLAYBACK_HIFI] = “hifi-playback”,
[USECASE_AUDIO_PLAYBACK_TTS] = “audio-tts-playback”,
…
其中每个<ctl…/>的名字都在驱动代码里有定义
比如 techpack/audio/asoc/*.c 中有定义
上层调用不同的USE CASE,也就切换到不同的PATH,就会调用到PATH中不同的控件,然后调用到KERNEL 驱动,KERNEL驱动层根据<ctl…/>的名字,及VALUE,调用对应的函数,进而控制硬件;
进而打通音频通路,音频流从CODEC中(或经DSP处理)送到后端设备中播放 ;
大致主这样的;