>It looks like Sun changed the sound interface for SunOS 4.1.3.  Old
>binaries get runtime errors.  Recompiling lemacs leads to a string of
>compile time errors centering around the changes to the sound
>interface.
>Has anyone tackled this problem yet?

Its not often that you get to follow up to your own msg...

Here is something that I hacked together that seems to work.  In
theory it will work on SunOS versions 4.1, 4.1.1, 4.1.2, or 4.1.3,
although I only have a 4.1.3 system to test it on at the moment.
Bugs/comments to me.

-wolfgang

#!/bin/sh
# shar:	Shell Archiver  (v1.22)
#
#	Run the following text with /bin/sh to create:
#	  playsunos413.c
#	  ymakefile.pat
#
sed 's/^X//' << 'SHAR_EOF' > playsunos413.c &&
X/******************************************************************************
X*									      *
X*	File:     playsunos413.c					      *
X*	Author:   Wolfgang S. Rupprecht <wolfgang@wsrcc.com>		      *
X*	Created:  Sat Dec 12 18:59:53 PST 1992				      *
X*	Contents: Updated version of sound playing utilities for SunOS 4.1.3  *
X*									      *
X*	Copyright (c) 1992 Wolfgang S. Rupprecht.			      *
X*									      *
X*******************************************************************************
X
XThis file is free software; you can redistribute it and/or modify
Xit under the terms of the GNU General Public License as published by
Xthe Free Software Foundation.
X
XThis file is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
XGNU General Public License for more details.
X
XYou should have received a copy of the GNU General Public License
Xalong with GNU Emacs; see the file COPYING.  If not, write to
Xthe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
X
X#include <stdio.h>
X#include <fcntl.h>
X#include <sys/ioctl.h>
X#include <sun/audioio.h>
X#include <multimedia/audio_errno.h>
X
X/* grabbed from libsst.h */
X#define gripe(string) \
X    message("audio: %s, %s", string, \
X	    (errno < sys_nerr) ? sys_errlist[errno] : \
X	    "unknown")
X#define SFBUFSZ (8 * 1024)
X
Xextern int errno, sys_nerr;
Xextern char *sys_errlist[];
X
Xvoid
Xplay_sound_file(sound_file, volume)
X    char           *sound_file;
X    int             volume;
X{
X    int             afd,
X                    sfd,
X                    length,
X                    rcnt,
X                    wcnt;
X    char            buffer[SFBUFSZ],
X                   *data;
X    audio_info_t    info;
X
X    afd = open("/dev/audio", O_WRONLY);
X    if (afd < 0)
X    {
X	gripe("audio open");
X	return;
X    }
X    {
X	double cvt;
X	cvt = volume;
X	cvt *= 2.54;
X	volume = cvt;
X	if (volume > 254)	/* 255 is special */
X	    volume = 254;
X    }
X    AUDIO_INITINFO(&info);
X    info.play.port = AUDIO_SPEAKER;
X    info.play.gain = volume;
X    if (ioctl(afd, AUDIO_SETINFO, &info) != AUDIO_SUCCESS)
X    {
X	gripe("audio ioctl");
X	close(afd);
X	return;
X    }
X    sfd = open(sound_file, O_RDONLY);
X    if (sfd < 0)
X    {
X	gripe("sound-file open");
X	close(afd);
X	return;
X    }
X    rcnt = 1;
X    while (rcnt > 0)
X    {
X	rcnt = read(sfd, buffer, SFBUFSZ);
X	if (rcnt < 0)
X	{
X	    gripe("sound-file read");	/* just a plain message??? */
X	    close(afd);
X	    close(sfd);
X	    return;
X	}
X	data = buffer;
X	length = rcnt;
X	while (length > 0)
X	{
X	    wcnt = write(afd, data, length);
X	    if (wcnt <= 0)
X	    {
X		gripe("audio write");	/* just a plain message??? */
X		close(afd);
X		close(sfd);
X		return;
X	    }
X	    length -= wcnt;
X	    data += wcnt;
X	}
X    }
X    close(afd);
X    close(sfd);
X}
X
X
Xvoid
Xplay_sound_data(data, length, volume)
X    unsigned char  *data;
X    int             length,
X                    volume;
X{
X    int             afd,
X                    wcnt;
X    audio_info_t    info;
X
X    afd = open("/dev/audio", O_WRONLY);
X    if (afd < 0)
X    {
X	gripe("audio open");
X	return;
X    }
X    {
X	double cvt;
X	cvt = volume;
X	cvt *= 2.54;
X	volume = cvt;
X	if (volume > 254)	/* 255 is special */
X	    volume = 254;
X    }
X    AUDIO_INITINFO(&info);
X    info.play.port = AUDIO_SPEAKER;
X    info.play.gain = volume;
X
X    if (ioctl(afd, AUDIO_SETINFO, &info) != AUDIO_SUCCESS)
X    {
X	gripe("audio ioctl");
X	close(afd);
X	return;
X    }
X    while (length > 0)
X    {
X	wcnt = write(afd, data, length);
X	if (wcnt <= 0)
X	{
X	    gripe("audio write");	/* just a plain message??? */
X	    close(afd);
X	    return;
X	}
X	length -= wcnt;
X	data += wcnt;
X    }
X    close(afd);
X}
SHAR_EOF
chmod 0644 playsunos413.c || echo "restore of playsunos413.c fails"
sed 's/^X//' << 'SHAR_EOF' > ymakefile.pat &&
X*** ymakefile.~2~	Sat Oct 10 13:18:54 1992
X--- ymakefile	Sat Dec 12 19:52:17 1992
X***************
X*** 194,202 ****
X  
X  #ifdef USE_SOUND
X  #ifdef sparc
X- # define SOUND_LIBS	-L/usr/demo/SOUND -laudio
X  # define SOUND_CFLAGS	-I/usr/demo/SOUND
X  # define SOUND_OBJS	play.o libsst.o
X  #else /* ! sparc */
X  #ifdef sgi
X  # define SOUND_LIBS	-laudio
X--- 194,207 ----
X  
X  #ifdef USE_SOUND
X  #ifdef sparc
X  # define SOUND_CFLAGS	-I/usr/demo/SOUND
X+ #ifdef SUNOS413
X+ # define SOUND_LIBS
X+ # define SOUND_OBJS	playsunos413.o
X+ #else
X+ # define SOUND_LIBS	-L/usr/demo/SOUND -laudio
X  # define SOUND_OBJS	play.o libsst.o
X+ #endif
X  #else /* ! sparc */
X  #ifdef sgi
X  # define SOUND_LIBS	-laudio
X***************
X*** 605,614 ****
X--- 610,624 ----
X  
X  #ifdef USE_SOUND
X  #ifdef sparc
X+ #ifdef sunos413
X+ playsunos413.o : playsunos413.c
X+ 	$(CC) -c $(CFLAGS) SOUND_CFLAGS playsunos413.c
X+ #else
X  play.o : libsst.h
X  	$(CC) -c $(CFLAGS) SOUND_CFLAGS play.c
X  libsst.o : libsst.h
X  	$(CC) -c $(CFLAGS) SOUND_CFLAGS libsst.c
X+ #endif /* sunos413 */
X  #endif /* sparc */
X  #endif
X  
SHAR_EOF
chmod 0644 ymakefile.pat || echo "restore of ymakefile.pat fails"
exit 0
-- 
Wolfgang Rupprecht    wolfgang@wsrcc.com (or) decwrl!wsrcc!wolfgang
Snail Mail:           39469 Gallaudet Drive, Fremont, CA 94538-4511