File: config.h.in

package info (click to toggle)
libffado 2.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 9,860 kB
  • sloc: cpp: 77,154; python: 9,258; ansic: 2,951; sh: 1,429; xml: 855; makefile: 29
file content (284 lines) | stat: -rw-r--r-- 12,105 bytes parent folder | download | duplicates (10)
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
/* config.h.in. */
#ifndef CONFIG_H
#define CONFIG_H

#define BINDIR "$BINDIR"
#define LIBDIR "$LIBDIR"
#define SHAREDIR "$SHAREDIR"

/* configuration file locations */
#define USER_CONFIG_FILE    "$USER_CONFIG_FILE"
#define SYSTEM_CONFIG_FILE  "$SYSTEM_CONFIG_FILE"

/* Define indicating availability of lrint() */
#define HAVE_LRINT $HAVE_LRINT

/* Define indicatin availability of lrintf() */
#define HAVE_LRINTF $HAVE_LRINTF

// serialization
#define SERIALIZE_USE_EXPAT $SERIALIZE_USE_EXPAT

#define CACHEDIR "$CACHEDIR"

// discovery
#define ENABLE_DISCOVERY_CACHE               1

// watchdog
#define WATCHDOG_DEFAULT_CHECK_INTERVAL_USECS   (1000*1000*4)
#define WATCHDOG_DEFAULT_RUN_REALTIME           1
#define WATCHDOG_DEFAULT_PRIORITY               98

// threading
#define THREAD_MAX_RTPRIO                   98
#define THREAD_MIN_RTPRIO                   1

// time

// we should be using absolute clock_nanosleep
// but on my system it causes a problem on shutdown.
#define USE_ABSOLUTE_NANOSLEEP              1

// 1394 service constants 
#define IEEE1394SERVICE_USE_CYCLETIMER_DLL                         1
#define IEEE1394SERVICE_CYCLETIMER_DLL_UPDATE_INTERVAL_USEC   200000
#define IEEE1394SERVICE_CYCLETIMER_DLL_BANDWIDTH_HZ              0.5
#define IEEE1394SERVICE_MAX_FIREWIRE_PORTS                         4
#define IEEE1394SERVICE_MIN_SPLIT_TIMEOUT_USECS              1000000

#define IEEE1394SERVICE_CYCLETIMER_HELPER_RUN_REALTIME       1
#define IEEE1394SERVICE_CYCLETIMER_HELPER_PRIO               1

// config rom read wait interval
#define IEEE1394SERVICE_CONFIGROM_READ_WAIT_USECS         1000

// FCP defines
#define IEEE1394SERVICE_FCP_MAX_TRIES                        2
#define IEEE1394SERVICE_FCP_SLEEP_BETWEEN_FAILURES_USECS  1000
#define IEEE1394SERVICE_FCP_POLL_TIMEOUT_MSEC              200
#define IEEE1394SERVICE_FCP_RESPONSE_TIMEOUT_USEC       200000

// The current version of libiec61883 doesn't seem to calculate
// the bandwidth correctly. Defining this to non-zero skips
// bandwidth allocation when doing CMP connections.
#define IEEE1394SERVICE_SKIP_IEC61883_BANDWIDTH_ALLOCATION   1

#define MINIMUM_INTERRUPTS_PER_PERIOD                       2U

// These are the result of a lot of trial and error
// due to weirdness in the kernel layer
#define MAX_XMIT_PACKET_SIZE                         (2048-16)
#define MIN_XMIT_PACKET_SIZE                                72
#define MAX_XMIT_NB_BUFFERS                                128
#define MAX_RECV_NB_BUFFERS                                128
#define MIN_RECV_PACKET_SIZE                                72

// the default ISO receive mode. 
// 0 = auto, 1 = packet-per-buffer, 2 = bufferfill. 
// 'auto' will automatically choose the mode that is expected 
// to perform best for the given situation. For large periods 
// this is 'bufferfill' mode, for small periods this is 
// 'packet-per-buffer' mode. The 'BUFFERFILL_MODE_THRESHOLD' 
// defines what a 'large period' is.
#define DEFAULT_ISO_RECEIVE_MODE                             0

// the number of packets required to fill one period from which
// the bufferfill mode is to be used
#define BUFFERFILL_MODE_THRESHOLD                           64


#define ISOHANDLER_FLUSH_BEFORE_ITERATE                      0

#define ISOHANDLER_DEATH_DETECT_TIMEOUT_USECS        1000000LL

#define ISOHANDLER_CHECK_CTR_RECONSTRUCTION                  1

#define ISOHANDLERMANAGER_MAX_ISO_HANDLERS_PER_PORT         16
#define ISOHANDLERMANAGER_MAX_STREAMS_PER_ISOTHREAD         16

// The best setup is if the receive handlers have lower priority
// than the client thread since that ensures that as soon as we
// received sufficient frames, the client thread runs.
// The transmit thread should have higher priority to ensure that
// all available data is flushed to the ISO kernel buffers as
// soon as possible
// At this moment, the jack backend uses base+5 to init ffado
// prio
#define ISOHANDLERMANAGER_ISO_PRIO_INCREASE                  0
#define ISOHANDLERMANAGER_ISO_PRIO_INCREASE_RECV            -1
#define ISOHANDLERMANAGER_ISO_PRIO_INCREASE_XMIT             1

// the timeout for ISO activity on any thread
// NOTE: don't make this 0
#define ISOHANDLERMANAGER_ISO_TASK_WAIT_TIMEOUT_USECS        1000000LL

// allows to add some processing margin. This shifts the time
// at which the buffer is transfer()'ed, making things somewhat
// more robust. It should be noted though that shifting the transfer
// time to a later time instant also causes the xmit buffer fill to be
// lower on average. This can be counteracted by increasing the
// STREAMPROCESSORMANAGER_XMIT_PREBUFFER_FRAMES option
#define STREAMPROCESSORMANAGER_SIGNAL_DELAY_TICKS           (3072*0)

// the number of frames that we prebuffer in the 1394 ISO layer
// this adds directly to the roundtrip latency
#define STREAMPROCESSORMANAGER_XMIT_PREBUFFER_FRAMES         100

// causes the waitForPeriod() call to wait until sufficient
// data is present in the buffer such that a transfer() will
// succeed. Normally we wait for the period of time that theoretically
// would mean that his is true. However sometimes the kernel hasn't
// flushed everything to userspace (or the card hasn't IRQ'd).
// the side-effect of this is some jitter in the return timing
// whenever this occurs.
#define STREAMPROCESSORMANAGER_ALLOW_DELAYED_PERIOD_SIGNAL         1

// startup control
#define STREAMPROCESSORMANAGER_CYCLES_FOR_DRYRUN            40000
#define STREAMPROCESSORMANAGER_CYCLES_FOR_STARTUP           200
#define STREAMPROCESSORMANAGER_PRESTART_CYCLES_FOR_XMIT     20
#define STREAMPROCESSORMANAGER_PRESTART_CYCLES_FOR_RECV     0
#define STREAMPROCESSORMANAGER_SYNCSTART_TRIES              10
#define STREAMPROCESSORMANAGER_SYNC_WAIT_TIME_MSEC          200
#define STREAMPROCESSORMANAGER_NB_ALIGN_TRIES               40
#define STREAMPROCESSORMANAGER_ALIGN_AVERAGE_TIME_MSEC      400

#define STREAMPROCESSORMANAGER_DYNAMIC_SYNC_DELAY           0

// the default bandwidth of the stream processor timestamp DLL when synchronizing (should be fast)
#define STREAMPROCESSOR_DLL_FAST_BW_HZ                      5.0
// the default bandwidth of the stream processor timestamp DLL when streaming
#define STREAMPROCESSOR_DLL_BW_HZ                           0.1

// -- AMDTP options -- //

// in ticks
// as per AMDTP2.1: 354.17us + 125us, but FFADO measures from the
// packet transmission time, so subtract 125 us:
// 354.17us @ 24.576ticks/usec = 8704 ticks
#define AMDTP_TRANSMIT_TRANSFER_DELAY   (8704U)

// the absolute minimum number of cycles we want to transmit
// a packet ahead of the presentation time. The nominal time
// the packet is transmitted ahead of the presentation time is
// given by AMDTP_TRANSMIT_TRANSFER_DELAY (in ticks), but in case we
// are too late for that, this constant defines how late we can
// be.
#define AMDTP_MIN_CYCLES_BEFORE_PRESENTATION                1

// the absolute maximum number of cycles we want to transmit
// a packet ahead of the ideal transmit time. The nominal time
// the packet is transmitted ahead of the presentation time is
// given by AMDTP_TRANSMIT_TRANSFER_DELAY (in ticks), but we can send
// packets early if we want to. (not completely according to spec)
// (for spec compliance you need to specify a value of 0)
#define AMDTP_MAX_CYCLES_TO_TRANSMIT_EARLY                  1

// ensure that the AMDTP SP clips all float values to [-1.0..1.0]
#define AMDTP_CLIP_FLOATS                                   1

// Allow that devices request that the AMDTP transmit SP adds
// payload to the NO-DATA packets.
#define AMDTP_ALLOW_PAYLOAD_IN_NODATA_XMIT                  1

// Default setting for the payload setting if
// AMDTP_ALLOW_PAYLOAD_IN_NODATA_XMIT is enabled. Devices can
// explicity override this
#define AMDTP_SEND_PAYLOAD_IN_NODATA_XMIT_BY_DEFAULT     true

// -- MOTU options -- //

// the transfer delay is substracted from the ideal presentation
// time to obtain a corrected presentation time. This values is
// then used to stamp the packet and determine the transmission
// time instant.
#define MOTU_TRANSMIT_TRANSFER_DELAY    (0U)

// the absolute minimum number of cycles we want to transmit
// a packet ahead of the presentation time. The nominal time
// the packet is transmitted ahead of the presentation time is
// given by MOTU_TRANSMIT_TRANSFER_DELAY (in ticks), but in case we
// are too late for that, this constant defines how late we can
// be.
#define MOTU_MIN_CYCLES_BEFORE_PRESENTATION                0

// the absolute maximum number of cycles we want to transmit
// a packet ahead of the ideal transmit time. The nominal time
// the packet is transmitted ahead of the presentation time is
// given by MOTU_TRANSMIT_TRANSFER_DELAY (in ticks), but we can send
// packets early if we want to.
#define MOTU_MAX_CYCLES_TO_TRANSMIT_EARLY                  2

// ensure that the MOTU tx SP clips all float values to [-1.0..1.0]
#define MOTU_CLIP_FLOATS                                   1

// -- RME options -- //

// the transfer delay is substracted from the ideal presentation
// time to obtain a corrected presentation time. This value is
// then used to stamp the packet and determine the transmission
// time instant.  This is in ticks, and has been determined 
// experimentally to provide the most stability.
#define RME_TRANSMIT_TRANSFER_DELAY    (3U*TICKS_PER_CYCLE)

// the absolute minimum number of cycles we want to transmit
// a packet ahead of the presentation time. The nominal time
// the packet is transmitted ahead of the presentation time is
// given by RME_TRANSMIT_TRANSFER_DELAY (in ticks), but in case we
// are too late for that, this constant defines how late we can
// be.
#define RME_MIN_CYCLES_BEFORE_PRESENTATION                1

// the absolute maximum number of cycles we want to transmit
// a packet ahead of the ideal transmit time. The nominal time
// the packet is transmitted ahead of the presentation time is
// given by RME_TRANSMIT_TRANSFER_DELAY (in ticks), but we can send
// packets early if we want to.
#define RME_MAX_CYCLES_TO_TRANSMIT_EARLY                  5

// The transfer delay assumed for incoming packets from an RME. 
// Normally this would be the same as the transmit transfer delay.
// This value is in ticks.
#define RME_RECEIVE_TRANSFER_DELAY     RME_TRANSMIT_TRANSFER_DELAY

// ensure that the RME tx SP clips all float values to [-1.0..1.0]
#define RME_CLIP_FLOATS                                   1

// -- Digidesign options -- //
//
// Currently these are just verbatim copies of the values which
// seem to work for MOTU devices.  Some tweaks may well be 
// necessary once testing begins with real devices.

// the transfer delay is substracted from the ideal presentation
// time to obtain a corrected presentation time. This values is
// then used to stamp the packet and determine the transmission
// time instant.
#define DIGIDESIGN_TRANSMIT_TRANSFER_DELAY    (0U)

// the absolute minimum number of cycles we want to transmit
// a packet ahead of the presentation time. The nominal time
// the packet is transmitted ahead of the presentation time is
// given by DIGIDESIGN_TRANSMIT_TRANSFER_DELAY (in ticks), but 
// in case we are too late for that, this constant defines how 
// late we can be.
#define DIGIDESIGN_MIN_CYCLES_BEFORE_PRESENTATION                0

// the absolute maximum number of cycles we want to transmit
// a packet ahead of the ideal transmit time. The nominal time
// the packet is transmitted ahead of the presentation time is
// given by DIGIDESIGN_TRANSMIT_TRANSFER_DELAY (in ticks), but 
// we can send packets early if we want to.
#define DIGIDESIGN_MAX_CYCLES_TO_TRANSMIT_EARLY                  2

// ensure that the DIGIDESIGN tx SP clips all float values to [-1.0..1.0]
#define DIGIDESIGN_CLIP_FLOATS                                   1

/// The unavoidable device specific hacks

// Use the information in the music plug instead of that in the
// cluster info block for the stream configuration. Should not
// be necessary
#define AVC_STREAMCONFIG_USE_MUSICPLUG                     0

#endif // CONFIG_H