View Issue Details

IDProjectCategoryView StatusLast Update
0000938FSSCPsoundpublic2006-08-19 04:42
ReporterGoober5000 Assigned Totaylor  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Summary0000938: The first time a soundtrack is loaded, the ambient pattern doesn't load
DescriptionI traced it to AudioStream::Create in audiostr-openal.cpp. For some reason this returns failure the first time it tries to load an ambient pattern, causing the pattern's handle to be set to -1 and the ambient music to not play.
TagsNo tags attached.

Relationships

has duplicate 0000935 closedtaylor audiostr-openal.cpp:1113 - OpenAL error = 'Invalid Operation' 
has duplicate 0000936 closedtaylor Music doesn't play in command briefings 

Activities

taylor

2006-06-07 03:41

administrator   ~0005786

Traced it to where in AudioStream::Create?

Goober5000

2006-06-14 22:52

administrator   ~0005842

Last edited: 2006-06-14 23:18

This:

// Create sound buffer
OpenAL_ErrorCheck( alGenSources(1, &m_source_id), return FAILURE );


EDIT: The error number returned by alGetError was 40964, and the errorlog text was the following:

SOUND: C:\Languages\Visual Studio Projects\Visual C++\fs2_open\code\sound\audiostr-openal.cpp:1136 - OpenAL error = 'Invalid Operation'

edited on: 06-14-06 19:18

taylor

2006-06-14 23:30

administrator   ~0005843

Hmm, that would indicate a context or device issue. Not really sure what to do there. I'll play with some things and see what I can come up with to make sure the context/device is still in a good state.

Kazan

2006-08-16 20:12

developer   ~0006460

any update on this taylor?

taylor

2006-08-16 23:40

administrator   ~0006461

Nope, still not sure why it happens. The errors seem to be context related, since by the OpenAL source that's when those errors are produces, but making sure the context is good (and active) doesn't fix the problem. It all works perfectly under Linux and OS X so it's something specific to Windows.

Kazan

2006-08-17 00:08

developer   ~0006462

Last edited: 2006-08-17 00:09

joy.. well this bug should be considered show-stopping for WCS

how about trying to work around the bug by trying again on failure?

edited on: 08-16-06 20:09

taylor

2006-08-17 03:59

administrator   ~0006463

There isn't much point in trying to work around a bug that can't be identified in the slightest. All of the code is open source so I've seen where the problem is coming from. But the real problem is that there doesn't appear to be an actual problem, and no fixes that should work actually do. I can't find any reason for it to fail like it does. It should only fail the way that it does for one reason, but that reason doesn't even exist as far as I can test. Even when it does fail the extra debug code I have tested with says that everything is working perfectly.

I'm trying to come at it from serveral other angles though. Not sure if anything will work, but I'll find out for sure once a test build goes out and people get back to me with success or failure.

CP5670

2006-08-17 20:34

reporter   ~0006465

The exact behavior of this seems to be vary between missions. Some missions have no issues, others often don't play the ambient music the first time but work fine if they're restarted, and one I have never plays it no matter what.

I think for now, it may be a good idea to release both OpenAL and Directsound builds for any upcoming 3.6.9 RCs. I don't recall having any issues with this when FSO was still using Directsound.

taylor

2006-08-17 20:47

administrator   ~0006466

No OpenAL means no MVEs. That's why we decided to go ahead and switch now. The Theora player will also be OpenAL only.

Kazan

2006-08-17 20:59

developer   ~0006467

are we sure OpenAL is always getting initialized cleanly before these calls are hit?

taylor

2006-08-17 21:23

administrator   ~0006468

Yes, OpenAL is fully in use, and playing sound, before it ever gets to this point that it's messing up. There is far more debugging code around the OpenAL calls than is remotely needed. If there was an init problem we would deffinitely know about it.

But like I said, there are only two possible reasons that the "Invalid Operation" error supposedly gets generated in that function: a) the context is either not active or invalid, or b) the device isn't valid. I can easily check for both problems before the call that fails is made and it works perfectly.

I've quadruple-checked all of the code and I can't find a problem. Whatever it is it's only an issue for Windows so there can't be just a basic error or it would show up on at least one of the other platforms. Either Creative is doing something totally different in their version of the driver (which I kinda doubt), or there is some Windows specific bug in the streaming code which is causing thread and/or mutex issues.

Kazan

2006-08-17 21:30

developer   ~0006469

i figured it was a dumb question, never hurts to ask though

... i'd rather have NO MVE than no music (MVE is a shitty format to begin with)

taylor

2006-08-18 18:22

administrator   ~0006474

CP5670 reports that a test build I sent him fixed the problems. So I'll get the updated code in CVS and then resolve this.

Kazan

2006-08-18 18:36

developer   ~0006475

f**king rock man :D good job

Goober5000

2006-08-18 19:30

administrator   ~0006476

Well done. :D

taylor

2006-08-19 04:42

administrator   ~0006484

Should now be...

Fixered.

Issue History

Date Modified Username Field Change
2006-06-07 02:40 Goober5000 New Issue
2006-06-07 02:51 Goober5000 Summary The first time a soundtrack is loaded, the ambient mission doesn't load => The first time a soundtrack is loaded, the ambient pattern doesn't load
2006-06-07 02:51 Goober5000 Description Updated
2006-06-07 03:41 taylor Note Added: 0005786
2006-06-14 22:52 Goober5000 Note Added: 0005842
2006-06-14 23:18 Goober5000 Note Edited: 0005842
2006-06-14 23:30 taylor Note Added: 0005843
2006-08-16 20:12 Kazan Note Added: 0006460
2006-08-16 23:40 taylor Note Added: 0006461
2006-08-17 00:08 Kazan Note Added: 0006462
2006-08-17 00:09 Kazan Note Edited: 0006462
2006-08-17 03:59 taylor Note Added: 0006463
2006-08-17 20:34 CP5670 Note Added: 0006465
2006-08-17 20:47 taylor Note Added: 0006466
2006-08-17 20:59 Kazan Note Added: 0006467
2006-08-17 21:23 taylor Note Added: 0006468
2006-08-17 21:30 Kazan Note Added: 0006469
2006-08-18 18:22 taylor Note Added: 0006474
2006-08-18 18:36 Kazan Note Added: 0006475
2006-08-18 19:30 Goober5000 Note Added: 0006476
2006-08-19 04:42 taylor Status assigned => resolved
2006-08-19 04:42 taylor Resolution open => fixed
2006-08-19 04:42 taylor Note Added: 0006484
2006-11-01 04:23 taylor Relationship added has duplicate 0000935
2006-11-01 04:24 taylor Relationship added has duplicate 0000936