root/trunk/libffado/config.h.in

Revision 1967, 11.5 kB (checked in by jwoithe, 10 years ago)

RME: more streaming stability fixes. Further extended testing is needed across all sample rates, but initial indications are that the streaming system is finally approaching a state of stability.

Line 
1 /* config.h.in. */
2 #ifndef CONFIG_H
3 #define CONFIG_H
4
5 #define BINDIR "$BINDIR"
6 #define LIBDIR "$LIBDIR"
7 #define SHAREDIR "$SHAREDIR"
8
9 /* configuration file locations */
10 #define USER_CONFIG_FILE    "$USER_CONFIG_FILE"
11 #define SYSTEM_CONFIG_FILE  "$SYSTEM_CONFIG_FILE"
12
13 /* Define indicating availability of lrint() */
14 #define HAVE_LRINT $HAVE_LRINT
15
16 /* Define indicatin availability of lrintf() */
17 #define HAVE_LRINTF $HAVE_LRINTF
18
19 // serialization
20 #define SERIALIZE_USE_EXPAT $SERIALIZE_USE_EXPAT
21
22 #define CACHEDIR "$CACHEDIR"
23
24 // discovery
25 #define ENABLE_DISCOVERY_CACHE               1
26
27 // watchdog
28 #define WATCHDOG_DEFAULT_CHECK_INTERVAL_USECS   (1000*1000*4)
29 #define WATCHDOG_DEFAULT_RUN_REALTIME           1
30 #define WATCHDOG_DEFAULT_PRIORITY               98
31
32 // threading
33 #define THREAD_MAX_RTPRIO                   98
34 #define THREAD_MIN_RTPRIO                   1
35
36 // time
37
38 // we should be using absolute clock_nanosleep
39 // but on my system it causes a problem on shutdown.
40 #define USE_ABSOLUTE_NANOSLEEP              1
41
42 // 1394 service constants
43 #define IEEE1394SERVICE_USE_CYCLETIMER_DLL                         1
44 #define IEEE1394SERVICE_CYCLETIMER_DLL_UPDATE_INTERVAL_USEC   200000
45 #define IEEE1394SERVICE_CYCLETIMER_DLL_BANDWIDTH_HZ              0.5
46 #define IEEE1394SERVICE_MAX_FIREWIRE_PORTS                         4
47 #define IEEE1394SERVICE_MIN_SPLIT_TIMEOUT_USECS              1000000
48
49 #define IEEE1394SERVICE_CYCLETIMER_HELPER_RUN_REALTIME       1
50 #define IEEE1394SERVICE_CYCLETIMER_HELPER_PRIO               1
51
52 // config rom read wait interval
53 #define IEEE1394SERVICE_CONFIGROM_READ_WAIT_USECS         1000
54
55 // FCP defines
56 #define IEEE1394SERVICE_FCP_MAX_TRIES                        2
57 #define IEEE1394SERVICE_FCP_SLEEP_BETWEEN_FAILURES_USECS  1000
58 #define IEEE1394SERVICE_FCP_POLL_TIMEOUT_MSEC              200
59 #define IEEE1394SERVICE_FCP_RESPONSE_TIMEOUT_USEC       200000
60
61 // The current version of libiec61883 doesn't seem to calculate
62 // the bandwidth correctly. Defining this to non-zero skips
63 // bandwidth allocation when doing CMP connections.
64 #define IEEE1394SERVICE_SKIP_IEC61883_BANDWIDTH_ALLOCATION   1
65
66 #define MINIMUM_INTERRUPTS_PER_PERIOD                       2U
67
68 // These are the result of a lot of trial and error
69 // due to weirdness in the kernel layer
70 #define MAX_XMIT_PACKET_SIZE                         (2048-16)
71 #define MIN_XMIT_PACKET_SIZE                                72
72 #define MAX_XMIT_NB_BUFFERS                                128
73 #define MAX_RECV_NB_BUFFERS                                128
74 #define MIN_RECV_PACKET_SIZE                                72
75
76 // the default ISO receive mode.
77 // 0 = auto, 1 = packet-per-buffer, 2 = bufferfill.
78 // 'auto' will automatically choose the mode that is expected
79 // to perform best for the given situation. For large periods
80 // this is 'bufferfill' mode, for small periods this is
81 // 'packet-per-buffer' mode. The 'BUFFERFILL_MODE_THRESHOLD'
82 // defines what a 'large period' is.
83 #define DEFAULT_ISO_RECEIVE_MODE                             0
84
85 // the number of packets required to fill one period from which
86 // the bufferfill mode is to be used
87 #define BUFFERFILL_MODE_THRESHOLD                           64
88
89
90 #define ISOHANDLER_FLUSH_BEFORE_ITERATE                      0
91
92 #define ISOHANDLER_DEATH_DETECT_TIMEOUT_USECS        1000000LL
93
94 #define ISOHANDLER_CHECK_CTR_RECONSTRUCTION                  1
95
96 #define ISOHANDLERMANAGER_MAX_ISO_HANDLERS_PER_PORT         16
97 #define ISOHANDLERMANAGER_MAX_STREAMS_PER_ISOTHREAD         16
98
99 // The best setup is if the receive handlers have lower priority
100 // than the client thread since that ensures that as soon as we
101 // received sufficient frames, the client thread runs.
102 // The transmit thread should have higher priority to ensure that
103 // all available data is flushed to the ISO kernel buffers as
104 // soon as possible
105 // At this moment, the jack backend uses base+5 to init ffado
106 // prio
107 #define ISOHANDLERMANAGER_ISO_PRIO_INCREASE                  0
108 #define ISOHANDLERMANAGER_ISO_PRIO_INCREASE_RECV            -1
109 #define ISOHANDLERMANAGER_ISO_PRIO_INCREASE_XMIT             1
110
111 // the timeout for ISO activity on any thread
112 // NOTE: don't make this 0
113 #define ISOHANDLERMANAGER_ISO_TASK_WAIT_TIMEOUT_USECS        1000000LL
114
115 // allows to add some processing margin. This shifts the time
116 // at which the buffer is transfer()'ed, making things somewhat
117 // more robust. It should be noted though that shifting the transfer
118 // time to a later time instant also causes the xmit buffer fill to be
119 // lower on average. This can be counteracted by increasing the
120 // STREAMPROCESSORMANAGER_XMIT_PREBUFFER_FRAMES option
121 #define STREAMPROCESSORMANAGER_SIGNAL_DELAY_TICKS           (3072*0)
122
123 // the number of frames that we prebuffer in the 1394 ISO layer
124 // this adds directly to the roundtrip latency
125 #define STREAMPROCESSORMANAGER_XMIT_PREBUFFER_FRAMES         100
126
127 // causes the waitForPeriod() call to wait until sufficient
128 // data is present in the buffer such that a transfer() will
129 // succeed. Normally we wait for the period of time that theoretically
130 // would mean that his is true. However sometimes the kernel hasn't
131 // flushed everything to userspace (or the card hasn't IRQ'd).
132 // the side-effect of this is some jitter in the return timing
133 // whenever this occurs.
134 #define STREAMPROCESSORMANAGER_ALLOW_DELAYED_PERIOD_SIGNAL         1
135
136 // startup control
137 #define STREAMPROCESSORMANAGER_CYCLES_FOR_DRYRUN            40000
138 #define STREAMPROCESSORMANAGER_CYCLES_FOR_STARTUP           200
139 #define STREAMPROCESSORMANAGER_PRESTART_CYCLES_FOR_XMIT     20
140 #define STREAMPROCESSORMANAGER_PRESTART_CYCLES_FOR_RECV     0
141 #define STREAMPROCESSORMANAGER_SYNCSTART_TRIES              10
142 #define STREAMPROCESSORMANAGER_SYNC_WAIT_TIME_MSEC          200
143 #define STREAMPROCESSORMANAGER_NB_ALIGN_TRIES               40
144 #define STREAMPROCESSORMANAGER_ALIGN_AVERAGE_TIME_MSEC      400
145
146 #define STREAMPROCESSORMANAGER_DYNAMIC_SYNC_DELAY           0
147
148 // the default bandwidth of the stream processor timestamp DLL when synchronizing (should be fast)
149 #define STREAMPROCESSOR_DLL_FAST_BW_HZ                      5.0
150 // the default bandwidth of the stream processor timestamp DLL when streaming
151 #define STREAMPROCESSOR_DLL_BW_HZ                           0.1
152
153 // -- AMDTP options -- //
154
155 // in ticks
156 // as per AMDTP2.1: 354.17us + 125us, but FFADO measures from the
157 // packet transmission time, so subtract 125 us:
158 // 354.17us @ 24.576ticks/usec = 8704 ticks
159 #define AMDTP_TRANSMIT_TRANSFER_DELAY   (8704U)
160
161 // the absolute minimum number of cycles we want to transmit
162 // a packet ahead of the presentation time. The nominal time
163 // the packet is transmitted ahead of the presentation time is
164 // given by AMDTP_TRANSMIT_TRANSFER_DELAY (in ticks), but in case we
165 // are too late for that, this constant defines how late we can
166 // be.
167 #define AMDTP_MIN_CYCLES_BEFORE_PRESENTATION                1
168
169 // the absolute maximum number of cycles we want to transmit
170 // a packet ahead of the ideal transmit time. The nominal time
171 // the packet is transmitted ahead of the presentation time is
172 // given by AMDTP_TRANSMIT_TRANSFER_DELAY (in ticks), but we can send
173 // packets early if we want to. (not completely according to spec)
174 // (for spec compliance you need to specify a value of 0)
175 #define AMDTP_MAX_CYCLES_TO_TRANSMIT_EARLY                  1
176
177 // ensure that the AMDTP SP clips all float values to [-1.0..1.0]
178 #define AMDTP_CLIP_FLOATS                                   1
179
180 // Allow that devices request that the AMDTP transmit SP adds
181 // payload to the NO-DATA packets.
182 #define AMDTP_ALLOW_PAYLOAD_IN_NODATA_XMIT                  1
183
184 // Default setting for the payload setting if
185 // AMDTP_ALLOW_PAYLOAD_IN_NODATA_XMIT is enabled. Devices can
186 // explicity override this
187 #define AMDTP_SEND_PAYLOAD_IN_NODATA_XMIT_BY_DEFAULT     true
188
189 // -- MOTU options -- //
190
191 // the transfer delay is substracted from the ideal presentation
192 // time to obtain a corrected presentation time. This values is
193 // then used to stamp the packet and determine the transmission
194 // time instant.
195 #define MOTU_TRANSMIT_TRANSFER_DELAY    (0U)
196
197 // the absolute minimum number of cycles we want to transmit
198 // a packet ahead of the presentation time. The nominal time
199 // the packet is transmitted ahead of the presentation time is
200 // given by MOTU_TRANSMIT_TRANSFER_DELAY (in ticks), but in case we
201 // are too late for that, this constant defines how late we can
202 // be.
203 #define MOTU_MIN_CYCLES_BEFORE_PRESENTATION                0
204
205 // the absolute maximum number of cycles we want to transmit
206 // a packet ahead of the ideal transmit time. The nominal time
207 // the packet is transmitted ahead of the presentation time is
208 // given by MOTU_TRANSMIT_TRANSFER_DELAY (in ticks), but we can send
209 // packets early if we want to.
210 #define MOTU_MAX_CYCLES_TO_TRANSMIT_EARLY                  2
211
212 // ensure that the MOTU tx SP clips all float values to [-1.0..1.0]
213 #define MOTU_CLIP_FLOATS                                   1
214
215 // -- RME options -- //
216
217 // the transfer delay is substracted from the ideal presentation
218 // time to obtain a corrected presentation time. This values is
219 // then used to stamp the packet and determine the transmission
220 // time instant.
221 #define RME_TRANSMIT_TRANSFER_DELAY    (0U)
222
223 // the absolute minimum number of cycles we want to transmit
224 // a packet ahead of the presentation time. The nominal time
225 // the packet is transmitted ahead of the presentation time is
226 // given by RME_TRANSMIT_TRANSFER_DELAY (in ticks), but in case we
227 // are too late for that, this constant defines how late we can
228 // be.
229 #define RME_MIN_CYCLES_BEFORE_PRESENTATION                0
230
231 // the absolute maximum number of cycles we want to transmit
232 // a packet ahead of the ideal transmit time. The nominal time
233 // the packet is transmitted ahead of the presentation time is
234 // given by RME_TRANSMIT_TRANSFER_DELAY (in ticks), but we can send
235 // packets early if we want to.
236 #define RME_MAX_CYCLES_TO_TRANSMIT_EARLY                  1
237
238 // ensure that the RME tx SP clips all float values to [-1.0..1.0]
239 #define RME_CLIP_FLOATS                                   1
240
241 // -- Digidesign options -- //
242 //
243 // Currently these are just verbatim copies of the values which
244 // seem to work for MOTU devices.  Some tweaks may well be
245 // necessary once testing begins with real devices.
246
247 // the transfer delay is substracted from the ideal presentation
248 // time to obtain a corrected presentation time. This values is
249 // then used to stamp the packet and determine the transmission
250 // time instant.
251 #define DIGIDESIGN_TRANSMIT_TRANSFER_DELAY    (0U)
252
253 // the absolute minimum number of cycles we want to transmit
254 // a packet ahead of the presentation time. The nominal time
255 // the packet is transmitted ahead of the presentation time is
256 // given by DIGIDESIGN_TRANSMIT_TRANSFER_DELAY (in ticks), but
257 // in case we are too late for that, this constant defines how
258 // late we can be.
259 #define DIGIDESIGN_MIN_CYCLES_BEFORE_PRESENTATION                0
260
261 // the absolute maximum number of cycles we want to transmit
262 // a packet ahead of the ideal transmit time. The nominal time
263 // the packet is transmitted ahead of the presentation time is
264 // given by DIGIDESIGN_TRANSMIT_TRANSFER_DELAY (in ticks), but
265 // we can send packets early if we want to.
266 #define DIGIDESIGN_MAX_CYCLES_TO_TRANSMIT_EARLY                  2
267
268 // ensure that the DIGIDESIGN tx SP clips all float values to [-1.0..1.0]
269 #define DIGIDESIGN_CLIP_FLOATS                                   1
270
271 /// The unavoidable device specific hacks
272
273 // Use the information in the music plug instead of that in the
274 // cluster info block for the stream configuration. Should not
275 // be necessary
276 #define AVC_STREAMCONFIG_USE_MUSICPLUG                     0
277
278 #endif // CONFIG_H
Note: See TracBrowser for help on using the browser.