PortAudio / portaudio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.
Other
1.37k stars 286 forks source link

wmme: fix ReadStream and WriteStream infinite timeout loops #889

Closed RossBencina closed 2 months ago

RossBencina commented 3 months ago

Replace infinite looping with bounded looping in ReadStream and WriteStream if the stream stalls for some reason. Causes ReadStream and WriteStream to return paTimedOut after a long timeout (currently set to 3 times the total buffer duration).

Note that ideally we'd detect that the wmme stream has failed rather than depending on timeouts, but there doesn't seem to be an API for that.

Note that stalling is possibly driver-dependent but has been observed after system sleep/hibernation in #883.

Proposed fix for #883