Skip to content

fix(aaudio): Correctly detect minimum buffer size#1039

Merged
roderickvd merged 9 commits intoRustAudio:masterfrom
Mynd-Group:aaudio-fix
Nov 14, 2025
Merged

fix(aaudio): Correctly detect minimum buffer size#1039
roderickvd merged 9 commits intoRustAudio:masterfrom
Mynd-Group:aaudio-fix

Conversation

@will3942
Copy link
Contributor

@will3942 will3942 commented Oct 27, 2025

AAudio buffer size minimum should be detected using the PROPERTY_OUTPUT_FRAMES_PER_BUFFER on the AudioManager not using AudioTrack.

Android documentation reference: https://developer.android.com/ndk/guides/audio/audio-latency#buffer-size

This allows for a sensible buffer size minimum to be used in comparison to the 1 second+ buffer sizes reported by AudioTrack.

Tested on a Samsung Galaxy Tab A9: SupportedStreamConfigRange { channels: 1, min_sample_rate: SampleRate(5512), max_sample_rate: SampleRate(5512), buffer_size: Range { min: 256, max: 2147483647 }, sample_format: I16 }

Closes: #890

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Min buffer size range detected on Android is huge (~1sec)

2 participants