0
0

i have an rme hdsp board in linux (ALSA), and im trying to open 4 playback ports on it.. so i created 4 system classes and in each i enumerate the devices

on the second time i call system.getNumDrivers(), it segfaults.

im running with fmodapi40302linux

i got into alsa mode using system.setOutput(FMOD.OUTPUTTYPE.ALSA);

im running newest alsa + linux 2.4.27

any ideas?

  • You must to post comments
0
0

i went into the alsa.conf and removed some of the drivers i wasnt using and fmod worked with ver 40303!

this is spectacular!!

if you could bump up max drivers or at least spit out a warning or something if you exceed the count instead of crashing and burning, that would probably prevent someone from experiencing this nightmare in the future

  • You must to post comments
0
0

i changed the multiplesoundcard example in the sdk to setOutput() to alsa on the system instances after they are created.

i get a segfault after it does this:
[quote:2u005i6l]======================================================================

MultipleSoundCard Example. Copyright (c) Firelight Technologies 2004.

Press ‘1’ to play a sound on soundcard A
Press ‘2’ to play a sound on soundcard B
Press ‘Esc’ to quit

Channels Playing on A 0. Channels Playing on B 0.
Segmentation fault[/quote:2u005i6l]

in gdb, i see this:

[quote:2u005i6l]Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16386 (LWP 5891)]
0x4046f0e8 in snd_pcm_poll_descriptors_revents (pcm=0x8104ce0,
pfds=0xbf7ff93c, nfds=1, revents=0xbf7ff92c) at pcm.c:1348
1348 if (pcm->fast_ops->poll_revents)
(gdb) print pcm
$2 = (snd_pcm_t *) 0x8104ce0
(gdb) print pcm->fast_ops
Error accessing memory address 0x8104de0: No such process.
(gdb) where

0 0x4046f0e8 in snd_pcm_poll_descriptors_revents (pcm=0x80b13f8, pfds=0xbf7ff93c, nfds=1, revents=0xbf7ff92c) at pcm.c:1348

1 0x4048142c in snd_pcm_generic_poll_revents (pcm=0x80b13f8, pfds=0x80b13f8, nfds=134943736, revents=0x80b13f8) at pcm_generic.c:74

2 0x4046f128 in snd_pcm_poll_descriptors_revents (pcm=0x80b13f8, pfds=0xbf7ff93c, nfds=1, revents=0xbf7ff92c) at pcm.c:1349

3 0x40470a52 in snd_pcm_wait_nocheck (pcm=0x80a0608, timeout=-1) at pcm.c:2256

4 0x4047095f in snd_pcm_wait (pcm=0x80a0608, timeout=134943736) at pcm.c:2217

5 0x40476d4d in snd_pcm_write_areas (pcm=0x80a0608, areas=0xbf7ff9e8, offset=0, size=1024, func=0x404821e0 <snd_pcm_plugin_write_areas>) at pcm.c:6431

6 0x4048268d in snd_pcm_plugin_writei (pcm=0x80a0608, buffer=0x80b13f8, size=134943736) at pcm_plugin.c:352

7 0x4046e95c in snd_pcm_writei (pcm=0xbf7ff92c, buffer=0x809f600, size=1024) at pcm_local.h:401

8 0x400988b1 in FMOD::OutputALSA::updateMixer () from ../../api/lib/libfmodex.so

9 0x00000002 in ?? ()

10 0x40109514 in ?? () from ../../api/lib/libfmodex.so

11 0x0804f540 in ?? ()

12 0x0804f420 in ?? ()

13 0x00000010 in ?? ()

14 0x00001000 in ?? ()

15 0x00000400 in ?? ()

16 0x40109514 in ?? () from ../../api/lib/libfmodex.so

17 0x0804f540 in ?? ()

18 0x00000000 in ?? ()

19 0xbf7ffbac in ?? ()

20 0x40098a79 in FMOD::OutputALSA::mixThreadCallback () from ../../api/lib/libfmodex.so

21 0x402b5dc8 in ?? () from /lib/libpthread.so.0

22 0x402aff9b in thread_self () from /lib/libpthread.so.0

[/quote:2u005i6l]

i can aplay on 2 devices without issue

  • You must to post comments
0
0

Thanks for your help with this issue nirva :) The MAXDRIVERS will be fixed in the next revision.

  • You must to post comments
0
0

I’m not able to reproduce either of these problems. The multiplesoundcard example calls system::getNumDrivers twice without a problem so perhaps you should see what you are doing different.

As for the crash you are getting in the multiplesoundcard example, is the ALSA output driver you are selecting able to support multiple instances? FMOD should return an error if it doesn’t, but perhaps there is an error in your alsa.conf file.

  • You must to post comments
0
0

the soundcard is an RME 9632 w/ AEB-O w/ 8 outputs

im using the jackit mixer stuff along with ALSA.

i can do aplay on 2 devices, but i cant open 2 fmod instances

  • You must to post comments
0
0

I just found a small bug in where getNumDrivers was over-writing some memory. This might be the cause of the crashes. I new version with the fix should be out by the end of today.

  • You must to post comments
0
0

sweet, looking forward to testing

  • You must to post comments
0
0

anything for me? if you want to just tell me what to fix, i can do that (i have a source license)

id love to try it out

  • You must to post comments
0
0

Sorry for the delay, there is a pre-release linux version available through ftp.

http://ftp.fmod.org
user: upload
pass: upload

  • You must to post comments
0
0

ok, that didnt fix it.. but i ran the multiplesoundcard example under valgrind and got some more info.. this is what happens right away:

[quote:3gkqkdkh]==19618== Invalid write of size 4
==19618== at 0x1B98CAB6: FMOD::OutputALSA::getALSAdrivers(char) (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19618== Address 0x1BCF06CC is 0 bytes after a block of size 1020 alloc’d
==19618== at 0x1B90659D: malloc (vg_replace_malloc.c:130)
==19618== by 0x1B989A98: FMOD_OS_Memory_Alloc(int) (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19618==
==19618== Invalid read of size 4
==19618== at 0x1B98CAC5: FMOD::OutputALSA::getALSAdrivers(char
) (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19618== Address 0x1BCF06CC is 0 bytes after a block of size 1020 alloc’d
==19618== at 0x1B90659D: malloc (vg_replace_malloc.c:130)
==19618== by 0x1B989A98: FMOD_OS_Memory_Alloc(int) (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19618==
==19618== Invalid read of size 4
==19618== at 0x1B98CAE4: FMOD::OutputALSA::getALSAdrivers(char*) (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19618== Address 0x1BCF06CC is 0 bytes after a block of size 1020 alloc’d
==19618== at 0x1B90659D: malloc (vg_replace_malloc.c:130)
==19618== by 0x1B989A98: FMOD_OS_Memory_Alloc(int) (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)[/quote:3gkqkdkh]

and then comes the soundcard listing:

[quote:3gkqkdkh][removed first 20]
26 : hdsp_a1
27 : hdsp_a1_jack
28 : hdsp_a2
29 : hdsp_a2_jack
30 : hdsp_a3
31 : hdsp_a3_jack
32 : hdsp_a4
==19618==
==19618== Invalid read of size 4
==19618== at 0x1B98CD01: FMOD::OutputALSA::getDriverName(int, char*, int) (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19618== Address 0x1BCF06CC is 0 bytes after a block of size 1020 alloc’d
==19618== at 0x1B90659D: malloc (vg_replace_malloc.c:130)
==19618== by 0x1B989A98: FMOD_OS_Memory_Alloc(int) (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
33 : hdsp_a4_jack
34 : hdsp_spdif
35 : hdsp_spdif_jack
36 : hdsp_analog

37 : hdsp_analog_jack

Press a corresponding number or ESC to quit[/quote:3gkqkdkh]

then i pick number 26 (i had to modify src to do this since the example uses getc())

[quote:3gkqkdkh]==19646==
==19646== Syscall param write(buf) points to uninitialised byte(s)
==19646== at 0x1BBA85FE: __write_nocancel (in /lib/tls/libpthread-0.60.so)
==19646== by 0x1BEACDC3: jack_client_deliver_request (client.c:145)
==19646== by 0x1BEB0885: jack_port_register (port.c:142)
==19646== by 0x1BAB169A: snd_pcm_jack_prepare (pcm_jack.c:166)
==19646== by 0x1BE6E8DD: snd_pcm_ioplug_prepare (pcm_ioplug.c:132)
==19646== by 0x1BE2D393: snd_pcm_prepare (pcm.c:973)
==19646== by 0x1BE40EE2: snd_pcm_plugin_prepare (pcm_plugin.c:158)
==19646== by 0x1BE2D393: snd_pcm_prepare (pcm.c:973)
==19646== by 0x1BE2CE4C: snd_pcm_hw_params (pcm.c:789)
==19646== by 0x1B98D159: FMOD::OutputALSA::start() (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19646== by 0x1B98DB91: FMOD::OutputALSA::startCallback(FMOD_OUTPUT_STATE*) (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19646== Address 0x52BFD01B is on thread 1’s stack
==19646==
==19646== Thread 2:
==19646== Syscall param write(buf) points to uninitialised byte(s)
==19646== at 0x1BBA8621: (within /lib/tls/libpthread-0.60.so)
==19646== by 0x1BEACDC3: jack_client_deliver_request (client.c:145)
==19646== by 0x1BEAEC1E: jack_activate (client.c:1683)
==19646== by 0x1BAB1734: snd_pcm_jack_start (pcm_jack.c:187)
==19646== by 0x1BE6F11F: snd_pcm_ioplug_start (pcm_ioplug.c:415)
==19646== by 0x1BE2D4F3: snd_pcm_start (pcm.c:1005)
==19646== by 0x1BE406F6: snd_pcm_generic_start (pcm_generic.c:155)
==19646== by 0x1BE2D4F3: snd_pcm_start (pcm.c:1005)
==19646== by 0x1BE35E39: snd_pcm_write_areas (pcm.c:6457)
==19646== by 0x1BE4168C: snd_pcm_plugin_writei (pcm_plugin.c:352)
==19646== by 0x1BE2D95B: snd_pcm_writei (pcm_local.h:401)
==19646== by 0x1B98C084: FMOD::OutputALSA::updateMixer() (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19646== Address 0x1C74F4A8 is on thread 2’s stack
==19646==
==19646== Syscall param write(buf) points to uninitialised byte(s)
==19646== at 0x1BBA8621: (within /lib/tls/libpthread-0.60.so)
==19646== by 0x1BEACDC3: jack_client_deliver_request (client.c:145)
==19646== by 0x1BEAF056: jack_connect (client.c:1829)
==19646== by 0x1BAB17AA: snd_pcm_jack_start (pcm_jack.c:202)
==19646== by 0x1BE6F11F: snd_pcm_ioplug_start (pcm_ioplug.c:415)
==19646== by 0x1BE2D4F3: snd_pcm_start (pcm.c:1005)
==19646== by 0x1BE406F6: snd_pcm_generic_start (pcm_generic.c:155)
==19646== by 0x1BE2D4F3: snd_pcm_start (pcm.c:1005)
==19646== by 0x1BE35E39: snd_pcm_write_areas (pcm.c:6457)
==19646== by 0x1BE4168C: snd_pcm_plugin_writei (pcm_plugin.c:352)
==19646== by 0x1BE2D95B: snd_pcm_writei (pcm_local.h:401)
==19646== by 0x1B98C084: FMOD::OutputALSA::updateMixer() (in fmodapi40303linux/api/lib/libfmodex.so.4.03.03)
==19646== Address 0x1C74F4BB is on thread 2’s stack
==19646==
==19646== Thread 3:
==19646== Syscall param gettimeofday(tv) points to unaddressable byte(s)
==19646== at 0x1BC433A1: gettimeofday (in /lib/tls/libc-2.3.2.so)
==19646== by 0x1BEB272B: jack_thread_proxy (thread.c:111)
==19646== by 0x1BBA3B62: start_thread (in /lib/tls/libpthread-0.60.so)
==19646== by 0x1BC87189: clone (in /lib/tls/libc-2.3.2.so)
==19646== Address 0x1 is not stack’d, malloc’d or (recently) free’d
==19646==
==19646== Syscall param gettimeofday(tz) points to unaddressable byte(s)
==19646== at 0x1BC433A1: gettimeofday (in /lib/tls/libc-2.3.2.so)
==19646== by 0x1BEB272B: jack_thread_proxy (thread.c:111)
==19646== by 0x1BBA3B62: start_thread (in /lib/tls/libpthread-0.60.so)
==19646== by 0x1BC87189: clone (in /lib/tls/libc-2.3.2.so)
==19646== Address 0x1 is not stack’d, malloc’d or (recently) free’d[/quote:3gkqkdkh]

then similar stuff happens for sound card B. but because we are running under valgrind, the program doesnt crash and instead contines on, but obviously not playing any sounds.

  • You must to post comments
0
0

im going to take a guess and say your first problem is you probably assume no one has more than 32 devices .. which is why on the 33rd device, the second error occurs

i still cant explain the first, but valgrind seems to be saying that you are writing and then reading 4 bytes after end of your 1020 malloc’d block

it might all just be downhill from that, so if you could give me a test binary right away to test after you can fix, i dont mind running through this again

  • You must to post comments
0
0

in the src, i noticed FMOD_OUTPUT_MAXDRIVERS is set to 32

note, that i actually dont have 32 drivers.. i only have 16 + alsa defaults that dont do much

is there a reason this cant be bumped up to liek 128 for alsa? the reason being alsa drivers often will be piggybacked on top of others for adapters, mixers, or filters

in this case, my only real playable drivers are hdsp_a1, hdsp_a2, hdsp_a3, hdsp_a4, hdsp_spdif, hdsp_analog

  • You must to post comments
Showing 12 results
Your Answer

Please first to submit.