Qt: do not show open options in both normal and advanced UI
[vlc.git] / modules / access / linsys / linsys_sdiaudio.h
blobe0ef80ba38dcdbb80ca148f336259b3eaf3120d9
1 /* sdiaudio.h
3 * Shared header file for the Linux user-space API for
4 * Linear Systems Ltd. SMPTE 292M and SMPTE 259M-C Audio interface boards.
6 * Copyright (C) 2009-2010 Linear Systems Ltd.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
11 * 1. Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of Linear Systems Ltd. nor the names of its
19 * contributors may be used to endorse or promote products derived from
20 * this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY LINEAR SYSTEMS LTD. "AS IS" AND ANY
23 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL LINEAR SYSTEMS LTD. OR CONTRIBUTORS
26 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
29 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 * Linear Systems can be contacted at <http://www.linsys.ca/>.
38 #ifndef _SDIAUDIO_H
39 #define _SDIAUDIO_H
41 /* Driver info */
42 #define SDIAUDIO_DRIVER_NAME "sdiaudio"
44 #define SDIAUDIO_MAJOR 0 /* Set to 0 for dynamic allocation.
45 * See /usr/src/linux/Documentation/devices.txt */
47 #define SDIAUDIO_TX_BUFFERS_MIN 2 /* This must be at least 2 */
48 /* The minimum transmit buffer size must be positive, divisible by 4,
49 * and large enough that the buffers aren't transferred to the onboard FIFOs
50 * too quickly for the machine to handle the interrupts.
51 * This is especially a problem at startup, when the FIFOs are empty.
52 * Relevant factors include onboard FIFO size, PCI bus throughput,
53 * processor speed, and interrupt latency. */
54 #define SDIAUDIO_TX_BUFSIZE_MIN 1024
55 #define SDIAUDIO_RX_BUFFERS_MIN 2 /* This must be at least 2 */
56 #define SDIAUDIO_RX_BUFSIZE_MIN 8 /* This must be positive and divisible by 4 */
58 #define SDIAUDIO_TX_BUFFERS 30 /* This must be at least 2 */
59 #define SDIAUDIO_TX_BUFSIZE 6400 /* This must be positive and divisible by 4 */
60 #define SDIAUDIO_RX_BUFFERS 30 /* This must be at least 2 */
61 #define SDIAUDIO_RX_BUFSIZE 6400 /* This must be positive and divisible by 4 */
63 /* Ioctl () definitions */
64 #define SDIAUDIO_IOC_MAGIC '~' /* This ioctl magic number is currently free. See
65 * /usr/src/linux/Documentation/ioctl-number.txt */
67 #define SDIAUDIO_IOC_TXGETCAP _IOR(SDIAUDIO_IOC_MAGIC, 1, unsigned int)
68 #define SDIAUDIO_IOC_TXGETEVENTS _IOR(SDIAUDIO_IOC_MAGIC, 2, unsigned int)
69 #define SDIAUDIO_IOC_TXGETBUFLEVEL _IOR(SDIAUDIO_IOC_MAGIC, 3, unsigned int)
70 #define SDIAUDIO_IOC_TXGETTXD _IOR(SDIAUDIO_IOC_MAGIC, 4, int)
72 #define SDIAUDIO_IOC_RXGETCAP _IOR(SDIAUDIO_IOC_MAGIC, 65, unsigned int)
73 #define SDIAUDIO_IOC_RXGETEVENTS _IOR(SDIAUDIO_IOC_MAGIC, 66, unsigned int)
74 #define SDIAUDIO_IOC_RXGETBUFLEVEL _IOR(SDIAUDIO_IOC_MAGIC, 67, unsigned int)
75 #define SDIAUDIO_IOC_RXGETCARRIER _IOR(SDIAUDIO_IOC_MAGIC, 68, int)
76 #define SDIAUDIO_IOC_RXGETSTATUS _IOR(SDIAUDIO_IOC_MAGIC, 69, int)
77 #define SDIAUDIO_IOC_RXGETAUDIOGR0ERROR _IOR(SDIAUDIO_IOC_MAGIC, 70, unsigned int)
78 #define SDIAUDIO_IOC_RXGETAUDIOGR0DELAYA _IOR(SDIAUDIO_IOC_MAGIC, 71, unsigned int)
79 #define SDIAUDIO_IOC_RXGETAUDIOGR0DELAYB _IOR(SDIAUDIO_IOC_MAGIC, 72, unsigned int)
80 #define SDIAUDIO_IOC_RXGETNONAUDIO _IOR(SDIAUDIO_IOC_MAGIC, 73, unsigned int)
81 #define SDIAUDIO_IOC_RXGETAUDSTAT _IOR(SDIAUDIO_IOC_MAGIC, 74, unsigned int)
82 #define SDIAUDIO_IOC_RXGETAUDRATE _IOR(SDIAUDIO_IOC_MAGIC, 75, unsigned int)
84 #define SDIAUDIO_IOC_GETID _IOR(SDIAUDIO_IOC_MAGIC, 129, unsigned int)
85 #define SDIAUDIO_IOC_GETVERSION _IOR(SDIAUDIO_IOC_MAGIC, 130, unsigned int)
86 /* Provide compatibility with applications compiled for older API */
87 #define SDIAUDIO_IOC_QBUF_DEPRECATED _IOW(SDIAUDIO_IOC_MAGIC, 131, unsigned int)
88 #define SDIAUDIO_IOC_QBUF _IO(SDIAUDIO_IOC_MAGIC, 131)
89 /* Provide compatibility with applications compiled for older API */
90 #define SDIAUDIO_IOC_DQBUF_DEPRECATED _IOW(SDIAUDIO_IOC_MAGIC, 132, unsigned int)
91 #define SDIAUDIO_IOC_DQBUF _IO(SDIAUDIO_IOC_MAGIC, 132)
93 /* Transmitter event flag bit locations */
94 #define SDIAUDIO_EVENT_TX_BUFFER_ORDER 0
95 #define SDIAUDIO_EVENT_TX_BUFFER (1 << SDIAUDIO_EVENT_TX_BUFFER_ORDER)
96 #define SDIAUDIO_EVENT_TX_FIFO_ORDER 1
97 #define SDIAUDIO_EVENT_TX_FIFO (1 << SDIAUDIO_EVENT_TX_FIFO_ORDER)
98 #define SDIAUDIO_EVENT_TX_DATA_ORDER 2
99 #define SDIAUDIO_EVENT_TX_DATA (1 << SDIAUDIO_EVENT_TX_DATA_ORDER)
101 /* Receiver event flag bit locations */
102 #define SDIAUDIO_EVENT_RX_BUFFER_ORDER 0
103 #define SDIAUDIO_EVENT_RX_BUFFER (1 << SDIAUDIO_EVENT_RX_BUFFER_ORDER)
104 #define SDIAUDIO_EVENT_RX_FIFO_ORDER 1
105 #define SDIAUDIO_EVENT_RX_FIFO (1 << SDIAUDIO_EVENT_RX_FIFO_ORDER)
106 #define SDIAUDIO_EVENT_RX_CARRIER_ORDER 2
107 #define SDIAUDIO_EVENT_RX_CARRIER (1 << SDIAUDIO_EVENT_RX_CARRIER_ORDER)
108 #define SDIAUDIO_EVENT_RX_DATA_ORDER 3
109 #define SDIAUDIO_EVENT_RX_DATA (1 << SDIAUDIO_EVENT_RX_DATA_ORDER)
111 /* Interface capabilities */
112 #define SDIAUDIO_CAP_RX_CD 0x00000001
113 #define SDIAUDIO_CAP_RX_DATA 0x00000002
114 #define SDIAUDIO_CAP_RX_STATS 0x00000004
115 #define SDIAUDIO_CAP_RX_NONAUDIO 0x00000008
116 #define SDIAUDIO_CAP_RX_24BIT 0x00000010
118 /* Audio sample size */
119 #define SDIAUDIO_CTL_AUDSAMP_SZ_16 16 /* 16 bit */
120 #define SDIAUDIO_CTL_AUDSAMP_SZ_24 24 /* 24 bit */
121 #define SDIAUDIO_CTL_AUDSAMP_SZ_32 32 /* 32 bit */
123 /* Audio channel enable */
124 #define SDIAUDIO_CTL_AUDCH_EN_0 0 /* 0 channel/disable audio */
125 #define SDIAUDIO_CTL_AUDCH_EN_2 2 /* 2 channel */
126 #define SDIAUDIO_CTL_AUDCH_EN_4 4 /* 4 channel */
127 #define SDIAUDIO_CTL_AUDCH_EN_6 6 /* 6 channel */
128 #define SDIAUDIO_CTL_AUDCH_EN_8 8 /* 8 channel */
130 #define SDIAUDIO_CTL_PCM_ALLCHANNEL 0x00000000 /* PCM for channel 1 - 8 */
131 #define SDIAUDIO_CTL_NONAUDIO_ALLCHANNEL 0x000000ff /* No audio for channel 1 - 8 */
133 /* Active audio channels status */
134 #define SDIAUDIO_CTL_ACT_CHAN_0 0x00 /* no audio control packets */
135 #define SDIAUDIO_CTL_ACT_CHAN_2 0x03 /* 2 channels */
136 #define SDIAUDIO_CTL_ACT_CHAN_4 0x0f /* 4 channels */
137 #define SDIAUDIO_CTL_ACT_CHAN_6 0x3f /* 6 channels */
138 #define SDIAUDIO_CTL_ACT_CHAN_8 0xff /* 8 channels */
140 /* Audio rate */
141 #define SDIAUDIO_CTL_SYNC_48_KHZ 0 /* Synchronous, 48 kHz */
142 #define SDIAUDIO_CTL_SYNC_44_1_KHZ 2 /* Synchronous, 44.1 kHz */
143 #define SDIAUDIO_CTL_SYNC_32_KHZ 4 /* Synchronous, 32 kHz */
144 #define SDIAUDIO_CTL_SYNC_96_KHZ 8 /* Synchronous, 96 kHz */
145 #define SDIAUDIO_CTL_SYNC_FREE_RUNNING 14 /* Synchronous, free running */
146 #define SDIAUDIO_CTL_ASYNC_48_KHZ 1 /* Asynchronous, 48 kHz */
147 #define SDIAUDIO_CTL_ASYNC_44_1_KHZ 3 /* Asynchronous, 44.1 kHz */
148 #define SDIAUDIO_CTL_ASYNC_32_KHZ 5 /* Asynchronous, 32 kHz */
149 #define SDIAUDIO_CTL_ASYNC_96_KHZ 9 /* Asynchronous, 96 kHz */
150 #define SDIAUDIO_CTL_ASYNC_FREE_RUNNING 15 /* Asynchronous, free running */
152 #endif