Skip to content

Car audio: don't drop volume on an Oboe reopen (null routed type != disconnect)#61

Merged
sfortis merged 1 commit into
devfrom
feature/car-route-unify
Jul 20, 2026
Merged

Car audio: don't drop volume on an Oboe reopen (null routed type != disconnect)#61
sfortis merged 1 commit into
devfrom
feature/car-route-unify

Conversation

@sfortis

@sfortis sfortis commented Jul 20, 2026

Copy link
Copy Markdown
Owner

In the car (BT A2DP), a notification/duck triggers an Oboe stream reopen, which resets the engine's routedDeviceType to -1 until the AudioDeviceCallback re-resolves it. getRoutedDeviceType() then returns null, and routedCarActive() treated null as 'left the car' (?: return false), scheduling the car-session exit; if the stream was still reopening at the 3s debounce, the exit fired and restored the pre-car volume (e.g. 40%) even though the car never disconnected. The user had to re-raise it with the volume rocker.

Fix: a null routed type is 'resolving', not a disconnect (a real disconnect resolves to a concrete builtin type). routedCarActive() now bails only on a concrete non-BT type; null or a BT type falls through to the connected-car-sink truth, mirroring how resolveCarKey handles a null routed key on entry (the entry/exit asymmetry was the bug). Confirmed against the 13:55 field log (car-audio active->gone in 3s with no BT disconnect). +1 regression test.

🤖 Generated with Claude Code

…d type != disconnect), fixing a spurious volume drop to the pre-car level on notification/duck
@sfortis sfortis added the bug Something isn't working label Jul 20, 2026
@sfortis
sfortis merged commit 35bdd63 into dev Jul 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant