From xemacs-m  Sat Apr 12 07:25:55 1997
Received: from elvenbow.nc.kyushu-u.ac.jp (root@elvenbow.nc.kyushu-u.ac.jp [133.5.6.4])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id HAA17159
	for <xemacs-beta@xemacs.org>; Sat, 12 Apr 1997 07:25:46 -0500 (CDT)
Received: from localhost (kasahara@localhost [127.0.0.1]) by elvenbow.nc.kyushu-u.ac.jp (8.8.5/3.5Wbeta) with ESMTP
	id VAA00640 for <xemacs-beta@xemacs.org>; Sat, 12 Apr 1997 21:25:36 +0900 (JST)
To: xemacs-beta@xemacs.org
Subject: Re: Native sound support for BSD/OS (unsuccessful yet)
In-Reply-To: Your message of "09 Apr 1997 23:21:12 +0200"
References: <m3hghfevuf.fsf_-_@cortex.corpus.uni-muenster.de>
X-Fingerprint: 31 DC 9F DF C2 B9 8E 00  3A 7C 4F 0C 03 D8 AC 16
X-URL: http://www.nc.kyushu-u.ac.jp/~kasahara/
Mime-Version: 1.0
X-Mailer: Mew version 1.69 on XEmacs 20.1
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <19970412212534G.kasahara@nc.kyushu-u.ac.jp>
Date: Sat, 12 Apr 1997 21:25:34 +0900
From: Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp>
X-Dispatcher: impost version 0.99+ (Mar. 3, 1997)
Lines: 62

I just upgraded my working machine to BSD/OS 3.0 yesterday, and I
tried to add native sound support for BSD/OS to xemacs-20.1-b11, but
I'm totally stuck now.

On 09 Apr 1997 23:21:12 +0200,
	Markus Gutschke <gutschk@uni-muenster.de> said:

> Load the file "src/Makefile.in.in" and look for the following lines
> 
> # elif defined (LINUX) || defined(__FreeBSD__)
> #   define SOUND_CFLAGS
> #   define SOUND_OBJS		linuxplay.o
> # else

I changed these lines as follows.

# elif defined (LINUX) || defined(__FreeBSD__) || defined (__bsdi__)
#   define SOUND_CFLAGS
#   define SOUND_OBJS           linuxplay.o
# else

Also, I had to modify linuxplay.c slightly because BSD/OS's
soundcard.h is in /usr/include/sys.

#include <errno.h>
#include <fcntl.h>
#if defined(__FreeBSD__)
#  include <machine/soundcard.h>
#elif defined(__bsdi__)
#  include <sys/soundcard.h>
#else
#  include <linux/soundcard.h>
#endif

Then I could make an xemacs executable successfully, but it didn't work
as expected.  I did 'M-x load-default-sounds', hit ctrl-g, then xemacs
dumped core inside 'ding'.

Program received signal SIGSEGV, Segmentation fault.
0x114c54 in linux_play_data_or_file (fd=-1, data=0xefbfd194 ".snd", length=565, volume=75) at linuxplay.c:981
(xxgdb) where
#0  0x114c54 in linux_play_data_or_file (fd=-1, data=0xefbfd194 ".snd", length=565, volume=75) at linuxplay.c:981
#1  0x114f9f in play_sound_data (data=0xefbfd194 ".snd", length=565, volume=75) at linuxplay.c:1077
#2  0x113133 in Fplay_sound (sound=272339068, volume=272338948, device=273518080) at sound.c:301
#3  0x113307 in Fding (arg=272338948, sound=272339068, device=272338948) at sound.c:349
....(omit)....

Segmentation fault occured inside linux_play_data_or_file, on this
line.

  if ((audio_fd=open((audio_dev="/dev/dsp"),
                     (O_WRONLY|O_NDELAY),0)) < 0) {

Currently I have no idea why it caused seg fault.

Any idea ?
-- 
Yoshiaki Kasahara
KITE Neiftwork Operation Center, Computer Center, Kyushu University

Email addr:                           |  I'm free!   & ~ __-^-_/~
    kasahara@nc.kyushu-u.ac.jp        |               ~   \___/

