Bug 3261 - Changing sound quality causes ioquake3 to segfault
Status: RESOLVED INVALID
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Sound
Version: 1.33 SVN
Hardware: PC Linux
: P3 minor
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2007-07-12 01:54 EDT by Michael Jard
Modified: 2007-07-22 16:30:15 EDT
0 users

See Also:



Description Michael Jard 2007-07-12 01:54:42 EDT
When using openal under linux (s_useopenal=1) on the current svn build (1108, also revision 989), changing the sound quality from the option menu quake exits with the message:

------ Initializing Sound ------
Received signal 11, exiting...

If s_useopenal is set to 0, the engine reinitializes with the new sound quality and no problems.

My system:
Debian Etch
ioquake3 svn build 1108
OpenAL version 0.0.8
Comment 1 Thilo Schulz 2007-07-12 04:32:02 EDT
It doesn't crash for me. Can you bisect?
Comment 2 Nathan Vexler 2007-07-12 10:16:12 EDT
I'm seeing this issue too (also etch); tested with latest openarena (0.7).
Comment 3 Robert Isaac 2007-07-22 15:22:06 EDT
This behavior only happens when the binary is compiled with USE_OPENAL_DLOPEN=0, with USE_OPENAL_DLOPEN=1 sound quality changes happen normally.

Tested on rev 1119 (and on open arena which is 1107).
Comment 4 Thilo Schulz 2007-07-22 16:30:15 EDT
Thanks for this additional info, this triggered a memory to surface in my head. As a matter of fact, this "bug" has been known for quite some time now. It actually is a bug in OpenAL, not ioquake3. It will go away in future versions of openal.
In gentoo it's getting patched automatically already so there it won't crash.
In the meantime, just compile openal with USE_OPENAL_DLOPEN and that bug will go away. Alternatively, you can recompile OpenAL yourself. As submitting a patch seems to be broken right now, I'll just post the patch here, the changes are simple enough.

--- openal-0.0.8/src/alc/alc_context.c.ori      2006-09-29 12:36:33.000000000 -0400
+++ openal-0.0.8/src/alc/alc_context.c  2006-09-29 12:38:05.000000000 -0400
@@ -236,8 +236,12 @@
                /* someone unpaused us */
                ispaused = AL_FALSE;

-               _alcDeviceResume( cc->write_device );
-               _alcDeviceResume( cc->read_device );
+               if (cc->write_device) {
+                       _alcDeviceResume( cc->write_device );
+               }
+               if (cc->read_device) {
+                       _alcDeviceResume( cc->read_device );
+               }

                _alcUnlockAllContexts();
                _alUnlockMixerPause();