diff -Nurd -x'*~' esound-0.2.36.orig/Makefile.in esound-0.2.36/Makefile.in
--- esound-0.2.36.orig/Makefile.in	2005-06-06 21:04:14.000000000 -0400
+++ esound-0.2.36/Makefile.in	2005-09-30 18:29:03.000000000 -0400
@@ -81,13 +81,13 @@
 esdPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS) $(esd_PROGRAMS)
 am__esd_SOURCES_DIST = esd.c clients.c filter.c mix.c players.c \
-	proto.c samples.c getopt.c getopt1.c util.c esd-config.h \
+	proto.c samples.c getopt.c getopt1.c        esd-config.h \
 	esd-server.h
 am__objects_1 = getopt.$(OBJEXT) getopt1.$(OBJEXT)
 @NEED_GETOPT_TRUE@am__objects_2 = $(am__objects_1)
 am_esd_OBJECTS = esd.$(OBJEXT) clients.$(OBJEXT) filter.$(OBJEXT) \
 	mix.$(OBJEXT) players.$(OBJEXT) proto.$(OBJEXT) \
-	samples.$(OBJEXT) $(am__objects_2) util.$(OBJEXT)
+	samples.$(OBJEXT) $(am__objects_2)
 esd_OBJECTS = $(am_esd_OBJECTS)
 am__DEPENDENCIES_2 = libesd.la $(am__DEPENDENCIES_1)
 esd_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
@@ -145,7 +145,7 @@
 @AMDEP_TRUE@	./$(DEPDIR)/libesd_la-genrand.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/libesd_la-util.Plo ./$(DEPDIR)/mix.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/players.Po ./$(DEPDIR)/proto.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/samples.Po ./$(DEPDIR)/util.Po
+@AMDEP_TRUE@	./$(DEPDIR)/samples.Po
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
@@ -391,7 +391,6 @@
 	proto.c		\
 	samples.c	\
 	$(getopt_src)   \
-	util.c		\
 	esd-config.h	\
 	esd-server.h
 
@@ -422,7 +421,7 @@
 	esdplay.c
 
 LDADD = libesd.la $(AUDIOFILE_LIBS)
-esd_LDADD = $(WRAP_LIB) $(LDADD)
+esd_LDADD = $(WRAP_LIB) $(LDADD) $(SOUND_LIBS)
 m4datadir = $(datadir)/aclocal
 m4data_DATA = esd.m4
 esdconfdir = $(sysconfdir)
@@ -676,7 +675,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/players.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proto.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/samples.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
diff -Nurd -x'*~' esound-0.2.36.orig/docs/Makefile.in esound-0.2.36/docs/Makefile.in
--- esound-0.2.36.orig/docs/Makefile.in	2005-06-06 21:04:14.000000000 -0400
+++ esound-0.2.36/docs/Makefile.in	2005-09-30 18:27:06.000000000 -0400
@@ -455,13 +455,13 @@
 @HAVE_JW_TRUE@install-data-local:
 @HAVE_JW_TRUE@	$(mkinstalldirs) $(DESTDIR)$(htmldir)
 @HAVE_JW_TRUE@	files=`cd html && echo *.html`; \
-@HAVE_JW_TRUE@	test "$$files" || for f in $$files; do \
-@HAVE_JW_TRUE@	  cp -p $$f $(DESTDIR)$(htmldir)/$$f; \
+@HAVE_JW_TRUE@	test "$$files" && for f in $$files; do \
+@HAVE_JW_TRUE@	  cp -p html/$$f $(DESTDIR)$(htmldir)/$$f; \
 @HAVE_JW_TRUE@	done
 
 @HAVE_JW_TRUE@uninstall-local:
 @HAVE_JW_TRUE@	files=`cd html && echo *.html`; \
-@HAVE_JW_TRUE@	test "$$files" || for f in $$files; do \
+@HAVE_JW_TRUE@	test "$$files" && for f in $$files; do \
 @HAVE_JW_TRUE@	  rm -rf $(DESTDIR)$(htmldir)/$$f; \
 @HAVE_JW_TRUE@	done
 @HAVE_JW_TRUE@	if test -d $(DESTDIR)$(htmldir); then rmdir $(DESTDIR)$(htmldir); fi
diff -Nurd -x'*~' esound-0.2.36.orig/esd.c esound-0.2.36/esd.c
--- esound-0.2.36.orig/esd.c	2005-05-25 21:02:52.000000000 -0400
+++ esound-0.2.36/esd.c	2005-09-30 18:27:06.000000000 -0400
@@ -35,6 +35,13 @@
 /* max arguments (argc + tokenized esd.conf) can't be more than this */
 #define MAX_OPTS 128
 
+#if defined (__APPLE__)
+#include <mach/mach.h>
+#include <mach/thread_policy.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#endif
+
 typedef const char *(*audio_devices_t)(void);
 typedef int (*audio_open_t)(void);
 typedef void (*audio_close_t)(void);
@@ -641,6 +648,29 @@
     int default_format = ESD_BITS16 | ESD_STEREO;
     /* end test scaffolding parameters */
 
+#if defined (__APPLE__)
+    /* get realtime priority */
+    {
+	struct thread_time_constraint_policy ttcpolicy;
+	int bus_speed, mib [2] = { CTL_HW, HW_BUS_FREQ };
+	size_t len;   
+
+	len = sizeof (bus_speed);
+	sysctl (mib, 2, &bus_speed, &len, NULL, 0);
+
+	/* Is it enough? */
+	ttcpolicy.period = bus_speed / 120;
+	ttcpolicy.computation = bus_speed / 2400;
+	ttcpolicy.constraint = bus_speed / 1200;
+	ttcpolicy.preemptible = 1;
+
+	thread_policy_set (mach_thread_self (),
+			   THREAD_TIME_CONSTRAINT_POLICY,
+			   (int*)&ttcpolicy,
+			   THREAD_TIME_CONSTRAINT_POLICY_COUNT);
+    }
+#endif
+
     programname = *argv;
 
 #ifdef DRIVER_ARTS
diff -Nurd -x'*~' esound-0.2.36.orig/esd.conf esound-0.2.36/esd.conf
--- esound-0.2.36.orig/esd.conf	2004-08-18 15:01:41.000000000 -0400
+++ esound-0.2.36/esd.conf	2005-09-30 18:27:06.000000000 -0400
@@ -1,6 +1,6 @@
 [esd]
 auto_spawn=1
 spawn_options=-terminate -nobeeps -as 2
-spawn_wait_ms=100
+spawn_wait_ms=999
 # default options are used in spawned and non-spawned mode
 default_options=
diff -Nurd -x'*~' esound-0.2.36.orig/esd_config.c esound-0.2.36/esd_config.c
--- esound-0.2.36.orig/esd_config.c	2005-05-25 19:50:41.000000000 -0400
+++ esound-0.2.36/esd_config.c	2005-09-30 18:27:06.000000000 -0400
@@ -9,7 +9,7 @@
 int esd_no_spawn=1; /* If we can't even find the system config file,
 		       things are screwed up - don't try to make things
 		       worse. */
-int esd_spawn_wait_ms=100; /* Time to wait trying to connect to an
+int esd_spawn_wait_ms=999; /* Time to wait trying to connect to an
 			      autospawned ESD, in milliseconds. */
 char esd_spawn_options[LINEBUF_SIZE] = "-terminate -nobeeps -as 2";
 
