Loading services/audiopolicy/managerdefault/AudioPolicyManager.cpp +19 −10 Original line number Diff line number Diff line Loading @@ -2486,7 +2486,7 @@ status_t AudioPolicyManager::startSource(const sp<SwAudioOutputDescriptor>& outp const sp<TrackClientDescriptor>& client, uint32_t *delayMs) { // cannot start playback of STREAM_TTS if any other output is being used // cannot start beacon playback if any other output is being used uint32_t beaconMuteLatency = 0; *delayMs = 0; Loading @@ -2494,6 +2494,8 @@ status_t AudioPolicyManager::startSource(const sp<SwAudioOutputDescriptor>& outp auto clientVolSrc = client->volumeSource(); auto clientStrategy = client->strategy(); auto clientAttr = client->attributes(); // SPEAKER_CLEANUP doesn't the share the high-frequency requirements of beacons if (clientAttr.usage != AUDIO_USAGE_SPEAKER_CLEANUP) { if (stream == AUDIO_STREAM_TTS) { ALOGV("\t found BEACON stream"); if (!mTtsOutputAvailable && mOutputs.isAnyOutputActive( Loading @@ -2506,6 +2508,9 @@ status_t AudioPolicyManager::startSource(const sp<SwAudioOutputDescriptor>& outp // some playback other than beacon starts beaconMuteLatency = handleEventForBeacon(STARTING_OUTPUT); } } else { // TODO handle muting of other streams outside of a11y } // force device change if the output is inactive and no audio patch is already present. // check active before incrementing usage count Loading Loading @@ -2776,7 +2781,11 @@ status_t AudioPolicyManager::stopSource(const sp<SwAudioOutputDescriptor>& outpu auto clientVolSrc = client->volumeSource(); bool wasLeUnicastActive = isLeUnicastActive(); // speaker cleanup is not a beacon event // TODO handle speaker cleanup activity if (client->attributes().usage != AUDIO_USAGE_SPEAKER_CLEANUP) { handleEventForBeacon(stream == AUDIO_STREAM_TTS ? STOPPING_BEACON : STOPPING_OUTPUT); } if (outputDesc->getActivityCount(clientVolSrc) > 0) { if (outputDesc->getActivityCount(clientVolSrc) == 1) { Loading Loading
services/audiopolicy/managerdefault/AudioPolicyManager.cpp +19 −10 Original line number Diff line number Diff line Loading @@ -2486,7 +2486,7 @@ status_t AudioPolicyManager::startSource(const sp<SwAudioOutputDescriptor>& outp const sp<TrackClientDescriptor>& client, uint32_t *delayMs) { // cannot start playback of STREAM_TTS if any other output is being used // cannot start beacon playback if any other output is being used uint32_t beaconMuteLatency = 0; *delayMs = 0; Loading @@ -2494,6 +2494,8 @@ status_t AudioPolicyManager::startSource(const sp<SwAudioOutputDescriptor>& outp auto clientVolSrc = client->volumeSource(); auto clientStrategy = client->strategy(); auto clientAttr = client->attributes(); // SPEAKER_CLEANUP doesn't the share the high-frequency requirements of beacons if (clientAttr.usage != AUDIO_USAGE_SPEAKER_CLEANUP) { if (stream == AUDIO_STREAM_TTS) { ALOGV("\t found BEACON stream"); if (!mTtsOutputAvailable && mOutputs.isAnyOutputActive( Loading @@ -2506,6 +2508,9 @@ status_t AudioPolicyManager::startSource(const sp<SwAudioOutputDescriptor>& outp // some playback other than beacon starts beaconMuteLatency = handleEventForBeacon(STARTING_OUTPUT); } } else { // TODO handle muting of other streams outside of a11y } // force device change if the output is inactive and no audio patch is already present. // check active before incrementing usage count Loading Loading @@ -2776,7 +2781,11 @@ status_t AudioPolicyManager::stopSource(const sp<SwAudioOutputDescriptor>& outpu auto clientVolSrc = client->volumeSource(); bool wasLeUnicastActive = isLeUnicastActive(); // speaker cleanup is not a beacon event // TODO handle speaker cleanup activity if (client->attributes().usage != AUDIO_USAGE_SPEAKER_CLEANUP) { handleEventForBeacon(stream == AUDIO_STREAM_TTS ? STOPPING_BEACON : STOPPING_OUTPUT); } if (outputDesc->getActivityCount(clientVolSrc) > 0) { if (outputDesc->getActivityCount(clientVolSrc) == 1) { Loading