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

Block size specification for audio worklet #21743

Open
msqr1 opened this issue Apr 11, 2024 · 3 comments
Open

Block size specification for audio worklet #21743

msqr1 opened this issue Apr 11, 2024 · 3 comments
Assignees

Comments

@msqr1
Copy link

msqr1 commented Apr 11, 2024

Audio worklet right now has an unchangable block size of 128, which lowers the latency, but it can come in too fast, or unfit for the provided processing algorithm.

@MatthieuMv
Copy link

MatthieuMv commented Apr 28, 2024

This can also be a waste of performance in case of a multi-threaded audio processor.
For example, if one generates audio blocks of 2048 samples, the audio callback is called at a higher frequency than processing. I'm pretty sure this implies more cache misses and more context switches in the long run.
Would it be a difficult feature to add ?

@msqr1
Copy link
Author

msqr1 commented Apr 29, 2024

I think it can be easy if block size allowed is a multiple of 128, since we can just allocate it once, accumulate with calculated offset while keeping track of count, and run the callback function on the buffer. Then we can keep reusing it since this is shared memory

@sbc100
Copy link
Collaborator

sbc100 commented Apr 29, 2024

@juj any feedback on this? IIRC this has maybe come up before?

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

4 participants