Android流媒体音频停止(暂停)

时间:2016-12-30 04:30:51

标签: android audio samsung-galaxy

我有一个Android版6.0.1的Galaxy S5 省电模式是"关闭"超省电模式是"关闭"

我尝试过三款互联网音乐流媒体应用:Pandora,SiriusXM和WDET Radio。

在每种情况下,音乐/音频素材播放一段时间(大约几分钟),然后音频会在应用程序处于关闭状态时关闭"暂停" (出现播放按钮,按下播放按钮时音频将继续)。这可以随时发生,换句话说,它不会发生在音轨的末尾。

我已经搜索了这个主题,我能找到的唯一建议是确保省电模式设置为关闭。我没有这些应用程序的源代码,所以我只能记录应用程序启用的内容。

我在过滤" aud"时捕获了一些logcat跟踪。我曾尝试过各种过滤器(也没有过滤),但在过滤" aud"之前我无法看到模式。

我已经粘贴了一段logcat,显示了Pandora的启动,当我关闭应用程序时,它从21:33:53运行到21:39。条目:

12-29 21:38:03.712 767-1806/? W/MediaFocusControl:   AudioFocus   audio focus client died

表示检测到静音音频的时间(通过收听)。没有用户干预导致这种情况。 logcat条目如下:

12-29 21:33:53.332 767-786/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:53.332 767-1713/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:53.572 767-1709/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:54.282 767-786/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:55.272 767-786/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:55.282 767-2423/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:55.862 767-1807/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:55.872 767-1709/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:55.872 767-1579/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:55.872 767-786/? D/AudioService: getStreamVolume 3 index 0
12-29 21:33:56.212 6009-6177/? W/AudioCapabilities: Unsupported mime audio/mpeg-L1
12-29 21:33:56.212 6009-6177/? W/AudioCapabilities: Unsupported mime audio/mpeg-L2
12-29 21:33:56.222 6009-6177/? W/AudioCapabilities: Unsupported mime audio/x-ms-wma
12-29 21:33:56.222 6009-6177/? W/AudioCapabilities: Unsupported mime audio/x-ima
12-29 21:33:56.222 6009-6177/? W/AudioCapabilities: Unsupported mime audio/evrc
12-29 21:33:56.232 6009-6177/? W/AudioCapabilities: Unsupported mime audio/qcelp
12-29 21:33:56.242 6009-6177/? W/AudioCapabilities: Unsupported mime audio/amr-wb-plus
12-29 21:33:56.252 6009-6177/? W/AudioCapabilities: Unsupported mime audio/qcelp
12-29 21:33:56.252 6009-6177/? W/AudioCapabilities: Unsupported mime audio/evrc
12-29 21:33:56.472 338-338/? E/OMXNodeInstance: setParameter(8e:SEC.aac.dec, ParamAudioAndroidAacPresentation(0x6f400003)) ERROR: UnsupportedIndex(0x8000101a)
12-29 21:33:56.492 338-6215/? I/SEC_AAC_DEC:  AudioSpecificConfig 0x 13 90
12-29 21:33:56.582 338-6215/? I/SEC_AAC_DEC:  AudioSpecificConfig 0x 13 90
12-29 21:33:56.912 338-29996/? W/AudioPolicyIntefaceImpl: Skipped to add effects on session 113
12-29 21:33:56.912 338-29996/? I/APM::AudioPolicyManager: startOutput() output 2, stream 3, session 113
12-29 21:33:56.922 338-945/? D/audio_hw_primary: out_set_parameters: enter: usecase(0: deep-buffer-playback) kvpairs: routing=2
12-29 21:33:56.922 338-945/? D/audio_hw_hfp: audio_extn_hfp_set_parameters: enter
12-29 21:33:56.922 338-945/? V/audio_hw_primary: out_set_parameters: exit: code(0)
12-29 21:33:56.922 338-945/? D/AudioFlinger: setCurDevice() 0x2
12-29 21:33:56.932 338-945/? I/AudioMixer: create resampler src 44100, 2, dst 48000, 2
12-29 21:33:56.932 338-945/? V/audio_hw_primary: start_output_stream: enter: usecase(0: deep-buffer-playback) devices(0x2)
12-29 21:33:56.932 338-945/? V/audio_hw_primary: select_devices: ENTER
12-29 21:33:56.932 338-945/? V/audio_hw_primary: select_devices: usecase(normal)
12-29 21:33:56.942 338-945/? V/audio_hw_primary: select_devices: usecase(PCM_PLAYBACK)
12-29 21:33:56.942 338-945/? D/audio_hw_primary: select_devices: out_snd_device(2: speaker)
12-29 21:33:56.942 338-945/? D/audio_hw_primary: select_devices: in_snd_device(0: dummy)
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> send_audio_cal, acdb_id = 15, path =  0
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> send_audtable
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TABLE


                                            [ 12-29 21:33:56.942   338:  945 D/         ]
                                            ACDBFILE_MGR:Read the devices count as zero, please check the acdb file
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_CAL
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> send_audvoltable
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_GAIN_DEP_STEP_TABLE
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_VOL_CAL
12-29 21:33:56.942 338-945/? D/ACDB-LOADER: ACDB -> AUDIO_SET_AFE_CAL
12-29 21:33:56.942 338-945/? V/audio_hw_primary: enable_snd_device: snd_device(2: speaker, speaker)
12-29 21:33:56.942 338-945/? D/audio_route: ++++ audio_route_update_mixer ==============
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: SPK DRV Volume
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: value: 8
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: RX7 Digital Volume
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: value: 79
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: COMP0 Switch
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: value: 1
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: RX7 MIX1 INP1, value: 5
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: DAC1 Switch
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: value: 1
12-29 21:33:56.942 338-945/? D/audio_route: ------ audio_route_update_mixer ==============
12-29 21:33:56.942 338-945/? V/audio_hw_primary: enable_audio_route: enter: usecase(0)
12-29 21:33:56.942 338-945/? V/audio_hw_primary: enable_audio_route: apply mixer path: deep-buffer-playback
12-29 21:33:56.942 338-945/? D/audio_route: ++++ audio_route_update_mixer ==============
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: SLIMBUS_0_RX Audio Mixer MultiMedia1
12-29 21:33:56.942 338-945/? D/audio_route: Setting mixer control: value: 1
12-29 21:33:56.952 338-945/? D/audio_route: ------ audio_route_update_mixer ==============
12-29 21:33:56.952 338-945/? V/audio_hw_primary: enable_audio_route: exit
12-29 21:33:56.952 338-945/? V/audio_hw_primary: start_output_stream: Opening PCM device card_id(0) device_id(0)
12-29 21:33:56.952 338-945/? V/audio_hw_primary: start_output_stream: exit
12-29 21:33:56.992 338-945/? D/AudioFlinger: mixer(0xb01c0000) Spend too much time to write: delta 54(effect 0)
12-29 21:33:57.062 767-1435/? I/MediaFocusControl:  AudioFocus  requestAudioFocus() from android.media.AudioManager$c4c6611com.pandora.radio.player.w$1$5c6d376 req=1flags=0x0
12-29 21:33:57.152 338-945/? D/AudioFlinger: mixer(0xb01c0000) throttle end: throttle time(120)
12-29 21:34:09.232 767-1314/? I/AudioService: isMediaSilentMode false
12-29 21:34:09.242 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4113, lastAudibleStreamVolume = 1
12-29 21:34:09.252 767-1713/? D/AudioService: getStreamVolume 3 index 10
12-29 21:34:09.252 767-2420/? D/AudioService: getStreamVolume 3 index 10
12-29 21:34:09.682 767-1314/? I/AudioService: isMediaSilentMode false
12-29 21:34:09.692 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4113, lastAudibleStreamVolume = 2
12-29 21:34:09.702 767-1807/? D/AudioService: getStreamVolume 3 index 20
12-29 21:34:09.712 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4112, lastAudibleStreamVolume = 2
12-29 21:34:09.732 767-1806/? D/AudioService: active stream is 0x8
12-29 21:34:09.732 767-1726/? D/AudioService: getStreamVolume 3 index 20
12-29 21:34:09.742 767-1294/? D/AudioService: getStreamVolume 3 index 20
12-29 21:34:10.102 767-1314/? I/AudioService: isMediaSilentMode false
12-29 21:34:10.112 767-1435/? D/AudioService: getStreamVolume 3 index 30
12-29 21:34:10.112 767-787/? D/AudioService: getStreamVolume 3 index 30
12-29 21:34:10.112 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4113, lastAudibleStreamVolume = 3
12-29 21:34:10.192 767-786/? D/AudioService: getStreamVolume 3 index 30
12-29 21:34:10.352 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4112, lastAudibleStreamVolume = 3
12-29 21:34:10.362 767-2424/? D/AudioService: active stream is 0x8
12-29 21:34:10.712 767-1314/? I/AudioService: isMediaSilentMode false
12-29 21:34:10.722 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4113, lastAudibleStreamVolume = 4
12-29 21:34:10.732 767-1711/? D/AudioService: getStreamVolume 3 index 40
12-29 21:34:10.732 767-1726/? D/AudioService: getStreamVolume 3 index 40
12-29 21:34:10.882 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4112, lastAudibleStreamVolume = 4
12-29 21:34:10.902 767-2424/? D/AudioService: active stream is 0x8
12-29 21:34:11.242 767-1806/? D/AudioService: getStreamVolume 3 index 40
12-29 21:34:11.602 767-1314/? I/AudioService: isMediaSilentMode false
12-29 21:34:11.612 767-787/? D/AudioService: getStreamVolume 3 index 50
12-29 21:34:11.622 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4113, lastAudibleStreamVolume = 5
12-29 21:34:11.622 767-786/? D/AudioService: getStreamVolume 3 index 50
12-29 21:34:11.792 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4112, lastAudibleStreamVolume = 5
12-29 21:34:11.812 767-2423/? D/AudioService: active stream is 0x8
12-29 21:34:12.142 767-1709/? D/AudioService: getStreamVolume 3 index 50
12-29 21:35:31.632 767-786/? D/AudioService: getStreamVolume 3 index 50
12-29 21:35:36.822 767-1711/? D/AudioService: getStreamVolume 3 index 50
12-29 21:35:57.142 338-945/? D/AudioFlinger: mixer(0xb01c0000) throttle end: throttle time(1)
12-29 21:36:17.112 767-1314/? I/AudioService: isMediaSilentMode false
12-29 21:36:17.142 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4113, lastAudibleStreamVolume = 4
12-29 21:36:17.142 767-1712/? D/AudioService: getStreamVolume 3 index 40
12-29 21:36:17.152 767-1806/? D/AudioService: getStreamVolume 3 index 40
12-29 21:36:17.162 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4112, lastAudibleStreamVolume = 4
12-29 21:36:17.172 767-1712/? D/AudioService: active stream is 0x8
12-29 21:36:17.592 767-1314/? I/AudioService: isMediaSilentMode false
12-29 21:36:17.602 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4113, lastAudibleStreamVolume = 3
12-29 21:36:17.622 767-787/? D/AudioService: getStreamVolume 3 index 30
12-29 21:36:17.642 767-2423/? D/AudioService: getStreamVolume 3 index 30
12-29 21:36:17.652 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4112, lastAudibleStreamVolume = 3
12-29 21:36:17.662 767-2424/? D/AudioService: active stream is 0x8
12-29 21:36:17.662 767-1294/? D/AudioService: getStreamVolume 3 index 30
12-29 21:36:19.392 767-1314/? I/AudioService: isMediaSilentMode false
12-29 21:36:19.392 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4113, lastAudibleStreamVolume = 4
12-29 21:36:19.412 767-1579/? D/AudioService: getStreamVolume 3 index 40
12-29 21:36:19.412 767-1711/? D/AudioService: getStreamVolume 3 index 40
12-29 21:36:19.612 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4112, lastAudibleStreamVolume = 4
12-29 21:36:19.622 767-1807/? D/AudioService: active stream is 0x8
12-29 21:36:19.902 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4113, lastAudibleStreamVolume = 5
12-29 21:36:19.912 767-1314/? I/AudioService: isMediaSilentMode false
12-29 21:36:19.932 767-1579/? D/AudioService: getStreamVolume 3 index 50
12-29 21:36:19.942 767-787/? D/AudioService: getStreamVolume 3 index 50
12-29 21:36:19.962 767-1435/? D/AudioService: getStreamVolume 3 index 50
12-29 21:36:20.142 1355-1481/? D/vol.VolumeDialogControl: onVolumeChangedW stream = 3, flags = 4112, lastAudibleStreamVolume = 5
12-29 21:36:20.162 767-1435/? D/AudioService: active stream is 0x8
12-29 21:36:27.352 338-945/? D/AudioFlinger: mixer(0xb01c0000) throttle end: throttle time(1)
12-29 21:36:45.422 338-945/? D/AudioFlinger: mixer(0xb01c0000) Spend too much time to write: delta 32(effect 2)
12-29 21:36:45.452 338-945/? D/AudioFlinger: mixer(0xb01c0000) throttle end: throttle time(5)
12-29 21:37:11.412 338-29996/? E/OMXNodeInstance: setParameter(91:SEC.aac.dec, ParamAudioAndroidAacPresentation(0x6f400003)) ERROR: UnsupportedIndex(0x8000101a)
12-29 21:37:11.432 338-7398/? I/SEC_AAC_DEC:  AudioSpecificConfig 0x 13 90
12-29 21:37:11.462 338-7398/? I/SEC_AAC_DEC:  AudioSpecificConfig 0x 13 90
12-29 21:37:40.682 338-923/? I/APM::AudioPolicyManager: stopOutput() output 2, stream 3, session 113
12-29 21:37:41.042 767-2420/? D/AudioService: getStreamVolume 3 index 50
12-29 21:37:41.322 767-1786/? D/AudioService: getStreamVolume 3 index 50
12-29 21:37:41.322 767-1806/? D/AudioService: getStreamVolume 3 index 50
12-29 21:37:41.322 767-2423/? D/AudioService: getStreamVolume 3 index 50
12-29 21:37:41.322 767-786/? D/AudioService: getStreamVolume 3 index 50
12-29 21:37:41.612 338-338/? W/AudioPolicyIntefaceImpl: Skipped to add effects on session 114
12-29 21:37:41.612 338-338/? I/APM::AudioPolicyManager: startOutput() output 2, stream 3, session 114
12-29 21:37:41.622 338-945/? D/audio_hw_primary: out_set_parameters: enter: usecase(0: deep-buffer-playback) kvpairs: routing=2
12-29 21:37:41.622 338-945/? V/audio_hw_primary: select_devices: ENTER
12-29 21:37:41.622 338-945/? V/audio_hw_primary: select_devices: usecase(normal)
12-29 21:37:41.622 338-945/? V/audio_hw_primary: select_devices: usecase(PCM_PLAYBACK)
12-29 21:37:41.622 338-945/? D/audio_hw_hfp: audio_extn_hfp_set_parameters: enter
12-29 21:37:41.622 338-945/? V/audio_hw_primary: out_set_parameters: exit: code(0)
12-29 21:37:41.622 338-945/? D/AudioFlinger: setCurDevice() 0x2
12-29 21:37:41.622 767-1294/? I/MediaFocusControl:  AudioFocus  requestAudioFocus() from android.media.AudioManager$c4c6611com.pandora.radio.player.w$1$5c6d376 req=1flags=0x0
12-29 21:37:41.632 338-945/? I/AudioMixer: create resampler src 44100, 2, dst 48000, 2
12-29 21:38:00.032 338-945/? D/AudioFlinger: mixer(0xb01c0000) Spend too much time to write: delta 45(effect 2)
12-29 21:38:00.092 338-945/? D/AudioFlinger: mixer(0xb01c0000) throttle end: throttle time(19)
12-29 21:38:03.712 767-1806/? W/MediaFocusControl:   AudioFocus   audio focus client died
12-29 21:38:03.712 767-1806/? I/MediaFocusControl: AudioFocus  removeFocusStackEntry(): removing entry for android.os.BinderProxy@bb512aa
12-29 21:38:04.932 767-2424/? I/MediaFocusControl:  AudioFocus  requestAudioFocus() from android.media.AudioManager$3900a0 req=1flags=0x0
12-29 21:38:04.942 6009-6009/? D/AudioManager: AudioManager dispatching onAudioFocusChange(-1) for android.media.AudioManager$c4c6611com.pandora.radio.player.w$1$5c6d376
12-29 21:38:05.142 767-1806/? I/MediaFocusControl:  AudioFocus  abandonAudioFocus() from android.media.AudioManager$c4c6611com.pandora.radio.player.w$1$5c6d376
12-29 21:38:05.152 767-1806/? I/MediaFocusControl: AudioFocus  removeFocusStackEntry(): removing entry for android.media.AudioManager$c4c6611com.pandora.radio.player.w$1$5c6d376
12-29 21:38:05.482 338-923/? I/APM::AudioPolicyManager: stopOutput() output 2, stream 3, session 114
12-29 21:38:08.392 338-945/? V/audio_hw_primary: out_standby: enter: usecase(0: deep-buffer-playback)
12-29 21:38:08.572 338-945/? V/audio_hw_primary: stop_output_stream: enter: usecase(0: deep-buffer-playback)
12-29 21:38:08.572 338-945/? V/audio_hw_primary: disable_audio_route: enter: usecase(0)
12-29 21:38:08.572 338-945/? V/audio_hw_primary: disable_audio_route: reset mixer path: deep-buffer-playback
12-29 21:38:08.572 338-945/? D/audio_route: ++++ audio_route_update_mixer ==============
12-29 21:38:08.572 338-945/? D/audio_route: Setting mixer control: SLIMBUS_0_RX Audio Mixer MultiMedia1
12-29 21:38:08.572 338-945/? D/audio_route: Setting mixer control: value: 0
12-29 21:38:08.582 338-945/? D/audio_route: ------ audio_route_update_mixer ==============
12-29 21:38:08.582 338-945/? V/audio_hw_primary: disable_audio_route: exit
12-29 21:38:08.582 338-945/? V/audio_hw_primary: disable_snd_device: snd_device(2: speaker)
12-29 21:38:08.582 338-945/? D/audio_route: ++++ audio_route_update_mixer ==============
12-29 21:38:08.582 338-945/? D/audio_route: Setting mixer control: SPK DRV Volume
12-29 21:38:08.582 338-945/? D/audio_route: Setting mixer control: value: 0
12-29 21:38:08.582 338-945/? D/audio_route: Setting mixer control: RX7 Digital Volume
12-29 21:38:08.582 338-945/? D/audio_route: Setting mixer control: value: 0
12-29 21:38:08.582 338-945/? D/audio_route: Setting mixer control: COMP0 Switch
12-29 21:38:08.582 338-945/? D/audio_route: Setting mixer control: value: 0
12-29 21:38:08.582 338-945/? D/audio_route: Setting mixer control: RX7 MIX1 INP1, value: 0
12-29 21:38:08.582 338-945/? D/audio_route: Setting mixer control: DAC1 Switch
12-29 21:38:08.582 338-945/? D/audio_route: Setting mixer control: value: 0
12-29 21:38:08.592 338-945/? D/audio_route: ------ audio_route_update_mixer ==============
12-29 21:38:08.592 338-945/? V/audio_hw_primary: stop_output_stream: exit: status(0)
12-29 21:38:08.592 338-945/? V/audio_hw_primary: out_standby: exit
12-29 21:39:41.392 767-786/? W/MediaFocusControl:   AudioFocus   audio focus client died
12-29 21:39:41.392 767-786/? I/MediaFocusControl: AudioFocus  removeFocusStackEntry(): removing entry for android.os.BinderProxy@b2a247a
12-29 21:39:41.402 767-2424/? D/AudioService: getStreamVolume 3 index 50
12-29 21:39:41.402 767-1807/? D/AudioService: getStreamVolume 3 index 50

音频焦点客户端的第二个实例死于:

12-29 21:39:41.392 767-786/? W/MediaFocusControl:   AudioFocus   audio focus client died

这是在我按下后退按钮然后从媒体通知关闭应用程序后发生的。

SiriusXM和WDET Radio应用程序都提供了类似的行为,因为"音频焦点客户端已经死亡"和静音行为有关。我是这些应用程序的最终用户,但由于它们都以类似的方式运行,我认为它必须与我的设备配置有关。无论我使用Wifi还是LTE作为我的数据链路,都会发生这种情况。此外,会出现相同的结束行为(当进入"暂停&#34时失去音频;)是否通过USB启用了日志记录或没有USB连接。

我过去没有注意到这种行为,但我无法确切地说它在什么时候开始发生。

什么能导致音频单方面静音?

我的Android上是否有可能导致此问题的设置?

我可以提供更多信息来帮助解决此问题吗?

非常感谢。 吉姆

新信息: 当音频焦点客户端被宣布死亡时,我运行了一些测试并发现了以下logcat模式(四个测试结果中的四个):

测试1:

12-30 16:14:05.545 809-911/? I/ActivityManager: Killing 13320:com.bmwgroup.connected.bmw.usa/u0a303 (adj 8): SSR - service for lastStateTime 603s, lastActivityTime 603s
12-30 16:14:05.575 809-911/? V/BroadcastQueue: [background] Process cur broadcast BroadcastRecord{c9a7ef2 u0 null qIdx=4}, state= (APP_RECEIVE) DELIVERED for app ProcessRecord{5a54404 2277:com.google.android.gms.persistent/u0a14}
12-30 16:14:05.595 809-2443/? W/MediaFocusControl:   AudioFocus   audio focus client died

的Test2:

12-30 16:39:59.942 809-832/? I/ActivityManager: Killing 17082:com.bmwgroup.connected.bmw.usa/u0a303 (adj 8): SSR - service for lastStateTime 600s, lastActivityTime 600s
12-30 16:39:59.972 809-1751/? W/MediaFocusControl:   AudioFocus   audio focus client died

Test3的:

12-30 16:50:13.251 809-1741/? I/ActivityManager: Killing 19652:com.bmwgroup.connected.bmw.usa/u0a303 (adj 8): SSR - service for lastStateTime 612s, lastActivityTime 612s
12-30 16:50:13.291 809-1751/? W/MediaFocusControl:   AudioFocus   audio focus client died

TEST4:

12-30 17:10:18.691 809-1747/? I/ActivityManager: Killing 26325:com.bmwgroup.connected.bmw.usa/u0a303 (adj 8): SSR - service for lastStateTime 603s, lastActivityTime 603s
12-30 17:10:18.731 809-1502/? W/MediaFocusControl:   AudioFocus   audio focus client died

在每种情况下,音频都在ActivityManager杀死Connected BMW应用程序的同时停止。

这是否意味着BMW Connected应用程序具有音频焦点,即使它没有流出音频?

其他应用程序(SiriusXM,Pandora或WDET Radio)是流媒体音频。

我卸载了Connected BMW应用程序,三个应用程序(SiriusXM,Pandora和WDET Radio)中的每一个都连续播放了20分钟。无论如何我从未使用过连接的应用程序。

1 个答案:

答案 0 :(得分:1)

Check this question

可能是因为Android操作系统因资源不足而导致服务中断。您可以使您的服务前景避免它。这是snippit:

private void sendToForeground() {
    Notification note = new Notification(0, null,
        System.currentTimeMillis());
    note.flags |= Notification.FLAG_NO_CLEAR;
    startForeground(0, note);
}

只需在onCreate of service中调用它。