FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix AAudio builder requested device id during stream open by robertwu1 · Pull Request #2353 · google/oboe · GitHub

/ oboe Public

Fix AAudio builder requested device id during stream open - #2353

Merged
robertwu1 merged 1 commit into
mainfrom
robertwu/fixdeviceidsetter
Mar 19, 2026
Merged

robertwu1 merged 1 commit into
mainfrom
robertwu/fixdeviceidsetter

Conversation

Copy link
Copy Markdown
Collaborator

The recent routing changed callback patch overrode getDeviceId() in
AudioStreamAAudio to dynamically return the mUpdatedDeviceIds array.

However, this caused a critical initialization bug.

During stream creation in AudioStreamAAudio::open(), the builder was
configured via builder_setDeviceId(aaudioBuilder, getDeviceId()). Because
mUpdatedDeviceIds is unpopulated until the very end of the open()
sequence, getDeviceId() evaluated to an empty array and prematurely
returned 0 (kUnspecified).

As a result, Oboe was completely ignoring the app's requested device
ID and strictly routing to the default microphone and speaker.
This explicitly queries AudioStreamBase::getDeviceId() during builder
initialization to correctly retrieve the app's originally requested
device ID, avoiding the overridden dynamic routing array.

robertwu1 requested a review from flamme March 19, 2026 22:02

flamme left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the excellent debugging and fast fix!

robertwu1 merged commit 5a58c7b into main Mar 19, 2026
3 checks passed
robertwu1 deleted the robertwu/fixdeviceidsetter branch March 19, 2026 22:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL