You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does CPAL add any latency for any of the backends? PortAudio has a major issue with doubling the latency with its JACK implementation and I am hoping CPAL has no such problems. Regardless of the answer, it would be good to document it.
In many cases, cpal directly forwards the hardware buffers provided by the underlying API to the user callback. For instance, on Windows, WASAPI signals a waitable object on every period, and cpal maps WASAPI's buffer as the slice that is passed to the data callback, which means you are reading from/writing to WASAPIs buffer directly. The current ASIO implementation does funnel everything through a staging buffer because it needs to (de-)interleave multi-channel streams, but this happens entirely within the same buffer cycle, so it doesn't affect total latency.
I'm personally not familiar with the other platforms, so I can't make any guarantees there, but if one of cpal's backends increases latency by queueing up stream data, then I'd consider that a bug.
Activity
LastExceed commentedon Aug 16, 2026
There shouldn't be any.
In many cases, cpal directly forwards the hardware buffers provided by the underlying API to the user callback. For instance, on Windows, WASAPI signals a waitable object on every period, and cpal maps WASAPI's buffer as the slice that is passed to the data callback, which means you are reading from/writing to WASAPIs buffer directly. The current ASIO implementation does funnel everything through a staging buffer because it needs to (de-)interleave multi-channel streams, but this happens entirely within the same buffer cycle, so it doesn't affect total latency.
I'm personally not familiar with the other platforms, so I can't make any guarantees there, but if one of cpal's backends increases latency by queueing up stream data, then I'd consider that a bug.