http://www.fmod.org/forum/viewtopic.php?p=45879#45879
I've posted some backtraces to crashes in gzdoom which point to libfmodex.so as the culprit. I switched to gzdoom (v1.4.08) today in my quest to play doom again due to the painful SDL input lags that occur with vanilla zdoom. Regardless, this issue is about sound, which affected vanilla and the gl port identically.
I run a pulseaudio server and have a 3-box slackware lan. The box in question does not host the server, it is a client. There are three ways that audio SHOULD work seemlessly on linux using a pulse audio client - oss emulation, alsa-pulse plugin, and now, as per FMOD v4.31.03 development version, the new pulseaudio backend (see trivial patch below). None work correctly for me.
zdoom v2.4.1 built against FMOD v4.28.06 ..no sound at all with ANY setup
zdoom v2.4.1 built against FMOD v4.30.04 ..doesn't build
zdoom svn-r2344-2010May29 built against FMOD v4.30.04 ..OSS / ALSA issue
zdoom svn-r2344-2010May29 + PulseAudio patch built against FMOD v4.31.03 ..OSS / ALSA / PULSEAUDIO issue
I imagine if any FMOD developer answers the above thread they'll probably point to your implementation (Randy?!). I've faffed with every snd_ related setting available, and disabled any reverb options i can see, but i'm not sure how to progress given that i can't break into the FMOD source in a gdb session. The only question i can think to ask here, is:In each instance the stream is initiated and works CORRECTLY, playing both music and menu sfx. However, when a new game is started, although the music continues to play fine, the first instance of a sound effect (the sound doesn't play but i'm expecting a gunshot!) consistently causes a segmentation fault.
why would SFX such as 'cycling a menu' work fine, and yet an in-game SFX like 'a gunshot' cause a segfault?
Any thoughts or suggestions?
Cheers.
pulseaudio patch
Code: Select all
diff -u -r svn-r2344-2010May29/src/m_options.cpp mod/src/m_options.cpp
--- svn-r2344-2010May29/src/m_options.cpp 2010-05-29 19:31:16.000000000 +0100
+++ mod/src/m_options.cpp 2010-05-31 19:51:50.000000000 +0100
@@ -1216,6 +1218,7 @@
{ "OpenAL", "OpenAL (very beta)" },
#elif defined(unix)
{ "OSS", "OSS" },
+ { "PULSEAUDIO", "PULSEAUDIO" },
{ "ALSA", "ALSA" },
{ "SDL", "SDL" },
{ "ESD", "ESD" },
diff -u -r svn-r2344-2010May29/src/sound/fmodsound.cpp mod/src/sound/fmodsound.cpp
--- svn-r2344-2010May29/src/sound/fmodsound.cpp 2010-05-29 19:31:16.000000000 +0100
+++ mod/src/sound/fmodsound.cpp 2010-05-31 19:52:08.000000000 +0100
@@ -162,6 +162,7 @@
// Linux
{ "OSS", FMOD_OUTPUTTYPE_OSS },
+ { "PULSEAUDIO", FMOD_OUTPUTTYPE_PULSEAUDIO },
{ "ALSA", FMOD_OUTPUTTYPE_ALSA },
{ "ESD", FMOD_OUTPUTTYPE_ESD },
{ "SDL", 666 },
@@ -435,7 +436,7 @@
Owner->Sys->setStreamBufferSize(16*1024, FMOD_TIMEUNIT_RAWBYTES);
return result != FMOD_OK;
}
- if (JustStarted && openstate == FMOD_OPENSTATE_STREAMING)
+ if (JustStarted && openstate == FMOD_OPENSTATE_PLAYING)
{
JustStarted = false;
}
@@ -486,7 +487,7 @@
if (FMOD_OK == Stream->getOpenState(&openstate, &percentbuffered, &starving))
{
- stats = (openstate <= FMOD_OPENSTATE_STREAMING ? OpenStateNames[openstate] : "Unknown state");
+ stats = (openstate <= FMOD_OPENSTATE_PLAYING ? OpenStateNames[openstate] : "Unknown state");
stats.AppendFormat(",%3d%% buffered, %s", percentbuffered, starving ? "Starving" : "Well-fed");
}
if (Channel == NULL)
#pulseaudio server produces an unhelpful buffer underrun error
>>>
>>>
>>> I: module-suspend-on-idle.c: Sink sblive51 idle for too long, suspending ...
D: sink.c: Suspend cause of sink sblive51 is 0x0004, suspending
I: alsa-sink.c: Device suspended...
I: client.c: Created 4 "Native client (TCP/IP client from 10.0.0.2:44520)"
I: protocol-native.c: Client authenticated anonymously.
D: protocol-native.c: Protocol version: remote 16, local 16
D: protocol-native.c: SHM possible: no
D: protocol-native.c: Negotiated SHM: no
D: module-augment-properties.c: Looking for .desktop file for gzdoom
I: client.c: Freed 4 "FMOD Ex Enumerator"
I: protocol-native.c: Connection died.
I: client.c: Created 5 "Native client (TCP/IP client from 10.0.0.2:44521)"
I: protocol-native.c: Client authenticated anonymously.
D: protocol-native.c: Protocol version: remote 16, local 16
D: protocol-native.c: SHM possible: no
D: protocol-native.c: Negotiated SHM: no
D: module-augment-properties.c: Looking for .desktop file for gzdoom
I: client.c: Freed 5 "FMOD Ex Enumerator"
I: protocol-native.c: Connection died.
I: client.c: Created 6 "Native client (TCP/IP client from 10.0.0.2:44522)"
I: protocol-native.c: Client authenticated anonymously.
D: protocol-native.c: Protocol version: remote 16, local 16
D: protocol-native.c: SHM possible: no
D: protocol-native.c: Negotiated SHM: no
D: module-augment-properties.c: Looking for .desktop file for gzdoom
D: module-stream-restore.c: Not restoring device for stream
sink-input-by-application-name:FMOD Ex App, because already set.
D: sink.c: Suspend cause of sink sblive51 is 0x0000, resuming
I: alsa-sink.c: Trying resume...
D: alsa-util.c: Maximum hw buffer size is 341 ms
D: alsa-util.c: Set buffer size first, period size second.
D: alsa-sink.c: hwbuf_unused=0
D: alsa-sink.c: setting avail_min=1
I: alsa-sink.c: Resumed successfully...
D: module-suspend-on-idle.c: Sink sblive51 becomes idle, timeout in 5 seconds.
I: alsa-sink.c: Starting playback.
I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_START failed
D: module-suspend-on-idle.c: Sink sblive51 becomes busy.
I: resampler.c: Forcing resampler 'copy', because of fixed, identical sample
rates.
D: resampler.c: Channel matrix:
D: resampler.c: I00 I01
D: resampler.c: +------------
D: resampler.c: O00 | 1.000 0.000
D: resampler.c: O01 | 0.000 1.000
D: resampler.c: O02 | 1.000 0.000
D: resampler.c: O03 | 0.000 1.000
D: resampler.c: O04 | 0.500 0.500
D: resampler.c: O05 | 0.000 0.000
I: remap.c: Using generic matrix remapping
I: resampler.c: Using resampler 'copy'
I: resampler.c: Using s16le as working format.
D: memblockq.c: memblockq requested: maxlength=33554432, tlength=0, base=12,
prebuf=0, minreq=1 maxrewind=0
D: memblockq.c: memblockq sanitized: maxlength=33554436, tlength=33554436,
base=12, prebuf=0, minreq=12 maxrewind=0
I: sink-input.c: Created input 1 "Mixer Stream" on sblive51 with sample spec
s16le 2ch 48000Hz and channel map front-left,front-right
I: sink-input.c: media.name = "Mixer Stream"
I: sink-input.c: application.name = "FMOD Ex App"
I: sink-input.c: native-protocol.peer = "TCP/IP client from 10.0.0.2:44522"
I: sink-input.c: native-protocol.version = "16"
I: sink-input.c: application.process.id = "3918"
I: sink-input.c: application.process.user = "root"
I: sink-input.c: application.process.host = "elservo"
I: sink-input.c: application.process.binary = "gzdoom"
I: sink-input.c: window.x11.display = ":1.0"
I: sink-input.c: application.language = "C"
I: sink-input.c: application.process.machine_id = "elservo"
I: sink-input.c: module-stream-restore.id =
"sink-input-by-application-name:FMOD Ex App"
I: protocol-native.c: Requested tlength=85.33 ms, minreq=10.67 ms
D: protocol-native.c: Adjust latency mode enabled, configuring sink latency to
half of overall latency.
D: memblockq.c: memblockq requested: maxlength=16384, tlength=23296, base=4,
prebuf=21252, minreq=2048 maxrewind=0
D: memblockq.c: memblockq sanitized: maxlength=16384, tlength=16384, base=4,
prebuf=14340, minreq=2048 maxrewind=0
I: protocol-native.c: Final latency 185.33 ms = 64.00 ms + 2*10.67 ms + 100.00
ms
D: protocol-native.c: max_request changed, trying to update from 16384 to 23296.
D: protocol-native.c: Failed to increase tlength
D: core-subscribe.c: Dropped redundant event due to change event.
D: protocol-native.c: Requesting rewind due to end of underrun.
D: alsa-sink.c: Requested to rewind 57600 bytes.
D: alsa-sink.c: Limited to 57600 bytes.
D: alsa-sink.c: before: 4800
D: alsa-sink.c: after: 4244
D: alsa-sink.c: Rewound 50928 bytes.
D: sink.c: Processing rewind...
D: sink-input.c: Have to rewind 50928 bytes on render memblockq.
D: source.c: Processing rewind...
D: protocol-native.c: Underrun on 'Mixer Stream', 0 bytes in queue.
D: protocol-native.c: Requesting rewind due to end of underrun.
D: alsa-sink.c: Requested to rewind 8352 bytes.
D: alsa-sink.c: Limited to 8352 bytes.
D: alsa-sink.c: before: 696
D: alsa-sink.c: after: 696
D: alsa-sink.c: Rewound 8352 bytes.
D: sink.c: Processing rewind...
D: sink-input.c: Have to rewind 8352 bytes on render memblockq.
D: source.c: Processing rewind...
D: protocol-native.c: Underrun on 'Mixer Stream', 0 bytes in queue.
D: alsa-sink.c: Requested to rewind 57600 bytes.
D: alsa-sink.c: Limited to 57600 bytes.
D: alsa-sink.c: before: 4800
D: alsa-sink.c: after: 4296
D: alsa-sink.c: Rewound 51552 bytes.
D: sink.c: Processing rewind...
D: source.c: Processing rewind...
D: module-suspend-on-idle.c: Sink sblive51 becomes idle, timeout in 5 seconds.
D: module-suspend-on-idle.c: Sink sblive51 becomes idle, timeout in 5 seconds.
D: core.c: Hmm, no streams around, trying to vacuum.
I: sink-input.c: Freeing input 1 "Mixer Stream"
I: client.c: Freed 6 "FMOD Ex App"
I: protocol-native.c: Connection died.
I: module-suspend-on-idle.c: Sink sblive51 idle for too long, suspending ...
D: sink.c: Suspend cause of sink sblive51 is 0x0004, suspending
I: alsa-sink.c: Device suspended...
#gdb backtrace when attached to the segfaulted process AFTER the error! ..seems
to give different stack info this way
0xb7036a04 in __lll_lock_wait () from /lib/libpthread.so.0
(gdb) bt
#0 0xb7036a04 in __lll_lock_wait () from /lib/libpthread.so.0
#1 0xb7031fab in _L_lock_844 () from /lib/libpthread.so.0
#2 0xb7031e3b in pthread_mutex_lock () from /lib/libpthread.so.0
#3 0xb6e848ca in FMOD_OS_CriticalSection_Enter () from
/usr/local/lib/libfmodex.so
#4 0xb6e75737 in FMOD::SystemI::stopSound () from /usr/local/lib/libfmodex.so
#5 0xb6e68644 in FMOD::SampleSoftware::release () from
/usr/local/lib/libfmodex.so
#6 0xb6e6a3b3 in FMOD::Sound::release () from /usr/local/lib/libfmodex.so
#7 0x082afab1 in S_UnloadSound ()
#8 0x082a4308 in ?? ()
#9 0x08104abd in call_terms ()
#10 0xb6b6aeaf in exit () from /lib/libc.so.6
#11 0xb7469115 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#12 0x00000001 in ?? ()
#13 0xb749a418 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#14 0x086bb2f0 in ?? ()
#15 0x0000000b in ?? ()
#16 0x08bbbc30 in ?? ()
#17 0x08a0e5d8 in ?? ()
#18 0xb785fff4 in ?? () from /lib/ld-linux.so.2
#19 0xb6996024 in ?? () from /opt/xorg//lib/libX11.so.6
#20 0x00000005 in ?? ()
#21 0xb1410b28 in ?? ()
#22 0x08a0e5d8 in ?? ()
#23 0xb70a7538 in ?? () from /usr/local/lib/libSDL-1.2.so.0
#24 0x08bb9e50 in ?? ()
#25 0x00000000 in ?? ()
#gdb backtrace from PULSEAUDIO output segfault
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1322497168 (LWP 3455)]
0xb6a6adce in memset () from /lib/libc.so.6
#0 0xb6a6adce in memset () from /lib/libc.so.6
#1 0xb6cfdd8d in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#2 0xb6cfd7c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#3 0xb6cfd7c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#4 0xb6cfd7c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#5 0xb6cfd7c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#6 0xb6d0530a in FMOD::DSPSoundCard::read () from /usr/local/lib/libfmodex.so
#7 0xb6d18011 in FMOD::Output::mix () from /usr/local/lib/libfmodex.so
#8 0xb6d3e2be in FMOD::OutputPulseAudio::updateMixer () from
/usr/local/lib/libfmodex.so
#9 0xb6d3706d in FMOD::Thread::callback () from /usr/local/lib/libfmodex.so
#10 0xb6ee39a0 in start_thread () from /lib/libpthread.so.0
#11 0xb6ace0de in clone () from /lib/libc.so.6
The program is running. Quit anyway (and detach it)? (y or n) Detaching from
program: /root/desktop/gzdoom/1.4.08.r811/
build/gzdoom, process 3452
#gdb backtrace from OSS output segfault
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1322247312 (LWP 3624)]
0xb6b24dce in memset () from /lib/libc.so.6
#0 0xb6b24dce in memset () from /lib/libc.so.6
#1 0xb6db8d8d in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#2 0xb6db87c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#3 0xb6db87c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#4 0xb6db87c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#5 0xb6db87c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#6 0xb6dc030a in FMOD::DSPSoundCard::read () from /usr/local/lib/libfmodex.so
#7 0xb6dd3011 in FMOD::Output::mix () from /usr/local/lib/libfmodex.so
#8 0xb6df5c26 in FMOD::OutputOSS::updateMixer () from
/usr/local/lib/libfmodex.so
#9 0xb6df206d in FMOD::Thread::callback () from /usr/local/lib/libfmodex.so
#10 0xb6f9e9a0 in start_thread () from /lib/libpthread.so.0
#11 0xb6b880de in clone () from /lib/libc.so.6
The program is running. Quit anyway (and detach it)? (y or n) Quitting: Can't
detach LWP 3625: No such process
#gdb backtrace from ALSA output segfault
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1321665680 (LWP 3474)]
0xb6b35dce in memset () from /lib/libc.so.6
#0 0xb6b35dce in memset () from /lib/libc.so.6
#1 0xb6dc8d8d in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#2 0xb6dc87c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#3 0xb6dc87c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#4 0xb6dc87c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#5 0xb6dc87c5 in FMOD::DSPFilter::read () from /usr/local/lib/libfmodex.so
#6 0xb6dd030a in FMOD::DSPSoundCard::read () from /usr/local/lib/libfmodex.so
#7 0xb6de3011 in FMOD::Output::mix () from /usr/local/lib/libfmodex.so
#8 0xb6e079e2 in FMOD::OutputALSA::updateMixer () from
/usr/local/lib/libfmodex.so
#9 0xb6e0206d in FMOD::Thread::callback () from /usr/local/lib/libfmodex.so
#10 0xb6fae9a0 in start_thread () from /lib/libpthread.so.0
#11 0xb6b990de in clone () from /lib/libc.so.6
The program is running. Quit anyway (and detach it)? (y or n) Detaching from
program: /root/desktop/gzdoom/1.4.08.r811/
build/gzdoom, process 3468