Subject: Re: Speak Freely for NetBSD?
To: Berndt Josef Wulf <wulf@ping.net.au>
From: Berndt Josef Wulf <wulf@ping.net.au>
List: port-i386
Date: 10/14/1996 22:14:15
Berndt Josef Wulf wrote
> 
> G'day,
> 
> I just tried to built speak_freely_6.1b on a NetBSD-1.2 system but
> was greated by compiler errors whilest compiling the soundbyte.c file.
> 
> cc -O2 -Iadpcm -Ilpc -Igsm/inc -Imd5 -Iidea -Ilibdes
> -DInternet_Port=2074 -DRelno="\"Release 6.1b, August 1996\""
> -DM_LITTLE_ENDIAN -DBSD_like   -c soundbyte.c
> In file included from soundbyte.c:38:
> /usr/include/sys/audioio.h:118: conflicting types for
> `audio_encoding_t'
> audio_descr.h:10: previous declaration of `audio_encoding_t'
> soundbyte.c: In function `soundinit':
> soundbyte.c:121: `SNDCTL_DSP_NONBLOCK' undeclared (first use this
> function)
> soundbyte.c:121: (Each undeclared identifier is reported only once
> soundbyte.c:121: for each function it appears in.)
> soundbyte.c:125: `SNDCTL_DSP_GETBLKSIZE' undeclared (first use this
> function)
> soundbyte.c: In function `soundplayvol':
> soundbyte.c:214: `SOUND_MIXER_PCM' undeclared (first use this
> function)
> soundbyte.c: In function `soundrecgain':
> soundbyte.c:235: `SOUND_MIXER_WRITE_RECLEV' undeclared (first use this
> function)
> *** Error code 1
> 
> NetBSD doesn't have the <machine/soundcard.h> header file and hence
> these definitions are not defined (I changed it to <sys/audioio.h>
> since this is where NetBSD defines all its audio variables.
> 
> Has someone managed to compile this package on NetBSD or is working on
> it?
> 
> Many thanks in advance
> 

Hi,

after the "overwhelming" response I dug into the source code and hacked
it to suit my OS following the path of least resistance - and YES you
are right... I am not a programmer ;)

I've got it to work in that it will connect to the server, sent the
compressed audio packets, which appears to be heard at the other end
of the line, but incoming packets are mostly silent :(

Using the -d parameter with sfspeaker shows the arriving packets. When
recording the packets into a sound file I am able to listen to the
record using my /dev/audio device.

Sometimes, live audio can be heard on a aparent good connection but
it seem to be somewhat at random. 

Having come this far, I am sure that it should be possible to get
speak_freely to work on the NetBSD platform. Is anyone out there who
can give me some hints on what to try next?

Below is my configuration of the Makefile....

CCFLAGS = -DM_LITTLE_ENDIAN -DBSD_like -DAUDIO_BLOCKING
LFLAGS = -lcurses -ltermcap -lcompat -lm
DUPLEX = -DHALF_DUPLEX
DEBUG = -O2

The core problem of compiling this package lies in the definition of
the audio_encoding_t which is conflicting with the definition in the
<sys/audioio.h> header file. I have renamed audio_enconding_t to
audio_encoding in audio_descr.h , which allows the construct for
struct audio_descr_t without interfering with audio_encoding_t as defined
in NetBSD's audioio.h file.

In soundbyte.c I added the symbol __NetBSD__ to the constructs
below...

line:64
#if defined(sun) || defined(__NetBSD__)
static audio_info_t Audio_info;       /* Current configuration info */
#endif

line:203
#if defined(sun) || defined(__NetBSD__)
	AUDIO_INITINFO(&Audio_info);      
	Audio_info.play.gain = scale_gain(value);
    	if (ioctl(Audio_fd, AUDIO_SETINFO, &Audio_info) < 0) {
	    perror("Set play volume");
	}		}
#else

line:224
#if defined(sun) || defined(__NetBSD__)
	AUDIO_INITINFO(&Audio_info);
	Audio_info.record.gain = scale_gain(value);
    	if (ioctl(Audio_fd, AUDIO_SETINFO, &Audio_info) < 0) {
    	perror("Set record gain");
	}
#else


Systeminfo: NetBSD-1.2/i386, 686P120, vibra16 sounccard, 32MB RAM

Any comments?

Many thanks in advance

cheerio Berndt
-- 
Name	: Berndt Josef Wulf
E-Mail	: wulf@ping.net.au
Sysinfo	: DEC AXPpci33+, NetBSD-1.2