annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/alsa/sound/uapi/hdspm.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
jpayne@69 2 #ifndef __SOUND_HDSPM_H
jpayne@69 3 #define __SOUND_HDSPM_H
jpayne@69 4 /*
jpayne@69 5 * Copyright (C) 2003 Winfried Ritsch (IEM)
jpayne@69 6 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
jpayne@69 7 *
jpayne@69 8 *
jpayne@69 9 * This program is free software; you can redistribute it and/or modify
jpayne@69 10 * it under the terms of the GNU General Public License as published by
jpayne@69 11 * the Free Software Foundation; either version 2 of the License, or
jpayne@69 12 * (at your option) any later version.
jpayne@69 13 *
jpayne@69 14 * This program is distributed in the hope that it will be useful,
jpayne@69 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jpayne@69 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
jpayne@69 17 * GNU General Public License for more details.
jpayne@69 18 *
jpayne@69 19 * You should have received a copy of the GNU General Public License
jpayne@69 20 * along with this program; if not, write to the Free Software
jpayne@69 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
jpayne@69 22 */
jpayne@69 23
jpayne@69 24 #ifdef __linux__
jpayne@69 25 #include <linux/types.h>
jpayne@69 26 #endif
jpayne@69 27
jpayne@69 28 /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
jpayne@69 29 #define HDSPM_MAX_CHANNELS 64
jpayne@69 30
jpayne@69 31 enum hdspm_io_type {
jpayne@69 32 MADI,
jpayne@69 33 MADIface,
jpayne@69 34 AIO,
jpayne@69 35 AES32,
jpayne@69 36 RayDAT
jpayne@69 37 };
jpayne@69 38
jpayne@69 39 enum hdspm_speed {
jpayne@69 40 ss,
jpayne@69 41 ds,
jpayne@69 42 qs
jpayne@69 43 };
jpayne@69 44
jpayne@69 45 /* -------------------- IOCTL Peak/RMS Meters -------------------- */
jpayne@69 46
jpayne@69 47 struct hdspm_peak_rms {
jpayne@69 48 __u32 input_peaks[64];
jpayne@69 49 __u32 playback_peaks[64];
jpayne@69 50 __u32 output_peaks[64];
jpayne@69 51
jpayne@69 52 __u64 input_rms[64];
jpayne@69 53 __u64 playback_rms[64];
jpayne@69 54 __u64 output_rms[64];
jpayne@69 55
jpayne@69 56 __u8 speed; /* enum {ss, ds, qs} */
jpayne@69 57 int status2;
jpayne@69 58 };
jpayne@69 59
jpayne@69 60 #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
jpayne@69 61 _IOR('H', 0x42, struct hdspm_peak_rms)
jpayne@69 62
jpayne@69 63 /* ------------ CONFIG block IOCTL ---------------------- */
jpayne@69 64
jpayne@69 65 struct hdspm_config {
jpayne@69 66 unsigned char pref_sync_ref;
jpayne@69 67 unsigned char wordclock_sync_check;
jpayne@69 68 unsigned char madi_sync_check;
jpayne@69 69 unsigned int system_sample_rate;
jpayne@69 70 unsigned int autosync_sample_rate;
jpayne@69 71 unsigned char system_clock_mode;
jpayne@69 72 unsigned char clock_source;
jpayne@69 73 unsigned char autosync_ref;
jpayne@69 74 unsigned char line_out;
jpayne@69 75 unsigned int passthru;
jpayne@69 76 unsigned int analog_out;
jpayne@69 77 };
jpayne@69 78
jpayne@69 79 #define SNDRV_HDSPM_IOCTL_GET_CONFIG \
jpayne@69 80 _IOR('H', 0x41, struct hdspm_config)
jpayne@69 81
jpayne@69 82 /*
jpayne@69 83 * If there's a TCO (TimeCode Option) board installed,
jpayne@69 84 * there are further options and status data available.
jpayne@69 85 * The hdspm_ltc structure contains the current SMPTE
jpayne@69 86 * timecode and some status information and can be
jpayne@69 87 * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
jpayne@69 88 * hdspm_status struct.
jpayne@69 89 */
jpayne@69 90
jpayne@69 91 enum hdspm_ltc_format {
jpayne@69 92 format_invalid,
jpayne@69 93 fps_24,
jpayne@69 94 fps_25,
jpayne@69 95 fps_2997,
jpayne@69 96 fps_30
jpayne@69 97 };
jpayne@69 98
jpayne@69 99 enum hdspm_ltc_frame {
jpayne@69 100 frame_invalid,
jpayne@69 101 drop_frame,
jpayne@69 102 full_frame
jpayne@69 103 };
jpayne@69 104
jpayne@69 105 enum hdspm_ltc_input_format {
jpayne@69 106 ntsc,
jpayne@69 107 pal,
jpayne@69 108 no_video
jpayne@69 109 };
jpayne@69 110
jpayne@69 111 struct hdspm_ltc {
jpayne@69 112 unsigned int ltc;
jpayne@69 113
jpayne@69 114 enum hdspm_ltc_format format;
jpayne@69 115 enum hdspm_ltc_frame frame;
jpayne@69 116 enum hdspm_ltc_input_format input_format;
jpayne@69 117 };
jpayne@69 118
jpayne@69 119 #define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
jpayne@69 120
jpayne@69 121 /*
jpayne@69 122 * The status data reflects the device's current state
jpayne@69 123 * as determined by the card's configuration and
jpayne@69 124 * connection status.
jpayne@69 125 */
jpayne@69 126
jpayne@69 127 enum hdspm_sync {
jpayne@69 128 hdspm_sync_no_lock = 0,
jpayne@69 129 hdspm_sync_lock = 1,
jpayne@69 130 hdspm_sync_sync = 2
jpayne@69 131 };
jpayne@69 132
jpayne@69 133 enum hdspm_madi_input {
jpayne@69 134 hdspm_input_optical = 0,
jpayne@69 135 hdspm_input_coax = 1
jpayne@69 136 };
jpayne@69 137
jpayne@69 138 enum hdspm_madi_channel_format {
jpayne@69 139 hdspm_format_ch_64 = 0,
jpayne@69 140 hdspm_format_ch_56 = 1
jpayne@69 141 };
jpayne@69 142
jpayne@69 143 enum hdspm_madi_frame_format {
jpayne@69 144 hdspm_frame_48 = 0,
jpayne@69 145 hdspm_frame_96 = 1
jpayne@69 146 };
jpayne@69 147
jpayne@69 148 enum hdspm_syncsource {
jpayne@69 149 syncsource_wc = 0,
jpayne@69 150 syncsource_madi = 1,
jpayne@69 151 syncsource_tco = 2,
jpayne@69 152 syncsource_sync = 3,
jpayne@69 153 syncsource_none = 4
jpayne@69 154 };
jpayne@69 155
jpayne@69 156 struct hdspm_status {
jpayne@69 157 __u8 card_type; /* enum hdspm_io_type */
jpayne@69 158 enum hdspm_syncsource autosync_source;
jpayne@69 159
jpayne@69 160 __u64 card_clock;
jpayne@69 161 __u32 master_period;
jpayne@69 162
jpayne@69 163 union {
jpayne@69 164 struct {
jpayne@69 165 __u8 sync_wc; /* enum hdspm_sync */
jpayne@69 166 __u8 sync_madi; /* enum hdspm_sync */
jpayne@69 167 __u8 sync_tco; /* enum hdspm_sync */
jpayne@69 168 __u8 sync_in; /* enum hdspm_sync */
jpayne@69 169 __u8 madi_input; /* enum hdspm_madi_input */
jpayne@69 170 __u8 channel_format; /* enum hdspm_madi_channel_format */
jpayne@69 171 __u8 frame_format; /* enum hdspm_madi_frame_format */
jpayne@69 172 } madi;
jpayne@69 173 } card_specific;
jpayne@69 174 };
jpayne@69 175
jpayne@69 176 #define SNDRV_HDSPM_IOCTL_GET_STATUS \
jpayne@69 177 _IOR('H', 0x47, struct hdspm_status)
jpayne@69 178
jpayne@69 179 /*
jpayne@69 180 * Get information about the card and its add-ons.
jpayne@69 181 */
jpayne@69 182
jpayne@69 183 #define HDSPM_ADDON_TCO 1
jpayne@69 184
jpayne@69 185 struct hdspm_version {
jpayne@69 186 __u8 card_type; /* enum hdspm_io_type */
jpayne@69 187 char cardname[20];
jpayne@69 188 unsigned int serial;
jpayne@69 189 unsigned short firmware_rev;
jpayne@69 190 int addons;
jpayne@69 191 };
jpayne@69 192
jpayne@69 193 #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
jpayne@69 194
jpayne@69 195 /* ------------- get Matrix Mixer IOCTL --------------- */
jpayne@69 196
jpayne@69 197 /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
jpayne@69 198 * 32768 Bytes
jpayne@69 199 */
jpayne@69 200
jpayne@69 201 /* organisation is 64 channelfader in a continuous memory block */
jpayne@69 202 /* equivalent to hardware definition, maybe for future feature of mmap of
jpayne@69 203 * them
jpayne@69 204 */
jpayne@69 205 /* each of 64 outputs has 64 infader and 64 outfader:
jpayne@69 206 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
jpayne@69 207
jpayne@69 208 #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
jpayne@69 209
jpayne@69 210 struct hdspm_channelfader {
jpayne@69 211 unsigned int in[HDSPM_MIXER_CHANNELS];
jpayne@69 212 unsigned int pb[HDSPM_MIXER_CHANNELS];
jpayne@69 213 };
jpayne@69 214
jpayne@69 215 struct hdspm_mixer {
jpayne@69 216 struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
jpayne@69 217 };
jpayne@69 218
jpayne@69 219 struct hdspm_mixer_ioctl {
jpayne@69 220 struct hdspm_mixer *mixer;
jpayne@69 221 };
jpayne@69 222
jpayne@69 223 /* use indirect access due to the limit of ioctl bit size */
jpayne@69 224 #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
jpayne@69 225
jpayne@69 226 #endif