目录
[详述 dumpsys audio](#详述 dumpsys audio)
[10、AudioDeviceBroker 的记录](#10、AudioDeviceBroker 的记录)
[12、音频事件日志 - 通话状态](#12、音频事件日志 - 通话状态)
[13、音频事件日志 - 蓝牙](#13、音频事件日志 - 蓝牙)
[14、音频事件日志 - 用户指定设备记录](#14、音频事件日志 - 用户指定设备记录)
[15、音频事件日志 - 音量变量记录](#15、音频事件日志 - 音量变量记录)
概述
除了音频日志,当前的音频状态。 音量,通话模式,可用音频设备,以及音频设置历史等都在AudioService中。而混音状态是在AudioFlinger中。 在音频问题定位中,这些信息是很有必要的。
详述 dumpsys audio
1、音频服务生命周期的事件日志
bash
udio event log: audio services lifecycle
11-07 09:27:41:377 AudioService()
11-07 09:39:41:773 onAudioServerDied() audioserver died
11-07 09:39:42:274 onAudioServerDied() audioserver started
11-07 09:39:43:123 after audioserver restart: initStreamVolume succeeded
11-07 09:45:52:654 onAudioServerDied() audioserver died
11-07 09:45:53:156 onAudioServerDied() audioserver started
11-07 09:45:53:960 after audioserver restart: initStreamVolume succeeded
11-07 09:59:36:019 onAudioServerDied() audioserver died
11-07 09:59:36:521 onAudioServerDied() audioserver started
11-07 09:59:37:160 after audioserver restart: initStreamVolume succeeded
根据音频服务生命周期的事件日志,以下是记录的音频服务活动:
-
11-07 09:27:41:377:AudioService() 被调用
-
11-07 09:39:41:773:onAudioServerDied() 音频服务器关闭
-
11-07 09:39:42:274:onAudioServerDied() 音频服务器重新启动
-
11-07 09:39:43:123:音频服务器重新启动后:initStreamVolume 成功
-
11-07 09:45:52:654:onAudioServerDied() 音频服务器关闭
-
11-07 09:45:53:156:onAudioServerDied() 音频服务器重新启动
-
11-07 09:45:53:960:音频服务器重新启动后:initStreamVolume 成功
-
11-07 09:59:36:019:onAudioServerDied() 音频服务器关闭
-
11-07 09:59:36:521:onAudioServerDied() 音频服务器重新启动
-
11-07 09:59:37:160:音频服务器重新启动后:initStreamVolume 成功
2、音频焦点事件日志
bash
Message handler (watch for unhandled messages):
Handler (com.android.server.audio.AudioService$AudioHandler) {6bd4ea7} @ 3315769
Looper (AudioService, tid 90) {8bb8f54}
(Total messages: 0, polling=true, quitting=false)
MediaFocusControl dump time: 上午10:22:45
Audio Focus stack entries (last is top of stack):
source:android.os.BinderProxy@c7fcefd -- pack: com.ctg.itrdc.clouddesk -- client: android.media.AudioManager@9d8338dcom.iiordanov.clink.audio.i@cd11942 -- gain: GAIN -- flags: -- loss: none -- notified: true -- uid: 10094 -- attr: AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_MUSIC flags=0x800 tags= bundle=null -- sdk:30
No external focus policy
Notify on duck: true
In ring or call: false
Audio event log: focus commands as seen by MediaFocusControl
11-07 09:28:14:181 requestAudioFocus() from uid/pid 10094/1918 clientId=android.media.AudioManager@9d8338dcom.iiordanov.clink.audio.i@cd11942 callingPack=com.ctg.itrdc.clouddesk req=1 flags=0x0 sdk=30
Multi Audio Focus enabled :false
根据音频焦点事件日志,以下是记录的音频焦点相关活动:
-
最后的音频焦点堆栈条目:source:android.os.BinderProxy@c7fcefd -- pack: com.ctg.itrdc.clouddesk -- client: android.media.AudioManager@9d8338dcom.iiordanov.clink.audio.i@cd11942 -- gain: GAIN -- flags: -- loss: none -- notified: true -- uid: 10094 -- attr: AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_MUSIC flags=0x800 tags= bundle=null -- sdk:30
-
外部焦点策略:无
-
响应"duck"通知:是
-
在振铃或通话中:否
-
Multi Audio Focus 是否启用:否
3、音频流音量信息
bash
Stream volumes (device: index)
- STREAM_VOICE_CALL:
Muted: false
Muted Internally: false
Min: 1
Max: 15
streamVolume:15
Current: 2 (speaker): 15, 4 (headset): 11, 80 (bt_a2dp): 15, 4000000 (usb_headset): 9, 40000000 (default): 11
Devices: speaker
- STREAM_SYSTEM:
Muted: false
Muted Internally: false
Min: 0
Max: 7
streamVolume:7
Current: 2 (speaker): 7, 40000000 (default): 5
Devices: speaker
- STREAM_RING:
Muted: false
Muted Internally: false
Min: 0
Max: 7
streamVolume:7
Current: 2 (speaker): 7, 40000000 (default): 5
Devices: speaker
- STREAM_MUSIC:
Muted: false
Muted Internally: false
Min: 0
Max: 15
streamVolume:15
Current: 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 4000000 (usb_headset): 9, 40000000 (default): 15
Devices: speaker
- STREAM_ALARM:
Muted: false
Muted Internally: false
Min: 1
Max: 7
streamVolume:6
Current: 40000000 (default): 6
Devices: speaker
- STREAM_NOTIFICATION:
Muted: false
Muted Internally: false
Min: 0
Max: 7
streamVolume:7
Current: 2 (speaker): 7, 40000000 (default): 5
Devices: speaker
- STREAM_BLUETOOTH_SCO:
Muted: false
Muted Internally: false
Min: 0
Max: 15
streamVolume:15
Current: 2 (speaker): 15, 20 (bt_sco_hs): 7, 80 (bt_a2dp): 15, 4000000 (usb_headset): 9, 40000000 (default): 7
Devices: speaker
- STREAM_SYSTEM_ENFORCED:
Muted: false
Muted Internally: false
Min: 0
Max: 7
streamVolume:7
Current: 2 (speaker): 7, 40000000 (default): 5
Devices: speaker
- STREAM_DTMF:
Muted: false
Muted Internally: false
Min: 0
Max: 15
streamVolume:15
Current: 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 4000000 (usb_headset): 9, 40000000 (default): 15
Devices: speaker
- STREAM_TTS:
Muted: false
Muted Internally: false
Min: 0
Max: 15
streamVolume:15
Current: 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 4000000 (usb_headset): 9, 40000000 (default): 15
Devices: speaker
- STREAM_ACCESSIBILITY:
Muted: false
Muted Internally: false
Min: 1
Max: 15
streamVolume:15
Current: 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 4000000 (usb_headset): 9, 40000000 (default): 15
Devices: speaker
- STREAM_ASSISTANT:
Muted: false
Muted Internally: false
Min: 0
Max: 15
streamVolume:15
Current: 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 4000000 (usb_headset): 9, 40000000 (default): 15
Devices: speaker
- mute affected streams = 0x6f
以下是不同音频流的设置:
-
STREAM_VOICE_CALL(通话音频流):
-
静音:否
-
内部静音:否
-
最小音量:1
-
最大音量:15
-
流音量:15
-
当前活动设备音量:2(扬声器):15,4(耳机):11,80(蓝牙A2DP):15,4000000(USB耳机):9,40000000(默认):11
-
设备:扬声器
-
STREAM_SYSTEM(系统音频流):
-
静音:否
-
内部静音:否
-
最小音量:0
-
最大音量:7
-
流音量:7
-
当前活动设备音量:2(扬声器):7,40000000(默认):5
-
设备:扬声器
-
STREAM_RING(铃声音频流):
-
静音:否
-
内部静音:否
-
最小音量:0
-
最大音量:7
-
流音量:7
-
当前活动设备音量:2(扬声器):7,40000000(默认):5
-
设备:扬声器
-
STREAM_MUSIC(音乐音频流):
-
静音:否
-
内部静音:否
-
最小音量:0
-
最大音量:15
-
流音量:15
-
当前活动设备音量:2(扬声器):15,4(耳机):15,20(蓝牙SCO耳机):15,80(蓝牙A2DP):15,4000000(USB耳机):9,40000000(默认):15
-
设备:扬声器
-
STREAM_ALARM(闹钟音频流):
-
静音:否
-
内部静音:否
-
最小音量:1
-
最大音量:7
-
流音量:6
-
当前活动设备音量:40000000(默认):6
-
设备:扬声器
-
STREAM_NOTIFICATION(通知音频流):
-
静音:否
-
内部静音:否
-
最小音量:0
-
最大音量:7
-
流音量:7
-
当前活动设备音量:2(扬声器):7,40000000(默认):5
-
设备:扬声器
-
STREAM_BLUETOOTH_SCO(蓝牙SCO音频流):
-
静音:否
-
内部静音:否
-
最小音量:0
-
最大音量:15
-
流音量:15
-
当前活动设备音量:2(扬声器):15,20(蓝牙SCO耳机):7,80(蓝牙A2DP):15,4000000(USB耳机):9,40000000(默认):7
-
设备:扬声器
-
STREAM_SYSTEM_ENFORCED(强制系统音频流):
-
静音:否
-
内部静音:否
-
最小音量:0
-
最大音量:7
-
流音量:7
-
当前活动设备音量:2(扬声器):7,40000000(默认):5
-
设备:扬声器
-
STREAM_DTMF(DTMF音频流):
-
静音:否
-
内部静音:否
-
最小音量:0
-
最大音量:15
-
流音量:15
-
当前活动设备音量:2(扬声器):15,4(耳机):15,20(蓝牙SCO耳机):15,80(蓝牙A2DP):15,4000000(USB耳机):9,40000000(默认):15
-
设备:扬声器
-
STREAM_TTS(文本转语音音频流):
-
静音:否
-
内部静音:否
-
最小音量:0
-
最大音量:15
-
流音量:15
-
当前活动设备音量:2(扬声器):15,4(耳机):15,20(蓝牙SCO耳机):15,80(蓝牙A2DP):15,4000000(USB耳机):9,40000000(默认):15
-
设备:扬声器
-
STREAM_ACCESSIBILITY(辅助功能音频流):
-
静音:否
-
内部静音:否
-
最小音量:1
-
最大音量:15
-
流音量:15
-
当前活动设备音量:2(扬声器):15,4(耳机):15,20(蓝牙SCO耳机):15,80(蓝牙A2DP):15,4000000(USB耳机):9,40000000(默认):15
-
设备:扬声器
-
STREAM_ASSISTANT(助手音频流):
-
静音:否
-
内部静音:否
-
最小音量:0
-
最大音量:15
-
流音量:15
-
当前活动设备音量:2(扬声器):15,4(耳机):15,20(蓝牙SCO耳机):15,80(蓝牙A2DP):15,4000000(USB耳机):9,40000000(默认):15
-
设备:扬声器
-
受静音影响的音频流:0x6f
4、音量组和设备的相关信息
bash
Volume Groups (device: index)
- VOLUME GROUP AUDIO_STREAM_ACCESSIBILITY:
Min: 1
Max: 15
Current: 40000000 (default): 15
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_ALARM:
Min: 1
Max: 7
Current: 40000000 (default): 6
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_DTMF:
Min: 0
Max: 15
Current: 40000000 (default): 15
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_ENFORCED_AUDIBLE:
Min: 0
Max: 7
Current: 40000000 (default): 5
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_MUSIC:
Min: 0
Max: 15
Current: 40000000 (default): 15
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_NOTIFICATION:
Min: 0
Max: 7
Current: 40000000 (default): 5
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_REROUTING:
Min: 0
Max: 15
Current: 40000000 (default): 15
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_RING:
Min: 0
Max: 7
Current: 40000000 (default): 5
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_SYSTEM:
Min: 0
Max: 7
Current: 40000000 (default): 5
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_VOICE_CALL:
Min: 1
Max: 15
Current: 40000000 (default): 11
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_ASSISTANT:
Min: 0
Max: 15
Current: 40000000 (default): 15
Devices: speaker
- VOLUME GROUP AUDIO_STREAM_CALL_ASSISTANT:
Min: 0
Max: 15
Current: 40000000 (default): 15
Devices: speaker
音量组和设备的相关信息如下:
-
音频流 ACCESSIBILITY(辅助功能音频流):
-
最小音量:1
-
最大音量:15
-
当前音量:40000000(默认):15
-
设备:扬声器
-
音频流 ALARM(闹钟音频流):
-
最小音量:1
-
最大音量:7
-
当前音量:40000000(默认):6
-
设备:扬声器
-
音频流 DTMF(DTMF音频流):
-
最小音量:0
-
最大音量:15
-
当前音量:40000000(默认):15
-
设备:扬声器
-
音频流 ENFORCED_AUDIBLE(强制可听音频流):
-
最小音量:0
-
最大音量:7
-
当前音量:40000000(默认):5
-
设备:扬声器
-
音频流 MUSIC(音乐音频流):
-
最小音量:0
-
最大音量:15
-
当前音量:40000000(默认):15
-
设备:扬声器
-
音频流 NOTIFICATION(通知音频流):
-
最小音量:0
-
最大音量:7
-
当前音量:40000000(默认):5
-
设备:扬声器
-
音频流 REROUTING(重定向音频流):
-
最小音量:0
-
最大音量:15
-
当前音量:40000000(默认):15
-
设备:扬声器
-
音频流 RING(铃声音频流):
-
最小音量:0
-
最大音量:7
-
当前音量:40000000(默认):5
-
设备:扬声器
-
音频流 SYSTEM(系统音频流):
-
最小音量:0
-
最大音量:7
-
当前音量:40000000(默认):5
-
设备:扬声器
-
音频流 VOICE_CALL(通话音频流):
-
最小音量:1
-
最大音量:15
-
当前音量:40000000(默认):11
-
设备:扬声器
-
音频流 ASSISTANT(助手音频流):
-
最小音量:0
-
最大音量:15
-
当前音量:40000000(默认):15
-
设备:扬声器
-
音频流 CALL_ASSISTANT(通话助手音频流):
-
最小音量:0
-
最大音量:15
-
当前音量:40000000(默认):15
-
设备:扬声器
5、铃声模式
bash
Ringer mode:
- mode (internal) = NORMAL
- mode (external) = NORMAL
- zen mode:ZEN_MODE_OFF
- ringer mode affected streams = 0x1a6 (STREAM_SYSTEM,STREAM_RING,STREAM_NOTIFICATION,STREAM_SYSTEM_ENFORCED,STREAM_DTMF)
- ringer mode muted streams = 0x0
- delegate = ZenModeHelper
铃声模式的相关信息如下:
-
内部铃声模式:NORMAL(正常模式)
-
外部铃声模式:NORMAL(正常模式)
-
免打扰模式(Zen Mode):ZEN_MODE_OFF(关闭免打扰模式)
-
受铃声模式影响的音频流:0x1a6(STREAM_SYSTEM、STREAM_RING、STREAM_NOTIFICATION、STREAM_SYSTEM_ENFORCED、STREAM_DTMF)
-
静音的音频流:0x0(没有音频流被静音)
-
铃声模式委托:ZenModeHelper
Zen Mode(免打扰模式)是一种在 Android 设备上提供静音和通知管理功能的特殊模式。它旨在帮助用户在特定情况下专注、放松或避免打扰。以下是 Zen Mode 的成员和功能:
Automatic rules(自动规则):Zen Mode 允许用户创建自动规则,根据时间、地点或事件来自动启用或禁用免打扰模式。例如,在特定时间段(如晚上)自动开启静音模式,或者在某个地点(如办公室)开启勿扰模式。
Notifications management(通知管理):Zen Mode 允许用户定义哪些通知可以在免打扰模式下显示,哪些通知应被完全屏蔽。用户可以自定义允许显示的应用程序和通知类型,以便只接收重要的通知。
Downtime(静默时段):Zen Mode 允许用户设置静默时段,即指定一段时期内设备完全静音并屏蔽所有通知。这可以帮助用户保持专注,如在睡眠期间或进行重要任务时。
Event-driven mode(事件驱动模式):Zen Mode 还可以根据特定的事件触发免打扰模式。例如,在与指定联系人进行通话时自动进入勿扰模式,以确保不被其他通知干扰。
Zen Mode 旨在为用户提供更好的通知和声音管理体验,帮助用户在需要时获得更好的专注和放松。用户可以根据自己的需求和偏好进行个性化配置。
6、音频路由
bash
Audio routes:
mMainType=0x0
mBluetoothName=null
音频路由指的是音频信号从源设备传输到输出设备的路径。根据提供的信息,这里有两个关键的属性:
mMainType=0x0:这表示主要的音频路由类型为 0x0。
mBluetoothName=null:这表示蓝牙设备的名称为空,即没有连接任何蓝牙设备。
7、其他状态信息
bash
Other state:
mVolumeController=VolumeController(android.os.BinderProxy@260eb89,mVisible=false)
mSafeMediaVolumeState=SAFE_MEDIA_VOLUME_DISABLED
mSafeMediaVolumeIndex=100
mSafeUsbMediaVolumeIndex=30
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=true
mIsSingleVolume=false
mUseFixedVolume=false
mFixedVolumeDevices=0x1000,0x800,0x200000,0x40000,0x80000
mExtVolumeController=null
mHdmiCecSink=false
mHdmiAudioSystemClient=null
mHdmiPlaybackClient=null
mHdmiTvClient=null
mHdmiSystemAudioSupported=false
mHdmiCecVolumeControlEnabled=false
mIsCallScreeningModeSupported=false
mic mute FromSwitch=false FromRestrictions=false FromApi=false from system=false
Audio policies:
Audio event log: dynamic policy events (logged when command received by AudioService)
提供的其他状态信息如下:
-
mVolumeController:音量控制器对象,用于管理音量控制。具体的实现是 VolumeController(android.os.BinderProxy@260eb89),该控制器当前不可见(mVisible=false)。
-
mSafeMediaVolumeState:安全媒体音量状态为SAFE_MEDIA_VOLUME_DISABLED,即安全媒体音量功能已禁用。
-
mSafeMediaVolumeIndex:安全媒体音量索引为100。
-
mSafeUsbMediaVolumeIndex:安全 USB 媒体音量索引为30。
-
mSafeUsbMediaVolumeDbfs:安全 USB 媒体音量的 dBFS 值为-37.0。
-
sIndependentA11yVolume:独立的无障碍音量设置为false。
-
mPendingVolumeCommand:待处理的音量命令为null,即当前没有等待处理的音量命令。
-
mMusicActiveMs:音乐活跃时间为0,表示当前没有正在播放的音乐。
-
mMcc:MCC(Mobile Country Code)为0。
-
mCameraSoundForced:相机声音被强制开启为false。
-
mHasVibrator:设备是否具有震动器为false,表示设备没有震动功能。
-
mVolumePolicy:音量策略为VolumePolicy[volumeDownToEnterSilent=false,volumeUpToExitSilent=false,doNotDisturbWhenSilent=false,vibrateToSilentDebounce=400],根据该策略进行音量调节的行为。
-
mAvrcpAbsVolSupported:支持 AVRCP 绝对音量为true。
-
mIsSingleVolume:是否使用单一音量模式为false,表示没有激活单一音量模式。
-
mUseFixedVolume:是否使用固定音量为false,表示没有启用固定音量。
-
mFixedVolumeDevices:固定音量设备为0x1000,0x800,0x200000,0x40000,0x80000。
-
mExtVolumeController:扩展音量控制器为空。
-
mHdmiCecSink:HDMI CEC(Consumer Electronics Control)Sink状态为false,表示没有连接 HDMI CEC Sink 设备。
-
mHdmiAudioSystemClient:HDMI 音频系统客户端为空。
-
mHdmiPlaybackClient:HDMI 播放客户端为空。
-
mHdmiTvClient:HDMI 电视客户端为空。
-
mHdmiSystemAudioSupported:是否支持 HDMI 系统音频为false。
-
mHdmiCecVolumeControlEnabled:HDMI CEC 音量控制是否启用为false。
-
mIsCallScreeningModeSupported:是否支持呼叫筛选模式为false。
-
mic mute FromSwitch=false FromRestrictions=false FromApi=false from system=false:麦克风静音的来源信息。
8、播放活动监控信息
bash
PlaybackActivityMonitor dump time: 上午10:22:45
playback listeners:
(S)com.android.server.audio.PlaybackActivityMonitor$PlayMonitorClient@82a67f2 (S)com.android.server.audio.PlaybackActivityMonitor$PlayMonitorClient@ce62e43
players:
AudioPlaybackConfiguration piid:15 type:android.media.SoundPool u/pid:1000/519 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
ducked players piids:
muted player piids:
banned uids:
Audio event log: playback activity as reported through PlayerBase
11-07 09:27:42:765 new player piid:15 uid/pid:1000/519 type:android.media.SoundPool attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
11-07 09:27:45:614 new player piid:23 uid/pid:10107/721 type:android.media.SoundPool attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
11-07 09:28:14:252 new player piid:31 uid/pid:10094/1918 type:unknown attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
11-07 09:28:14:420 player piid:31 state:started
11-07 09:28:15:883 player piid:31 state:stopped
11-07 09:28:15:992 releasing player piid:31
11-07 09:29:03:709 new player piid:47 uid/pid:10094/1918 type:unknown attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
11-07 09:29:03:721 player piid:47 state:started
11-07 09:29:34:724 player piid:47 state:stopped
11-07 09:29:34:835 releasing player piid:47
11-07 09:46:38:540 new player piid:23 uid/pid:10094/1918 type:unknown attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
11-07 09:46:38:619 player piid:23 state:started
11-07 09:47:06:022 player piid:23 state:stopped
11-07 09:47:06:126 releasing player piid:23
11-07 09:47:21:467 new player piid:31 uid/pid:10094/1918 type:unknown attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
11-07 09:47:21:474 player piid:31 state:started
11-07 09:47:48:950 player piid:31 state:stopped
11-07 09:47:49:055 releasing player piid:31
11-07 09:47:58:426 new player piid:39 uid/pid:10094/1918 type:unknown attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
11-07 09:47:58:572 player piid:39 state:started
11-07 09:48:25:933 player piid:39 state:stopped
11-07 09:48:26:039 releasing player piid:39
11-07 10:01:09:253 new player piid:23 uid/pid:10094/1918 type:unknown attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
11-07 10:01:09:260 player piid:23 state:started
11-07 10:01:21:723 player piid:23 state:stopped
11-07 10:01:21:827 releasing player piid:23
11-07 10:04:06:598 new player piid:31 uid/pid:10094/1918 type:unknown attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
11-07 10:04:06:607 player piid:31 state:started
11-07 10:04:22:385 player piid:31 state:stopped
11-07 10:04:22:491 releasing player piid:31
提供的播放活动监控信息如下:
播放监听器:
-
(S)com.android.server.audio.PlaybackActivityMonitor$PlayMonitorClient@82a67f2
-
(S)com.android.server.audio.PlaybackActivityMonitor$PlayMonitorClient@ce62e43
播放器:
- AudioPlaybackConfiguration piid:15
类型:android.media.SoundPool
uid/pid:1000/519
状态:空闲(idle)
属性:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
Ducked players piids(降低音量的播放器 piid):无
Muted player piids(静音的播放器 piid):无
Banned uids(禁止的 UID):无
音频事件日志(通过 PlayerBase 报告的播放活动):
-
11-07 09:27:42:765 新的播放器 piid:15 uid/pid:1000/519 类型:android.media.SoundPool 属性:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
-
11-07 09:27:45:614 新的播放器 piid:23 uid/pid:10107/721 类型:android.media.SoundPool 属性:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
-
11-07 09:28:14:252 新的播放器 piid:31 uid/pid:10094/1918 类型:unknown 属性:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
-
11-07 09:28:14:420 播放器 piid:31 状态:started
-
11-07 09:28:15:883 播放器 piid:31 状态:stopped
-
11-07 09:28:15:992 释放播放器 piid:31
-
11-07 09:29:03:709 新的播放器 piid:47 uid/pid:10094/1918 类型:unknown 属性:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
-
11-07 09:29:03:721 播放器 piid:47 状态:started
-
11-07 09:29:34:724 播放器 piid:47 状态:stopped
-
11-07 09:29:34:835 释放播放器 piid:47
-
11-07 09:46:38:540 新的播放器 piid:23 uid/pid:10094/1918 类型:unknown 属性:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
-
11-07 09:46:38:619 播放器 piid:23 状态:started
-
11-07 09:47:06:022 播放器 piid:23 状态:stopped
-
11-07 09:47:06:126 释放播放器 piid:23
-
11-07 09:47:21:467 新的播放器 piid:31 uid/pid:10094/1918 类型:unknown 属性:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
-
11-07 09:47:21:474 播放器 piid:31 状态:started
-
11-07 09:47:48:950 播放器 piid:31 状态:stopped
-
11-07 09:47:49:055 释放播放器 piid:31
-
11-07 09:47:58:426 新的播放器 piid:39 uid/pid:10094/1918 类型:unknown 属性:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
-
11-07 09:47:58:572 播放器 piid:39 状态:started
-
11-07 09:48:25:933 播放器 piid:39 状态:stopped
-
11-07 09:48:26:039 释放播放器 piid:39
-
11-07 10:01:09:253 新的播放器 piid:23 uid/pid:10094/1918 类型:unknown 属性:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
-
11-07 10:01:09:260 播放器 piid:23 状态:started
-
11-07 10:01:21:723 播放器 piid:23 状态:stopped
-
11-07 10:01:21:827 释放播放器 piid:23
-
11-07 10:04:06:598 新的播放器 piid:31 uid/pid:10094/1918 类型:unknown 属性:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
-
11-07 10:04:06:607 播放器 piid:31 状态:started
-
11-07 10:04:22:385 播放器 piid:31 状态:stopped
-
11-07 10:04:22:491 释放播放器 piid:31
9、录音活动记录
bash
RecordActivityMonitor dump time: 上午10:22:45
Audio event log: recording activity received by AudioService
11-07 09:28:25:984 rec update riid:39 uid:10094 session:17 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 09:28:55:776 rec stop riid:39 uid:10094 session:17 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 09:30:37:756 rec start riid:55 uid:10094 session:33 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 09:31:09:295 rec stop riid:55 uid:10094 session:33 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 09:40:32:902 rec update riid:15 uid:10094 session:9 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 09:40:51:025 rec stop riid:15 uid:10094 session:9 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 09:43:10:580 rec update riid:23 uid:10094 session:17 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 09:43:17:286 rec stop riid:23 uid:10094 session:17 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 09:46:09:512 rec start riid:15 uid:10094 session:9 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 09:46:35:728 rec stop riid:15 uid:10094 session:9 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 10:00:39:767 rec start riid:15 uid:10094 session:9 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 10:00:51:183 rec stop riid:15 uid:10094 session:9 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 10:06:44:994 rec update riid:39 uid:10094 session:33 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
11-07 10:07:11:060 rec stop riid:39 uid:10094 session:33 src:VOICE_COMMUNICATION pack:com.ctg.itrdc.clouddesk
录音活动记录:
-
11-07 09:28:25:984 开始录制,riid:39,uid:10094,session:17,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 09:28:55:776 停止录制,riid:39,uid:10094,session:17,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 09:30:37:756 开始录制,riid:55,uid:10094,session:33,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 09:31:09:295 停止录制,riid:55,uid:10094,session:33,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 09:40:32:902 更新录制,riid:15,uid:10094,session:9,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 09:40:51:025 停止录制,riid:15,uid:10094,session:9,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 09:43:10:580 更新录制,riid:23,uid:10094,session:17,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 09:43:17:286 停止录制,riid:23,uid:10094,session:17,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 09:46:09:512 开始录制,riid:15,uid:10094,session:9,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 09:46:35:728 停止录制,riid:15,uid:10094,session:9,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 10:00:39:767 开始录制,riid:15,uid:10094,session:9,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 10:00:51:183 停止录制,riid:15,uid:10094,session:9,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 10:06:44:994 更新录制,riid:39,uid:10094,session:33,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
-
11-07 10:07:11:060 停止录制,riid:39,uid:10094,session:33,来源:VOICE_COMMUNICATION,包名:com.ctg.itrdc.clouddesk
10、AudioDeviceBroker 的记录
AudioDeviceBroker(音频设备代理)是Android操作系统中的一个组件,它负责管理和控制设备之间的音频通信。它是音频服务的一部分,旨在确保音频设备(如扬声器、耳机、麦克风等)在不同的音频策略和使用场景中正常运行。
AudioDeviceBroker 通过以下方式发挥作用:
-
设备连接和断开:当音频设备连接或断开连接时,AudioDeviceBroker将负责检测和通知系统。它可以识别和管理具有不同音频能力(例如扬声器、耳机、蓝牙设备等)的设备,并根据需要自动调整音频路由。
-
音频策略管理: AudioDeviceBroker 跟踪当前的音频策略,并根据应用程序和系统的需求来确定适合的音频路由和音频输出设备。它可以根据当前正在运行的应用程序类型(如媒体播放器、电话通话、语音识别等)和用户设置来切换音频输入和输出设备。
-
音频通话管理:AudioDeviceBroker 针对语音通话进行专门管理。它负责处理来自通话相关功能(如蓝牙耳机、扬声器电话、免提通话等)的请求,并确保音频通话的正常进行。
总之,AudioDeviceBroker 在 Android 系统中起着至关重要的作用,以确保音频设备的连通性、音频路由的正确配置以及音频通话的正常管理和切换。这有助于提供良好的音频体验,并为用户和应用程序提供适当的音频功能。
bash
AudioDeviceBroker:
Message handler (watch for unhandled messages):
Handler (com.android.server.audio.AudioDeviceBroker$BrokerHandler) {aec4cc0} @ 3315811
Looper (AudioDeviceBroker, tid 91) {27f5df9}
(Total messages: 0, polling=true, quitting=false)
Preferred devices for strategy:
Connected devices:
[DeviceInfo: type:0x80001000 (usb_device) name:USB-Audio - USB 2.0 PC Camera addr:card=20;device=0; codec: 0]
APM Connected device (A2DP sink only):
mForcedUseForComm: FORCE_NONE
mForcedUseForCommExt: FORCE_NONE
mModeOwnerPid: 0
Speakerphone clients:
mBluetoothHeadset: android.bluetooth.BluetoothHeadset@673113e
mBluetoothHeadsetDevice: null
mScoAudioState: SCO_STATE_INACTIVE
mScoAudioMode: SCO_MODE_VIRTUAL_CALL
Sco clients:
mHearingAid: null
mA2dp: android.bluetooth.BluetoothA2dp@2336b9f
mAvrcpAbsVolSupported: false
消息处理程序:
-
处理程序:com.android.server.audio.AudioDeviceBroker$BrokerHandler,在3315811位置上的 Handler
-
使用 Looper:AudioDeviceBroker,线程 ID 91,标识符为 27f5df9
-
总共处理的消息数为 0,正在轮询消息,退出状态为 false
优选设备策略:
- 没有提供任何优选设备的信息
已连接设备:
- [DeviceInfo: type:0x80001000 (usb_device) name:USB-Audio - USB 2.0 PC Camera addr:card=20;device=0; codec: 0] - USB-Audio - USB 2.0 PC Camera
APM 连接的设备(仅限 A2DP 沉浸式听觉设备):
- 没有提供任何 APM 连接的设备信息
强制用于通信的设备:
-
mForcedUseForComm: FORCE_NONE
-
mForcedUseForCommExt: FORCE_NONE
-
mModeOwnerPid: 0
扬声器电话客户端:
- 没有提供任何扬声器电话客户端的信息
蓝牙耳机:
-
mBluetoothHeadset: android.bluetooth.BluetoothHeadset@673113e
-
mBluetoothHeadsetDevice: null
SCO(通话相关)客户端:
-
mScoAudioState: SCO_STATE_INACTIVE
-
mScoAudioMode: SCO_MODE_VIRTUAL_CALL
SCO(通话相关)客户端:
- 没有提供任何 SCO(通话相关)客户端的信息
助听器设备:
- mHearingAid: null
A2DP(高级音频分发配置文件):
- mA2dp: android.bluetooth.BluetoothA2dp@2336b9f
是否支持 Avrcp 绝对音量控制:
- mAvrcpAbsVolSupported: false
11、音效(SoundEffects)信息
SoundEffects(音效)在软件和硬件系统中有多种作用,主要包括以下几个方面:
-
用户反馈:音效能够为用户提供可听的反馈,增强用户体验。例如,在触摸屏上按下按钮时,通过播放点击音效来模拟实际按钮的感觉,让用户知道他们已成功执行了操作。
-
事件提示:音效可用于指示某些事件的发生。例如,在收到新消息或邮件时,播放提示音效可以提醒用户注意。
-
界面导航:音效可以用作用户界面的导航工具。例如,通过播放不同的音效来区分选项卡之间的切换,帮助用户更好地理解界面结构。
-
系统警告:音效可以用于向用户发送警告或关键信息。例如,在低电量或错误状态下播放警告音效,以吸引用户的注意并要求采取相应的操作。
-
游戏娱乐:音效在游戏中扮演着重要的角色,用于增强游戏体验。例如,在游戏过程中播放特殊动作、攻击或背景音效,以提供更加沉浸式的游戏体验。
总体而言,音效能够为用户提供多样的听觉体验,并在软件和硬件系统中扮演着重要的角色。它们不仅可以提供反馈和提示,还能够增强用户界面、传达警示和娱乐性,从而提升用户的参与感和满意度。
bash
SoundEffects:
Message handler (watch for unhandled messages):
Handler (com.android.server.audio.SoundEffectsHelper$SfxHandler) {6a974ec} @ 3315813
Looper (AS.SfxWorker, tid 89) {24ee0b5}
(Total messages: 0, polling=true, quitting=false)
Default attenuation (dB): -6
Audio event log: Sound Effects Loading
11-07 09:27:42:763 effects loading started
11-07 09:27:43:981 effect KeypressStandard.ogg loaded
11-07 09:27:43:985 effect Effect_Tick.ogg loaded
11-07 09:27:44:114 effect KeypressSpacebar.ogg loaded
11-07 09:27:44:131 effect KeypressDelete.ogg loaded
11-07 09:27:44:356 effect KeypressReturn.ogg loaded
11-07 09:27:44:373 effect KeypressInvalid.ogg loaded
11-07 09:27:44:373 effects loading completed
-
消息处理程序:
-
处理程序:com.android.server.audio.SoundEffectsHelper$SfxHandler,在3315813位置上的 Handler
-
使用 Looper:AS.SfxWorker,线程 ID 89,标识符为 24ee0b5
-
总共处理的消息数为 0,正在轮询消息,退出状态为 false
-
默认衰减(Default attenuation):-6 dB
-
音频事件日志(Audio event log):
-
事件:Sound Effects Loading
-
时间戳:11-07 09:27:42:763
-
音效加载开始
-
事件:effect KeypressStandard.ogg loaded
-
时间戳:11-07 09:27:43:981
-
音效 KeypressStandard.ogg 加载完成
-
事件:effect Effect_Tick.ogg loaded
-
时间戳:11-07 09:27:43:985
-
音效 Effect_Tick.ogg 加载完成
-
事件:effect KeypressSpacebar.ogg loaded
-
时间戳:11-07 09:27:44:114
-
音效 KeypressSpacebar.ogg 加载完成
-
事件:effect KeypressDelete.ogg loaded
-
时间戳:11-07 09:27:44:131
-
音效 KeypressDelete.ogg 加载完成
-
事件:effect KeypressReturn.ogg loaded
-
时间戳:11-07 09:27:44:356
-
音效 KeypressReturn.ogg 加载完成
-
事件:effect KeypressInvalid.ogg loaded
-
时间戳:11-07 09:27:44:373
-
音效 KeypressInvalid.ogg 加载完成
-
事件:effects loading completed
-
时间戳:11-07 09:27:44:373
-
音效加载完成
以上是关于音效加载的记录。它显示了音效加载的开始和完成时间,以及每个音效文件的加载情况。
12、音频事件日志 - 通话状态
bash
Event logs:
Audio event log: phone state (logged after successful call to AudioSystem.setPhoneState(int, int))
11-07 09:40:51:498 setMode(MODE_NORMAL) from package=MSG_CHECK_MODE_FOR_UID pid=1918 selected mode=MODE_NORMAL by pid=0
11-07 09:40:51:548 mode IN COMMUNICATION timeout for package=com.ctg.itrdc.clouddesk pid=1918
11-07 09:40:52:133 setMode(MODE_NORMAL) from package=com.ctg.itrdc.clouddesk pid=1918 selected mode=MODE_NORMAL by pid=0
11-07 09:43:10:368 setMode(MODE_IN_COMMUNICATION) from package=com.ctg.itrdc.clouddesk pid=1918 selected mode=MODE_IN_COMMUNICATION by pid=1918
11-07 09:43:11:338 setMode(MODE_IN_COMMUNICATION) from package=com.ctg.itrdc.clouddesk pid=1918 selected mode=MODE_IN_COMMUNICATION by pid=1918
11-07 09:43:17:486 setMode(MODE_NORMAL) from package=MSG_CHECK_MODE_FOR_UID pid=1918 selected mode=MODE_NORMAL by pid=0
11-07 09:43:17:557 mode IN COMMUNICATION timeout for package=com.ctg.itrdc.clouddesk pid=1918
11-07 09:43:18:396 setMode(MODE_NORMAL) from package=com.ctg.itrdc.clouddesk pid=1918 selected mode=MODE_NORMAL by pid=0
11-07 09:45:53:661 onAudioServerDied causes setPhoneState(MODE_NORMAL, uid=0)
11-07 09:46:09:387 setMode(MODE_IN_COMMUNICATION) from package=com.ctg.itrdc.clouddesk pid=1918 selected mode=MODE_IN_COMMUNICATION by pid=1918
11-07 09:46:10:175 setMode(MODE_IN_COMMUNICATION) from package=com.ctg.itrdc.clouddesk pid=1918 selected mode=MODE_IN_COMMUNICATION by pid=1918
11-07 09:46:36:918 setMode(MODE_NORMAL) from package=com.ctg.itrdc.clouddesk pid=1918 selected mode=MODE_NORMAL by pid=0
11-07 09:59:37:027 onAudioServerDied causes setPhoneState(MODE_NORMAL, uid=0)
11-07 10:00:39:573 setMode(MODE_IN_COMMUNICATION) from package=com.ctg.itrdc.clouddesk pid=1918 selected mode=MODE_IN_COMMUNICATION by pid=1918
11-07 10:00:51:682 setMode(MODE_NORMAL) from package=MSG_CHECK_MODE_FOR_UID pid=1918 selected mode=MODE_NORMAL by pid=0
11-07 10:00:51:705 mode IN COMMUNICATION timeout for package=com.ctg.itrdc.clouddesk pid=1918
根据提供的事件日志,以下是对每个事件的解释:
-
11-07 09:40:51:498 - 从包名为 "MSG_CHECK_MODE_FOR_UID" 的进程调用了 `AudioSystem.setPhoneState` 方法来设置手机的状态为 `MODE_NORMAL`。
-
11-07 09:40:51:548 - 来自包名为 "com.ctg.itrdc.clouddesk" 的进程发出了 "mode IN COMMUNICATION" 超时警告。
-
11-07 09:40:52:133 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setPhoneState` 方法来设置手机的状态为 `MODE_NORMAL`。
-
11-07 09:43:10:368 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setMode` 方法来设置音频模式为 `MODE_IN_COMMUNICATION`。
-
11-07 09:43:11:338 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setMode` 方法来设置音频模式为 `MODE_IN_COMMUNICATION`。
-
11-07 09:43:17:486 - 从包名为 "MSG_CHECK_MODE_FOR_UID" 的进程调用了 `AudioSystem.setPhoneState` 方法来设置手机的状态为 `MODE_NORMAL`。
-
11-07 09:43:17:557 - 来自包名为 "com.ctg.itrdc.clouddesk" 的进程发出了 "mode IN COMMUNICATION" 超时警告。
-
11-07 09:43:18:396 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setPhoneState` 方法来设置手机的状态为 `MODE_NORMAL`。
-
11-07 09:45:53:661 - "onAudioServerDied" 导致调用了 `AudioSystem.setPhoneState` 方法来设置手机的状态为 `MODE_NORMAL`。
-
11-07 09:46:09:387 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setMode` 方法来设置音频模式为 `MODE_IN_COMMUNICATION`。
-
11-07 09:46:10:175 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setMode` 方法来设置音频模式为 `MODE_IN_COMMUNICATION`。
-
11-07 09:46:36:918 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setPhoneState` 方法来设置手机的状态为 `MODE_NORMAL`。
-
11-07 09:59:37:027 - "onAudioServerDied" 导致调用了 `AudioSystem.setPhoneState` 方法来设置手机的状态为 `MODE_NORMAL`。
-
11-07 10:00:39:573 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setMode` 方法来设置音频模式为 `MODE_IN_COMMUNICATION`。
-
11-07 10:00:51:682 - 从包名为 "MSG_CHECK_MODE_FOR_UID" 的进程调用了 `AudioSystem.setPhoneState` 方法来设置手机的状态为 `MODE_NORMAL`。
-
11-07 10:00:51:705 - 来自包名为 "com.ctg.itrdc.clouddesk" 的进程发出了 "mode IN COMMUNICATION" 超时警告。
-
11-07 10:00:52:295 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setPhoneState` 方法来设置手机的状态为 `MODE_NORMAL`。
-
11-07 10:06:44:675 - 从包名为 "com.ctg.itrdc.clouddesk" 的进程调用了 `AudioSystem.setMode` 方法来设置音频模式为 `MODE_IN_COMMUNICATION`。
13、音频事件日志 - 蓝牙
bash
Audio event log: wired/A2DP/hearing aid device connection
11-07 09:40:52:184 stopBluetoothSco()) from u/pid:10094/1918
11-07 09:43:10:491 startBluetoothSco()) from u/pid:10094/1918
11-07 09:43:18:442 stopBluetoothSco()) from u/pid:10094/1918
11-07 09:46:09:446 startBluetoothSco()) from u/pid:10094/1918
11-07 09:46:36:985 stopBluetoothSco()) from u/pid:10094/1918
11-07 09:47:46:379 APM failed to make unavailable A2DP device addr=64:68:76:2F:50:6A error=1
11-07 09:47:46:383 msg: setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent state=0 addr=64:68:76:2F:50:6A prof=2 supprNoisy=false vol=-1
11-07 09:47:46:399 A2DP sink connected: device addr=64:68:76:2F:50:6A state=0 codec=AUDIO_FORMAT_DEFAULT vol=-1
11-07 09:47:55:166 BT profile service: connecting A2DP profile
11-07 09:47:55:261 BT profile service: connecting HEADSET profile
11-07 09:47:57:271 msg: setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent state=2 addr=64:68:76:2F:50:6A prof=2 supprNoisy=true vol=15
11-07 09:47:57:274 A2DP sink connected: device addr=64:68:76:2F:50:6A state=2 codec=AUDIO_FORMAT_SBC vol=15
11-07 09:47:57:503 A2DP device addr=64:68:76:2F:50:6A now available
11-07 09:47:57:513 onBluetoothA2dpActiveDeviceChange addr=64:68:76:2F:50:6A event=DEVICE_CONFIG_CHANGE
11-07 09:47:57:744 APM handleDeviceConfigChange success for A2DP device addr=64:68:76:2F:50:6A codec=AUDIO_FORMAT_SBC
11-07 09:48:59:027 msg: setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent state=0 addr=64:68:76:2F:50:6A prof=2 supprNoisy=false vol=-1
11-07 09:48:59:032 broadcast ACTION_AUDIO_BECOMING_NOISY
11-07 09:49:00:033 A2DP sink connected: device addr=64:68:76:2F:50:6A state=0 codec=AUDIO_FORMAT_SBC vol=-1
11-07 09:49:00:076 A2DP device addr=64:68:76:2F:50:6A made unavailable
11-07 10:06:22:033 msg: setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent state=2 addr=64:68:76:2F:50:6A prof=2 supprNoisy=true vol=15
11-07 10:06:22:037 onBluetoothA2dpActiveDeviceChange addr=64:68:76:2F:50:6A event=DEVICE_CONFIG_CHANGE
11-07 10:06:22:037 A2dp config change ignored (scheduled connection change)
11-07 10:06:22:037 A2DP sink connected: device addr=64:68:76:2F:50:6A state=2 codec=AUDIO_FORMAT_SBC vol=15
11-07 10:06:22:184 A2DP device addr=64:68:76:2F:50:6A now available
11-07 10:06:44:727 startBluetoothSco()) from u/pid:10094/1918
11-07 10:07:12:348 stopBluetoothSco()) from u/pid:10094/1918
11-07 10:09:59:478 msg: setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent state=0 addr=64:68:76:2F:50:6A prof=2 supprNoisy=false vol=-1
11-07 10:09:59:505 broadcast ACTION_AUDIO_BECOMING_NOISY
11-07 10:10:00:505 A2DP sink connected: device addr=64:68:76:2F:50:6A state=0 codec=AUDIO_FORMAT_SBC vol=-1
11-07 10:10:00:544 A2DP device addr=64:68:76:2F:50:6A made unavailable
根据提供的音频事件日志,可以看出以下设备连接和断开的时间顺序:
-
09:40:52:184:关闭蓝牙耳机设备SCO模式
-
09:43:10:491:启动蓝牙耳机设备SCO模式
-
09:43:18:442:关闭蓝牙耳机设备SCO模式
-
09:46:09:446:启动蓝牙耳机设备SCO模式
-
09:46:36:985:关闭蓝牙耳机设备SCO模式
-
09:47:46:379:无法连接A2DP设备,地址为64:68:76:2F:50:6A,出错代码为1
-
09:47:46:383:设置蓝牙A2DP设备连接状态,状态为0,地址为64:68:76:2F:50:6A,配置文件为2,关闭噪声抑制,音量为-1
-
09:47:46:399:A2DP设备连接建立,地址为64:68:76:2F:50:6A,状态为0,音频编码格式为默认,音量为-1
-
09:47:55:166:蓝牙配置文件服务:连接A2DP配置文件
-
09:47:55:261:蓝牙配置文件服务:连接HEADSET配置文件
-
09:47:57:271:设置蓝牙A2DP设备连接状态,状态为2,地址为64:68:76:2F:50:6A,配置文件为2,启用噪声抑制,音量为15
-
09:47:57:274:A2DP设备连接建立,地址为64:68:76:2F:50:6A,状态为2,音频编码格式为SBC,音量为15
-
09:47:57:503:A2DP设备地址为64:68:76:2F:50:6A的设备现在可用
-
09:47:57:513:蓝牙A2DP设备活动设备更改,地址为64:68:76:2F:50:6A,事件为DEVICE_CONFIG_CHANGE
-
09:47:57:744:APM成功处理A2DP设备地址为64:68:76:2F:50:6A的设备配置更改,音频编码格式为SBC
-
09:48:59:027:设置蓝牙A2DP设备连接状态,状态为0,地址为64:68:76:2F:50:6A,配置文件为2,关闭噪声抑制,音量为-1
-
09:48:59:032:广播ACTION_AUDIO_BECOMING_NOISY
-
09:49:00:033:A2DP设备连接建立,地址为64:68:76:2F:50:6A,状态为0,音频编码格式为SBC,音量为-1
-
09:49:00:076:A2DP设备地址为64:68:76:2F:50:6A的设备不可用
-
10:06:22:033:设置蓝牙A2DP设备连接状态,状态为2,地址为64:68:76:2F:50:6A,配置文件为2,启用噪声抑制,音量为15
-
10:06:22:037:蓝牙A2DP活动设备更改,地址为64:68:76:2F:50:6A,事件为DEVICE_CONFIG_CHANGE
-
10:06:22:037:忽略A2dp配置更改(预定的连接更改)
-
10:06:22:037:A2DP设备连接建立,地址为64:68:76:2F:50:6A,状态为2,音频编码格式为SBC,音量为15
-
10:06:22:184:A2DP设备地址为64:68:76:2F:50:6A的设备现在可用
-
10:06:22:184:蓝牙A2DP设备活动设备更改,地址为64:68:76:2F:50:6A,事件为DEVICE_CONFIG_CHANGE
-
10:06:22:192:APM成功处理A2DP设备地址为64:68:76:2F:50:6A的设备配置更改,音频编码格式为SBC
-
10:07:38:200:设置蓝牙A2DP设备连接状态,状态为0,地址为64:68:76:2F:50:6A,配置文件为2,关闭噪声抑制,音量为-1
-
10:07:38:211:关闭蓝牙设备,地址为64:68:76:2F:50:6A
-
10:07:38:350:打开蓝牙设备,地址为64:68:76:2F:50:6A
-
10:08:54:466:蓝牙配置文件服务:连接A2DP配置文件
-
10:08:54:566:蓝牙配置文件服务:连接HEADSET配置文件
-
10:08:56:647:设置蓝牙A2DP设备连接状态,状态为2,地址为64:68:76:2F:50:6A,配置文件为2,启用噪声抑制,音量为15
-
10:08:56:648:A2DP设备连接建立,地址为64:68:76:2F:50:6A,状态为2,音频编码格式为SBC,音量为15
-
10:08:57:555:忽略A2dp配置更改(预定的连接更改)
-
11:12:19:827:设置蓝牙A2DP设备连接状态,状态为0,地址为64:68:76:2F:50:6A,配置文件为2,关闭噪声抑制,音量为-1
-
11:12:19:838:A2DP设备连接建立,地址为64:68:76:2F:50:6A,状态为0,音频编码格式为SBC,音量为-1
-
11:13:00:905:A2DP设备地址为64:68:76:2F:50:6A的设备不可用
-
11:54:35:888:广播ACTION_AUDIO_BECOMING_NOISY
-
11:55:48:583:设置蓝牙A2DP设备连接状态,状态为0,地址为64:68:76:2F:50:6A,配置文件为2,关闭噪声抑制,音量为-1
-
11:55:48:591:A2DP设备连接建立,地址为64:68:76:2F:50:6A,状态为0,音频编码格式为SBC,音量为-1
-
11:56:39:635:蓝牙A2DP设备活动设备更改,地址为64:68:76:2F:50:6A,事件为DEVICE_CONFIG_CHANGE
14、音频事件日志 - 用户指定设备记录
bash
Audio event log: force use (logged before setForceUse() is executed)
11-07 10:00:39:604 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:10094/1918
11-07 10:00:39:605 setForceUse(FOR_COMMUNICATION, FORCE_NONE) due to setNewModeOwner
11-07 10:00:51:716 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:1000/519
11-07 10:00:52:325 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:10094/1918
11-07 10:00:52:326 setForceUse(FOR_COMMUNICATION, FORCE_NONE) due to setNewModeOwner
11-07 10:06:22:041 setForceUse(FOR_MEDIA, FORCE_NONE) due to setBluetoothA2dpOn(true) from u/pid:1000/519 src:onSetA2dpSinkConnectionState
11-07 10:06:44:722 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:10094/1918
11-07 10:06:44:725 setForceUse(FOR_COMMUNICATION, FORCE_NONE) due to setNewModeOwner
11-07 10:06:45:006 setForceUse(FOR_COMMUNICATION, FORCE_BT_SCO) due to BtHelper.receiveBtEvent
11-07 10:06:45:007 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:1000/519
11-07 10:06:45:261 setForceUse(FOR_RECORD, FORCE_BT_SCO) due to BtHelper.receiveBtEvent
11-07 10:06:45:490 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:10094/1918
11-07 10:07:12:345 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:10094/1918
11-07 10:07:12:346 setForceUse(FOR_COMMUNICATION, FORCE_BT_SCO) due to setNewModeOwner
11-07 10:07:12:541 setForceUse(FOR_COMMUNICATION, FORCE_NONE) due to BtHelper.receiveBtEvent
11-07 10:07:12:541 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:1000/519
11-07 10:07:12:579 setForceUse(FOR_RECORD, FORCE_NONE) due to BtHelper.receiveBtEvent
11-07 10:09:59:467 setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE) due to muteRingerModeStreams() from u/pid:1000/519
11-07 10:09:59:477 setForceUse(FOR_COMMUNICATION, FORCE_NONE) due to resetBluetoothSco
11-07 10:09:59:477 setForceUse(FOR_RECORD, FORCE_NONE) due to resetBluetoothSco
根据提供的音频事件日志,以下是发生的事件:
-
10:00:39:604:由于`muteRingerModeStreams()`从用户/进程ID为10094/1918,被调用了`setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE)`。
-
10:00:39:605:由于`setNewModeOwner`的调用,导致了`setForceUse(FOR_COMMUNICATION, FORCE_NONE)`。
-
10:00:51:716:由于`muteRingerModeStreams()`从用户/进程ID为1000/519,被调用了`setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE)`。
-
10:00:52:325:由于`muteRingerModeStreams()`从用户/进程ID为10094/1918,被调用了`setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE)`。
-
10:00:52:326:由于`setNewModeOwner`的调用,导致了`setForceUse(FOR_COMMUNICATION, FORCE_NONE)`。
-
10:06:22:041:由于从用户/进程ID为1000/519的`onSetA2dpSinkConnectionState`中调用了`setBluetoothA2dpOn(true)`,导致了`setForceUse(FOR_MEDIA, FORCE_NONE)`。
-
10:06:44:722:由于`muteRingerModeStreams()`从用户/进程ID为10094/1918,被调用了`setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE)`。
-
10:06:44:725:由于`setNewModeOwner`的调用,导致了`setForceUse(FOR_COMMUNICATION, FORCE_NONE)`。
-
10:06:45:006:由于`BtHelper.receiveBtEvent`的调用,导致了`setForceUse(FOR_COMMUNICATION, FORCE_BT_SCO)`。
-
10:06:45:007:由于`muteRingerModeStreams()`从用户/进程ID为1000/519,被调用了`setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE)`。
-
10:06:45:261:由于`BtHelper.receiveBtEvent`的调用,导致了`setForceUse(FOR_RECORD, FORCE_BT_SCO)`。
-
10:06:45:490:由于`muteRingerModeStreams()`从用户/进程ID为10094/1918,被调用了`setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE)`。
-
10:07:12:345:由于`muteRingerModeStreams()`从用户/进程ID为10094/1918,被调用了`setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE)`。
-
10:07:12:346:由于`setNewModeOwner`的调用,导致了`setForceUse(FOR_COMMUNICATION, FORCE_BT_SCO)`。
-
10:07:12:541:由于`BtHelper.receiveBtEvent`的调用,导致了`setForceUse(FOR_COMMUNICATION, FORCE_NONE)`。
-
10:07:12:541:由于`muteRingerModeStreams()`从用户/进程ID为1000/519,被调用了`setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE)`。
-
10:07:12:579:由于`BtHelper.receiveBtEvent`的调用,导致了`setForceUse(FOR_RECORD, FORCE_NONE)`。
-
10:09:59:467:由于`muteRingerModeStreams()`从用户/进程ID为1000/519,被调用了`setForceUse(FOR_VIBRATE_RINGING, FORCE_NONE)`。
-
10:09:59:477:由于`resetBluetoothSco`的调用,导致了`setForceUse(FOR_COMMUNICATION, FORCE_NONE)`。
-
10:09:59:477:由于`resetBluetoothSco`的调用,导致了`setForceUse(FOR_RECORD, FORCE_NONE)`。
以上是根据提供的音频事件日志解释的事件。每个事件似乎都是根据特定条件来设置音频强制使用模式。具体的应用和用途可能因系统配置而异。
15、音频事件日志 - 音量变量记录
bash
Audio event log: volume changes (logged when command received by AudioService)
11-07 09:27:48:700 adjustStreamVolume(stream:STREAM_ACCESSIBILITY dir:ADJUST_UNMUTE flags:0x0) from com.zte.usmartsettings
11-07 09:28:03:404 setStreamVolume(stream:STREAM_BLUETOOTH_SCO index:15 flags:0x0) from com.android.bluetooth
11-07 09:28:03:523 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, muted)
11-07 09:28:03:535 onSetA2dpSinkConnectionState dev:0x80 volIdx:150
11-07 09:28:03:935 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, unmuted)
11-07 09:28:04:715 avrcpSupportsAbsoluteVolume addr=64:68:76:2F:50:6A support=true
11-07 09:28:36:045 adjustStreamVolume(stream:STREAM_VOICE_CALL dir:ADJUST_UNMUTE flags:0x0) from android
11-07 09:28:36:047 adjustStreamVolume(stream:STREAM_SYSTEM dir:ADJUST_UNMUTE flags:0x0) from android
11-07 09:28:36:051 adjustStreamVolume(stream:STREAM_RING dir:ADJUST_UNMUTE flags:0x0) from android
11-07 09:28:36:055 adjustStreamVolume(stream:STREAM_MUSIC dir:ADJUST_UNMUTE flags:0x0) from android
11-07 09:28:36:058 adjustStreamVolume(stream:STREAM_ALARM dir:ADJUST_UNMUTE flags:0x0) from android
11-07 09:28:36:058 adjustStreamVolume(stream:STREAM_NOTIFICATION dir:ADJUST_UNMUTE flags:0x0) from android
11-07 09:28:36:061 adjustStreamVolume(stream:STREAM_DTMF dir:ADJUST_UNMUTE flags:0x0) from android
11-07 09:28:36:062 adjustStreamVolume(stream:STREAM_ACCESSIBILITY dir:ADJUST_UNMUTE flags:0x0) from android
11-07 09:28:36:062 adjustStreamVolume(stream:STREAM_BLUETOOTH_SCO dir:ADJUST_UNMUTE flags:0x0) from android
11-07 09:39:43:039 avrcpSupportsAbsoluteVolume addr=64:68:76:2F:50:6A support=true
11-07 09:47:46:377 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, muted)
11-07 09:47:46:522 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, unmuted)
11-07 09:47:48:467 setStreamVolume(stream:STREAM_MUSIC index:14 flags:0x0) from com.zte.usmartsettings
11-07 09:47:48:511 setStreamVolume(stream:STREAM_BLUETOOTH_SCO index:14 flags:0x0) from com.zte.usmartsettings
11-07 09:47:48:520 adjustStreamVolume(stream:STREAM_BLUETOOTH_SCO dir:ADJUST_UNMUTE flags:0x0) from com.zte.usmartsettings
11-07 09:47:48:525 setStreamVolume(stream:STREAM_VOICE_CALL index:14 flags:0x0) from com.zte.usmartsettings
11-07 09:47:52:121 setStreamVolume(stream:STREAM_MUSIC index:15 flags:0x0) from com.zte.usmartsettings
11-07 09:47:52:160 setStreamVolume(stream:STREAM_BLUETOOTH_SCO index:15 flags:0x0) from com.zte.usmartsettings
11-07 09:47:52:183 adjustStreamVolume(stream:STREAM_BLUETOOTH_SCO dir:ADJUST_UNMUTE flags:0x0) from com.zte.usmartsettings
11-07 09:47:52:191 setStreamVolume(stream:STREAM_VOICE_CALL index:15 flags:0x0) from com.zte.usmartsettings
11-07 09:47:57:114 setStreamVolume(stream:STREAM_BLUETOOTH_SCO index:15 flags:0x0) from com.android.bluetooth
11-07 09:47:57:267 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, muted)
11-07 09:47:57:276 onSetA2dpSinkConnectionState dev:0x80 volIdx:150
11-07 09:47:57:852 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, unmuted)
11-07 09:47:58:550 avrcpSupportsAbsoluteVolume addr=64:68:76:2F:50:6A support=true
11-07 09:48:59:023 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, muted)
11-07 09:49:00:183 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, unmuted)
11-07 10:06:21:718 setStreamVolume(stream:STREAM_BLUETOOTH_SCO index:15 flags:0x0) from com.android.bluetooth
11-07 10:06:22:033 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, muted)
11-07 10:06:22:039 onSetA2dpSinkConnectionState dev:0x80 volIdx:150
11-07 10:06:22:193 avrcpSupportsAbsoluteVolume addr=64:68:76:2F:50:6A support=true
11-07 10:06:22:294 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, unmuted)
11-07 10:09:59:476 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, muted)
11-07 10:10:00:652 VolumeStreamState.muteInternally(stream:STREAM_MUSIC, unmuted)
这个日志记录了音量变更的事件。以下是一些关键行为的总结:
-
时间 09:27:48:700:调整辅助功能音频流的音量。
-
时间 09:28:03:404:将蓝牙通话音频流的音量设置为15。
-
时间 09:28:03:523:将音乐音频流静音。
-
时间 09:28:03:935:取消音乐音频流的静音状态。
-
时间 09:28:04:715:检测到A2DP音频设备支持绝对音量。
-
时间 09:28:36:045:取消语音呼叫音频流的静音状态。
-
时间 09:28:36:047:取消系统音频流的静音状态。
-
时间 09:28:36:051:取消铃声音频流的静音状态。
-
时间 09:28:36:055:取消音乐音频流的静音状态。
-
时间 09:28:36:058:取消闹钟音频流的静音状态。
-
时间 09:28:36:058:取消通知音频流的静音状态。
-
时间 09:28:36:061:取消DTMF音频流的静音状态。
-
时间 09:28:36:062:取消辅助功能音频流的静音状态。
-
时间 09:28:36:062:取消蓝牙通话音频流的静音状态。
-
时间 09:39:43:039:检测到A2DP音频设备支持绝对音量。
-
时间 09:47:46:377:将音乐音频流静音。
-
时间 09:47:46:522:取消音乐音频流的静音状态。
-
时间 09:47:48:467:将音乐音频流的音量设置为14。
-
时间 09:47:48:511:将蓝牙通话音频流的音量设置为14。
-
时间 09:47:48:520:取消蓝牙通话音频流的静音状态。
-
时间 09:47:48:525:将语音呼叫音频流的音量设置为14。