bring back esound-0.2.38.

fix the issues with audio(4) handling that caused this to get
reverted previously.

add an arts flavor.
This commit is contained in:
jakemsr 2008-03-31 01:05:54 +00:00
parent ac50f5ddb5
commit feb531b75c
16 changed files with 280 additions and 127 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.43 2007/10/05 14:14:14 todd Exp $
# $OpenBSD: Makefile,v 1.44 2008/03/31 01:05:54 jakemsr Exp $
# $FreeBSD: Makefile,v 1.8 1999/03/09 01:08:46 nectar Exp $
COMMENT= sound library for Enlightenment
DISTNAME= esound-0.2.34
PKGNAME= ${DISTNAME}p1v0
SHARED_LIBS += esd 2.39 # .2.34
DISTNAME= esound-0.2.38
PKGNAME= ${DISTNAME}v0
SHARED_LIBS += esd 2.40 # .2.38
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_GNOME:=sources/esound/0.2/}
@ -20,16 +20,37 @@ PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c m wrap
FLAVORS= arts
FLAVOR?=
USE_LIBTOOL= Yes
SEPARATE_BUILD= concurrent
AUTOCONF_VERSION=2.13
AUTOCONF_VERSION=2.61
CONFIGURE_STYLE= autoconf
CONFIGURE_ARGS+= ${CONFIGURE_SHARED}
CONFIGURE_ARGS+= --with-libwrap
CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \
--disable-alsa \
--disable-oss \
--with-libwrap
# broken, relies upon v4-mapped addresses
CONFIGURE_ARGS+= --disable-ipv6
.if ${FLAVOR:L:Marts}
CONFIGURE_ARGS+=--enable-arts
MODULES+= devel/gettext
LIB_DEPENDS+= artsc::x11/kde/arts3
WANTLIB+= glib-2.0 gthread-2.0 gmodule-2.0 pcre pthread stdc++
.else
CONFIGURE_ARGS+=--disable-arts
.endif
FAKE_FLAGS= DESTDIR=${WRKINST} \
esdconfdir=${PREFIX}/share/examples/esound
post-extract:
@cp -f ${FILESDIR}/audio_sun.c ${WRKSRC}
pre-configure:
@perl -pi -e 's|_LOCALBASE_|${LOCALBASE}|' \
${WRKSRC}/test-script
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (esound-0.2.34.tar.gz) = lSbU/7u9lGJ2izjAgscmxw==
RMD160 (esound-0.2.34.tar.gz) = +/rAann7gX+e9h14CJRfe6h8ARA=
SHA1 (esound-0.2.34.tar.gz) = T6H7MhIZl/6edQe/WvKWpkvAoiA=
SHA256 (esound-0.2.34.tar.gz) = ass7wF3kshz9cpH93R9XwooxyHLuYGowp4ktAkLdznU=
SIZE (esound-0.2.34.tar.gz) = 392336
MD5 (esound-0.2.38.tar.gz) = d8TpgFoBf7oGVSSH3zxmYg==
RMD160 (esound-0.2.38.tar.gz) = OwL3H38UZcIECjzwETbzHWJnfmE=
SHA1 (esound-0.2.38.tar.gz) = QFQ9y1sVcsdwKwuwt1aEQEY1G6U=
SHA256 (esound-0.2.38.tar.gz) = SKOU83d2M2JmBnlKUpTwHilOERTWzD54lMapDyImsGc=
SIZE (esound-0.2.38.tar.gz) = 519964

View File

@ -1,4 +1,4 @@
/* $OpenBSD: audio_sun.c,v 1.3 2004/01/25 22:07:28 fgsch Exp $ */
/* $OpenBSD: audio_sun.c,v 1.4 2008/03/31 01:05:54 jakemsr Exp $ */
/*
* Copyright (c) 2002 CubeSoft Communications, Inc.
@ -27,7 +27,10 @@
#include "config.h"
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/audioio.h>
#include <string.h>
static void sun_panic(int fd, char *s)
{
@ -48,9 +51,8 @@ int esd_audio_open()
{
const char *device;
int afd = -1;
int fmt = 0, channels = 0;
int fmt = 0, channels = 0, bits = 0;
int mode = O_WRONLY;
audio_encoding_t enc;
audio_info_t info;
AUDIO_INITINFO(&info);
@ -58,13 +60,11 @@ int esd_audio_open()
/* set the appropriate mode */
if((esd_audio_format & ESD_MASK_FUNC) == ESD_RECORD) {
mode = O_RDWR;
info.mode = AUMODE_PLAY | AUMODE_RECORD;
info.mode = AUMODE_PLAY | AUMODE_PLAY_ALL | AUMODE_RECORD;
} else {
info.mode = AUMODE_PLAY;
info.mode = AUMODE_PLAY | AUMODE_PLAY_ALL;
}
mode |= O_NONBLOCK;
/* open the sound device */
device = esd_audio_device ? esd_audio_device : "/dev/audio";
if ((afd = open(device, mode, 0)) == -1) {
@ -72,10 +72,6 @@ int esd_audio_open()
return( -2 );
}
mode = fcntl(afd, F_GETFL);
mode &= ~O_NONBLOCK;
fcntl(afd, F_SETFL, mode);
/* set the requested mode */
if(ioctl(afd, AUDIO_SETINFO, &info) < 0) {
sun_panic(afd, "AUDIO_SETINFO");
@ -91,22 +87,24 @@ int esd_audio_open()
}
/* pick a supported encoding */
#if defined(WORDS_BIGENDIAN)
fmt = ( (esd_audio_format & ESD_MASK_BITS) == ESD_BITS16 )
? /* 16 bit */ AUDIO_ENCODING_SLINEAR_BE
: /* 8 bit */ AUDIO_ENCODING_PCM8;
#else
fmt = ( (esd_audio_format & ESD_MASK_BITS) == ESD_BITS16 )
? /* 16 bit */ AUDIO_ENCODING_SLINEAR_LE
: /* 8 bit */ AUDIO_ENCODING_PCM8;
#endif
enc.index = 0;
while(!ioctl(afd, AUDIO_GETENC, &enc) && enc.encoding != fmt) {
enc.index++;
if ((esd_audio_format & ESD_MASK_BITS) == ESD_BITS16) {
bits = 16;
fmt = (BYTE_ORDER == 4321) ?
AUDIO_ENCODING_SLINEAR_BE : AUDIO_ENCODING_SLINEAR_LE;
} else {
bits = 8;
fmt = (BYTE_ORDER == 4321) ?
AUDIO_ENCODING_ULINEAR_BE : AUDIO_ENCODING_ULINEAR_LE;
}
info.play.encoding = fmt;
info.play.precision = bits;
if(ioctl(afd, AUDIO_SETINFO, &info) == -1) {
fprintf(stderr, "Unsupported encoding: %i-bit (0x%x)\n",
bits, fmt);
sun_panic(afd, "SETINFO");
return(-1);
}
/* number of channels */
channels = (((esd_audio_format & ESD_MASK_CHAN) == ESD_STEREO)
? /* stereo */ 2
@ -116,13 +114,19 @@ int esd_audio_open()
if((esd_audio_format & ESD_MASK_FUNC) == ESD_RECORD) {
info.record.channels = channels;
}
info.play.encoding = fmt;
info.play.precision = enc.precision;
if(ioctl(afd, AUDIO_SETINFO, &info) == -1) {
fprintf(stderr, "Unsupported encoding: %i-bit \"%s\" (0x%x)\n",
enc.precision, enc.name, fmt);
fprintf(stderr, "Unsupported channel count: %d\n",
channels);
sun_panic(afd, "SETINFO");
return(-1);
}
/* blocksize, sync to internal esd buffer size */
info.blocksize = ESD_BUF_SIZE;
info.hiwat = 4;
if(ioctl(afd, AUDIO_SETINFO, &info) < 0) {
fprintf(stderr, "Unsupported blocksize: %d\n",
info.blocksize);
sun_panic(afd, "SETINFO");
return(-1);
}

View File

@ -1,11 +0,0 @@
--- Makefile.in.orig Tue Mar 16 07:26:18 2004
+++ Makefile.in Thu Jun 24 20:07:12 2004
@@ -180,7 +180,7 @@ esd_LDADD = $(WRAP_LIB) $(LDADD)
m4datadir = $(datadir)/aclocal
m4data_DATA = esd.m4
-esdconfdir = $(sysconfdir)
+esdconfdir = $(datadir)/examples/esound
esdconf_DATA = esd.conf
pkgconfigdir = $(libdir)/pkgconfig

View File

@ -1,10 +0,0 @@
--- acconfig.h.orig Thu Jan 15 05:49:09 2004
+++ acconfig.h Thu Jun 24 20:09:24 2004
@@ -11,6 +11,7 @@
#undef DRIVER_ALSA_09_NEW_PCM_API
#undef DRIVER_DART
#undef DRIVER_COREAUDIO
+#undef DRIVER_SUN
#undef DRIVER_NONE
#undef HAVE_INET_ATON
#undef HAVE_INET_PTON

View File

@ -0,0 +1,89 @@
$OpenBSD: patch-audio_arts_c,v 1.1 2008/03/31 01:05:54 jakemsr Exp $
--- audio_arts.c.orig Thu Apr 19 07:43:59 2007
+++ audio_arts.c Sun Mar 9 22:03:23 2008
@@ -19,6 +19,7 @@
*
*/
+#if 0
#include <dlfcn.h>
enum arts_parameter_t_enum { ARTS_P_BUFFER_TIME = 2 };
@@ -37,14 +38,17 @@ static int (*arts_stream_set)(arts_stream_t sst, arts_
static arts_stream_t (*arts_play_stream)(int rrate, int bbits, int cch, const char *nn);
static arts_stream_t (*arts_record_stream)(int rrate, int bbits, int cch, const char *nn);
+#endif
+#include <artsc/artsc.h>
+
static arts_stream_t stream;
static int err_arts = -1;
static int arts_exit = 1;
static int arts()
{
-
+#if 0
handle = dlopen ("libartsc.so", RTLD_LAZY);
if (!handle) {
@@ -61,12 +65,13 @@ static int arts()
arts_record_stream = dlsym(handle, "arts_record_stream");
arts_close_stream = dlsym(handle, "arts_close_stream");
arts_stream_set = dlsym(handle, "arts_stream_set");
+#endif
err_arts = arts_init();
if (err_arts < 0) {
arts_exit = 0;
- dlclose(handle);
+ // dlclose(handle);
return err_arts;
}
@@ -83,6 +88,8 @@ int arts_esd_audio_open()
int channels;
int bits;
+ err_arts = arts_init();
+
channels = ( ( ( esd_audio_format & ESD_MASK_CHAN) == ESD_STEREO )
? /* stereo */ 2 : /* mono */ 1 );
bits = ( (esd_audio_format & ESD_MASK_BITS) == ESD_BITS16 )
@@ -105,7 +112,7 @@ void arts_esd_audio_close()
arts_close_stream(stream);
arts_exit = 0;
arts_free();
- dlclose(handle);
+ // dlclose(handle);
return;
}
@@ -131,11 +138,13 @@ void arts_esd_audio_flush()
static void impl_exit()
{
+#if 0
if ((arts_exit > 0) && (handle)) {
if (err_arts >= 0)
arts_free();
dlclose(handle);
}
+#endif
}
void artschk()
@@ -148,6 +157,10 @@ void artschk()
impl_esd_audio_flush = arts_esd_audio_flush;
impl_esd_audio_write = arts_esd_audio_write;
impl_esd_audio_read = arts_esd_audio_read;
+ /* close connection. esd carelessly close()s 0-128, which will likely
+ include our connection and leave us messed up. open it again when
+ ready to send data. */
+ arts_free();
}
- atexit(impl_exit);
+ // atexit(impl_exit);
}

View File

@ -1,11 +1,39 @@
--- audio.c.orig Tue Jun 4 10:40:44 2002
+++ audio.c Fri Jul 19 18:32:52 2002
@@ -25,6 +25,8 @@ static int esd_audio_fd = -1;
# include "audio_alsa.c"
#elif defined(DRIVER_ALSA_09)
#include "audio_alsa09.c"
+#elif defined(DRIVER_SUN)
+# include "audio_sun.c"
#elif defined(DRIVER_OSS)
# include "audio_oss.c"
#elif defined(DRIVER_AIX)
$OpenBSD: patch-audio_c,v 1.5 2008/03/31 01:05:54 jakemsr Exp $
--- audio.c.orig Thu Apr 19 17:43:59 2007
+++ audio.c Sat Jun 2 23:15:49 2007
@@ -20,34 +20,7 @@ static int esd_audio_fd = -1;
/*******************************************************************/
/* returns audio_fd for use by main prog - platform dependent */
-/* ALSA before OSS as ALSA is OSS compatible */
-#if defined(DRIVER_ALSA_09)
-# include "audio_alsa09.c"
-#elif defined(DRIVER_ALSA) || defined(DRIVER_NEWALSA)
-# include "audio_alsa.c"
-#elif defined(DRIVER_OSS)
-# include "audio_oss.c"
-#elif defined(DRIVER_AIX)
-# include "audio_aix.c"
-#elif defined(DRIVER_IRIX)
-# include "audio_irix.c"
-#elif defined(DRIVER_HPUX)
-# include "audio_hpux.c"
-#elif defined(DRIVER_OSF)
-# include "audio_osf.c"
-#elif defined(DRIVER_SOLARIS)
-# include "audio_solaris.c"
-#elif defined(DRIVER_MKLINUX)
-# include "audio_mklinux.c"
-#elif defined(DRIVER_DART)
-# include "audio_dart.c"
-#elif defined(DRIVER_COREAUDIO)
-# include "audio_coreaudio.c"
-#elif defined(DRIVER_ARTS)
-# include "audio_arts.c"
-#else
-# include "audio_none.c"
-#endif
+#include "audio_sun.c"
/*******************************************************************/
/* display available devices */

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-clients_c,v 1.1 2008/03/31 01:05:54 jakemsr Exp $
--- clients.c.orig Sun Mar 9 16:25:22 2008
+++ clients.c Sun Mar 9 16:28:43 2008
@@ -141,9 +141,9 @@ int get_new_clients( int listen )
struct sockaddr_in incoming;
#if defined (ENABLE_IPV6)
struct sockaddr_in6 incoming6;
- size_t size_in6 = sizeof(struct sockaddr_in6);
+ socklen_t size_in6 = sizeof(struct sockaddr_in6);
#endif
- size_t size_in = sizeof(struct sockaddr_in);
+ socklen_t size_in = sizeof(struct sockaddr_in);
esd_client_t *new_client = NULL;
unsigned long addr;
@@ -186,7 +186,7 @@ int get_new_clients( int listen )
if (esd_use_tcpip)
{
struct request_info req;
- struct servent *serv;
+ /* struct servent *serv; */
request_init( &req, RQ_DAEMON, "esound", RQ_FILE, fd, NULL );
fromhost( &req );

View File

@ -1,10 +0,0 @@
--- config.h.in.orig Tue Mar 16 07:25:33 2004
+++ config.h.in Thu Jun 24 20:10:12 2004
@@ -45,6 +45,7 @@
#undef DRIVER_ALSA_09_NEW_PCM_API
#undef DRIVER_DART
#undef DRIVER_COREAUDIO
+#undef DRIVER_SUN
#undef DRIVER_NONE
#undef HAVE_INET_ATON
#undef HAVE_INET_PTON

View File

@ -1,34 +1,30 @@
--- configure.in.orig Tue Mar 16 16:20:39 2004
+++ configure.in Thu Aug 9 17:02:45 2007
@@ -205,6 +205,16 @@ if test "x$enable_local_sound" = "xyes"; then
esac
$OpenBSD: patch-configure_ac,v 1.3 2008/03/31 01:05:54 jakemsr Exp $
--- configure.ac.orig Thu May 3 13:47:30 2007
+++ configure.ac Sun Mar 9 20:03:26 2008
@@ -301,21 +301,16 @@ if test "x$enable_local_sound" = "xyes"; then
if test "x$HAVE_ARTS" = "xyes"; then
found_sound=yes
CFLAGS="$CFLAGS $ARTSC_CFLAGS"
- LIBS="$LIBS $ARTS_LIBS"
+ LIBS="$LIBS $ARTS_LIBS -lstdc++"
AC_DEFINE(DRIVER_ARTS, 1, [Defined if Arts backend is enabled])
fi
fi
+ if test "${ac_cv_header_sys_audioio_h}" = "yes"; then
+ case ${host_os} in
+ openbsd* | netbsd*)
+ found_sound=yes
+ DRIVER_SUN=1
+ AC_DEFINE(DRIVER_SUN)
+ ;;
+ esac
+ fi
+
case ${host_os} in
os2*)
found_sound=yes
@@ -263,7 +273,9 @@ if test "x$enable_local_sound" = "xyes"; then
- if test "$found_sound" = "no"; then
- AC_MSG_ERROR([Could not find a support sound driver])
- fi
-
dnl Check for additional audio libs needed
echo "---------------------------------------------------------------------"
echo "--- Checking to see which audio libraries are required for linking.";
echo "--- Most of these checks should also fail. Do not be alarmed.";
- AC_CHECK_FUNC(_oss_ioctl,,[AC_CHECK_LIB(ossaudio,_oss_ioctl)])
+ if test ! "$DRIVER_SUN"; then
+ AC_CHECK_FUNC(_oss_ioctl,,[AC_CHECK_LIB(ossaudio,_oss_ioctl)])
+ fi
AC_CHECK_FUNC(ALnewconfig,,[AC_CHECK_LIB(audio,ALnewconfig)])
if test "x$enable_alsa" = "xyes"; then
AC_CHECK_FUNC(snd_cards,,[AC_CHECK_LIB(sound,snd_cards)])
@@ -382,7 +394,8 @@ if test "x$with_libwrap" = "xyes"; then
@@ -393,7 +388,8 @@ if test "x$with_libwrap" = "xyes"; then
wrap_ok=no
AC_TRY_LINK(
@ -38,7 +34,7 @@
#include <syslog.h>
int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING;],
@@ -392,7 +405,8 @@ int deny_severity = LOG_WARNING;],
@@ -403,7 +399,8 @@ int deny_severity = LOG_WARNING;],
wrap_ok=yes],
[LIBS="$LIBS -lnsl"
AC_TRY_LINK(

View File

@ -1,6 +1,7 @@
--- esd.c.orig Wed Jan 14 07:00:46 2004
+++ esd.c Thu Jun 24 20:07:12 2004
@@ -236,12 +236,12 @@ struct stat dir_stats;
$OpenBSD: patch-esd_c,v 1.3 2008/03/31 01:05:54 jakemsr Exp $
--- esd.c.orig Thu May 3 13:28:35 2007
+++ esd.c Sun Mar 9 21:54:55 2008
@@ -274,12 +274,12 @@ struct stat dir_stats;
#if defined(S_ISVTX)
#define ESD_UNIX_SOCKET_DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|\

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-esdlib_c,v 1.1 2008/03/31 01:05:54 jakemsr Exp $
--- esdlib.c.orig Thu Apr 19 07:43:59 2007
+++ esdlib.c Sun Mar 9 23:39:06 2008
@@ -769,7 +769,7 @@ int esd_open_sound( const char *host )
sprintf(cmd, "%s/esd %s -spawnfd %d", SERVERDIR, esd_spawn_options?esd_spawn_options:"", esd_pipe[1]);
- execl("/bin/sh", "/bin/sh", "-c", cmd, NULL);
+ execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL);
perror("execl");
_exit(1);
} else

View File

@ -1,16 +1,18 @@
--- test-script.orig Wed Jul 15 04:26:14 1998
+++ test-script Tue Mar 5 09:21:40 2002
$OpenBSD: patch-test-script,v 1.5 2008/03/31 01:05:54 jakemsr Exp $
--- test-script.orig Thu Apr 19 07:43:59 2007
+++ test-script Sun Mar 9 16:23:07 2008
@@ -1,4 +1,4 @@
-#!/bin/tcsh
+#!/usr/local/bin/tcsh
echo welcome to the test.
echo ""
@@ -40,7 +40,6 @@ echo $< >& /dev/null
@@ -40,7 +40,7 @@ echo $< >& /dev/null
esdmon > sample.raw &
esdcat -b -m -r 11025 test.wav
sleep 3
-killall esdmon
+pkill esdmon
echo press enter to continue...
echo $< >& /dev/null

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-util_c,v 1.4 2007/08/11 17:29:36 martynas Exp $
--- util.c.orig Mon Mar 1 12:06:58 2004
+++ util.c Thu Jun 24 20:15:35 2004
$OpenBSD: patch-util_c,v 1.5 2008/03/31 01:05:54 jakemsr Exp $
--- util.c.orig Thu Apr 19 17:43:59 2007
+++ util.c Sat Jun 2 23:38:31 2007
@@ -1,5 +1,8 @@
#include "config.h"
#include "esd.h"
@ -10,11 +10,11 @@ $OpenBSD: patch-util_c,v 1.4 2007/08/11 17:29:36 martynas Exp $
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>
@@ -23,38 +26,31 @@ have_ipv6() {
@@ -23,38 +26,31 @@ have_ipv6(void) {
const char*
esd_get_socket_dirname (void)
{
- char *audiodev;
- const char *audiodev;
- static char *dirname = NULL;
+ static char *sockdir = NULL, sockdirbuf[PATH_MAX];
+ struct passwd *pw;
@ -32,7 +32,7 @@ $OpenBSD: patch-util_c,v 1.4 2007/08/11 17:29:36 martynas Exp $
- strcpy(dirname, "/tmp/.esd");
- strcat(dirname, audiodev);
+ if (sockdir != NULL)
+ return (sockdir);
+ return sockdir;
+ pw = getpwuid(getuid());
+ if (pw == NULL || pw->pw_dir == NULL) {
+ fprintf(stderr, "esd: could not find home directory\n");
@ -43,7 +43,7 @@ $OpenBSD: patch-util_c,v 1.4 2007/08/11 17:29:36 martynas Exp $
+ snprintf(sockdirbuf, sizeof(sockdirbuf), "%s/.esd", pw->pw_dir);
+ endpwent();
+ sockdir = sockdirbuf;
+ return (sockdir);
+ return sockdir;
}
const char*
@ -62,9 +62,9 @@ $OpenBSD: patch-util_c,v 1.4 2007/08/11 17:29:36 martynas Exp $
-
- return name;
+ if (sockname != NULL)
+ return (sockname);
+ return sockname;
+ snprintf(socknamebuf, sizeof(socknamebuf), "%s/socket",
+ esd_get_socket_dirname());
+ sockname = socknamebuf;
+ return (sockname);
+ return sockname;
}

View File

@ -1 +1,9 @@
sound library for Enlightenment
Esound is an audio mixing server that allows multiple applications
to output sound to the same audio device.
Esound is seriously lacking in features required for a modern desktop
environment, particularly for multi-channel audio and audio/video
synchronization.
FLAVORS:
arts: esd will run as a client of artsd if artsd is running

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.17 2007/08/11 17:29:36 martynas Exp $
@comment $OpenBSD: PLIST,v 1.18 2008/03/31 01:05:54 jakemsr Exp $
bin/esd
bin/esd-config
bin/esdcat
@ -18,7 +18,6 @@ lib/pkgconfig/esound.pc
@man man/man1/esd.1
@man man/man1/esdcat.1
@man man/man1/esdctl.1
@man man/man1/esddsp.1
@man man/man1/esdfilt.1
@man man/man1/esdloop.1
@man man/man1/esdmon.1