Skip to content

Instantly share code, notes, and snippets.

@polynomial
Created February 23, 2026 03:56
Show Gist options
  • Select an option

  • Save polynomial/603811b12cd597792994a8916d90ec19 to your computer and use it in GitHub Desktop.

Select an option

Save polynomial/603811b12cd597792994a8916d90ec19 to your computer and use it in GitHub Desktop.
Android bug: speaker-safe route not restored after notification interrupts media playback (Pixel 10 Pro)

Android Bug: Audio route not restored to speaker-safe after notification interruption

Summary

On Pixel 10 Pro (Android 16 / SDK 36), when media is playing on the speaker and a notification sound plays, the audio route switches from speaker-safe to speaker when media resumes. speaker-safe applies additional DSP limiting and is quieter; the switch to speaker causes a noticeable volume increase at the same volume setting. The route is never restored to speaker-safe.

Impact

When using the phone to play podcasts or sleep sounds at bedtime, the volume suddenly increases after the first notification arrives (typically 10-15 minutes after locking the screen), waking the user. Reproducible across multiple apps (Podcast Addict, Headspace).

Device

  • Pixel 10 Pro
  • Android 16 (SDK 36)
  • Build: BMEA-A0D-00

Steps to Reproduce

  1. Open a media app (e.g., Headspace, Podcast Addict)
  2. Start playing audio on the speaker at a low volume
  3. Lock the screen
  4. Wait for any notification to arrive

Expected Behavior

After the notification sound finishes and media resumes, audio should continue playing via speaker-safe at the same perceived volume.

Actual Behavior

After the notification sound finishes, media resumes via speaker (not speaker-safe), which is perceptibly louder at the same volume setting.

Log Evidence

Phase 1: Initial media playback routed to speaker-safe

02-22 17:41:46.084  1352  2548 I ASvc::CommandWorker: StartStreamAndActivateRoute: try to start primary-playback, counter 5
02-22 17:41:46.085  1352  2548 I AHal::Router: InvalidateLocked: new graph #5189 Edges(1):
02-22 17:41:46.085  1352  2548 I AHal::Router:   [direction: 0, use case: primary-playback, id: 0, ... device: speaker-safe, ...]
02-22 17:41:46.085  1352  2548 I AHal::Router: LogTransferring:   (null) => primary-playback-0 -> speaker-safe
02-22 17:41:46.085  1352  2548 I AHal::Router: Configure: config device primary-playback-0 -> speaker-safe
02-22 17:41:46.090  1352  2548 I AHal::Speaker: Enable: speaker-safe
02-22 17:41:46.097  1352  2548 I AHal::AdaptedRouteControl: Update: update route from null to adapted-speaker-safe
02-22 17:41:46.098  1352  2548 I AHal::AudioRoutePathController: ApplyPath: adapted-speaker-safe: true
02-22 17:41:46.098  1352  2548 I AHal::AudioRoutePathController: ApplyPath: speaker-safe: true
02-22 17:41:46.098  1352  2548 D audio_route: Apply path: primary-playback-0 -> speaker-safe
02-22 17:41:46.174  1352  1352 D AHal::AudioMetric: UpdatePlaybackMetadata: New Playback Info: PlaybackInfo {Route: {SYS_RESERVED_INVALID, device: speaker-safe, use_case: primary-playback}, volume: 0.287763, is_active: 1, ...}

Phase 2: Notification sound takes audio focus

02-22 17:41:45.254  2991  1288 D RingtonePlayer: requesting AudioFocus
02-22 17:41:45.257  1934  3536 I MediaFocusControl: requestAudioFocus() from uid/pid 10264/2991 AA=USAGE_NOTIFICATION/CONTENT_TYPE_SONIFICATION clientId=android.media.AudioManager@a3710b4 callingPack=com.android.systemui req=3 flags=0x0 sdk=36
02-22 17:41:45.257  1934  3536 I AS.FadeOutManager: unfadeOutUid() uid:10264
02-22 17:41:45.257  2991  1288 D RingtonePlayer: notification will be delayed by 500ms

Phase 3: Notification finishes, media app gets focus back

02-22 17:41:49.146  2991  1288 D RingtonePlayer: onCompletion() abandoning AudioFocus
02-22 17:41:49.147  1934  3536 I MediaFocusControl: abandonAudioFocus() from uid/pid 10264/2991 clientId=android.media.AudioManager@a3710b4 callingPack=com.android.systemui
02-22 17:41:49.148  1934  3536 I AS.FadeOutManager: unfadeOutUid() uid:10319

Phase 4: speaker-safe route torn down

02-22 17:41:52.114  1352  2548 I AHal::Router: Deactivate: deactivate 400001
02-22 17:41:52.114  1352  2548 I AHal::Waves: UpdateActiveDevices: removing speaker-safe
02-22 17:41:52.114  1352  2548 I AHal::DeviceInterface: Disconnect: disconnect primary-playback-0 -> speaker-safe
02-22 17:41:52.116  1352  2548 I AHal::Speaker: Disable: speaker-safe
02-22 17:41:52.117  1352  2548 I AHal::AdaptedRouteControl: Update: update route from adapted-speaker-safe to null
02-22 17:41:52.118  1352  2548 I AHal::AudioRoutePathController: ResetPath: adapted-speaker-safe: true
02-22 17:41:52.118  1352  2548 I AHal::Router: LogTransferring:   primary-playback-0 -> speaker-safe => (null)

Phase 5: Media resumes on speaker (NOT speaker-safe) — BUG

02-22 17:42:37.287  1352  2553 I ASvc::CommandWorker: cw-deep-buffer-playback: Command{start: Void{}} in StreamOutStandbyState
02-22 17:42:37.287  1352  2553 I ASvc::CommandWorker: StartStreamAndActivateRoute: try to start deep-buffer-playback, counter 5
02-22 17:42:37.287  1352  2553 I AHal::Router: InvalidateLocked: new graph #5192 Edges(1):
02-22 17:42:37.287  1352  2553 I AHal::Router:   [direction: 0, use case: deep-buffer-playback, id: 0, ... device: speaker, ...]
02-22 17:42:37.287  1352  2553 I AHal::Router: LogTransferring:   (null) => deep-buffer-playback-0 -> speaker
02-22 17:42:37.287  1352  2553 I AHal::Router: Configure: config device deep-buffer-playback-0 -> speaker
02-22 17:42:37.288  1352  2553 I AHal::Speaker: Enable: speaker
02-22 17:42:37.291  1352  2553 I AHal::AdaptedRouteControl: Update: update route from null to adapted-speaker
02-22 17:42:37.304  1352  2553 D AHal::AudioMetric: OnRoutingGraphChanged: New Playback Info: PlaybackInfo {Route: {SYS_RESERVED_INVALID, device: speaker, use_case: deep-buffer-playback}, volume: 0, is_active: 0, ...}

Note two changes:

  1. Use case changed: primary-playbackdeep-buffer-playback
  2. Device changed: speaker-safespeaker (louder, no DSP limiting)

Phase 6: Audio continues on speaker indefinitely

02-22 17:57:52.574  1352  2204 D AHal::Waves: UpdateTuning: update Device: speaker, ... MaxVolume: 0.158308, ...
02-22 17:58:07.566  1352  2204 D AHal::Waves: UpdateTuning: update Device: speaker, ... MaxVolume: 0.158308, ...

The route never returns to speaker-safe for the remainder of the session.

Workaround

Enabling Do Not Disturb before playing sleep audio prevents notifications from triggering the audio focus change that causes the route switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment