Bug 67718 - glob2-0.8.9 dies on startup due to badly written sound mixer function
Bug#: 67718 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: games@gentoo.org Reported By: tetromino@gmail.com
Component: Games
URL: 
Summary: glob2-0.8.9 dies on startup due to badly written sound mixer function
Keywords:  
Status Whiteboard: 
Opened: 2004-10-15 14:16 0000
Description:   Opened: 2004-10-15 14:16 0000
Glob2-0.8.9 (and earlier versions, if the forum is to be believed) dies on
startup unless esd is active (maybe it also works with arts, I am not sure).
The problem is that in SoundMixer.cpp, the mixer thinks that since it asked for
an SDL_AudioSpec to supply the mixer callback with 128k of data at a time, then
SDL_AudioSpec will faithfully obey. As a matter of fact, SDL_AudioSpec does
behave as expected when the mixer is around, but when playing to a raw alsa
device, it only gives the callback function 2k of data at a time. This triggers
a spurious assert() - the mixer callback has no features whatsoever that depend
on an exact numerical value of the length of the data stream, but the authors
of glob2 had deciced to practice some paranoid defensive programming...

Reproducible: Always
Steps to Reproduce:
1. make sure sound dameons aren't active
2. emerge glob2
3. $ glob2

Actual Results:  
Toolkit : Initialized : Graphic Context created
Toolkit : Screen set to 640x480 at 0 bpp in window
glob2: SoundMixer.cpp:70: void mixaudio(void*, Uint8*, int): Assertion
`nsamples
== 8192*8' failed.
Aborted


Expected Results:  
glob2 successfully runs

------- Comment #1 From Alexandre Rostovtsev 2004-10-15 14:18:46 0000 -------
Created an attachment (id=41915) [details]
glob2-0.8.9.soundmixer.patch

Patch to change the assertion to something more sensible.

Also, typo above: change "SDL_AudioSpec does behave as expected when the mixer
is around" to "SDL_AudioSpec does behave as expected when the sound daemon is
around"

------- Comment #2 From Alexandre Rostovtsev 2004-10-15 14:19:56 0000 -------
Created an attachment (id=41916) [details]
glob2-0.8.9.ebuild to use the patch above

------- Comment #3 From Mr. Bones. 2004-10-15 20:22:07 0000 -------
Let's have the output of emerge --info please.

------- Comment #4 From Mr. Bones. 2004-10-15 21:13:16 0000 -------
Turned down the assert checking.  Upstream will pick this up for the next
release.  Thanks for the bug report.

Resync and remerge for the fix.  Since it works for me as is and for most
people, I imagine, there's no rev bump.