Burgestrand/Hallon — Issue #65: Format might change before popping audio data off the AudioQueue in AudioDriver#stream
Author: Burgestrand
Created: 2012-01-17 09:33:48+00:00
State: open
Labels: Audio, Bug

The rationale for using the AudioDriver#stream { |num_samples| } method was that the driver could decide the size of the data it’ll consume. However, there’s an issue here.

For the audio driver to decide the format of the data it receives it needs to read its’ own format. It’s set by Hallon::Player on the underlying driver as soon as it changes.

Now, it’s possible that the driver reads its’ current format, decides how much data it wants, and then yields to the stream feeder block. If the format changes between calling the streamer-block and achieving the lock around the audio queue, the data that our driver gets *might* have another format than expected.