0
0

Hi,

I’ve tried three different ways to get a piece of software called ‘gzdoom’ to
play nicely with pulseaudio through FMOD.

padsp ./gzdoom +snd_output oss

..padsp wraps the program to provide oss emulation.

./gzdoom +snd_output alsa

..which uses alsa’s default interface which is in fact a plugin ‘pulse’, to
direct output through pulseaudio server.

./gzdoom +snd_output pulseaudio (requires a tiny bit of patching)

..which uses your brand new pulseaudio backend to directly interface with
pulseaudio.

In each instance the stream is initiated and works CORRECTLY, playing both music and menu sfx. However, when the 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.
The closed source nature of FMOD makes it impossible for me to give further
info (i think), and indeed the backtraces below probably won’t help much either, but i was hoping, as the pulseaudio backend is ‘a relatively untested baby’ for you that you might be interested in having a think on this issue so i can throw some useful thoughts to the ‘zdoom’ developers.

Thanks,

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

  • You must to post comments
0
0

Hmm, it doesn’t appear to be related to the backend output mode used since the crash is coming from somewhere inside the DSP network. Is there perhaps a memory overwrite corruption going on? I would recommend running with valgrind to make sure no FMOD memory is getting stomped.

An alternative to totally rule out output mode issues is to run using the nosound or wavwriter output modes, however I don’t expect this to yield different results. Also I suggest linking against the logging version of FMOD to see if there is any useful TTY output.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.