summaryrefslogtreecommitdiff
blob: de85af43a16a9689327a78e81a493500f8216d76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
diff -ur esound-0.2.36/Makefile.in esound-0.2.36-patched/Makefile.in
--- esound-0.2.36/Makefile.in	2005-06-07 09:04:14.000000000 +0800
+++ esound-0.2.36-patched/Makefile.in	2005-08-28 14:17:07.000000000 +0800
@@ -93,37 +93,37 @@
 esd_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 am_esdcat_OBJECTS = esdcat.$(OBJEXT)
 esdcat_OBJECTS = $(am_esdcat_OBJECTS)
-esdcat_LDADD = $(LDADD)
+esdcat_LDADD = $(LDADD) $(SOUND_LIBS)
 esdcat_DEPENDENCIES = libesd.la $(am__DEPENDENCIES_1)
 am__esdctl_SOURCES_DIST = getopt.c getopt1.c esdctl.c
 am_esdctl_OBJECTS = $(am__objects_2) esdctl.$(OBJEXT)
 esdctl_OBJECTS = $(am_esdctl_OBJECTS)
-esdctl_LDADD = $(LDADD)
+esdctl_LDADD = $(LDADD) $(SOUND_LIBS)
 esdctl_DEPENDENCIES = libesd.la $(am__DEPENDENCIES_1)
 am_esdfilt_OBJECTS = esdfilt.$(OBJEXT)
 esdfilt_OBJECTS = $(am_esdfilt_OBJECTS)
-esdfilt_LDADD = $(LDADD)
+esdfilt_LDADD = $(LDADD) $(SOUND_LIBS)
 esdfilt_DEPENDENCIES = libesd.la $(am__DEPENDENCIES_1)
 am_esdloop_OBJECTS = esdloop.$(OBJEXT)
 esdloop_OBJECTS = $(am_esdloop_OBJECTS)
-esdloop_LDADD = $(LDADD)
+esdloop_LDADD = $(LDADD) $(SOUND_LIBS)
 esdloop_DEPENDENCIES = libesd.la $(am__DEPENDENCIES_1)
 am_esdmon_OBJECTS = esdmon.$(OBJEXT)
 esdmon_OBJECTS = $(am_esdmon_OBJECTS)
-esdmon_LDADD = $(LDADD)
+esdmon_LDADD = $(LDADD) $(SOUND_LIBS)
 esdmon_DEPENDENCIES = libesd.la $(am__DEPENDENCIES_1)
 am__esdplay_SOURCES_DIST = getopt.c getopt1.c esdplay.c
 am_esdplay_OBJECTS = $(am__objects_2) esdplay.$(OBJEXT)
 esdplay_OBJECTS = $(am_esdplay_OBJECTS)
-esdplay_LDADD = $(LDADD)
+esdplay_LDADD = $(LDADD) $(SOUND_LIBS)
 esdplay_DEPENDENCIES = libesd.la $(am__DEPENDENCIES_1)
 am_esdrec_OBJECTS = esdrec.$(OBJEXT)
 esdrec_OBJECTS = $(am_esdrec_OBJECTS)
-esdrec_LDADD = $(LDADD)
+esdrec_LDADD = $(LDADD) $(SOUND_LIBS)
 esdrec_DEPENDENCIES = libesd.la $(am__DEPENDENCIES_1)
 am_esdsample_OBJECTS = esdsample.$(OBJEXT)
 esdsample_OBJECTS = $(am_esdsample_OBJECTS)
-esdsample_LDADD = $(LDADD)
+esdsample_LDADD = $(LDADD) $(SOUND_LIBS)
 esdsample_DEPENDENCIES = libesd.la $(am__DEPENDENCIES_1)
 binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 SCRIPTS = $(bin_SCRIPTS)
@@ -422,7 +422,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)
diff -ur esound-0.2.36/esd.c esound-0.2.36-patched/esd.c
--- esound-0.2.36/esd.c	2005-05-26 09:02:52.000000000 +0800
+++ esound-0.2.36-patched/esd.c	2005-08-28 14:24:46.000000000 +0800
@@ -8,6 +8,10 @@
 #include <errno.h>
 #include <signal.h>
 #include <time.h>
+#include <mach/mach.h>
+#include <mach/thread_policy.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
 
 #ifndef HAVE_NANOSLEEP
 #include <sys/time.h>
@@ -641,6 +645,25 @@
     int default_format = ESD_BITS16 | ESD_STEREO;
     /* end test scaffolding parameters */
 
+    {
+	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);
+
+	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);
+    }
+
     programname = *argv;
 
 #ifdef DRIVER_ARTS
diff -ur esound-0.2.36/esd_config.c esound-0.2.36-patched/esd_config.c
--- esound-0.2.36/esd_config.c	2005-05-26 07:50:41.000000000 +0800
+++ esound-0.2.36-patched/esd_config.c	2005-08-28 14:21:43.000000000 +0800
@@ -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";