|
From: Michael G. <mg...@ee...> - 2000-12-11 06:28:47
|
>Apologies if this issue is being beaten to death as I write this, and
>if the list archives haven't caught up (nothing is listed for this
>month.)
No worries, the mailing list has only been around for a week.
>
>I'm trying to build peep on my Debian 2.2/2.3 box, using ALSA
>0.59D. I'm encountering several issues, and have run into a stumbling
>block.
>
>First, let me just state that I'm not an ALSA expert. The extent of my
>efforts to fix these apparent ALSA difficulties involves changing a
>few type names, etc.
You and me both =)
>
>First, I encountered this error:
>
>gcc -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -g -O2 -c VoiceMixer.c
>VoiceMixer.c: In function `MixerInit':
>VoiceMixer.c:49: `SND_PCM_OPEN_PLAYBACK' undeclared (first use in this function)
>VoiceMixer.c:49: (Each undeclared identifier is reported only once
>VoiceMixer.c:49: for each function it appears in.)
>VoiceMixer.c:55: `SND_PCM_SFMT_S16_LE' undeclared (first use in this function)
>make[2]: *** [VoiceMixer.o] Error 1
>make[2]: Leaving directory `/home/nolan/src/peep/Peep-0.3.4/server'
>
>I looked at Sound.h, and the following lines were commented out:
>
>/* Include these headers for ALSA definitions */
>#include <sys/asoundlib.h>
>#include <linux/asound.h>
>/*#include <linux/asoundid.h>*/
>
>I uncommented them, and commented out the last include which I don't
>seem to have in my version of ALSA. It seems odd that the includes
>were commented out while the defines were not; is ALSA support not
>up-to-date?
Other ALSA people have written me and had the same problems. My
general guidelines are: Are you sure that headers and libraries are
installed (not just alsa drivers and utils)... Also, it may be out of
date because when I had written the code, it was back in version 0.4.x
or so.. I'll probably have to download the new version and update
it. But ALSA has been moving fast lately.
I suggest that if you have the libraries and headers, just edit
your config.h and undef ALSA and define DEVICE_DRIVER. That will use
/dev/audio and should get you going. If anyone can provide me with a
patch or fix for ALSA, I'd appreciate it..
>
>VoiceMixer.c compiles, and everything runs smoothly until AlsaSound.c:
>gcc -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -g -O2 -c AlsaSound.c
>AlsaSound.c: In function `GetSoundCardInfo':
>AlsaSound.c:47: `snd_pcm_playback_info_t' undeclared (first use in this function)
>AlsaSound.c:47: (Each undeclared identifier is reported only once
>AlsaSound.c:47: for each function it appears in.)
>AlsaSound.c:47: `info' undeclared (first use in this function)
>AlsaSound.c:48: parse error before `static'
>AlsaSound.c:51: `err' undeclared (first use in this function)
>AlsaSound.c:53: warning: passing arg 2 of `strcat' makes pointer from integer
>without a cast
>AlsaSound.c:59: `s' undeclared (first use in this function)
>AlsaSound.c: In function `GetSoundStatus':
>AlsaSound.c:70: `snd_pcm_playback_status_t' undeclared (first use in this function)
>AlsaSound.c:70: `status' undeclared (first use in this function)
>AlsaSound.c:71: parse error before `static'
>AlsaSound.c:74: `err' undeclared (first use in this function)
>AlsaSound.c:76: warning: passing arg 2 of `strcat' makes pointer from integer
>without a cast
>AlsaSound.c:81: `s' undeclared (first use in this function)
>AlsaSound.c: In function `SetSoundFormat':
>AlsaSound.c:99: `snd_pcm_format_t' undeclared (first use in this function)
>AlsaSound.c:99: parse error before `format'
>AlsaSound.c:101: `format' undeclared (first use in this function)
>AlsaSound.c:109: warning: passing arg 2 of `strcat' makes pointer from
>integer without a cast
>make: *** [AlsaSound.o] Error 1
>
>Fun. :) <grepgrep manglemangle C-xs make>. I changed
>snd_pcm_playback_info_t to snd_pcm_info_t, and made a bit of progress.
>
>My next big stumbling block is with sound_card_info. Namely, WTH do I
>find the thing? :) rgreps in the Peep source directory don't reveal
>anything, nor does a rgrep in /usr/include. I'm relatively sure it exists since
>gcc doesn't complain about it not being defined, but instead complains
>about structure members. But, I can't seem to find the structure to
>try to fix this.
These were all Alsa structures defined in the header and linked
with the library.. if you do have the libraries and headers,
then I guess I'm out of date.. I hate that. heh.
>
>One more thing (geez when will this guy shut up?!? :) I mucked with
>the configure.in to disable ALSA, hoping that the device driver
>support might work instead. But the latest peepd segfaults. Here's a
>transcript of the server startup:
>
>===========================================
>Welcome to PEEP (the network auralizer).
>Copyright (C) 2000 Michael Gilfix
>===========================================
>
>Initializing Sound Engine...
>Used 32 voices.
>Loading peep.conf and Sound Samples into memory...
>Depending on your machine and sound files, this may take a while.
>Sound Initialization complete.
>Starting Mixer thread...
>Starting Engine thread...
>Initializing server thread...
>Segmentation fault
>
>And the last few lines of strace output (if they help.):
This strace is BIG help. If you look at the strace, you'll
notice that it is trying to bind to port address 0.0.0.0. Good
luck. The fix is in the configuration file (I know, I need better
error checking there). Make sure that the hostname is right in the
configuration file.. that makes a BIG difference. ALso make sure
your broadcast stuff is right.. you'll know it's fixed when the
sin_addr=inet_addr("<YOUR IP>") is right.
>
>open("/etc/protocols", O_RDONLY) = 37
>fcntl(37, F_GETFD) = 0
>fcntl(37, F_SETFD, FD_CLOEXEC) = 0
>fstat(37, {st_mode=S_IFREG|0644, st_size=1748, ...}) = 0
>old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
>0) = 0x40ee8000
>read(37, "# /etc/protocols:\n# $Id: protoco"..., 4096) = 1748
>close(37) = 0
>munmap(0x40ee8000, 4096) = 0
>socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 37
>setsockopt(37, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
>bind(37, {sin_family=AF_INET, sin_port=htons(2001), sin_addr=inet_addr("0.0.0.0")}},
>16) = 0
>--- SIGSEGV (Segmentation fault) ---
>+++ killed by SIGSEGV +++
>
>gdb shows:
>
>0x400e6741 in strcpy () from /lib/libc.so.6
>(gdb) bt
>bt
>#0 0x400e6741 in strcpy () from /lib/libc.so.6
>#1 0x804a424 in ServerInit (p=2001) at Server.c:129
>#2 0x8049413 in main (argc=1, argv=0xbffffc4c) at Main.c:209
>
>Hope this helps some
Hope this helps you.. =)
>
>
--
Michael Gilfix
mg...@ee...
|