Bug 2836 - ioQ3 with OpenAL enabled crashes while playing WQ3 online
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Sound
Version: 1.33 SVN
Hardware: PC Linux
: P2 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2006-08-18 01:01 EDT by nixpenguin
Modified: 2007-05-21 11:27:01 EDT
2 users (show)

See Also:


Attachments
Three backtraces (6.14 KB, text/plain)
2006-09-04 16:43 EDT, nixpenguin

Description nixpenguin 2006-08-18 01:01:18 EDT
When playing the WesternQ3 mod on a remote server (vs. bots usually) and with s_useOpenAL set to the default of 1, the client will randomly crash without a signal. This may happen right away or it may take a while to occur. Some sound-related errors do appear in the console:

^1ERROR: while buffering data for music stream - Invalid value 
^1ERROR: Can't delete sound buffer for sound/feedback/hit.wav 

The first seems to show up randomly, and the second immediately after typing /quit or right before the client crashes (but this is not reliable). Using "/set developer 1" does not provide any additional information related to this issue.

Workaround:
Setting s_useOpenAL to 0 seems to resolve the issue.

Software info:
ioQ3 svn, rev. 838 with Debian's libopenal0a 0.0.8-1. The former was built from source with GCC 4.1.x and default build options plus -mtune=pentium4 (32-bit processor and userspace)
Comment 1 Thilo Schulz 2006-08-19 17:30:21 EDT
Please start quake3 and issue the command:
snd_restart
in the console.
Tell me if the game crashes.
I have just found a bug in OpenAL that would cause the problem. A temporary workaround would be to recompile ioq3 from source and set the makefile option USE_OPENAL_DLOPEN=1
Comment 2 nixpenguin 2006-08-24 19:58:42 EDT
Yes, it does crash after doing a snd_restart when connected to a remote WQ3 server (r838-860).

It does not crash with r860 compiled with USE_OPENAL_DLOPEN=1 (tested snd_restart and played a few games online). A few of these errors did still appear while playing, though:

^1ERROR: while buffering data for music stream - Invalid value 
Comment 3 Tony J. White 2006-08-25 11:29:56 EDT
> ^1ERROR: while buffering data for music stream - Invalid value 

I get a similar error on Mac OS X as well when playing vanilla Q3.

I haven't found the cause yet, but it seems to be triggered when a lot of other sounds are playing (like hit.wav).  I thought this was a problem local to Apple's OpenAL implementation since I could never reproduce it on Linux.

Try setting s_alSources to 64 and then 128 to see how each effects the problem.

Also, on Linux you may need to force OpenAL to use ALSA to get decent playback:

echo "(define devices '(alsa))" > ~/.openalrc
Comment 4 nixpenguin 2006-08-25 19:54:27 EDT
> echo "(define devices '(alsa))" > ~/.openalrc

That seems to make no difference -- offline, at least. I tried r860 with several changes detailed below and a 25 bot WQ3 match (10, 10, 5 to avoid command overflow) on wq_fort locally with no timelimit and no fraglimit (spectating and alternately flying around, following a bot, and staying near the center of the map).

USE_OPENAL_DLOPEN=1
s_alSources of 64, 96, or 128: Does NOT crash when doing snd_restart. Did not crash after a 45 minute botmatch either, but I saw the "Can't delete sound buffer" error after typing /quit. The invalid value while buffering data errors continue to appear as well.

USE_OPENAL_DLOPEN=0
s_alSources of 64, 96, or 128 (10m botmatch each): Almost the same as above, except that it crashes when doing snd_restart after loading a map (but it does NOT crash by itself during a botmatch).

Should I try testing each combination online, or does the snd_restart crash narrow it down enough? Just to be clear, WQ3 is the ONLY mod that has issues with ioQ3+OpenAL -- on my system, anyways.
Comment 5 nixpenguin 2006-08-26 18:50:02 EDT
Ok, I checked out OpenAL svn (http://www.openal.org/downloads.html) r1348 and tried that with ioQ3 r860 USE_OPENAL_DLOPEN=0. The only noticeable difference so far is that the snd_restart crash is no longer present. However, it did crash without a signal while I was playing WQ3 on a remote server.

I'm guessing that these OpenAL issues are problems with that lib and not ioQ3/WQ3. I'll keep using workarounds for now.
Comment 6 Tony J. White 2006-08-31 12:28:23 EDT
Thilo thinks this is fixed in svn 874:

http://icculus.org/cgi-bin/ezmlm/ezmlm-cgi?50:mss:1335:200608:cppbmmlfilocehkbjbic

Can you please test?
Comment 7 nixpenguin 2006-08-31 18:19:20 EDT
> Thilo thinks this is fixed in svn 874

Apparently not; I was playing WQ3 online with r883 and still experienced a crash. :( IOW, no change from the last report about r860. Both with USE_OPENAL_DLOPEN=0.
Comment 8 Thilo Schulz 2006-09-01 08:10:19 EDT
Ok, I'll start to debug it this evening or tomorrow. How long do you have to play for the bug to appear?
I've read through the comments but I'd like to get clear instructions on how to reproduce this.
Comment 9 nixpenguin 2006-09-01 17:14:44 EDT
I can't give you a set amount of time, because it seems to happen randomly. I'd say within half an hour, while playing on either the first map or the second one after the server cycles. BTW, this has been an issue for quite a while (since May 2006 at least), so it's not due to any recent changes.
Comment 10 Thilo Schulz 2006-09-01 19:57:27 EDT
Hmm.. ok can you compile the latest SVN revision with debugging enabled and play the game in gdb? Best would be if you started gdb from a different computer via ssh. Once it crashes, a backtrace would be helpful
Comment 11 nixpenguin 2006-09-02 07:39:21 EDT
As I stated previously, it crashes without a signal. That won't work.
Comment 12 Thilo Schulz 2006-09-02 13:45:29 EDT
if it crashes without a signal the only way it could have "crashed" is by the engine to go byebye on its own will. In that case it probably spits out a nice error message that would be worth telling us about?
And if it don't: setting a breakpoint for exit() or _exit() would probably help a great deal in finding the source.
If the program doesn't terminate on a normal way I cannot image there's no signal gdb would be able to catch.
Comment 13 nixpenguin 2006-09-04 16:43:01 EDT
Created attachment 1058 [details]
Three backtraces
Comment 14 nixpenguin 2006-10-08 00:50:13 EDT
Were those of any help whatsoever? This still happens on my new box, and the only thing that didn't change is the soundcard.

Old box: 32-bit Debian Linux, Pentium 4 2.53Ghz (no HT), GF 5700, Audigy2 ZS

ioQ3 built with default optimizations (I could not seem to reproduce this issue with a debug build that was not also optimized, but perhaps I didn't try long enough)

New box: 64-bit Debian Linux, Athlon 64 X2 4600+, GF 7950, Audigy2 ZS

ioQ3 built with default optimizations plus -march=k8
Comment 15 Thilo Schulz 2006-11-25 08:39:20 EST
(In reply to comment #14)
> Were those of any help whatsoever? This still happens on my new box, and the
> only thing that didn't change is the soundcard.

Yes, these backtraces are really helpful. It turns out this is a bug in Western Quake3, not ioquake3.

0x080ad246 in S_AL_SrcSetup (src=11, sfx=1143845683, priority=SRCPRI_ONESHOT, entity=3,
    channel=2, local=qfalse) at code/client/snd_openal.c:358
358             if(knownSfx[sfx].filename[0] == '\0')

My name will be "easterbunny" from now on if knownSfx[1143845683] is not out of range. The non-openal sound part does some checking on the input values it receives from mods. I have added input checking to ioquake3 as well, which should fix your problem. In the meantime, it will print out an ERROR message to the gamer as soon as this bug appears. Go kick the WesternQ3 developers to get rid of it.
Comment 16 nixpenguin 2006-12-10 17:17:11 EST
I'm no longer playing WQ3, but thanks. :^)
Comment 17 Ryan C. Gordon 2007-05-21 11:27:01 EDT
Setting a QA contact on all ioquake3 bugs, even resolved ones. Sorry if you get a flood of email from this, it should only happen once. Apologies for the incovenience.

--ryan.