0

谷歌的语音助手已经有一段时间没有工作了,因为我手机的麦克风似乎被另一个应用程序使用了。

使用 ADB,我如何知道哪些应用程序正在使用麦克风?

谢谢!

更新:

adb shell dumpsys audio的输出如下

MediaFocusControl dump time: 09:01:00

Audio Focus stack entries (last is top of stack):
mFocusStack:

mFocusStackForExternal:

No external focus policy



 Notify on duck:  true

 In ring or call: false


Stream volumes (device: index)
- STREAM_VOICE_CALL:
   Muted: false
   Min: 1
   Max: 10
   Current: 1 (earpiece): 10, 2 (speaker): 10, 4 (headset): 8, 20 (bt_sco_hs): 8, 80 (bt_a2dp): 8, 40000000 (default): 8
   Devices: earpiece
- STREAM_SYSTEM:
   Muted: false
   Min: 0
   Max: 15
   Current: 1 (earpiece): 12, 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 40000000 (default): 15
   Devices: speaker
- STREAM_RING:
   Muted: false
   Min: 0
   Max: 15
   Current: 1 (earpiece): 12, 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 40000000 (default): 15
   Devices: speaker
- STREAM_MUSIC:
   Muted: false
   Min: 0
   Max: 15
   Current: 2 (speaker): 8, 4 (headset): 8, 8 (headphone): 8, 20 (bt_sco_hs): 11, 80 (bt_a2dp): 13, 4000 (usb_device): 8, 20000000 (usb_device): 8, 40000000 (default): 11
   Devices: speaker
- STREAM_ALARM:
   Muted: false
   Min: 0
   Max: 15
   Current: 2 (speaker): 15, 40000000 (default): 12
   Devices: speaker
- STREAM_NOTIFICATION:
   Muted: false
   Min: 0
   Max: 15
   Current: 1 (earpiece): 12, 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 40000000 (default): 15
   Devices: speaker
- STREAM_BLUETOOTH_SCO:
   Muted: false
   Min: 0
   Max: 15
   Current: 1 (earpiece): 10, 20 (bt_sco_hs): 10, 80 (bt_a2dp): 13, 40000000 (default): 7
   Devices: earpiece
- STREAM_SYSTEM_ENFORCED:
   Muted: false
   Min: 0
   Max: 15
   Current: 1 (earpiece): 12, 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 40000000 (default): 15
   Devices: speaker
- STREAM_DTMF:
   Muted: false
   Min: 0
   Max: 15
   Current: 1 (earpiece): 12, 2 (speaker): 15, 4 (headset): 15, 20 (bt_sco_hs): 15, 80 (bt_a2dp): 15, 40000000 (default): 15
   Devices: speaker
- STREAM_TTS:
   Muted: false
   Min: 0
   Max: 15
   Current: 2 (speaker): 8, 4 (headset): 8, 8 (headphone): 8, 20 (bt_sco_hs): 11, 80 (bt_a2dp): 13, 4000 (usb_device): 8, 20000000 (usb_device): 8, 40000000 (default): 11
   Devices: speaker
- STREAM_ACCESSIBILITY:
   Muted: false
   Min: 0
   Max: 15
   Current: 2 (speaker): 8, 4 (headset): 8, 8 (headphone): 8, 20 (bt_sco_hs): 11, 80 (bt_a2dp): 13, 4000 (usb_device): 8, 20000000 (usb_device): 8, 40000000 (default): 11
   Devices: speaker

- mute affected streams = 0x2e

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

Audio routes:
  mMainType=0x0
  mBluetoothName=null

Other state:
  mVolumeController=VolumeController(android.os.BinderProxy@962b52,mVisible=false)
  mSafeMediaVolumeState=SAFE_MEDIA_VOLUME_ACTIVE
  mSafeMediaVolumeIndex=80
  sIndependentA11yVolume=false
  mPendingVolumeCommand=null
  mMusicActiveMs=0
  UNSAFE_VOLUME_MUSIC_ACTIVE_MS_MAX=72000000
  mMcc=222
  mCameraSoundForced=false
  mHasVibrator=true
  mVolumePolicy=VolumePolicy[volumeDownToEnterSilent=false,volumeUpToExitSilent=true,doNotDisturbWhenSilent=true,vibrateToSilentDebounce=400]
  mAvrcpAbsVolSupported=false

Audio policies:

PlaybackActivityMonitor dump time: 09:01:00
  ID:23 -- type:android.media.SoundPool -- u/pid:1000/1431 -- state:idle -- attr:AudioAttributes: usage=6 content=4 flags=0x0 tags= bundle=null
  ID:39 -- type:android.media.SoundPool -- u/pid:10028/2089 -- state:idle -- attr:AudioAttributes: usage=13 content=4 flags=0x0 tags= bundle=null
  ID:31015 -- type:android.media.MediaPlayer -- u/pid:10028/2089 -- state:stopped -- attr:AudioAttributes: usage=5 content=4 flags=0x0 tags= bundle=null
  ID:15 -- type:android.media.SoundPool -- u/pid:1000/1431 -- state:idle -- attr:AudioAttributes: usage=13 content=4 flags=0x0 tags= bundle=null
  ID:31 -- type:android.media.SoundPool -- u/pid:10028/2089 -- state:idle -- attr:AudioAttributes: usage=13 content=4 flags=0x0 tags= bundle=null
  ID:31007 -- type:android.media.MediaPlayer -- u/pid:1000/1431 -- state:stopped -- attr:AudioAttributes: usage=13 content=4 flags=0x0 tags= bundle=null

  ducked players:

  muted player piids:

RecordActivityMonitor dump time: 09:01:00
  session:5065 -- source:VOICE_COMMUNICATION -- uid:10132 -- patch:9 -- pack:com.whatsapp -- format client=1ch 16000Hz ENCODING_PCM_16BIT, dev=1ch 16000Hz ENCODING_PCM_16BIT

Audio Mode:
HwAudioService:DEBUG =false
mIsHuaweiSafeMediaConfig =true
mSecurityVolumeIndex =8
LOUD_VOICE_MODE_SUPPORT=false
Lound Voice State:
HW_SOUND_TRIGGER_SUPPORT=false
mSoundTriggerStatus=0
mad=on:
wakeup=on:
HW_KARAOKE_EFFECT_ENABLED=true
DTS_SOUND_EFFECTS_SUPPORT=false
mDtsStatus=0
Dts State:
DTS_MODE_PRESTATE:unknown
HS_NO_CHARGE_ON:
isCallForeground=true
DUAL_SMARTPA_SUPPORT=false
SPK_RCV_STEREO_SUPPORT=false
mSpkRcvStereoStatus=-1
mLowlatencyUidsMap={}
mVoipOptimizeInGameMode =false

我不知道,但似乎麦克风没有被任何应用程序使用,或者我错了?

4

1 回答 1

0

您可以尝试使用此命令:

adb shell dumpsys audio

在输出中查看。Audio Focus stack entries (last is top of stack)它将使用麦克风显示应用程序的包名称

示例(当我在 whatsapp 中使用麦克风时)输出为:

 source:android.os.BinderProxy@829ac54 -- pack: com.whatsapp -- client: android.media.AudioManager@d13214cX.4K0@e5a922d -- gain: GAIN_TRANSIENT -- flags:  -- loss: none -- notified: true -- uid: 10165 -- attr: AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_MUSIC flags=0x800 tags= bundle=null -- sdk:30
于 2021-12-27T06:13:34.310 回答