第一步AudioFlinger (audioserver进程) eg: AudioFlinger::PatchPanel::createAudioPatch frameworks/av/services/audioflinger/PatchPanel.cpp /system/lib/ibaudioflinger.so
第二步libaudiohal(audioserver进程) eg: DeviceHalHidl::createAudioPatch Android P: frameworks/av/media/libaudiohal/4.0/DeviceHalHidl.cpp /system/lib/libaudiohal@4.0.so Android Q: frameworks/av/media/libaudiohal/impl/DeviceHalHidl.cpp /system/lib/libaudiohal@5.0.so
第三步device impl (android.hardware.audio@2.0-service-droidlogic进程) eg: Device::createAudioPatch Android P: hardware/interfaces/audio/core/all-versions/default/include/core/all-versions/default/Device.impl.h /vendor/lib/hw/android.hardware.audio@4.0-impl.so Android Q: hardware/interfaces/audio/core/all-versions/default/Device.cpp /vendor/lib/hw/android.hardware.audio@5.0-impl.so
第四步 audio hal (android.hardware.audio@2.0-service-droidlogic进程) eg: audio_hw.c create_audio_patch /vendor/lib/hw/audio.primary.xxx.so
audioserver和android.hardware.audio@2.0-service-droidlogic两个进程之间调用,之间通过vndbinder通信,system分区调用vendor分区。