Commit 636e52e
refactor(alsa): optimize period configuration and audio callback performance (#1013)
* refactor(alsa): optimize period configuration and audio callback performance
Implement device-aware period configuration strategy:
- Query device limits to determine optimal approach
- Prefer double buffering when buffer fits within device period size limits
- Use multi-period configuration for larger buffers with calculated period distribution
- Fallback to buffer-size-only configuration for maximum device compatibility
Performance optimizations:
- Pre-allocate worker thread buffers and silence templates
- Cache period_frames and period_samples in StreamInner for hot path performance
- Pre-fill descriptors array once instead of reallocating on each poll
* docs: clarify FrameCount and improve BufferSize documentation
* feat(alsa): enable support for U24 sample format
* refactor: rename to clippy::too_many_arguments
Co-authored-by: Alexandre Bique <[email protected]>1 parent 87b7036 commit 636e52e
4 files changed
+334
-96
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments