-
Notifications
You must be signed in to change notification settings - Fork 4
/
jack-patch
249 lines (220 loc) · 9.62 KB
/
jack-patch
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/jack/systemdeps.h jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/jack/systemdeps.h
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/jack/systemdeps.h 2012-05-30 05:11:00.000000000 +1000
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/jack/systemdeps.h 2014-07-16 10:27:07.393066708 +1000
@@ -120,4 +120,9 @@
#endif /* __APPLE__ || __linux__ || __sun__ || sun */
+#ifdef __ARMEL__
+ #undef POST_PACKED_STRUCTURE
+ #define POST_PACKED_STRUCTURE
+#endif
+
#endif
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/JackMidiPort.cpp jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/JackMidiPort.cpp
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/JackMidiPort.cpp 2012-05-30 05:11:00.000000000 +1000
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/JackMidiPort.cpp 2015-02-04 11:41:45.810000000 +1100
@@ -124,7 +124,7 @@
next_buf = buf;
}
}
- assert(next_event != 0);
+ if (!next_event) break;
// write the event
jack_midi_data_t* dest = mix->ReserveEvent(next_event->time, next_event->size);
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/JackTimedDriver.cpp jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/JackTimedDriver.cpp
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/JackTimedDriver.cpp 2012-05-30 05:11:00.000000000 +1000
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/common/JackTimedDriver.cpp 2014-08-10 02:28:55.930000000 +1000
@@ -61,7 +61,7 @@
NotifyXRun(cur_time_usec, float(cur_time_usec - fBeginDateUst));
fCycleCount = 0;
wait_time_usec = 0;
- jack_error("JackTimedDriver::Process XRun = %ld usec", (cur_time_usec - fBeginDateUst));
+ jack_error("JackTimedDriver::Process XRun = %lld usec, %lld, %lld", (cur_time_usec - fBeginDateUst), cur_time_usec, fBeginDateUst);
}
//jack_log("JackTimedDriver::Process wait_time = %d", wait_time_usec);
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/debian/rules jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/debian/rules
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/debian/rules 2012-11-28 07:22:31.000000000 +1100
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/debian/rules 2014-07-16 09:44:29.514352549 +1000
@@ -41,7 +41,7 @@
waf-configure-options = --prefix=/usr --classic
waf-configure-options += --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
-waf-configure-options += $(if $(filter linux,$(DEB_HOST_ARCH_OS)),--alsa --dbus)
+waf-configure-options += $(if $(filter linux,$(DEB_HOST_ARCH_OS)),--alsa)
waf-configure-options += $(if $(filter amd64 i386 powerpc,$(DEB_HOST_ARCH)),--firewire)
DEB_MAKE_INVOKE = ./waf -v --destdir=$(CURDIR)/debian/tmp
@@ -86,7 +86,6 @@
dh_install -pjackd2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/jack/jack_alsa.so
dh_install -pjackd2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/jack/jack_alsarawmidi.so
dh_install -pjackd2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/jack/audioadapter.so
- dh_install -pjackd2 debian/tmp/usr/share/dbus-1/*
endif
binary-install/jackd2::
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/alsa_driver.c jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/alsa_driver.c
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/alsa_driver.c 2012-05-30 05:11:00.000000000 +1000
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/alsa_driver.c 2014-07-23 21:35:48.970000000 +1000
@@ -991,8 +991,9 @@
}
}
- if ((driver->capture_handle && driver->capture_and_playback_not_synced)
- || !driver->playback_handle) {
+ if (driver->capture_handle && (
+ driver->capture_and_playback_not_synced ||
+ !driver->playback_handle)) {
if ((err = snd_pcm_prepare (driver->capture_handle)) < 0) {
jack_error ("ALSA: prepare error for capture on \"%s\""
" (%s)", driver->alsa_name_capture,
@@ -1085,8 +1086,9 @@
}
}
- if ((driver->capture_handle && driver->capture_and_playback_not_synced)
- || !driver->playback_handle) {
+ if (driver->capture_handle && (
+ driver->capture_and_playback_not_synced ||
+ !driver->playback_handle)) {
if ((err = snd_pcm_start (driver->capture_handle)) < 0) {
jack_error ("ALSA: could not start capture (%s)",
snd_strerror (err));
@@ -1610,10 +1612,6 @@
return 0;
}
*/
- if (!driver->playback_handle) {
- return 0;
- }
-
if (nframes > driver->frames_per_cycle) {
return -1;
}
@@ -1621,6 +1619,10 @@
if (driver->midi)
(driver->midi->write)(driver->midi, nframes);
+ if (!driver->playback_handle) {
+ return 0;
+ }
+
nwritten = 0;
contiguous = 0;
orig_nframes = nframes;
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/alsa_seqmidi.c jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/alsa_seqmidi.c
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/alsa_seqmidi.c 2012-05-30 05:11:00.000000000 +1000
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/alsa_seqmidi.c 2014-07-17 11:56:57.363334526 +1000
@@ -145,13 +145,13 @@
{
SND_SEQ_PORT_CAP_SUBS_READ,
JackPortIsOutput,
- "playback",
+ "capture",
do_jack_input
},
{
SND_SEQ_PORT_CAP_SUBS_WRITE,
JackPortIsInput,
- "capture",
+ "playback",
do_jack_output
}
};
@@ -497,12 +497,10 @@
snprintf(name, sizeof(name), "system:midi_playback_%d", ++self->midi_out_cnt);
port->jack_port = jack_port_register(self->jack,
- name, JACK_DEFAULT_MIDI_TYPE, jack_caps, 0);
+ port->name, JACK_DEFAULT_MIDI_TYPE, jack_caps, 0);
if (!port->jack_port)
goto failed;
- jack_port_set_alias (port->jack_port, port->name);
-
/* generate an alias */
snprintf(port->name, sizeof(port->name), "%s:midi/%s_%d",
@@ -514,6 +512,7 @@
*c = '-';
jack_port_set_alias (port->jack_port, port->name);
+ jack_port_set_alias (port->jack_port, name);
if (type == PORT_INPUT)
err = alsa_connect_from(self, port->remote.client, port->remote.port);
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/JackAlsaDriver.cpp jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/JackAlsaDriver.cpp
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/JackAlsaDriver.cpp 2012-05-30 05:11:00.000000000 +1000
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/JackAlsaDriver.cpp 2014-07-29 11:44:28.660000000 +1000
@@ -350,7 +350,7 @@
int JackAlsaDriver::Start()
{
- int res = JackAudioDriver::Start();
+ int res = JackTimedDriver::Start();
if (res >= 0) {
res = alsa_driver_start((alsa_driver_t *)fDriver);
if (res < 0) {
@@ -375,6 +375,13 @@
int wait_status;
jack_nframes_t nframes;
fDelayedUsecs = 0.f;
+ alsa_driver_t *driver = (alsa_driver_t *) fDriver;
+
+ if (!(driver->capture_handle || driver->playback_handle)) {
+ ProcessWait();
+ JackDriver::CycleTakeBeginTime();
+ goto read;
+ }
retry:
@@ -398,6 +405,7 @@
// Has to be done before read
JackDriver::CycleIncTime();
+read:
return alsa_driver_read((alsa_driver_t *)fDriver, fEngineControl->fBufferSize);
}
@@ -929,12 +937,6 @@
}
}
- /* duplex is the default */
- if (!capture && !playback) {
- capture = TRUE;
- playback = TRUE;
- }
-
g_alsa_driver = new Jack::JackAlsaDriver("system", "alsa_pcm", engine, table);
Jack::JackDriverClientInterface* threaded_driver = new Jack::JackThreadedDriver(g_alsa_driver);
// Special open for ALSA driver...
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/JackAlsaDriver.h jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/JackAlsaDriver.h
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/JackAlsaDriver.h 2012-05-30 05:11:00.000000000 +1000
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/alsa/JackAlsaDriver.h 2014-07-20 15:26:17.950000000 +1000
@@ -22,6 +22,7 @@
#define __JackAlsaDriver__
#include "JackAudioDriver.h"
+#include "JackTimedDriver.h"
#include "JackThreadedDriver.h"
#include "JackTime.h"
#include "alsa_driver.h"
@@ -33,7 +34,7 @@
\brief The ALSA driver.
*/
-class JackAlsaDriver : public JackAudioDriver
+class JackAlsaDriver : public JackTimedDriver
{
private:
@@ -47,7 +48,7 @@
public:
JackAlsaDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
- : JackAudioDriver(name, alias, engine, table),fDriver(NULL),fReservedCaptureDevice(-1),fReservedPlaybackDevice(-1)
+ : JackTimedDriver(name, alias, engine, table),fDriver(NULL),fReservedCaptureDevice(-1),fReservedPlaybackDevice(-1)
{}
virtual ~JackAlsaDriver()
{}
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/JackLinuxTime.c jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/JackLinuxTime.c
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/JackLinuxTime.c 2012-05-30 05:11:00.000000000 +1000
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/linux/JackLinuxTime.c 2014-08-10 02:28:19.160000000 +1000
@@ -217,7 +217,7 @@
SERVER_EXPORT void InitTime()
{
- __jack_cpu_mhz = jack_get_mhz ();
+ //__jack_cpu_mhz = jack_get_mhz ();
}
SERVER_EXPORT void EndTime()
diff -ur jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/posix/JackCompilerDeps_os.h jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/posix/JackCompilerDeps_os.h
--- jack-orig/jackd2-1.9.8~dfsg.4+20120529git007cdc37/posix/JackCompilerDeps_os.h 2012-05-30 05:11:00.000000000 +1000
+++ jack/jackd2-1.9.8~dfsg.4+20120529git007cdc37/posix/JackCompilerDeps_os.h 2014-07-16 10:28:29.610136977 +1000
@@ -58,5 +58,10 @@
#define POST_PACKED_STRUCTURE
#endif
+#ifdef __ARMEL__
+ #undef POST_PACKED_STRUCTURE
+ #define POST_PACKED_STRUCTURE
+#endif
+
#endif