cpal icon indicating copy to clipboard operation
cpal copied to clipboard

Inconsistent stream auto-play behavior

Open Ralith opened this issue 4 years ago • 2 comments

StreamTrait::play says:

Note: Not all platforms automatically run the stream upon creation

This is a footgun, causing incautious applications to behave inconsistently on different platforms. Can cpal instead normalize platform behavior, perhaps by implicitly playing on platforms which start paused, or by deferring stream construction until the first play call at least on platforms with auto-play?

Ralith avatar Oct 09 '21 18:10 Ralith

Some related discussion back in #175.

mitchmindtree avatar Oct 11 '21 08:10 mitchmindtree

Tomaka's argument for initially-paused is compelling:

Another thing to take into account is that if you create a play-by-default voice then pause it, you might have a problem because the backend attempted to get data between the creation of the voice and the pausing.

I also see that ALSA historically was initially paused; I wonder when/why that changed.

Ralith avatar Oct 11 '21 18:10 Ralith