Skip to content

Conversation

@marcpabst
Copy link

@marcpabst marcpabst commented Mar 24, 2025

This is initial work to enable getting the current latency in samples from a Stream. The latency() -> Option<u32> method returns None by default, so this will already compile with all backends. So far, an implementation for coreaudio on MacOS is provided.

Addreses #773.

@marcpabst marcpabst marked this pull request as ready for review March 25, 2025 21:13
@marcpabst
Copy link
Author

marcpabst commented Mar 25, 2025

I think this can be reviewed now - so far it only implements latency() for MacOS Core Audio but should be easy enough to support other backends too.

@marcpabst
Copy link
Author

marcpabst commented Apr 3, 2025

Could I get some feedback on this? I'm considering pouring some work into cpal (including improvments to the WASAPI backend) but I don't really want to maintain by own fork...

Edit: This was not meant to be offsensive at all, but it would be good to see if there's interest in this!

@roderickvd
Copy link
Member

@marcpabst I got added as maintainer and am doing some backlog grooming. Yes there is interest in this. I'd like to ensure that a sensical number of hosts would be supported coming out of the gates. So beyond CoreAudio also Alsa and WASAPI?

roderickvd added a commit that referenced this pull request Dec 23, 2025
Add buffer_size() method to Stream trait that returns the number of
frames passed to each data callback invocation (actual size or upper
limit depending on platform).

AAudio improvements:
- BufferSize::Default now explicitly configures using optimal burst size
  from AudioManager, following Android low-latency audio best practices
- buffer_size() query falls back to burst size if frames_per_data_callback
  was not explicitly set
- Refactored buffer configuration to eliminate code duplication

Addresses #1042
Relates to #964, #942
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.

3 participants