motu: report the optical control register read from the device when obtaining the...
[ffado.git] / libffado / config.h.in
blob0838ee43602a2a3166124dda71f25e22255e1edb
1 /* config.h.in. */
2 #ifndef CONFIG_H
3 #define CONFIG_H
5 #define BINDIR "$BINDIR"
6 #define LIBDIR "$LIBDIR"
7 #define SHAREDIR "$SHAREDIR"
9 /* configuration file locations */
10 #define USER_CONFIG_FILE "$USER_CONFIG_FILE"
11 #define SYSTEM_CONFIG_FILE "$SYSTEM_CONFIG_FILE"
13 /* Define indicating availability of lrint() */
14 #define HAVE_LRINT $HAVE_LRINT
16 /* Define indicatin availability of lrintf() */
17 #define HAVE_LRINTF $HAVE_LRINTF
19 // serialization
20 #define SERIALIZE_USE_EXPAT $SERIALIZE_USE_EXPAT
22 #define CACHEDIR "$CACHEDIR"
24 // discovery
25 #define ENABLE_DISCOVERY_CACHE 1
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
32 // threading
33 #define THREAD_MAX_RTPRIO 98
34 #define THREAD_MIN_RTPRIO 1
36 // time
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
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
49 #define IEEE1394SERVICE_CYCLETIMER_HELPER_RUN_REALTIME 1
50 #define IEEE1394SERVICE_CYCLETIMER_HELPER_PRIO 1
52 // config rom read wait interval
53 #define IEEE1394SERVICE_CONFIGROM_READ_WAIT_USECS 1000
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
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
66 #define MINIMUM_INTERRUPTS_PER_PERIOD 2U
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
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
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
90 #define ISOHANDLER_FLUSH_BEFORE_ITERATE 0
92 #define ISOHANDLER_DEATH_DETECT_TIMEOUT_USECS 1000000LL
94 #define ISOHANDLER_CHECK_CTR_RECONSTRUCTION 1
96 #define ISOHANDLERMANAGER_MAX_ISO_HANDLERS_PER_PORT 16
97 #define ISOHANDLERMANAGER_MAX_STREAMS_PER_ISOTHREAD 16
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
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
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)
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
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
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
146 #define STREAMPROCESSORMANAGER_DYNAMIC_SYNC_DELAY 0
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
153 // -- AMDTP options -- //
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)
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
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
177 // ensure that the AMDTP SP clips all float values to [-1.0..1.0]
178 #define AMDTP_CLIP_FLOATS 1
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
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
189 // -- MOTU options -- //
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)
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
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
212 // ensure that the MOTU tx SP clips all float values to [-1.0..1.0]
213 #define MOTU_CLIP_FLOATS 1
215 // -- RME options -- //
217 // the transfer delay is substracted from the ideal presentation
218 // time to obtain a corrected presentation time. This value is
219 // then used to stamp the packet and determine the transmission
220 // time instant. This is in ticks, and has been determined
221 // experimentally to provide the most stability.
222 #define RME_TRANSMIT_TRANSFER_DELAY (3U*TICKS_PER_CYCLE)
224 // the absolute minimum number of cycles we want to transmit
225 // a packet ahead of the presentation time. The nominal time
226 // the packet is transmitted ahead of the presentation time is
227 // given by RME_TRANSMIT_TRANSFER_DELAY (in ticks), but in case we
228 // are too late for that, this constant defines how late we can
229 // be.
230 #define RME_MIN_CYCLES_BEFORE_PRESENTATION 1
232 // the absolute maximum number of cycles we want to transmit
233 // a packet ahead of the ideal transmit time. The nominal time
234 // the packet is transmitted ahead of the presentation time is
235 // given by RME_TRANSMIT_TRANSFER_DELAY (in ticks), but we can send
236 // packets early if we want to.
237 #define RME_MAX_CYCLES_TO_TRANSMIT_EARLY 5
239 // The transfer delay assumed for incoming packets from an RME.
240 // Normally this would be the same as the transmit transfer delay.
241 // This value is in ticks.
242 #define RME_RECEIVE_TRANSFER_DELAY RME_TRANSMIT_TRANSFER_DELAY
244 // ensure that the RME tx SP clips all float values to [-1.0..1.0]
245 #define RME_CLIP_FLOATS 1
247 // -- Digidesign options -- //
249 // Currently these are just verbatim copies of the values which
250 // seem to work for MOTU devices. Some tweaks may well be
251 // necessary once testing begins with real devices.
253 // the transfer delay is substracted from the ideal presentation
254 // time to obtain a corrected presentation time. This values is
255 // then used to stamp the packet and determine the transmission
256 // time instant.
257 #define DIGIDESIGN_TRANSMIT_TRANSFER_DELAY (0U)
259 // the absolute minimum number of cycles we want to transmit
260 // a packet ahead of the presentation time. The nominal time
261 // the packet is transmitted ahead of the presentation time is
262 // given by DIGIDESIGN_TRANSMIT_TRANSFER_DELAY (in ticks), but
263 // in case we are too late for that, this constant defines how
264 // late we can be.
265 #define DIGIDESIGN_MIN_CYCLES_BEFORE_PRESENTATION 0
267 // the absolute maximum number of cycles we want to transmit
268 // a packet ahead of the ideal transmit time. The nominal time
269 // the packet is transmitted ahead of the presentation time is
270 // given by DIGIDESIGN_TRANSMIT_TRANSFER_DELAY (in ticks), but
271 // we can send packets early if we want to.
272 #define DIGIDESIGN_MAX_CYCLES_TO_TRANSMIT_EARLY 2
274 // ensure that the DIGIDESIGN tx SP clips all float values to [-1.0..1.0]
275 #define DIGIDESIGN_CLIP_FLOATS 1
277 /// The unavoidable device specific hacks
279 // Use the information in the music plug instead of that in the
280 // cluster info block for the stream configuration. Should not
281 // be necessary
282 #define AVC_STREAMCONFIG_USE_MUSICPLUG 0
284 #endif // CONFIG_H