snowkit / snow

A low level cross platform framework for Haxe. Mac, Windows, Linux, Android, iOS, WebGL.
http://snowkit.org/snow
MIT License
133 stars 35 forks source link

Pause / Resume functionality for streaming sounds causes fail with AL.INVALID_VALUE #82

Closed DjPale closed 8 years ago

DjPale commented 9 years ago

To reproduce: run Alpha-2 sample, go to the Play state, use Esc to pause and the resume the background sound.

https://dl.dropboxusercontent.com/u/34026018/2015-09-18%2011_31_25-alpha-2.0%2B0010.png

Confirmed on Windows and Linux targets (also by others).

I have traced this to the flush_queue call (https://github.com/underscorediscovery/snow/blob/master/snow/modules/openal/sound/ALStream.hx#L106) which sets the AL error flag, but it is not checked before the update_stream call later: https://github.com/underscorediscovery/snow/blob/master/snow/modules/openal/sound/ALStream.hx#L131

DjPale commented 9 years ago

I don't know enough about OpenAL to suggest a fix, but it seems that you cannot unqueue unprocessed buffers which seems like what the code is doing (OpenAL spec 1.1 section 4.3.6). But I lack the bigger picture :)

ruby0x1 commented 8 years ago

Have you seen this after snow alpha-2.0 at all?