Compile problem with sdl <-> alsa

hello sdl team,

first: i’m not subscribed, please CC me on reply.

I’m using the last SDL CVS snapshot from Mon, Nov. 24th.

When running make i get this error:

gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION=""
-DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DPACKAGE=“SDL”
-DVERSION=“1.2.7” -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
-DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -I. -I. -O3 -march=pentium3 -Wall
-DENABLE_DUMMYVIDEO -DDISKAUD_SUPPORT -DUSE_DLOPEN -DOSS_SUPPORT
-DALSA_SUPPORT -DARTSC_SUPPORT -DARTSC_DYNAMIC=libartsc.so.0
-I/usr/local/kde/include/artsc -pthread -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/X11R6/include -DENABLE_X11 -DXTHREADS
-I./include -I./src/video -DXFREE86_VM -DXFREE86_VMGAMMA -DXFREE86_DGAMOUSE
-DDEFAULT_DGAMOUSE -DXFREE86_XV -DHAVE_XINERAMA -Isrc/video -DENABLE_DGA
-DENABLE_FBCON -DHAVE_OPENGL -DUSE_INPUT_EVENTS -D_REENTRANT
-DSDL_USE_PTHREADS -I…/…/…/include -I…/…/…/include/SDL -I…/…/…/src
-I…/…/…/src/linux -I…/…/…/src/main -I…/…/…/src/audio
-I…/…/…/src/video -I…/…/…/src/video/XFree86/extensions
-I…/…/…/src/events -I…/…/…/src/joystick -I…/…/…/src/cdrom
-I…/…/…/src/thread -I…/…/…/src/timer -I…/…/…/src/endian
-I…/…/…/src/file -I…/…/…/src/thread -MT SDL_alsa_audio.lo -MD -MP
-MF .deps/SDL_alsa_audio.Tpo -c SDL_alsa_audio.c -fPIC -DPIC
-o .libs/SDL_alsa_audio.o
SDL_alsa_audio.c: In function ALSA_OpenAudio': SDL_alsa_audio.c:272: error: too few arguments to functionsnd_pcm_hw_params_get_channels’
SDL_alsa_audio.c:282: warning: passing arg 3 of
snd_pcm_hw_params_set_rate_near' makes pointer from integer without a cast SDL_alsa_audio.c:292: warning: passing arg 3 ofsnd_pcm_hw_params_set_period_size_near’ makes pointer from integer without a
cast
SDL_alsa_audio.c:294: warning: passing arg 3 of
snd_pcm_hw_params_set_periods_near' makes pointer from integer without a cast make[3]: *** [SDL_alsa_audio.lo] Error 1 make[3]: Leaving directory/usr/src/packages/SDL-1.2/src/audio/alsa’
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /usr/src/packages/SDL-1.2/src/audio' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/usr/src/packages/SDL-1.2/src’
make: *** [all-recursive] Error 1

I just run “./configure --prefix=/usr” to configure the package. I have the
same problem with libsdl-1.2.6 stable package.
My Alsa version is 1.0.0rc1

This is the output from the sdl configure script:

tr:/usr/src/packages/SDL-1.2$ ./configure --prefix=/usr
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking target system type… i686-pc-linux-gnu
checking for a BSD-compatible install… /bin/install -c
checking whether build environment is sane… yes
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking for style of include used by make… GNU
checking for gcc… gcc
checking for C compiler default output… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ANSI C… none needed
checking dependency style of gcc… gcc3
checking for a sed that does not truncate output… /bin/sed
checking for egrep… grep -E
checking for ld used by gcc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for /usr/bin/ld option to reload object files… -r
checking for BSD-compatible nm… /usr/bin/nm -B
checking whether ln -s works… yes
checking how to recognise dependent libraries… pass_all
checking how to run the C preprocessor… gcc -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking dlfcn.h usability… yes
checking dlfcn.h presence… yes
checking for dlfcn.h… yes
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking dependency style of g++… gcc3
checking how to run the C++ preprocessor… g++ -E
checking for g77… no
checking for f77… no
checking for xlf… no
checking for frt… no
checking for pgf77… no
checking for fl32… no
checking for af77… no
checking for fort77… no
checking for f90… no
checking for xlf90… no
checking for pgf90… no
checking for epcf90… no
checking for f95… no
checking for fort… no
checking for xlf95… no
checking for lf95… no
checking for g95… no
checking whether we are using the GNU Fortran 77 compiler… no
checking whether accepts -g… no
checking the maximum length of command line arguments… 32768
checking command to parse /usr/bin/nm -B output from gcc object… ok
checking for objdir… .libs
checking for ar… ar
checking for ranlib… ranlib
checking for strip… strip
checking if gcc static flag works… yes
checking if gcc supports -fno-rtti -fno-exceptions… no
checking for gcc option to produce PIC… -fPIC
checking if gcc PIC flag -fPIC works… yes
checking if gcc supports -c -o file.o… yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries… yes
checking whether -lc should be explicitly linked in… no
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking dynamic linker characteristics… GNU/Linux ld.so
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
configure: creating libtool
appending configuration tag “CXX” to libtool
checking for ld used by g++… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
checking for g++ option to produce PIC… -fPIC
checking if g++ PIC flag -fPIC works… yes
checking if g++ supports -c -o file.o… yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking dynamic linker characteristics… GNU/Linux ld.so
appending configuration tag “F77” to libtool
checking whether make sets $(MAKE)… (cached) yes
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ANSI C… (cached) none needed
checking dependency style of gcc… (cached) gcc3
checking for inline… inline
checking for an ANSI C-conforming const… yes
checking whether we are using the GNU C++ compiler… (cached) yes
checking whether g++ accepts -g… (cached) yes
checking dependency style of g++… (cached) gcc3
checking for a BSD-compatible install… /bin/install -c
checking for working alloca.h… yes
checking for alloca… yes
checking for dlopen… yes
checking for dlopen in -ldl… yes
checking for nasm… no
checking for OSS audio support… yes
checking for ALSA audio support… checking for snd_pcm_open in -lasound…
yes
checking for artsc-config… /usr/local/kde/bin/artsc-config
checking for aRts development environment… yes
– /usr/local/kde/lib/libartsc.so.* -> libartsc.so.0
checking for esd-config… no
checking for ESD - version >= 0.2.8… no
*** The esd-config script installed by ESD could not be found
*** If ESD was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the ESD_CONFIG environment variable to the
*** full path to esd-config.
checking for NAS audio support… no
checking for X… libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for gethostbyname… yes
checking for connect… yes
checking for remove… yes
checking for shmat… yes
checking for IceConnectionNumber in -lICE… yes
checking for XFree86 VidMode 1.0 support… yes
checking for XFree86 VidMode gamma support… yes
checking for XFree86 DGA 1.0 support… yes
checking for XFree86 XvImage support… yes
checking for X11 Xinerama support… yes
checking for Xi Graphics XiGMiscExtension support… no
checking for XFree86 DGA 2.0 support… yes
checking for framebuffer console support… yes
checking for PlayStation 2 GS support… no
checking for OpenGL (GLX) support… yes
checking for Linux 2.4 unified input interface… yes
checking for pthreads… yes
checking for recursive mutexes… yes
checking for pthread semaphores… yes
checking for broken glibc 2.0 pthreads… no
checking whether semun is defined in /usr/include/sys/sem.h… no
Copying ./src/main/linux/SDL_main.c -> src/main/SDL_main.c
Copying ./src/thread/linux/SDL_systhread.c -> src/thread/SDL_systhread.c
Copying ./src/thread/linux/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h
Copying ./src/thread/linux/SDL_syssem.c -> src/thread/SDL_syssem.c
Copying ./src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h
Copying ./src/thread/linux/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c
Copying ./src/thread/linux/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h
Copying ./src/thread/linux/SDL_syscond.c -> src/thread/SDL_syscond.c
Copying ./src/thread/generic/SDL_syscond_c.h -> src/thread/SDL_syscond_c.h
Copying ./src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating docs/Makefile
config.status: creating docs/html/Makefile
config.status: creating docs/man3/Makefile
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating src/main/Makefile
config.status: creating src/main/macosx/Makefile
config.status: creating src/main/macosx/Info.plist
config.status: creating src/audio/Makefile
config.status: creating src/audio/alsa/Makefile
config.status: creating src/audio/arts/Makefile
config.status: creating src/audio/baudio/Makefile
config.status: creating src/audio/dc/Makefile
config.status: creating src/audio/disk/Makefile
config.status: creating src/audio/dma/Makefile
config.status: creating src/audio/dmedia/Makefile
config.status: creating src/audio/dsp/Makefile
config.status: creating src/audio/esd/Makefile
config.status: creating src/audio/macrom/Makefile
config.status: creating src/audio/mint/Makefile
config.status: creating src/audio/mme/Makefile
config.status: creating src/audio/nas/Makefile
config.status: creating src/audio/nto/Makefile
config.status: creating src/audio/openbsd/Makefile
config.status: creating src/audio/paudio/Makefile
config.status: creating src/audio/riscos/Makefile
config.status: creating src/audio/sun/Makefile
config.status: creating src/audio/ums/Makefile
config.status: creating src/audio/windib/Makefile
config.status: creating src/audio/windx5/Makefile
config.status: creating src/video/Makefile
config.status: creating src/video/aalib/Makefile
config.status: creating src/video/ataricommon/Makefile
config.status: creating src/video/bwindow/Makefile
config.status: creating src/video/cybergfx/Makefile
config.status: creating src/video/dc/Makefile
config.status: creating src/video/dga/Makefile
config.status: creating src/video/directfb/Makefile
config.status: creating src/video/dummy/Makefile
config.status: creating src/video/epoc/Makefile
config.status: creating src/video/fbcon/Makefile
config.status: creating src/video/gem/Makefile
config.status: creating src/video/ggi/Makefile
config.status: creating src/video/maccommon/Makefile
config.status: creating src/video/macdsp/Makefile
config.status: creating src/video/macrom/Makefile
config.status: creating src/video/nanox/Makefile
config.status: creating src/video/photon/Makefile
config.status: creating src/video/picogui/Makefile
config.status: creating src/video/ps2gs/Makefile
config.status: creating src/video/qtopia/Makefile
config.status: creating src/video/quartz/Makefile
config.status: creating src/video/riscos/Makefile
config.status: creating src/video/svga/Makefile
config.status: creating src/video/vgl/Makefile
config.status: creating src/video/wincommon/Makefile
config.status: creating src/video/windib/Makefile
config.status: creating src/video/windx5/Makefile
config.status: creating src/video/x11/Makefile
config.status: creating src/video/xbios/Makefile
config.status: creating src/video/XFree86/Makefile
config.status: creating src/video/XFree86/extensions/Makefile
config.status: creating src/video/XFree86/Xinerama/Makefile
config.status: creating src/video/XFree86/Xv/Makefile
config.status: creating src/video/XFree86/Xxf86dga/Makefile
config.status: creating src/video/XFree86/Xxf86vm/Makefile
config.status: creating src/events/Makefile
config.status: creating src/joystick/Makefile
config.status: creating src/joystick/amigaos/Makefile
config.status: creating src/joystick/beos/Makefile
config.status: creating src/joystick/bsd/Makefile
config.status: creating src/joystick/darwin/Makefile
config.status: creating src/joystick/dc/Makefile
config.status: creating src/joystick/dummy/Makefile
config.status: creating src/joystick/linux/Makefile
config.status: creating src/joystick/macos/Makefile
config.status: creating src/joystick/mint/Makefile
config.status: creating src/joystick/riscos/Makefile
config.status: creating src/joystick/win32/Makefile
config.status: creating src/cdrom/Makefile
config.status: creating src/cdrom/aix/Makefile
config.status: creating src/cdrom/beos/Makefile
config.status: creating src/cdrom/dc/Makefile
config.status: creating src/cdrom/dummy/Makefile
config.status: creating src/cdrom/bsdi/Makefile
config.status: creating src/cdrom/freebsd/Makefile
config.status: creating src/cdrom/linux/Makefile
config.status: creating src/cdrom/macos/Makefile
config.status: creating src/cdrom/macosx/Makefile
config.status: creating src/cdrom/mint/Makefile
config.status: creating src/cdrom/openbsd/Makefile
config.status: creating src/cdrom/osf/Makefile
config.status: creating src/cdrom/qnx/Makefile
config.status: creating src/cdrom/win32/Makefile
config.status: creating src/thread/Makefile
config.status: creating src/timer/Makefile
config.status: creating src/endian/Makefile
config.status: creating src/file/Makefile
config.status: creating src/cpuinfo/Makefile
config.status: creating src/hermes/Makefile
config.status: creating sdl-config
config.status: creating SDL.spec
config.status: creating SDL.qpg
config.status: executing depfiles commands
config.status: executing default commands
tr:/usr/src/packages/

Thank you for any hint in advance :slight_smile:

Thomas–
Just because the message may never be received does not mean it is
not worth sending.

I don’t have ALSA installed at the moment. If somebody has any time,
can they update SDL for ALSA 1.0?

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam Lantinga wrote:

I don’t have ALSA installed at the moment. If somebody has any time,
can they update SDL for ALSA 1.0?

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

The attathced patch does the trick (although there will have to be code
changes when the alsa 0.9 api get deprecated).

On a side-note, the good news is that using alsa 1.0.0rc1 solves the
previous issues I had with my ac97 via sound chipset.

Stephane

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: alsa.patch
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031214/b28d0623/attachment.txt

I hate to refer to my own messages, but here it goes… :wink:

The game i’m trying to play (frozen-bubble) still segfaults on
sound-initialization, but this may be unrelated or may be a bug in sdl-perl
or whatever…

Ok, the problem here was that the game couldn’t open the sound device due to a
running artsd from kde. using artsdsp as wrapper solved the problem.

So your proposed patch works 100% for me, thank you very much :slight_smile:

Yours,
Thomas

PS.: please CC me, i’m not subsribed to the list !–
Just because the message may never be received does not mean it is
not worth sending.

Hello Stephane,

thanks for the patch, it works for me. Well, at least it makes SDL compile
with alsa support.
The game i’m trying to play (frozen-bubble) still segfaults on
sound-initialization, but this may be unrelated or may be a bug in sdl-perl
or whatever…

BTW: it seems the last CVS snapshot (saturday, 13th) is somehow broken.
configure complains that it cannot find the install-sh script (which indeed
is not included in the tarball).

Thank you anyway :slight_smile:
Thomas

PS.: please CC me, i’m not subsribed to the list !On Sunday 14 December 2003 18:17, you wrote:

Hi,
sorry, I hadn’t seen the need for a CC so I’m resending to you privately.
Can you try the attached patch please ?

Stephane


Just because the message may never be received does not mean it is
not worth sending.