Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture buffer size doesn't affect latency #971

Open
okaniku opened this issue Feb 7, 2024 · 1 comment
Open

Capture buffer size doesn't affect latency #971

okaniku opened this issue Feb 7, 2024 · 1 comment

Comments

@okaniku
Copy link

okaniku commented Feb 7, 2024

I have an 'echo' app that captures my mic and plays it back immediately. I'm trying to improve the latency. I'm able to noticeably improve the latency by increasing the capture frequency. I expected to also be able to improve the latency by decreasing the buffer size (i.e. the bufferSize parameter on alcCaptureOpenDevice), but this doesn't happen.

Is this a known issue, or is my assumption incorrect?

@kcat
Copy link
Owner

kcat commented Feb 7, 2024

The capture buffer size specifies the minimum total buffer that captured samples are read into. It doesn't affect how long it takes for samples coming in to be ready for reading, only how long you can wait before you start losing samples from a buffer overrun.

There currently isn't a way to specify the period or packet size, which would determines how many samples need to be captured before the app is made aware of them.

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

No branches or pull requests

2 participants