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

Unable to pause WASAPI output stream from callback #235

Open
maximumspatium opened this issue May 9, 2020 · 1 comment
Open

Unable to pause WASAPI output stream from callback #235

maximumspatium opened this issue May 9, 2020 · 1 comment

Comments

@maximumspatium
Copy link

maximumspatium commented May 9, 2020

As the title says, I'm trying to pause a sound output stream from the callback.

The corresponding code is here: https://github.com/dingusdev/dingusppc/blob/ba81094fa278cfa3c59b9996f307e05c2109e845/devices/awacs.cpp#L179-L187

The above code works flawlessly with CoreAudio.

When running it with the WASAPI backend, soundio_outstream_pause() seems to have no effect. libsoundio continues to invoke the callback at infinitum.

The ability to pause a stream when data is exhausted is a requirement for us.

We're emulating a vintage sound DMA that should go idle when there is no more data. An operating system that runs in another thread polls the internal state of the DMA channel and blocks as long as the DMA channel is active.

Is there a possibility to make it work with WASAPI?

@shangjiaxuan
Copy link

This seems easy to fix. Look at this pull #231, it also addresses some problems with wasapi and has a smaller default buffer size for less default latency.

Or you may look at the outstream_shared_run function and add a check for pause before calling the write callback and see if the problem persists.

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

2 participants