Okay, I agree that this is SDL's fault.  Feel free to reassign it
appropriately.  I investigated further:

   * This was using the alsa audio output of SDL, _not_ the OSS one (bug
#314866).
   * The behavior I listed only happens when another audio stream is
already playing when kobodl is started; when nothing else is playing, it
fails to initialize the audio system entirely:

-----
WARNING: Failed to get hardware screen surface.Switching to SINGLE buffer mode.
ALSA lib pcm_direct.c:666:(snd_pcm_direct_initialize_slave) 
snd_pcm_hw_params_any failed
ALSA lib pcm_dmix.c:814:(snd_pcm_dmix_open) unable to initialize slave
Couldn't initialize audio; disabling sound effects.
-----

   * When I valgrind kobodl while something else _is_ playing, I start
getting reports of invalid accesses before SDL_InitSubSystem() even
returns:

-----
[EMAIL PROTECTED] /tmp]$ valgrind --db-attach=yes ./kobodl
==17615== Memcheck, a memory error detector for x86-linux.
==17615== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==17615== Using valgrind-2.4.0, a program supervision framework for x86-linux.
==17615== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==17615== For more details, rerun with: -v
==17615== 
WARNING: Failed to get hardware screen surface.Switching to SINGLE buffer mode.
==17615== Syscall param socketcall.connect(serv_addr..sun_path) points to 
uninitialised byte(s)
==17615==    at 0x1B9E8EE6: connect (socket.S:65)
==17615==    by 0x1BE48384: snd_pcm_direct_client_connect (pcm_direct.c:371)
==17615==    by 0x1BE4BA07: snd_pcm_dmix_open (pcm_dmix.c:832)
==17615==    by 0x1BE4C05D: _snd_pcm_dmix_open (pcm_dmix.c:1158)
==17615==    by 0x1BE13CC6: snd_pcm_open_conf (pcm.c:2061)
==17615==    by 0x1BE142DD: snd_pcm_open_noupdate (pcm.c:2093)
==17615==    by 0x1BE14606: snd_pcm_open_slave (pcm.c:2177)
==17615==    by 0x1BE523BD: _snd_pcm_softvol_open (pcm_softvol.c:811)
==17615==    by 0x1BE13CC6: snd_pcm_open_conf (pcm.c:2061)
==17615==    by 0x1BE1463A: snd_pcm_open_slave (pcm.c:2178)
==17615==    by 0x1BE34384: _snd_pcm_plug_open (pcm_plug.c:1159)
==17615==    by 0x1BE13CC6: snd_pcm_open_conf (pcm.c:2061)
==17615==  Address 0x52BFE040 is on thread 1's stack
==17615== 
==17615== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- y
starting debugger
==17615== starting debugger with cmd: /usr/bin/gdb -nw /proc/17618/fd/1015 17618
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux"...Using host libthread_db library 
"/usr/lib/debug/libthread_db.so.1".

Attaching to program: /proc/17618/fd/1015, process 17618
`system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols.
Reading symbols from /usr/lib/valgrind/vg_inject.so...done.
Loaded symbols for /usr/lib/valgrind/vg_inject.so
Reading symbols from /usr/lib/valgrind/vgpreload_memcheck.so...done.
Loaded symbols for /usr/lib/valgrind/vgpreload_memcheck.so
Reading symbols from /usr/lib/libSDL_image-1.2.so.0...done.
Loaded symbols for /usr/lib/libSDL_image-1.2.so.0
Reading symbols from /usr/lib/libSDL-1.2.so.0...done.
Loaded symbols for /usr/lib/libSDL-1.2.so.0
Reading symbols from /usr/lib/debug/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 17615)]
Loaded symbols for /usr/lib/debug/libpthread.so.0
Reading symbols from /usr/lib/libstdc++.so.5...done.
Loaded symbols for /usr/lib/libstdc++.so.5
Reading symbols from /usr/lib/debug/libm.so.6...done.
Loaded symbols for /usr/lib/debug/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /usr/lib/debug/libc.so.6...done.
Loaded symbols for /usr/lib/debug/libc.so.6
Reading symbols from /usr/lib/debug/libdl.so.2...done.
Loaded symbols for /usr/lib/debug/libdl.so.2
Reading symbols from /usr/lib/libtiff.so.4...done.
Loaded symbols for /usr/lib/libtiff.so.4
Reading symbols from /usr/lib/libjpeg.so.62...done.
Loaded symbols for /usr/lib/libjpeg.so.62
Reading symbols from /usr/lib/libpng12.so.0...done.
Loaded symbols for /usr/lib/libpng12.so.0
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
Loaded symbols for /usr/X11R6/lib/libX11.so.6
Reading symbols from /usr/X11R6/lib/libXext.so.6...done.
Loaded symbols for /usr/X11R6/lib/libXext.so.6
Reading symbols from /usr/lib/libasound.so.2...done.
Loaded symbols for /usr/lib/libasound.so.2
Reading symbols from /lib/ld-linux.so.2...Reading symbols from 
/usr/lib/debug/lib/ld-2.3.2.so...done.
done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/lib/libXcursor.so.1...done.
Loaded symbols for /usr/lib/libXcursor.so.1
Reading symbols from /usr/lib/libXrender.so.1...done.
Loaded symbols for /usr/lib/libXrender.so.1
Reading symbols from /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2...done.
Loaded symbols for /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2
0x1b9e8ee6 in connect () from /usr/lib/debug/libpthread.so.0
(gdb) bt
#0  0x1b9e8ee6 in connect () from /usr/lib/debug/libpthread.so.0
#1  0x1be47de6 in make_local_socket (
    filename=0x1b90f000 "/tmp/alsa-dmix-28723-1119143272-371288", server=0, 
    ipc_perm=102) at pcm_direct.c:195
#2  0x1be48385 in snd_pcm_direct_client_connect (dmix=0x1c2d5178)
    at pcm_direct.c:371
#3  0x1be4ba08 in snd_pcm_dmix_open (pcmp=0x52bfe30c, 
    name=0x66 <Address 0x66 out of bounds>, ipc_key=102, ipc_perm=102, 
    params=0x66, bindings=0x66, slowptr=102, root=0x66, sconf=0x66, 
    stream=SND_PCM_STREAM_PLAYBACK, mode=1) at pcm_dmix.c:832
#4  0x1be4c05e in _snd_pcm_dmix_open (pcmp=0x66, 
    name=0x66 <Address 0x66 out of bounds>, root=0x1bf29a30, conf=0x1c363bc0, 
    stream=102, mode=102) at pcm_dmix.c:1158
#5  0x1be13cc7 in snd_pcm_open_conf (pcmp=0x52bfe30c, 
    name=0x1c3638c0 "dmix:0", pcm_root=0x1bf29a30, pcm_conf=0x1c363bc0, 
    stream=102, mode=102) at pcm.c:2061
#6  0x1be142de in snd_pcm_open_noupdate (pcmp=0x66, root=0x1bf29a30, 
    name=0x1c3638c0 "dmix:0", stream=102, mode=102) at pcm.c:2093
#7  0x1be14607 in snd_pcm_open_slave (pcmp=0x52bfe30c, root=0x1bf29a30, 
    conf=0x1c2d24e0, stream=SND_PCM_STREAM_PLAYBACK, mode=1) at pcm.c:2177
#8  0x1be523be in _snd_pcm_softvol_open (pcmp=0x66, 
    name=0x66 <Address 0x66 out of bounds>, root=0x1bf29a30, conf=0x1c363630, 
    stream=102, mode=102) at pcm_softvol.c:811
#9  0x1be13cc7 in snd_pcm_open_conf (pcmp=0x52bfe450, name=0x0, 
    pcm_root=0x1bf29a30, pcm_conf=0x1c363630, stream=102, mode=102)
    at pcm.c:2061
#10 0x1be1463b in snd_pcm_open_slave (pcmp=0x52bfe450, root=0x1bf29a30, 
    conf=0x1c363630, stream=SND_PCM_STREAM_PLAYBACK, mode=1) at pcm.c:2178
#11 0x1be34385 in _snd_pcm_plug_open (pcmp=0x66, 
    name=0x66 <Address 0x66 out of bounds>, root=0x1bf29a30, conf=0x1c3632b0, 
    stream=102, mode=102) at pcm_plug.c:1159
#12 0x1be13cc7 in snd_pcm_open_conf (pcmp=0x52bfe68c, name=0x0, 
    pcm_root=0x1bf29a30, pcm_conf=0x1c3632b0, stream=102, mode=102)
    at pcm.c:2061
#13 0x1be1463b in snd_pcm_open_slave (pcmp=0x52bfe68c, root=0x1bf29a30, 
    conf=0x1c3632b0, stream=SND_PCM_STREAM_PLAYBACK, mode=1) at pcm.c:2178
#14 0x1be4f582 in _snd_pcm_asym_open (pcmp=0x66, name=0x1b98c987 "default", 
    root=0x1bf29a30, conf=0x1c2d06f8, stream=SND_PCM_STREAM_PLAYBACK, mode=102)
    at pcm_asym.c:112
#15 0x1be13cc7 in snd_pcm_open_conf (pcmp=0x52bfe68c, 
    name=0x1b98c987 "default", pcm_root=0x1bf29a30, pcm_conf=0x1c2d06f8, 
    stream=102, mode=102) at pcm.c:2061
#16 0x1be142de in snd_pcm_open_noupdate (pcmp=0x66, root=0x1bf29a30, 
    name=0x1b98c987 "default", stream=102, mode=102) at pcm.c:2093
---Type <return> to continue, or q <return> to quit---
#17 0x1be14397 in snd_pcm_open (pcmp=0x52bfe68c, name=0x1b98c987 "default", 
    stream=102, mode=102) at pcm.c:2114
#18 0x1b94701e in Audio_Available ()
    at 
../../../../SDL-1.2.7+1.2.8cvs20041007/src/audio/alsa/SDL_alsa_audio.c:191
#19 0x1b942e43 in SDL_AudioInit (driver_name=0x0)
    at ../../../SDL-1.2.7+1.2.8cvs20041007/src/audio/SDL_audio.c:330
#20 0x1b941c9b in SDL_InitSubSystem (flags=16)
    at ../../SDL-1.2.7+1.2.8cvs20041007/src/SDL.c:90
#21 0x0806bad2 in _start_SDL_output () at audio.c:541
#22 0x0806c05d in audio_start (rate=102, latency=50, use_oss=102, use_midi=0, 
    pollaudio=102) at audio.c:819
#23 0x0805f2f2 in init_audio (p=0x80e0be0) at kobo.cpp:859
#24 0x0806047c in main (argc=0, argv=0x52bfe838) at kobo.cpp:1567
(gdb) 
-----

  The same error shows up when I valgrind a trivial program that just
calls SDL_InitSubSystem(SDL_INIT_AUDIO) while something else is playing.
There are some other miscellaneous valgrind complaints after that in
kobodeluxe (which aren't in the trivial program).

-- 
Andrew Moise <[EMAIL PROTECTED]>



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to