#297 closed defect (fixed)
alSourceUnqueueBuffers fails with "invalid value"
Reported by: | Jan Wassenberg | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | |
Component: | Core engine | Keywords: | snd_mgr |
Cc: | Patch: |
Description
This has been reported on two Linux systems, both running OpenALsoft. To narrow down the cause, I added some printfs [source ID, is it a valid source name, #processed buffers]:
ade7938 1 0 ade7938 1 0 ade7938 1 0 ade7938 1 0 ade7938 1 0 ade7938 1 0 ade7938 1 0 ade7938 1 0 ade7938 1 0 ade7938 1 0 adcede0 1 1
so the first time it's actually wanting to unqueue a buffer, OpenAL reports an error. After continuing from the error, it doesn't come up again during the program run.
alSourceUnqueueBuffers fails with "invalid value" iff a buffer cannot be unqueued because it's still playing. However what we do is ask how many buffers have finished before removing exactly that many. I have no idea what could be causing this, especially because the Windows OpenAL implementation does not raise this error. Help is very welcome.
Attachments (2)
Change History (7)
by , 15 years ago
Attachment: | openal.trace added |
---|
comment:1 by , 15 years ago
Thanks for the trace! That's very useful, unfortunately I didn't see anything suspicious, though. I've passed this on to the openal-devel mailing list.
by , 15 years ago
Attachment: | annotated_trace.txt added |
---|
comment:2 by , 15 years ago
Update: I've boiled down the trace to the mostly important parts (see annotated trace.txt above), which has revealed a problem. The same OpenAL source is reused after stopping it and wiping out its buffer queue. This is legitimate and desirable (creating sources may be expensive), but OpenALsoft doesn't appear to handle the case correctly where the old source was set to looping and therefore had unprocessed buffers.
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [7111]) # fix sound error on Linux Linux OpenALsoft implementations weren't resetting source state correctly when stopping/clearing buffer queue, leading to errors when the source was reused. workaround: use 'rewind' to ensure the buffer state is updated. closes #297 (please reopen if the problem persists)
output from
ltrace -C -l /usr/lib/libopenal.so ./pyrogenesis_dbg