Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92
以采样率和buffer size为线索来跟踪开机时Audio Hal第一次初始化:
AudioPolicyManager ->
ConfigParsingUtils::loadAudioPolicyConfig -> AUDIO_POLICY_CONFIG_FILE是/system/etc/audio_policy.conf, 对应/device/rockchip/common/audio_policy_rk30board.conf
loadHwModules ->
loadHwModule ->
config_find(root, INPUTS_TAG); //INPUTS_TAG是inputs,在audio_policy.conf能找到.
module->loadInput ->
HwModule::loadInput ->
profile->loadSamplingRates -> 找到SAMPLING_RATES_TAG的内容,即sampling_rates
mSamplingRates.add //所有支持采样率都存下来,其他如format, channel也一样被各自存下来
mInputProfiles.add //一个input节点当做一个profile存下来
new AudioInputDescriptor(inProfile); -> 根据上面profile来创建
profile->pickSamplingRate //获
OS: Android 6.0
Kernel: 3.10.92
以采样率和buffer size为线索来跟踪开机时Audio Hal第一次初始化:
AudioPolicyManager ->
ConfigParsingUtils::loadAudioPolicyConfig -> AUDIO_POLICY_CONFIG_FILE是/system/etc/audio_policy.conf, 对应/device/rockchip/common/audio_policy_rk30board.conf
loadHwModules ->
loadHwModule ->
config_find(root, INPUTS_TAG); //INPUTS_TAG是inputs,在audio_policy.conf能找到.
module->loadInput ->
HwModule::loadInput ->
profile->loadSamplingRates -> 找到SAMPLING_RATES_TAG的内容,即sampling_rates
mSamplingRates.add //所有支持采样率都存下来,其他如format, channel也一样被各自存下来
mInputProfiles.add //一个input节点当做一个profile存下来
new AudioInputDescriptor(inProfile); -> 根据上面profile来创建
profile->pickSamplingRate //获