安卓系统中音频模块的配置文件汇总

整个安卓设备的配置文件在system/etc/目录下,音频作为其中的一个子模块当然也包含在内,通过shell命令可以看到和下面类似的文件列表

msm8953_64:/system/etc $ ls  
IPACM_cfg.xml                       data                                        init.qcom.bt.sh                      mixer_paths_mtp.xml                     recovery-resource.dat                 
NOTICE.html.gz                      default_volume_tables.xml                   init.qcom.coex.sh                    mixer_paths_qrd_sku3.xml                reduce_adj_list.xml                   
Rtkconfig.ini                       dpm                                         init.qcom.debug.sh                   mixer_paths_qrd_skuh.xml                sap.conf                              
a2dp_audio_policy_configuration.xml drc                                         init.qcom.efs.sync.sh                mixer_paths_qrd_skuhf.xml               sec_config                            
aanc_tuning_mixer.txt               ethertypes                                  init.qcom.fm.sh                      mixer_paths_qrd_skui.xml                security                              
acdbdata                            event-log-tags                              init.qcom.post_boot.sh               mixer_paths_qrd_skum.xml                sensors                               
apdr.conf                           firmware                                    init.qcom.sdio.sh                    mixer_paths_qrd_skun.xml                sound_trigger_mixer_paths.xml         
apns-conf.xml                       flp.conf                                    init.qcom.testscripts.sh             mixer_paths_skuk.xml                    sound_trigger_mixer_paths_wcd9306.xml 
appops_policy.xml                   fonts.xml                                   init.qcom.uicc.sh                    mixer_paths_wcd9306.xml                 sound_trigger_mixer_paths_wcd9330.xml 
audio_effects.conf                  fs_config_files                             init.qcom.wifi.sh                    mixer_paths_wcd9326.xml                 sound_trigger_mixer_paths_wcd9335.xml 
audio_platform_info.xml             ftm_test_config                             init.qti.ims.sh                      mixer_paths_wcd9330.xml                 sound_trigger_platform_info.xml       
audio_platform_info_extcodec.xml    ftm_test_config_msm8953-sku3-tasha-snd-card izat.conf                            mixer_paths_wcd9335.xml                 special_Permission_list.xml           
audio_policy.conf                   ftm_test_config_mtp                         lowi.conf                            mkshrc                                  spn-conf.xml                          
audio_policy_configuration.xml      ftm_test_config_wcd9335                     mcu                                  mmi                                     surround_sound_3mic                   
audio_policy_volumes.xml            gamedwhitelist.xml                          media_codecs.xml                     packagesFilterList.txt                  thermal-engine.conf                   
bluetooth                           gps.conf                                    media_codecs_8953_v1.xml             permissions                             usb_audio_policy_configuration.xml    
cacert_location.pem                 hcidump.sh                                  media_codecs_google_audio.xml        plmn-conf.xml                           vold.fstab                            
camera                              hostapd                                     media_codecs_google_telephony.xml    ppp                                     wfdconfig.xml                         
capability.xml                      hosts                                       media_codecs_google_video.xml        preloaded-classes                       wfdconfigsink.xml                     
cdma_call_conf.xml                  hsic.control.bt.sh                          media_codecs_performance.xml         promote_adj_list.xml                    white_app_list.xml                    
cdrom_install.iso                   init                                        media_codecs_performance_8953_v1.xml public.libraries.txt                    whitelistedapps.xml                   
clatd.conf                          init.ath3k.bt.sh                            media_profiles.xml                   qca6234-service.sh                      wifi                                  
cne                                 init.crda.sh                                media_profiles_8953_v1.xml           qmi_fw.conf                             xtra_root_cert.pem                    
compiled-classes                    init.qcom.audio.sh                          mixer_paths.xml                      r_submix_audio_policy_configuration.xml xtwifi.conf

/system/etc/audio_policy.conf:音频的硬件模块(包括primary,usb,a2dp,r_submix等4部分,这四个部分又一一对应着audio.xxx.default.so等4个共享库文件),在安卓的策略模块APM.cpp的构造函数中会将它们加载到系统中

当然有的安卓设备制造商也会有一个,它的存储目录是/vendor/etc/audio_policy.conf

/system/etc/mixer_paths.xml:系统中的音频流经过的路由列表

/system/etc/audio_policy_volumes.xml和default_volume_tables.xml:音频流的音量曲线,选取曲线上的四个点,通过四个点将上层设置的音频流音量的float值转换为db值,最后将这个db值设置到audio的硬件上去

/system/etc/media_codecs_google_audio: 系统中支持的音频流的编解码格式

/data/system/user/0(用户名)/settings_system.xml:保存着用户在系统设置中调节过的各类音频流音量的值,其实就是系统的Provider,settings_secure.xml和settings_global.xml 类型的也在同级目录

 

另外注意这些配置文件是在安卓设备中的,其实在系统源码中也能找到对应的源文件,设备中的配置文件也是源码经过编译后烧录进去的

如 /system/etc/audio_policy.conf 对应着源码的位置是 frameworks/av/services/audiopolicy/config/audio_policy.conf

 

调试音频的shell命令(调试音频流时很管用,强烈推荐使用!!!):

笔者通过shell命令解决过一个音频流混音卡顿的BUG,手机通过蓝牙连接车载设备,然后手机端播放音乐,声音在车载设备上跟高德语音导航的音频流一起混音播出时出现了卡顿的情况(当然车载设备已经支持了蓝牙的主从切换功能),但是在车载设备上播放音频和高德语音导航的音频流一起混音并没有出现卡顿的情况;后来是分析这两种场景下的音频流信息才找到的解决问题的思路,发现单独车载设备上播放音乐和高德导航混音时两者的音频流走的是不同的音频输出流通道;但是手机通过蓝牙连接车载设备播放音乐和高德导航一起混音时走的是同一个音频流输出通道(音乐和导航使用相同的通道时,当另一路导航音频流过来了,会将当前音频流通道暂时关闭之后再开启导致的卡顿),只要把手机上播放音频流的通道改成跟车载设备上播放音乐的通道一致,就没有出现卡顿的情况了~其实修改的是音频策略模块

dumpsys audio 当前系统中各种音频流的音量信息,以及音频焦点申请记录,外设插拔记录等

dumpsys media.audio_flinger 当前系统中音频流信息,以及对应的处理线程的相关信息。 Android Q 版本
dumpsys media.audio_policy  当前系统中可用的输入/输出设备,组合的音频通路等信息。Android Q 版本

 

附执行shell命令后的返回信息,这些信息精炼,但每行信息表示的含义都很重要!这些数字化的信息跟上层多样化的业务逻辑都是一一对应的,我会标注部分知道的信息,其它的信息还请Audio相关的大神们补充完善^^

============================================================

dten_s27:/ # dumpsys audio

MediaFocusControl dump time: 10:17:16 AM

Audio Focus stack entries (last is top of stack):(音频焦点栈信息,现在是由应用程序包名为org.chromium.content.browser的应用获取到音频焦点)
  source:android.os.BinderProxy@f800af5 -- pack: org.chromium.webview_shell -- client: android.media.AudioManager@c44930forg.chromium.content.browser.AudioFocusDelegate@f46a57f -- gain: GAIN -- flags:  -- loss: none -- notified: true -- uid: 10018 -- attr: AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_MUSIC flags=0x0 tags= bundle=null -- sdk:24


No external focus policy

 Notify on duck:  true

 In ring or call: false

Audio event log: focus commands as seen by MediaFocusControl(音频焦点的申请/释放记录,看到申请焦点的应用程序的包名)
05-07 10:16:35:309 requestAudioFocus() from uid/pid 10018/32500 clientId=android.media.AudioManager@c44930forg.chromium.content.browser.AudioFocusDelegate@a9b5f9c callingPack=org.chromium.webview_shell req=1 flags=0x0 sdk=24
05-07 10:16:48:504 abandonAudioFocus() from uid/pid 10018/32500 clientId=android.media.AudioManager@c44930forg.chromium.content.browser.AudioFocusDelegate@a9b5f9c
05-07 10:16:48:506 abandonAudioFocus() from uid/pid 10018/32500 clientId=android.media.AudioManager@c44930forg.chromium.content.browser.AudioFocusDelegate@a9b5f9c
05-07 10:17:05:451 requestAudioFocus() from uid/pid 10018/32500 clientId=android.media.AudioManager@c44930forg.chromium.content.browser.AudioFocusDelegate@f46a57f callingPack=org.chromium.webview_shell req=1 flags=0x0 sdk=24

Stream volumes (device: index)
- STREAM_VOICE_CALL:
   Muted: false
   Min: 0
   Max: 100
   Current: 2 (speaker): 86, 40000000 (default): 71
   Devices: speaker
- STREAM_SYSTEM:
   Muted: false
   Min: 0
   Max: 7
   Current: 40000000 (default): 3
   Devices: speaker
- STREAM_RING:
   Muted: false
   Min: 0
   Max: 7
   Current: 40000000 (default): 3
   Devices: speaker
- STREAM_MUSIC:(Music流的音量信息,包括最大/最小音量/当前音量值信息,各种设备Music流的音量值信息,其它流的音量值信息类似)
   Muted: false
   Min: 0
   Max: 100
   Current: 2 (speaker): 86, 4 (headset): 10, 8 (headphone): 10, 4000000 (usb_headset): 25, 40000000 (default): 71
   Devices: speaker
- STREAM_ALARM:
   Muted: false
   Min: 1
   Max: 7
   Current: 40000000 (default): 3
   Devices: speaker
- STREAM_NOTIFICATION:
   Muted: false
   Min: 0
   Max: 7
   Current: 40000000 (default): 3
   Devices: speaker
- STREAM_BLUETOOTH_SCO:
   Muted: false
   Min: 0
   Max: 100
   Current: 2 (speaker): 13, 40000000 (default): 71
   Devices: speaker
- STREAM_SYSTEM_ENFORCED:
   Muted: false
   Min: 0
   Max: 7
   Current: 40000000 (default): 3
   Devices: speaker
- STREAM_DTMF:
   Muted: false
   Min: 0
   Max: 15
   Current: 2 (speaker): 13, 4 (headset): 11, 8 (headphone): 11, 4000000 (usb_headset): 11, 40000000 (default): 11
   Devices: speaker
- STREAM_TTS:
   Muted: false
   Min: 0
   Max: 15
   Current: 2 (speaker): 13, 4 (headset): 2, 8 (headphone): 2, 4000000 (usb_headset): 4, 40000000 (default): 11
   Devices: speaker
- STREAM_ACCESSIBILITY:
   Muted: false
   Min: 0
   Max: 100
   Current: 2 (speaker): 86, 4 (headset): 2, 8 (headphone): 2, 4000000 (usb_headset): 4, 40000000 (default): 11
   Devices: speaker

- mute affected streams = 0x2f

Ringer mode:
- mode (internal) = NORMAL
- mode (external) = NORMAL
- ringer mode affected streams = 0xa6 (STREAM_SYSTEM,STREAM_RING,STREAM_NOTIFICATION,STREAM_SYSTEM_ENFORCED)
- ringer mode muted streams = 0x0
- delegate = ZenModeHelper

Audio routes:
  mMainType=0x0
  mBluetoothName=null

Other state:
  mVolumeController=VolumeController(android.os.BinderProxy@4b00f85,mVisible=false)
  mSafeMediaVolumeState=SAFE_MEDIA_VOLUME_ACTIVE
  mSafeMediaVolumeIndex=100
  mSafeUsbMediaVolumeIndex=250
  mSafeUsbMediaVolumeDbfs=-37.0
  sIndependentA11yVolume=false
  mPendingVolumeCommand=null
  mMusicActiveMs=0
  mMcc=0
  mCameraSoundForced=false
  mHasVibrator=false
  mVolumePolicy=VolumePolicy[volumeDownToEnterSilent=false,volumeUpToExitSilent=false,doNotDisturbWhenSilent=false,vibrateToSilentDebounce=400]
  mAvrcpAbsVolSupported=false

Audio policies:
Audio event log: dynamic policy events (logged when command received by AudioService)

PlaybackActivityMonitor dump time: 10:17:16 AM

  playback listeners:
 (S)com.android.server.audio.PlaybackActivityMonitor$PlayMonitorClient@98f51da


  players:
  ID:15 -- type:android.media.SoundPool -- u/pid:1000/3826 -- state:idle -- attr:AudioAttributes: usage=USAGE_VOICE_COMMUNICATION content=CONTENT_TYPE_MOVIE flags=0x0 tags= bundle=null
  ID:23 -- type:android.media.SoundPool -- u/pid:1000/3826 -- state:idle -- attr:AudioAttributes: usage=USAGE_VOICE_COMMUNICATION content=CONTENT_TYPE_SPEECH flags=0x0 tags= bundle=null
  ID:31 -- type:android.media.SoundPool -- u/pid:1000/3826 -- state:idle -- attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x0 tags= bundle=null
  ID:39 -- type:android.media.SoundPool -- u/pid:10012/4074 -- state:idle -- attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x0 tags= bundle=null
  ID:63 -- type:OpenSL ES AudioPlayer (Buffer Queue) -- u/pid:10018/32500 -- state:started -- attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null

  ducked players piids:

  muted player piids:

  banned uids:

Audio event log: playback activity as reported through PlayerBase
11-25 08:00:20:771 new player piid:15 uid/pid:1000/3826 type:android.media.SoundPool attr:AudioAttributes: usage=USAGE_VOICE_COMMUNICATION content=CONTENT_TYPE_MOVIE flags=0x0 tags= bundle=null
11-25 08:00:20:772 new player piid:23 uid/pid:1000/3826 type:android.media.SoundPool attr:AudioAttributes: usage=USAGE_VOICE_COMMUNICATION content=CONTENT_TYPE_SPEECH flags=0x0 tags= bundle=null
05-06 17:25:25:917 new player piid:31 uid/pid:1000/3826 type:android.media.SoundPool attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x0 tags= bundle=null
05-06 17:25:26:365 new player piid:39 uid/pid:10012/4074 type:android.media.SoundPool attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x0 tags= bundle=null
05-07 09:30:39:611 new player piid:47 uid/pid:10032/5569 type:unknown attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
05-07 09:30:39:810 player piid:47 state:started
05-07 09:30:40:053 player piid:47 state:stopped
05-07 09:30:40:053 releasing player piid:47
05-07 10:16:33:927 new player piid:55 uid/pid:10018/32500 type:OpenSL ES AudioPlayer (Buffer Queue) attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
05-07 10:16:33:930 player piid:55 state:started
05-07 10:16:35:059 player piid:55 state:stopped
05-07 10:16:35:153 player piid:55 state:started
05-07 10:16:46:842 player piid:55 state:stopped
05-07 10:16:51:882 releasing player piid:55
05-07 10:17:04:336 new player piid:63 uid/pid:10018/32500 type:OpenSL ES AudioPlayer (Buffer Queue) attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
05-07 10:17:04:338 player piid:63 state:started
05-07 10:17:05:226 player piid:63 state:stopped
05-07 10:17:05:314 player piid:63 state:started

RecordActivityMonitor dump time: 10:17:16 AM


Audio event log: recording activity as reported through AudioSystem.AudioRecordingCallback

Event logs:
Audio event log: phone state (logged after successfull call to AudioSystem.setPhoneState(int))
05-07 09:30:39:618 setMode(MODE_IN_COMMUNICATION) from package=us.zoom.zoompresence pid=5569 selected mode=MODE_IN_COMMUNICATION by pid=5569


Audio event log: wired device connection (logged before onSetWiredDeviceConnectionState() is executed)(有线设备的插拔记录,下面是插/拔USB有线耳机后的操作记录)
05-06 17:25:26:333 setWiredDeviceConnectionState( type:80001000 state:DEVICE_STATE_AVAILABLE addr:card=1;device=0; name:USB-Audio - DTEN Android Mic 27) from UsbAlsaDevice
05-06 17:25:31:626 setWiredDeviceConnectionState( type:400 state:DEVICE_STATE_AVAILABLE addr: name:) from com.droidlogic

05-07 10:39:20:905 setWiredDeviceConnectionState( type:4000000 state:DEVICE_STATE_AVAILABLE addr:card=2;device=0; name:USB-Audio - USB Audio) from UsbAlsaDevice
05-07 10:39:21:539 setWiredDeviceConnectionState( type:82000000 state:DEVICE_STATE_AVAILABLE addr:card=2;device=0; name:USB-Audio - USB Audio) from UsbAlsaDevice
05-07 10:39:58:802 setWiredDeviceConnectionState( type:4000000 state:DEVICE_STATE_UNAVAILABLE addr:card=2;device=0; name:USB-Audio - USB Audio) from UsbAlsaDevice
05-07 10:39:58:832 setWiredDeviceConnectionState( type:82000000 state:DEVICE_STATE_UNAVAILABLE addr:card=2;device=0; name:USB-Audio - USB Audio) from UsbAlsaDevice
05-07 10:39:58:861 setWiredDeviceConnectionState( type:80001000 state:DEVICE_STATE_AVAILABLE addr:card=1;device=0; name:USB-Audio - DTEN Android Mic 27) from UsbAlsaDevice


Audio event log: force use (logged before setForceUse() is executed)
11-25 08:00:20:720 setForceUse(FOR_SYSTEM, FORCE_NONE) due to AudioService ctor
11-25 08:00:20:721 setForceUse(FOR_DOCK, FORCE_ANALOG_DOCK) due to readDockAudioSettings
11-25 08:00:20:723 setForceUse(FOR_ENCODED_SURROUND, FORCE_NONE) due to readPersistedSettings
11-25 08:00:20:736 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:1000/3826
05-06 17:25:26:332 setForceUse(FOR_COMMUNICATION, FORCE_NONE) due to resetBluetoothSco
05-06 17:25:26:333 setForceUse(FOR_RECORD, FORCE_NONE) due to resetBluetoothSco
05-06 17:25:26:333 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:1000/3826
05-06 17:25:31:613 setForceUse(FOR_DOCK, FORCE_ANALOG_DOCK) due to readDockAudioSettings
05-06 17:25:31:613 setForceUse(FOR_ENCODED_SURROUND, FORCE_NONE) due to readPersistedSettings
05-06 17:25:31:613 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:1000/3826
05-06 17:25:31:627 setForceUse(FOR_DOCK, FORCE_ANALOG_DOCK) due to readDockAudioSettings
05-06 17:25:31:627 setForceUse(FOR_COMMUNICATION, FORCE_NONE) due to resetBluetoothSco
05-06 17:25:31:628 setForceUse(FOR_RECORD, FORCE_NONE) due to resetBluetoothSco
05-06 17:25:31:628 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:1000/3826
05-06 17:25:31:628 setForceUse(FOR_DOCK, FORCE_ANALOG_DOCK) due to readDockAudioSettings
05-06 17:25:31:628 setForceUse(FOR_ENCODED_SURROUND, FORCE_NONE) due to SettingsObserver
05-07 09:30:39:621 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:10032/5569
05-07 09:30:39:622 setForceUse(FOR_COMMUNICATION, FORCE_SPEAKER) due to setSpeakerphoneOn(true) from u/pid:10032/5569


Audio event log: volume changes (logged when command received by AudioService)
05-06 17:25:26:307 setStreamVolume(stream:STREAM_MUSIC index:87 flags:0x4) from android
05-06 17:25:26:313 setStreamVolume(stream:STREAM_VOICE_CALL index:87 flags:0x4) from android
05-06 17:25:26:314 setStreamVolume(stream:STREAM_BLUETOOTH_SCO index:13 flags:0x4) from android
05-07 09:30:40:108 setStreamVolume(stream:STREAM_VOICE_CALL index:86 flags:0x0) from us.zoom.zoompresence
05-07 09:30:40:112 setStreamVolume(stream:STREAM_MUSIC index:86 flags:0x0) from us.zoom.zoompresence
05-07 09:30:40:213 setStreamVolume(stream:STREAM_BLUETOOTH_SCO index:13 flags:0x4) from android
dten_s27:/ #

============================================================

msm8953_64:/ $ dumpsys media.audio_flinger
Library audio_pre_processing
  Noise Suppression / Qualcomm Fluence
    UUID: 1d97bb0b-9e2f-4403-9ae3-58c2554306f8
    TYPE: 58b4b260-8e06-11e0-aa8e-0002a5d5c51b
    apiVersion: 00020000
    flags: 00000203
  Acoustic Echo Canceler / Qualcomm Fluence
    UUID: 0f8d0d2a-59e5-45fe-b6e4-248c8a799109
    TYPE: 7b491460-8d4d-11e0-bd61-0002a5d5c51b
    apiVersion: 00020000
    flags: 00000203
Library offload_bundle
  (no effects)
Library proxy
  Visualizer / The Android Open Source Project
    UUID: 1d0a1a53-7d5d-48f2-8e71-27fbd10d842c
    TYPE: e46b26a0-dddd-11db-8afd-0002a5d5c51b
    apiVersion: 00020000
    flags: 00400008
  Qualcomm Technologies Insert Preset Reverb / Qualcomm Technologies, Inc.
    UUID: f3e178d2-ebcb-408e-8357-0002a5d5c51b
    TYPE: 47382d60-ddd8-11db-bf3a-0002a5d5c51b
    apiVersion: 00020000
    flags: 00400088
  Qualcomm Technologies Auxiliary Preset Reverb / Qualcomm Technologies, Inc.
    UUID: 1b78f587-6d1c-422e-8b84-0002a5d5c51b
    TYPE: 47382d60-ddd8-11db-bf3a-0002a5d5c51b
    apiVersion: 00020000
    flags: 00400001
  Qualcomm Technologies Insert Environmental Reverb / Qualcomm Technologies, Inc.
    UUID: b707403a-a1c1-4291-9573-0002a5d5c51b
    TYPE: c2e5d5f0-94bd-4763-9cac-4e234d06839e
    apiVersion: 00020000
    flags: 00400088
  Qualcomm Technologies Auxiliary Environmental Reverb / Qualcomm Technologies, Inc.
    UUID: 48404ac9-d202-4ccc-bf84-0002a5d5c51b
    TYPE: c2e5d5f0-94bd-4763-9cac-4e234d06839e
    apiVersion: 00020000
    flags: 00400001
  Equalizer / NXP Software Ltd.
    UUID: c8e70ecd-48ca-456e-8a4f-0002a5d5c51b
    TYPE: 0bed4300-ddd6-11db-8f34-0002a5d5c51b
    apiVersion: 00020000
    flags: 00400048
  Qualcomm Technologies Virtualizer / Qualcomm Technologies, Inc.
    UUID: d3467faa-acc7-4d34-acaf-0002a5d5c51b
    TYPE: 37cc2c00-dddd-11db-8577-0002a5d5c51b
    apiVersion: 00020000
    flags: 00400290
  Qualcomm Technologies Bass Boost / Qualcomm Technologies, Inc.
    UUID: 14804144-a5ee-4d24-aa88-0002a5d5c51b
    TYPE: 0634f220-ddd4-11db-a0fc-0002a5d5c51b
    apiVersion: 00020000
    flags: 00400290
Library loudness_enhancer
  Loudness Enhancer / The Android Open Source Project
    UUID: fa415329-2034-4bea-b5dc-5b381c8d1e2c
    TYPE: fe3199be-aed0-413f-87bb-11260eb63cf1
    apiVersion: 00020000
    flags: 00000008
Library downmix
  Multichannel Downmix To Stereo / The Android Open Source Project
    UUID: 93f04452-e4fe-41cc-91f9-e475b6d1d69f
    TYPE: 381e49cc-a858-4aa2-87f6-e8388e7601b2
    apiVersion: 00020000
    flags: 00000008
Library visualizer_hw
  (no effects)
Library visualizer_sw
  (no effects)
Library qcreverb
  (no effects)
Library qcvirt
  (no effects)
Library qcbassboost
  (no effects)
Library reverb
  (no effects)
Library bundle
  Volume / NXP Software Ltd.
    UUID: 119341a0-8469-11df-81f9-0002a5d5c51b
    TYPE: 09e8ede0-ddde-11db-b4f6-0002a5d5c51b
    apiVersion: 00020000
    flags: 00000050
Clients:(播放过音频流的应用程序列表,通过pid去查找包名即可知道应用名称)
  pid: 1912
  pid: 2751
  pid: 3190
Notification Clients:
  pid: 609
  pid: 623
  pid: 1151
  pid: 1698
  pid: 1912
  pid: 2374
  pid: 2751
  pid: 2831
  pid: 3190
  pid: 3651
Global session refs:
  session   pid count(通过AudioTrack对象播放音频流时向AudioFlinger申请的AudioSessionID,以及应用程序和他们的对应关系)
        9  1912     1
       17  2751     1
       65  3190     1
       89  3190     1
       97  3190     1
      113  2751     1
Hardware status: 0
Standby Time mSec: 3000

Output thread 0xe7383680 type 0 (MIXER):(四种回放线程中的一种MixThread,该线程中的音频流都会进行混音操作)
  Thread name: AudioOut_D
  I/O handle: 13(Audio输出流通道在系统中的句柄,系统加载硬件模块的时候会给所有的输出流通道分配一个固定唯一的句柄,后续系统通过这个句柄去访问该音频流通道,后续打印出来的audio_policy中的输出流通道的句柄是对应的)
  TID: 929
  Standby: yes
  Sample rate: 48000 Hz(音频数据的采样率)
  HAL frame count: 192(HAL层支持的最小音频帧数)
  HAL format: 0x1 (pcm16)(HAL层支持的音频采用位数,还有32位)
  HAL buffer size: 768 bytes(HAL层支持的一次性处理的音频数据量)
  Channel count: 2(音轨数量,这里是双声道,还可能是单声道)
  Channel mask: 0x00000003 (front-left, front-right)
  Processing format: 0x5 (pcmfloat)
  Processing frame size: 8 bytes
  Pending config events: none
  Output device: 0x20000 (LINE)(Audio硬件模块的名称)
  Input device: 0 (NONE)
  Audio source: 0 (default)
  Normal frame count: 960
  Last write occurred (msecs): 2178799
  Total writes: 369
  Delayed writes: 0
  Blocked in write: no
  Suspend count: 0
  Sink buffer : 0xe73d4000
  Mixer buffer: 0xe79fd000
  Effect buffer: 0xe79ff000
  Fast track availMask=0xfc
  Standby delay ns=3000000000
  AudioStreamOut: 0xe83c8150 flags 0x6 (PRIMARY|FAST)(车载设备上通常该线程处理的是导航语音播到类的音频流)
  Frames written: 354240
  Suspended frames: 0
  PipeSink frames written: 354240
  Hal stream dump:
  Thread throttle time (msecs): 0
  AudioMixer tracks: 0x00000001
  Master mono: off
  FastMixer command=COLD_IDLE writeSequence=3694 framesWritten=354624
            numTracks=1 writeErrors=0 underruns=0 overruns=1
            sampleRate=48000 frameCount=192 measuredWarmup=18.5 ms, warmupCycles=5
            mixPeriod=4.00 ms
  Simple moving statistics over last 7.4 seconds:
    wall clock time in ms per mix cycle:
      mean=4.00 min=1.64 max=6.52 stddev=0.19
    raw CPU load in us per mix cycle:
      mean=104 min=0 max=338 stddev=44
  Distribution of mix cycle times in ms for the tails (> ~3 stddev outliers):
    left tail: mean=1.64 min=1.64 max=1.64 stddev=nan
    right tail: mean=6.52 min=6.52 max=6.52 stddev=nan
  Fast tracks: sMaxFastTracks=8 activeMask=0x1
  Index Active Full Partial Empty  Recent Ready    Written
      0    yes  818       0     0    full   768     353472
      1     no    0       0     0    full     0          0
      2     no    0       0     0    full     0          0
      3     no    0       0     0    full     0          0
      4     no    0       0     0    full     0          0
      5     no    0       0     0    full     0          0
      6     no    0       0     0    full     0          0
      7     no    0       0     0    full     0          0
  Stream volumes in dB: 0:-11, 1:-10, 2:-10, 3:0, 4:-10, 5:-10, 6:0, 7:-10, 8:-10, 9:-96, 10:0, 11:0, 12:0
  Normal mixer raw underrun counters: partial=0 empty=0
  1 Tracks of which 0 are active(该线程中处理的音频流列表,各个音频流的详细信息,如果当前线程中有活跃的音频流那么会有一行 其active列的值为 yes)
    Name Active Client Type      Fmt Chn mask Session fCount S F SRate  L dB  R dB    Server Main buf  Aux Buf Flags UndFrmCnt
    F  1     no   1912    0 00000001 00000001       9    960 I 0 48000   -10   -10  00000000 0xe73d4000 0x0 0x000         0 
  0 Effect Chains

Output thread 0xe6f83ec0 type 0 (MIXER):
  Thread name: AudioOut_15
  I/O handle: 21
  TID: 933
  Standby: yes
  Sample rate: 48000 Hz
  HAL frame count: 192
  HAL format: 0x1 (pcm16)
  HAL buffer size: 768 bytes
  Channel count: 2
  Channel mask: 0x00000003 (front-left, front-right)
  Processing format: 0x5 (pcmfloat)
  Processing frame size: 8 bytes
  Pending config events: none
  Output device: 0 (NONE)
  Input device: 0 (NONE)
  Audio source: 0 (default)
  Normal frame count: 960
  Last write occurred (msecs): 2492096
  Total writes: 0
  Delayed writes: 0
  Blocked in write: no
  Suspend count: 0
  Sink buffer : 0xe73d8000
  Mixer buffer: 0xe73d6000
  Effect buffer: 0xe73e6000
  Fast track availMask=0xfe
  Standby delay ns=3000000000
  AudioStreamOut: 0xe83c8268 flags 0x104 (FAST|RAW)
  Frames written: 0
  Suspended frames: 0
  PipeSink frames written: 0
  Hal stream dump:
  Thread throttle time (msecs): 0
  AudioMixer tracks: 0x00000000
  Master mono: off
  FastMixer command=COLD_IDLE writeSequence=0 framesWritten=0
            numTracks=0 writeErrors=0 underruns=0 overruns=0
            sampleRate=0 frameCount=0 measuredWarmup=0 ms, warmupCycles=0
            mixPeriod=nan ms
  No FastMixer statistics available currently
  Fast tracks: sMaxFastTracks=8 activeMask=0
  Index Active Full Partial Empty  Recent Ready    Written
      0     no    0       0     0    full     0          0
      1     no    0       0     0    full     0          0
      2     no    0       0     0    full     0          0
      3     no    0       0     0    full     0          0
      4     no    0       0     0    full     0          0
      5     no    0       0     0    full     0          0
      6     no    0       0     0    full     0          0
      7     no    0       0     0    full     0          0
  Stream volumes in dB: 0:-5.9, 1:-6, 2:0, 3:0, 4:0, 5:0, 6:0, 7:-6, 8:-6, 9:0, 10:0, 11:0, 12:0
  Normal mixer raw underrun counters: partial=0 empty=0
  0 Tracks
  0 Effect Chains

Output thread 0xe6c833c0 type 0 (MIXER):
  Thread name: AudioOut_1D
  I/O handle: 29
  TID: 935
  Standby: yes
  Sample rate: 48000 Hz
  HAL frame count: 1920
  HAL format: 0x1 (pcm16)
  HAL buffer size: 7680 bytes
  Channel count: 2
  Channel mask: 0x00000003 (front-left, front-right)
  Processing format: 0x1 (pcm16)
  Processing frame size: 4 bytes
  Pending config events: none
  Output device: 0x20000 (LINE)
  Input device: 0 (NONE)
  Audio source: 0 (default)
  Normal frame count: 1920
  Last write occurred (msecs): 1087537
  Total writes: 4905
  Delayed writes: 0
  Blocked in write: no
  Suspend count: 0
  Sink buffer : 0xe73da000
  Mixer buffer: 0xe83d8000
  Effect buffer: 0xe73dc000
  Fast track availMask=0xfe
  Standby delay ns=3000000000
  AudioStreamOut: 0xe83c82a0 flags 0x8 (DEEP_BUFFER)(通常处理的是音乐类型的音频流,音乐软件播放的音频流通常是在该线程中处理)
  Frames written: 9417600
  Suspended frames: 0
  Hal stream dump:
  Thread throttle time (msecs): 106
  AudioMixer tracks: 0x00000003
  Master mono: off
  FastMixer not initialized
  Stream volumes in dB: 0:-11, 1:-10, 2:-10, 3:0, 4:-10, 5:-10, 6:0, 7:-10, 8:-10, 9:-96, 10:0, 11:0, 12:0
  Normal mixer raw underrun counters: partial=0 empty=0
  2 Tracks of which 0 are active
    Name Active Client Type      Fmt Chn mask Session fCount S F SRate  L dB  R dB    Server Main buf  Aux Buf Flags UndFrmCnt
       1     no   3190    3 00000001 00000003      97   7088 I 0 22050     0     0  00000000 0xe73da000 0x0 0x000         0 
       0     no   3190    3 00000001 00000003      89   7072 P 3 44100     0     0  004FF80C 0xe73da000 0x0 0x600      1768 
  0 Effect Chains

Output thread 0xe6b03140 type 0 (MIXER):
  Thread name: AudioOut_25
  I/O handle: 37
  TID: 938
  Standby: yes
  Sample rate: 48000 Hz
  HAL frame count: 768
  HAL format: 0x1 (pcm16)
  HAL buffer size: 3072 bytes
  Channel count: 2
  Channel mask: 0x00000003 (front-left, front-right)
  Processing format: 0x5 (pcmfloat)
  Processing frame size: 8 bytes
  Pending config events: none
  Output device: 0 (NONE)
  Input device: 0 (NONE)
  Audio source: 0 (default)
  Normal frame count: 1152
  Last write occurred (msecs): 2492100
  Total writes: 0
  Delayed writes: 0
  Blocked in write: no
  Suspend count: 0
  Sink buffer : 0xe6b56800
  Mixer buffer: 0xe6b54000
  Effect buffer: 0xe7afb400
  Fast track availMask=0xfe
  Standby delay ns=3000000000
  AudioStreamOut: 0xe83c8460 flags 0 (NONE)
  Frames written: 0
  Suspended frames: 0
  PipeSink frames written: 0
  Hal stream dump:
  Thread throttle time (msecs): 0
  AudioMixer tracks: 0x00000000
  Master mono: off
  FastMixer command=COLD_IDLE writeSequence=0 framesWritten=0
            numTracks=0 writeErrors=0 underruns=0 overruns=0
            sampleRate=0 frameCount=0 measuredWarmup=0 ms, warmupCycles=0
            mixPeriod=nan ms
  No FastMixer statistics available currently
  Fast tracks: sMaxFastTracks=8 activeMask=0
  Index Active Full Partial Empty  Recent Ready    Written
      0     no    0       0     0    full     0          0
      1     no    0       0     0    full     0          0
      2     no    0       0     0    full     0          0
      3     no    0       0     0    full     0          0
      4     no    0       0     0    full     0          0
      5     no    0       0     0    full     0          0
      6     no    0       0     0    full     0          0
      7     no    0       0     0    full     0          0
  Stream volumes in dB: 0:-5.9, 1:-6, 2:0, 3:0, 4:0, 5:0, 6:0, 7:-6, 8:-6, 9:0, 10:0, 11:0, 12:0
  Normal mixer raw underrun counters: partial=0 empty=0
  0 Tracks
  0 Effect Chains

Output thread 0xe73de000 type 1 (DIRECT):(四种回放线程中的一种,DirectOutputThread直接输出线程,该线程专门处理不需要解码的音频流,直接向Audio硬件输出音频数据即可)
  Thread name: AudioOut_5D
  I/O handle: 93
  TID: 6270
  Standby: yes
  Sample rate: 16000 Hz
  HAL frame count: 640
  HAL format: 0x1 (pcm16)
  HAL buffer size: 1280 bytes
  Channel count: 1
  Channel mask: 0x00000001 (front-left)
  Processing format: 0x1 (pcm16)
  Processing frame size: 2 bytes
  Pending config events: none
  Output device: 0x20000 (LINE)
  Input device: 0 (NONE)
  Audio source: 0 (default)
  Normal frame count: 640
  Last write occurred (msecs): 1099483
  Total writes: 43
  Delayed writes: 0
  Blocked in write: no
  Suspend count: 0
  Sink buffer : 0xe8387200
  Mixer buffer: 0xe83e7a00
  Effect buffer: 0xe8387700
  Fast track availMask=0xfe
  Standby delay ns=1000000000
  AudioStreamOut: 0xe83c8620 flags 0x2001 (DIRECT|0x2000)
  Frames written: 27197
  Suspended frames: 0
  Hal stream dump:
  Stream volumes in dB: 0:-11, 1:-10, 2:-10, 3:0, 4:-10, 5:-10, 6:0, 7:-10, 8:-10, 9:-96, 10:0, 11:0, 12:0
  Normal mixer raw underrun counters: partial=0 empty=0
  1 Tracks of which 0 are active
    Name Active Client Type      Fmt Chn mask Session fCount S F SRate  L dB  R dB    Server Main buf  Aux Buf Flags UndFrmCnt
    none     no   2751    3 00000001 00000001     113   1288 S 1 16000     0     0  00002E3D 0xe8387200 0x0 0x601       323 
  0 Effect Chains

Input thread 0xe6783b00:
  Thread name: AudioIn_36
  I/O handle: 54
  TID: 3298
  Standby: no
  Sample rate: 16000 Hz
  HAL frame count: 320
  HAL format: 0x1 (pcm16)
  HAL buffer size: 2560 bytes
  Channel count: 4
  Channel mask: 0x8000000f (index mask, bits:0xf)
  Processing format: 0x1 (pcm16)
  Processing frame size: 8 bytes
  Pending config events: none
  Output device: 0x20000 (LINE)
  Input device: 0x80000004 (BUILTIN_MIC)
  Audio source: 1 (mic)
  Fast capture thread: no
  Fast track available: no
  FastCapture not initialized
  1 Tracks of which 1 are active(由于我司的小智语音助手开着因此Mic始终是开着的,等待着音频的输入)
    Active Client Fmt Chn mask Session S   Server fCount SRate
       yes   2751   1 8000000F      17 6 0255C600    960 16000
  0 Effect Chains

USB audio module:
  No output streams.

  No input streams.

Reroute submix audio module:
 route[0] rate in=0 out=0, addr=[]
 route[1] rate in=0 out=0, addr=[]
 route[2] rate in=0 out=0, addr=[]
 route[3] rate in=0 out=0, addr=[]
 route[4] rate in=0 out=0, addr=[]
 route[5] rate in=0 out=0, addr=[]
 route[6] rate in=0 out=0, addr=[]
 route[7] rate in=0 out=0, addr=[]
 route[8] rate in=0 out=0, addr=[]
 route[9] rate in=48000 out=48000, addr=[]

============================================================

msm8953_64:/ $ dumpsys media.audio_policy
AudioPolicyManager: 0xe83be200
Command Thread: 0xe83aaba0
Tones Thread: 0xe83aab40
AudioCommandThread 0xe83aaba0 Dump
- Commands:
   Command Time        Wait pParam
  Last Command
   02      001390.879  0    0xe702c198
AudioCommandThread 0xe83aab40 Dump
- Commands:
   Command Time        Wait pParam
  Last Command
     none

AudioPolicyManager Dump: 0xe83be200
 Primary Output: 13
 Phone state: 0
 Force use for communications 0
 Force use for media 10
 Force use for record 0
 Force use for dock 8
 Force use for system 0
 Force use for hdmi system audio 0
 Force use for encoded surround output 0
 TTS output not available
 Master mono: off
- Available output devices:(可用的输出设备列表)
  Device 1:
  - id:  1
  - tag name: Earpiece(听筒,下面是它支持的音频流的详细参数,有采样格式,采样率,声道数等)
  - type: AUDIO_DEVICE_OUT_EARPIECE                       
  - Profiles:
      Profile 0:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:48000
          - channel masks:0x0010
  Device 2:
  - id:  2
  - tag name: Speaker(扩音器,下面是它支持的音频流的详细参数,有采样格式,采样率,声道数等)
  - type: AUDIO_DEVICE_OUT_SPEAKER                        
  - Profiles:
      Profile 0:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:48000
          - channel masks:0x0003
  Device 3:
  - id: 13
  - tag name: Line(外放耳机,我们车载系统选择它作为主要的输出通道,下面是它支持的音频流的详细参数,有采样格式,采样率,声道数等)
  - type: AUDIO_DEVICE_OUT_LINE                           
  - Profiles:
      Profile 0:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:48000
          - channel masks:0x0003
  Device 4:
  - id:  6
  - tag name: Telephony Tx(通话设备,下面是它支持的音频流的详细参数,有采样格式,采样率,声道数等)
  - type: AUDIO_DEVICE_OUT_TELEPHONY_TX                   
  - Profiles:
      Profile 0:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:8000, 16000
          - channel masks:0x0001, 0x0003
- Available input devices:(可用的输入设备列表)
  Device 1:
  - id: 10
  - tag name: Built-In Mic(前置Mic,下面是它支持的输入的音频流的详细参数,有采样格式,采样率,声道数等)
  - type: AUDIO_DEVICE_IN_BUILTIN_MIC             
  - Profiles:
      Profile 0:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
          - channel masks:0x000c, 0x0010, 0x0030
      Profile 1:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
          - channel masks:0x000c, 0x0010, 0x0030, 0x00fc, 0x80000007, 0x8000000f
  Device 2:
  - id: 11
  - tag name: Built-In Back Mic(后置Mic,下面是它支持的输入的音频流的详细参数,有采样格式,采样率,声道数等)
  - type: AUDIO_DEVICE_IN_BACK_MIC                        
  - Profiles:
      Profile 0:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
          - channel masks:0x000c, 0x0010, 0x0030
      Profile 1:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
          - channel masks:0x000c, 0x0010, 0x0030, 0x00fc, 0x80000007, 0x8000000f
  Device 3:
  - id:  8
  - tag name: FM Tuner(FM设备,下面是它支持的输入的音频流的详细参数,有采样格式,采样率,声道数等)
  - type: AUDIO_DEVICE_IN_FM_TUNER                        
  - Profiles:
      Profile 0:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:48000
          - channel masks:0x000c, 0x0010
      Profile 1:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
          - channel masks:0x000c, 0x0010, 0x0030
  Device 4:
  - id:  9
  - tag name: Telephony Rx(通话输入设备,下面是它支持的输入的音频流的详细参数,有采样格式,采样率,声道数等)
  - type: AUDIO_DEVICE_IN_TELEPHONY_RX                    
  - Profiles:
      Profile 0:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:8000, 16000, 48000
          - channel masks:0x0010
      Profile 1:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
          - channel masks:0x000c, 0x0010, 0x0030
  Device 5:
  - id: 12
  - tag name: Remote Submix In(远程输入设备,下面是它支持的输入的音频流的详细参数,有采样格式,采样率,声道数等)
  - type: AUDIO_DEVICE_IN_REMOTE_SUBMIX                   
  - address: 0                               
  - Profiles:
      Profile 0:
          - format: AUDIO_FORMAT_PCM_16_BIT
          - sampling rates:48000
          - channel masks:0x000c

HW Modules dump:
- HW Module 1:
  - name: primary(Audio主要的输入/输出硬件模块)
  - handle: 10
  - version: 2.0
  - outputs:
    output 0:
    - name: primary output
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0003
    - flags: 0x0006
    - Supported devices:
      Device 1:
      - id:  1
      - tag name: Earpiece
      - type: AUDIO_DEVICE_OUT_EARPIECE                       
      Device 2:
      - id:  2
      - tag name: Speaker
      - type: AUDIO_DEVICE_OUT_SPEAKER                        
      Device 3:
      - tag name: Wired Headset
      - type: AUDIO_DEVICE_OUT_WIRED_HEADSET                  
      Device 4:
      - tag name: Wired Headphones
      - type: AUDIO_DEVICE_OUT_WIRED_HEADPHONE                
      Device 5:
      - id: 13
      - tag name: Line
      - type: AUDIO_DEVICE_OUT_LINE                           
      Device 6:
      - tag name: BT SCO All
      - type: AUDIO_DEVICE_OUT_ALL_SCO                        
      Device 7:
      - tag name: HDMI
      - type: AUDIO_DEVICE_OUT_AUX_DIGITAL                    
      Device 8:
      - tag name: Proxy
      - type: AUDIO_DEVICE_OUT_PROXY                          
      Device 9:
      - tag name: FM
      - type: AUDIO_DEVICE_OUT_FM                             
    output 1:
    - name: raw
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0003
    - flags: 0x0104
    - Supported devices:
      Device 1:
      - id:  1
      - tag name: Earpiece
      - type: AUDIO_DEVICE_OUT_EARPIECE                       
      Device 2:
      - id:  2
      - tag name: Speaker
      - type: AUDIO_DEVICE_OUT_SPEAKER                        
      Device 3:
      - tag name: Wired Headset
      - type: AUDIO_DEVICE_OUT_WIRED_HEADSET                  
      Device 4:
      - tag name: Wired Headphones
      - type: AUDIO_DEVICE_OUT_WIRED_HEADPHONE                
      Device 5:
      - id: 13
      - tag name: Line
      - type: AUDIO_DEVICE_OUT_LINE                           
      Device 6:
      - tag name: BT SCO All
      - type: AUDIO_DEVICE_OUT_ALL_SCO                        
      Device 7:
      - tag name: HDMI
      - type: AUDIO_DEVICE_OUT_AUX_DIGITAL                    
      Device 8:
      - tag name: Proxy
      - type: AUDIO_DEVICE_OUT_PROXY                          
    output 2:
    - name: deep_buffer
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0003
    - flags: 0x0008
    - Supported devices:
      Device 1:
      - id:  1
      - tag name: Earpiece
      - type: AUDIO_DEVICE_OUT_EARPIECE                       
      Device 2:
      - id:  2
      - tag name: Speaker
      - type: AUDIO_DEVICE_OUT_SPEAKER                        
      Device 3:
      - tag name: Wired Headset
      - type: AUDIO_DEVICE_OUT_WIRED_HEADSET                  
      Device 4:
      - tag name: Wired Headphones
      - type: AUDIO_DEVICE_OUT_WIRED_HEADPHONE                
      Device 5:
      - id: 13
      - tag name: Line
      - type: AUDIO_DEVICE_OUT_LINE                           
      Device 6:
      - tag name: BT SCO All
      - type: AUDIO_DEVICE_OUT_ALL_SCO                        
      Device 7:
      - tag name: HDMI
      - type: AUDIO_DEVICE_OUT_AUX_DIGITAL                    
      Device 8:
      - tag name: Proxy
      - type: AUDIO_DEVICE_OUT_PROXY                          
    output 3:
    - name: multichannel
    - Profiles:
        Profile 0:[dynamic channels]
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
    - flags: 0x0001
    - Supported devices:
      Device 1:
      - tag name: HDMI
      - type: AUDIO_DEVICE_OUT_AUX_DIGITAL                    
      Device 2:
      - tag name: Proxy
      - type: AUDIO_DEVICE_OUT_PROXY                          
    output 4:
    - name: direct_pcm
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
            - channel masks:0x0001, 0x0003, 0x0007, 0x0033, 0x0037, 0x003f, 0x013f, 0x063f
        Profile 1:
            - format: AUDIO_FORMAT_PCM_8_24_BIT
            - sampling rates:8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
            - channel masks:0x0001, 0x0003, 0x0007, 0x0033, 0x0037, 0x003f, 0x013f, 0x063f
        Profile 2:
            - format: AUDIO_FORMAT_PCM_24_BIT_PACKED
            - sampling rates:8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
            - channel masks:0x0001, 0x0003, 0x0007, 0x0033, 0x0037, 0x003f, 0x013f, 0x063f
    - flags: 0x2001
    - Supported devices:
      Device 1:
      - id:  1
      - tag name: Earpiece
      - type: AUDIO_DEVICE_OUT_EARPIECE                       
      Device 2:
      - id:  2
      - tag name: Speaker
      - type: AUDIO_DEVICE_OUT_SPEAKER                        
      Device 3:
      - tag name: Wired Headset
      - type: AUDIO_DEVICE_OUT_WIRED_HEADSET                  
      Device 4:
      - tag name: Wired Headphones
      - type: AUDIO_DEVICE_OUT_WIRED_HEADPHONE                
      Device 5:
      - id: 13
      - tag name: Line
      - type: AUDIO_DEVICE_OUT_LINE                           
      Device 6:
      - tag name: BT SCO All
      - type: AUDIO_DEVICE_OUT_ALL_SCO                        
      Device 7:
      - tag name: HDMI
      - type: AUDIO_DEVICE_OUT_AUX_DIGITAL                    
      Device 8:
      - tag name: Proxy
      - type: AUDIO_DEVICE_OUT_PROXY                          
    output 5:
    - name: compressed_offload
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_MP3
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x0001, 0x0003
        Profile 1:
            - format: AUDIO_FORMAT_FLAC
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
            - channel masks:0x0001, 0x0003
        Profile 2:
            - format: AUDIO_FORMAT_ALAC
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
            - channel masks:0x0001, 0x0003, 0x0007, 0x0033, 0x0037, 0x003f, 0x013f, 0x063f
        Profile 3:
            - format: AUDIO_FORMAT_APE
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
            - channel masks:0x0001, 0x0003
        Profile 4:
            - format: AUDIO_FORMAT_AAC_LC
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000
            - channel masks:0x0001, 0x0003
        Profile 5:
            - format: AUDIO_FORMAT_AAC_HE_V1
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000
            - channel masks:0x0001, 0x0003
        Profile 6:
            - format: AUDIO_FORMAT_AAC_HE_V2
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000
            - channel masks:0x0001, 0x0003
        Profile 7:
            - format: AUDIO_FORMAT_WMA
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x0001, 0x0003, 0x0007, 0x0033, 0x0037, 0x003f, 0x013f, 0x063f
        Profile 8:
            - format: AUDIO_FORMAT_WMA_PRO
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000
            - channel masks:0x0001, 0x0003, 0x0007, 0x0033, 0x0037, 0x003f, 0x013f, 0x063f
        Profile 9:
            - format: AUDIO_FORMAT_VORBIS
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
            - channel masks:0x0001, 0x0003
        Profile 10:
            - format: AUDIO_FORMAT_AAC_ADTS_LC
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000
            - channel masks:0x0001, 0x0003
        Profile 11:
            - format: AUDIO_FORMAT_AAC_ADTS_HE_V1
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000
            - channel masks:0x0001, 0x0003
        Profile 12:
            - format: AUDIO_FORMAT_AAC_ADTS_HE_V2
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000
            - channel masks:0x0001, 0x0003
    - flags: 0x0031
    - Supported devices:
      Device 1:
      - id:  1
      - tag name: Earpiece
      - type: AUDIO_DEVICE_OUT_EARPIECE                       
      Device 2:
      - id:  2
      - tag name: Speaker
      - type: AUDIO_DEVICE_OUT_SPEAKER                        
      Device 3:
      - tag name: Wired Headset
      - type: AUDIO_DEVICE_OUT_WIRED_HEADSET                  
      Device 4:
      - tag name: Wired Headphones
      - type: AUDIO_DEVICE_OUT_WIRED_HEADPHONE                
      Device 5:
      - id: 13
      - tag name: Line
      - type: AUDIO_DEVICE_OUT_LINE                           
      Device 6:
      - tag name: BT SCO All
      - type: AUDIO_DEVICE_OUT_ALL_SCO                        
      Device 7:
      - tag name: HDMI
      - type: AUDIO_DEVICE_OUT_AUX_DIGITAL                    
      Device 8:
      - tag name: Proxy
      - type: AUDIO_DEVICE_OUT_PROXY                          
    output 6:
    - name: voice_tx
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000, 48000
            - channel masks:0x0001, 0x0003
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - id:  6
      - tag name: Telephony Tx
      - type: AUDIO_DEVICE_OUT_TELEPHONY_TX                   
    output 7:
    - name: voip_rx
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000
            - channel masks:0x0001
    - flags: 0x0801
    - Supported devices:
      Device 1:
      - id:  1
      - tag name: Earpiece
      - type: AUDIO_DEVICE_OUT_EARPIECE                       
      Device 2:
      - id:  2
      - tag name: Speaker
      - type: AUDIO_DEVICE_OUT_SPEAKER                        
      Device 3:
      - tag name: Wired Headset
      - type: AUDIO_DEVICE_OUT_WIRED_HEADSET                  
      Device 4:
      - tag name: Wired Headphones
      - type: AUDIO_DEVICE_OUT_WIRED_HEADPHONE                
      Device 5:
      - id: 13
      - tag name: Line
      - type: AUDIO_DEVICE_OUT_LINE                           
      Device 6:
      - tag name: BT SCO All
      - type: AUDIO_DEVICE_OUT_ALL_SCO                        
  - inputs:
    input 0:
    - name: primary input
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x000c, 0x0010, 0x0030
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - id:  8
      - tag name: FM Tuner
      - type: AUDIO_DEVICE_IN_FM_TUNER                        
      Device 2:
      - tag name: Wired Headset Mic
      - type: AUDIO_DEVICE_IN_WIRED_HEADSET                   
      Device 3:
      - tag name: BT SCO Headset Mic
      - type: AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET           
      Device 4:
      - id:  9
      - tag name: Telephony Rx
      - type: AUDIO_DEVICE_IN_TELEPHONY_RX                    
    input 1:
    - name: surround_sound
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x000c, 0x0010, 0x0030, 0x00fc, 0x80000007, 0x8000000f
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - id: 10
      - tag name: Built-In Mic
      - type: AUDIO_DEVICE_IN_BUILTIN_MIC                     
      Device 2:
      - id: 11
      - tag name: Built-In Back Mic
      - type: AUDIO_DEVICE_IN_BACK_MIC                        
    input 2:
    - name: record_24
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_8_24_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 96000, 192000
            - channel masks:0x000c, 0x0010, 0x0030, 0x80000007, 0x8000000f
        Profile 1:
            - format: AUDIO_FORMAT_PCM_24_BIT_PACKED
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 96000, 192000
            - channel masks:0x000c, 0x0010, 0x0030, 0x80000007, 0x8000000f
        Profile 2:
            - format: AUDIO_FORMAT_PCM_FLOAT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 96000, 192000
            - channel masks:0x000c, 0x0010, 0x0030, 0x80000007, 0x8000000f
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - id: 10
      - tag name: Built-In Mic
      - type: AUDIO_DEVICE_IN_BUILTIN_MIC                     
      Device 2:
      - id: 11
      - tag name: Built-In Back Mic
      - type: AUDIO_DEVICE_IN_BACK_MIC                        
      Device 3:
      - tag name: Wired Headset Mic
      - type: AUDIO_DEVICE_IN_WIRED_HEADSET                   
    input 3:
    - name: voice_rx
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000, 48000
            - channel masks:0x000c, 0x0010
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - id:  9
      - tag name: Telephony Rx
      - type: AUDIO_DEVICE_IN_TELEPHONY_RX                    
  - Declared devices:
    Device 1:
    - id:  1
    - tag name: Earpiece
    - type: AUDIO_DEVICE_OUT_EARPIECE                       
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0010
    Device 2:
    - id:  2
    - tag name: Speaker
    - type: AUDIO_DEVICE_OUT_SPEAKER                        
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0003
    Device 3:
    - tag name: Wired Headset
    - type: AUDIO_DEVICE_OUT_WIRED_HEADSET                  
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0003
    Device 4:
    - tag name: Wired Headphones
    - type: AUDIO_DEVICE_OUT_WIRED_HEADPHONE                
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0003
    Device 5:
    - id: 13
    - tag name: Line
    - type: AUDIO_DEVICE_OUT_LINE                           
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0003
    Device 6:
    - tag name: BT SCO
    - type: AUDIO_DEVICE_OUT_BLUETOOTH_SCO                  
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000
            - channel masks:0x0001
    Device 7:
    - tag name: BT SCO Headset
    - type: AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET          
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000
            - channel masks:0x0001
    Device 8:
    - tag name: BT SCO Car Kit
    - type: AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT           
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000
            - channel masks:0x0001
    Device 9:
    - tag name: BT SCO All
    - type: AUDIO_DEVICE_OUT_ALL_SCO                        
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000
            - channel masks:0x0001
    Device 10:
    - id:  6
    - tag name: Telephony Tx
    - type: AUDIO_DEVICE_OUT_TELEPHONY_TX                   
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000
            - channel masks:0x0001, 0x0003
    Device 11:
    - tag name: HDMI
    - type: AUDIO_DEVICE_OUT_AUX_DIGITAL                    
    - Profiles:
        Profile 0:[dynamic channels]
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
    Device 12:
    - tag name: Proxy
    - type: AUDIO_DEVICE_OUT_PROXY                          
    - Profiles:
        Profile 0:[dynamic channels]
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
    Device 13:
    - tag name: FM
    - type: AUDIO_DEVICE_OUT_FM                             
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0001, 0x0003
    Device 14:
    - id: 10
    - tag name: Built-In Mic
    - type: AUDIO_DEVICE_IN_BUILTIN_MIC                     
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x000c, 0x0010, 0x0030
        Profile 1:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x000c, 0x0010, 0x0030, 0x00fc, 0x80000007, 0x8000000f
    Device 15:
    - id: 11
    - tag name: Built-In Back Mic
    - type: AUDIO_DEVICE_IN_BACK_MIC                        
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x000c, 0x0010, 0x0030
        Profile 1:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x000c, 0x0010, 0x0030, 0x00fc, 0x80000007, 0x8000000f
    Device 16:
    - id:  8
    - tag name: FM Tuner
    - type: AUDIO_DEVICE_IN_FM_TUNER                        
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x000c, 0x0010
        Profile 1:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x000c, 0x0010, 0x0030
    Device 17:
    - tag name: Wired Headset Mic
    - type: AUDIO_DEVICE_IN_WIRED_HEADSET                   
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x000c, 0x0010, 0x0030
    Device 18:
    - tag name: BT SCO Headset Mic
    - type: AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET           
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000
            - channel masks:0x0010
    Device 19:
    - id:  9
    - tag name: Telephony Rx
    - type: AUDIO_DEVICE_IN_TELEPHONY_RX                    
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 16000, 48000
            - channel masks:0x0010
        Profile 1:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
            - channel masks:0x000c, 0x0010, 0x0030

  Audio Routes (14):
  - Route 1:
    - Type: Mix
    - Sink: Earpiece
    - Sources: 
        primary output 
        raw 
        deep_buffer 
        direct_pcm 
        compressed_offload 
        voip_rx 

  - Route 2:
    - Type: Mix
    - Sink: Speaker
    - Sources: 
        primary output 
        raw 
        deep_buffer 
        direct_pcm 
        compressed_offload 
        voip_rx 

  - Route 3:
    - Type: Mix
    - Sink: Wired Headset
    - Sources: 
        primary output 
        raw 
        deep_buffer 
        direct_pcm 
        compressed_offload 
        voip_rx 

  - Route 4:
    - Type: Mix
    - Sink: Wired Headphones
    - Sources: 
        primary output 
        raw 
        deep_buffer 
        direct_pcm 
        compressed_offload 
        voip_rx 

  - Route 5:
    - Type: Mix
    - Sink: Line
    - Sources: 
        primary output 
        raw 
        deep_buffer 
        direct_pcm 
        compressed_offload 
        voip_rx 

  - Route 6:
    - Type: Mix
    - Sink: HDMI
    - Sources: 
        primary output 
        raw 
        deep_buffer 
        multichannel 
        direct_pcm 
        compressed_offload 

  - Route 7:
    - Type: Mix
    - Sink: Proxy
    - Sources: 
        primary output 
        raw 
        deep_buffer 
        multichannel 
        direct_pcm 
        compressed_offload 

  - Route 8:
    - Type: Mix
    - Sink: FM
    - Sources: 
        primary output 

  - Route 9:
    - Type: Mix
    - Sink: BT SCO All
    - Sources: 
        primary output 
        raw 
        deep_buffer 
        direct_pcm 
        compressed_offload 
        voip_rx 

  - Route 10:
    - Type: Mix
    - Sink: Telephony Tx
    - Sources: 
        voice_tx 

  - Route 11:
    - Type: Mix
    - Sink: primary input
    - Sources: 
        Wired Headset Mic 
        BT SCO Headset Mic 
        FM Tuner 
        Telephony Rx 

  - Route 12:
    - Type: Mix
    - Sink: surround_sound
    - Sources: 
        Built-In Mic 
        Built-In Back Mic 

  - Route 13:
    - Type: Mix
    - Sink: record_24
    - Sources: 
        Built-In Mic 
        Built-In Back Mic 
        Wired Headset Mic 

  - Route 14:
    - Type: Mix
    - Sink: voice_rx
    - Sources: 
        Telephony Rx 

- HW Module 2:
  - name: a2dp(Audio 蓝牙设备输入/输出时处理模块)
  - handle: 18
  - version: 2.0
  - outputs:
    output 0:
    - name: a2dp output
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:44100
            - channel masks:0x0003
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - tag name: BT A2DP Out
      - type: AUDIO_DEVICE_OUT_BLUETOOTH_A2DP                 
      Device 2:
      - tag name: BT A2DP Headphones
      - type: AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES      
      Device 3:
      - tag name: BT A2DP Speaker
      - type: AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER         
  - inputs:
    input 0:
    - name: a2dp input
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:44100, 48000
            - channel masks:0x000c, 0x0010
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - tag name: BT A2DP In
      - type: AUDIO_DEVICE_IN_BLUETOOTH_A2DP                  
  - Declared devices:
    Device 1:
    - tag name: BT A2DP Out
    - type: AUDIO_DEVICE_OUT_BLUETOOTH_A2DP                 
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:44100
            - channel masks:0x0003
    Device 2:
    - tag name: BT A2DP Headphones
    - type: AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES      
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:44100
            - channel masks:0x0003
    Device 3:
    - tag name: BT A2DP Speaker
    - type: AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER         
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:44100
            - channel masks:0x0003
    Device 4:
    - tag name: BT A2DP In
    - type: AUDIO_DEVICE_IN_BLUETOOTH_A2DP                  
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:44100, 48000
            - channel masks:0x000c, 0x0010

  Audio Routes (4):
  - Route 1:
    - Type: Mix
    - Sink: BT A2DP Out
    - Sources: 
        a2dp output 

  - Route 2:
    - Type: Mix
    - Sink: BT A2DP Headphones
    - Sources: 
        a2dp output 

  - Route 3:
    - Type: Mix
    - Sink: BT A2DP Speaker
    - Sources: 
        a2dp output 

  - Route 4:
    - Type: Mix
    - Sink: a2dp input
    - Sources: 
        BT A2DP In 

- HW Module 3:
  - name: usb(Audio USB设备输入/输出时处理模块)
  - handle: 26
  - version: 2.0
  - outputs:
    output 0:
    - name: usb_accessory output
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:44100
            - channel masks:0x0003
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - tag name: USB Host Out
      - type: AUDIO_DEVICE_OUT_USB_ACCESSORY                  
    output 1:
    - name: usb_device output
    - Profiles:
        Profile 0:[dynamic format][dynamic channels][dynamic rates]
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - tag name: USB Device Out
      - type: AUDIO_DEVICE_OUT_USB_DEVICE                     
  - inputs:
    input 0:
    - name: usb_device input
    - Profiles:
        Profile 0:[dynamic format][dynamic channels][dynamic rates]
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - tag name: USB Device In
      - type: AUDIO_DEVICE_IN_USB_DEVICE                      
  - Declared devices:
    Device 1:
    - tag name: USB Host Out
    - type: AUDIO_DEVICE_OUT_USB_ACCESSORY                  
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:44100
            - channel masks:0x0003
    Device 2:
    - tag name: USB Device Out
    - type: AUDIO_DEVICE_OUT_USB_DEVICE                     
    - Profiles:
        Profile 0:[dynamic format][dynamic channels][dynamic rates]
    Device 3:
    - tag name: USB Device In
    - type: AUDIO_DEVICE_IN_USB_DEVICE                      
    - Profiles:
        Profile 0:[dynamic format][dynamic channels][dynamic rates]

  Audio Routes (3):
  - Route 1:
    - Type: Mix
    - Sink: USB Host Out
    - Sources: 
        usb_accessory output 

  - Route 2:
    - Type: Mix
    - Sink: USB Device Out
    - Sources: 
        usb_device output 

  - Route 3:
    - Type: Mix
    - Sink: usb_device input
    - Sources: 
        USB Device In 

- HW Module 4:
  - name: r_submix(Audio 远程交互时处理模块)
  - handle: 34
  - version: 2.0
  - outputs:
    output 0:
    - name: r_submix output
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0003
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - tag name: Remote Submix Out
      - type: AUDIO_DEVICE_OUT_REMOTE_SUBMIX                  
      - address: 0                               
  - inputs:
    input 0:
    - name: r_submix input
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x000c
    - flags: 0x0000
    - Supported devices:
      Device 1:
      - id: 12
      - tag name: Remote Submix In
      - type: AUDIO_DEVICE_IN_REMOTE_SUBMIX                   
      - address: 0                               
  - Declared devices:
    Device 1:
    - tag name: Remote Submix Out
    - type: AUDIO_DEVICE_OUT_REMOTE_SUBMIX                  
    - address: 0                               
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x0003
    Device 2:
    - id: 12
    - tag name: Remote Submix In
    - type: AUDIO_DEVICE_IN_REMOTE_SUBMIX                   
    - address: 0                               
    - Profiles:
        Profile 0:
            - format: AUDIO_FORMAT_PCM_16_BIT
            - sampling rates:48000
            - channel masks:0x000c

  Audio Routes (2):
  - Route 1:
    - Type: Mix
    - Sink: Remote Submix Out
    - Sources: 
        r_submix output 

  - Route 2:
    - Type: Mix
    - Sink: r_submix input
    - Sources: 
        Remote Submix In 


Outputs dump:(下面打印的是输出流通道列表,跟上面提到的输出流通道的句柄是一一对应的)
- Output 13 dump(跟上面保持一致的句柄号):
 Latency: 48
 Flags 00000006
 ID: 3
 Sampling rate: 48000
 Format: 00000001
 Channels: 00000003
 Devices 00020000
 Stream volume refCount muteCount(句柄为13(跟上述的IO Handle的句柄保持一致)的输出设备中的各种音频流的音量信息)
 00     -10.625     00       00 (refCount这一列比较重要,当该音频流输出通道中含有多少个对应类型的音频流时这个数值就是多少)
 01     -10.000     00       00
 02     -10.000     00       00
 03     0.000     00       00(通常表示Music流类型的音频流,前面的编号跟AudioSystem.java中定义的编号是保持一致的,下面的行也是类似的)
 04     -10.000     00       00(通常表示Alarm流类型的音频流)
 05     -10.000     00       00
 06     -1.000     00       00
 07     -10.000     00       00
 08     -10.000     00       00
 09     -96.000     00       00
 10     0.000     00       00
 11     0.000     00       00
 12     -1.000     00       00
- Output 21 dump:
 Latency: 48
 Flags 00000104
 ID: 4
 Sampling rate: 48000
 Format: 00000001
 Channels: 00000003
 Devices 00000002
 Stream volume refCount muteCount
 00     -5.882     00       00
 01     -6.000     00       00
 02     0.000     00       00
 03     0.000     00       00
 04     0.000     00       00
 05     0.000     00       00
 06     -1.000     00       00
 07     -6.000     00       00
 08     -6.000     00       00
 09     0.000     00       00
 10     0.000     00       00
 11     0.000     00       00
 12     -1.000     00       00
- Output 29 dump:
 Latency: 80
 Flags 00000008
 ID: 5
 Sampling rate: 48000
 Format: 00000001
 Channels: 00000003
 Devices 00020000
 Stream volume refCount muteCount
 00     -10.625     00       00
 01     -10.000     00       00
 02     -10.000     00       00
 03     0.000     00       00
 04     -10.000     00       00
 05     -10.000     00       00
 06     -1.000     00       00
 07     -10.000     00       00
 08     -10.000     00       00
 09     -96.000     00       00
 10     0.000     00       00
 11     0.000     00       00
 12     -1.000     00       00
- Output 37 dump:
 Latency: 112
 Flags 00000000
 ID: 7
 Sampling rate: 48000
 Format: 00000001
 Channels: 00000003
 Devices 00010000
 Stream volume refCount muteCount
 00     -5.882     00       00
 01     -6.000     00       00
 02     0.000     00       00
 03     0.000     00       00
 04     0.000     00       00
 05     0.000     00       00
 06     -1.000     00       00
 07     -6.000     00       00
 08     -6.000     00       00
 09     0.000     00       00
 10     0.000     00       00
 11     0.000     00       00
 12     -1.000     00       00
- Output 93 dump:
 Latency: 50
 Flags 00002001
 ID: 20
 Sampling rate: 16000
 Format: 00000001
 Channels: 00000001
 Devices 00020000
 Stream volume refCount muteCount
 00     -10.625     00       00
 01     -10.000     00       00
 02     -10.000     00       00
 03     0.000     00       00
 04     -10.000     00       00
 05     -10.000     00       00
 06     -1.000     00       00
 07     -10.000     00       00
 08     -10.000     00       00
 09     -96.000     00       00
 10     0.000     00       00
 11     0.000     00       00
 12     -1.000     00       00

Inputs dump:
- Input 54 dump:
 ID: 16
 Sampling rate: 16000
 Format: 1
 Channels: 8000000f
 Devices 80000004
 Audio Sessions:
   Audio session 1:
   - session: 17
   - owner uid: 10064
   - input source: 1
   - format: 00000001
   - sample: 16000
   - channel mask: 8000000f
   - is soundtrigger: false
   - open count: 1
   - active count: 1

Streams dump:
 Stream  Can be muted  Index Min  Index Max  Index Cur [device : index]...
 00      true          01         05         40000000 : 04, 
 01      true          00         07         0002 : 07, 40000000 : 07, 
 02      true          00         07         0002 : 07, 40000000 : 07, 
 03      true          00         15         0004 : 10, 0008 : 10, 40000000 : 15, 
 04      true          00         07         40000000 : 07, 
 05      true          00         07         0002 : 07, 40000000 : 07, 
 06      true          00         15         40000000 : 15, 
 07      true          00         07         0002 : 07, 40000000 : 07, 
 08      true          00         15         0002 : 15, 40000000 : 15, 
 09      true          00         15         0004 : 10, 0008 : 10, 40000000 : 15, 
 10      true          00         15         0004 : 10, 0008 : 10, 40000000 : 15, 
 11      true          00         01         40000000 : 00, 
 12      true          00         01         40000000 : 00, 

Volume Curves for Use Cases (aka Stream types) dump:(各种音频场景的音量曲线,选取曲线上的4个点,将上层音量的float值转换为audio硬件音量的db值,实际上解析的就是上述audio_policy_volumes.xml和default_volume_tables.xml配置文件)
 AUDIO_STREAM_VOICE_CALL (00): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  0, -4200), ( 33, -2800), ( 66, -1400), (100,     0) }
   DEVICE_CATEGORY_SPEAKER : {(  0, -2400), ( 33, -1600), ( 66,  -800), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  0, -2400), ( 33, -1600), ( 66,  -800), (100,     0) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }

 AUDIO_STREAM_SYSTEM (01): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  1, -3000), ( 33, -2600), ( 66, -2200), (100, -1800) }
   DEVICE_CATEGORY_SPEAKER : {(  1, -2400), ( 33, -1800), ( 66, -1200), (100,  -600) }
   DEVICE_CATEGORY_EARPIECE : {(  1, -2400), ( 33, -1800), ( 66, -1200), (100,  -600) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -2100), (100, -1000) }

 AUDIO_STREAM_RING (02): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  1, -4950), ( 33, -3350), ( 66, -1700), (100,     0) }
   DEVICE_CATEGORY_SPEAKER : {(  1, -2970), ( 33, -2010), ( 66, -1020), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  1, -4950), ( 33, -3350), ( 66, -1700), (100,     0) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -2100), (100, -1000) }

 AUDIO_STREAM_MUSIC (03): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }
   DEVICE_CATEGORY_SPEAKER : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }

 AUDIO_STREAM_ALARM (04): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  1, -4950), ( 33, -3350), ( 66, -1700), (100,     0) }
   DEVICE_CATEGORY_SPEAKER : {(  1, -2970), ( 33, -2010), ( 66, -1020), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  1, -4950), ( 33, -3350), ( 66, -1700), (100,     0) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -2100), (100, -1000) }

 AUDIO_STREAM_NOTIFICATION (05): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  1, -4950), ( 33, -3350), ( 66, -1700), (100,     0) }
   DEVICE_CATEGORY_SPEAKER : {(  1, -2970), ( 33, -2010), ( 66, -1020), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  1, -4950), ( 33, -3350), ( 66, -1700), (100,     0) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -2100), (100, -1000) }

 AUDIO_STREAM_BLUETOOTH_SCO (06): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  0, -4200), ( 33, -2800), ( 66, -1400), (100,     0) }
   DEVICE_CATEGORY_SPEAKER : {(  0, -2400), ( 33, -1600), ( 66,  -800), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  0, -4200), ( 33, -2800), ( 66, -1400), (100,     0) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }

 AUDIO_STREAM_ENFORCED_AUDIBLE (07): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  1, -3000), ( 33, -2600), ( 66, -2200), (100, -1800) }
   DEVICE_CATEGORY_SPEAKER : {(  1, -2400), ( 33, -1800), ( 66, -1200), (100,  -600) }
   DEVICE_CATEGORY_EARPIECE : {(  1, -2400), ( 33, -1800), ( 66, -1200), (100,  -600) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -2100), (100, -1000) }

 AUDIO_STREAM_DTMF (08): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  1, -3000), ( 33, -2600), ( 66, -2200), (100, -1800) }
   DEVICE_CATEGORY_SPEAKER : {(  1, -2400), ( 33, -1800), ( 66, -1200), (100,  -600) }
   DEVICE_CATEGORY_EARPIECE : {(  1, -2400), ( 33, -1800), ( 66, -1200), (100,  -600) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -2100), (100, -1000) }

 AUDIO_STREAM_TTS (09): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  0, -9600), (100, -9600) }
   DEVICE_CATEGORY_SPEAKER : {(  0,     0), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  0, -9600), (100, -9600) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  0, -9600), (100, -9600) }

 AUDIO_STREAM_ACCESSIBILITY (10): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }
   DEVICE_CATEGORY_SPEAKER : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  1, -5800), ( 20, -4000), ( 60, -1700), (100,     0) }

 AUDIO_STREAM_REROUTING (11): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  0,     0), (100,     0) }
   DEVICE_CATEGORY_SPEAKER : {(  0,     0), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  0,     0), (100,     0) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  0,     0), (100,     0) }

 AUDIO_STREAM_PATCH (12): Curve points for device category (index, attenuation in millibel)
   DEVICE_CATEGORY_HEADSET : {(  0,     0), (100,     0) }
   DEVICE_CATEGORY_SPEAKER : {(  0,     0), (100,     0) }
   DEVICE_CATEGORY_EARPIECE : {(  0,     0), (100,     0) }
   DEVICE_CATEGORY_EXT_MEDIA : {(  0,     0), (100,     0) }


Total Effects CPU: 0.000000 MIPS, Total Effects memory: 0 KB, Max memory used: 0 KB
Registered effects:

Audio Patches:
  Audio patch 1:
  - handle:  5
  - audio flinger handle: 44
  - owner uid: 1041
  - 1 sources:
    - Device ID 10 AUDIO_DEVICE_IN_BUILTIN_MIC
  - 1 sinks:
    - Mix ID 16 I/O handle 54
  Audio patch 2:
  - handle:  8
  - audio flinger handle: 68
  - owner uid: 1041
  - 1 sources:
    - Mix ID 3 I/O handle 13
  - 1 sinks:
    - Device ID 13 AUDIO_DEVICE_OUT_LINE
  Audio patch 3:
  - handle:  9
  - audio flinger handle: 76
  - owner uid: 1041
  - 1 sources:
    - Mix ID 5 I/O handle 29
  - 1 sinks:
    - Device ID 13 AUDIO_DEVICE_OUT_LINE
  Audio patch 4:
  - handle: 11
  - audio flinger handle: 92
  - owner uid: 1041
  - 1 sources:
    - Mix ID 20 I/O handle 93
  - 1 sinks:
    - Device ID 13 AUDIO_DEVICE_OUT_LINE
 

  • 0
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值