~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/sound/asound_fm.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2 #ifndef __SOUND_ASOUND_FM_H
  3 #define __SOUND_ASOUND_FM_H
  4 
  5 /*
  6  *  Advanced Linux Sound Architecture - ALSA
  7  *
  8  *  Interface file between ALSA driver & user space
  9  *  Copyright (c) 1994-98 by Jaroslav Kysela <perex@perex.cz>,
 10  *                           4Front Technologies
 11  *
 12  *  Direct FM control
 13  */
 14 
 15 #define SNDRV_DM_FM_MODE_OPL2   0x00
 16 #define SNDRV_DM_FM_MODE_OPL3   0x01
 17 
 18 struct snd_dm_fm_info {
 19         unsigned char fm_mode;          /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
 20         unsigned char rhythm;           /* percussion mode flag */
 21 };
 22 
 23 /*
 24  *  Data structure composing an FM "note" or sound event.
 25  */
 26 
 27 struct snd_dm_fm_voice {
 28         unsigned char op;               /* operator cell (0 or 1) */
 29         unsigned char voice;            /* FM voice (0 to 17) */
 30 
 31         unsigned char am;               /* amplitude modulation */
 32         unsigned char vibrato;          /* vibrato effect */
 33         unsigned char do_sustain;       /* sustain phase */
 34         unsigned char kbd_scale;        /* keyboard scaling */
 35         unsigned char harmonic;         /* 4 bits: harmonic and multiplier */
 36         unsigned char scale_level;      /* 2 bits: decrease output freq rises */
 37         unsigned char volume;           /* 6 bits: volume */
 38 
 39         unsigned char attack;           /* 4 bits: attack rate */
 40         unsigned char decay;            /* 4 bits: decay rate */
 41         unsigned char sustain;          /* 4 bits: sustain level */
 42         unsigned char release;          /* 4 bits: release rate */
 43 
 44         unsigned char feedback;         /* 3 bits: feedback for op0 */
 45         unsigned char connection;       /* 0 for serial, 1 for parallel */
 46         unsigned char left;             /* stereo left */
 47         unsigned char right;            /* stereo right */
 48         unsigned char waveform;         /* 3 bits: waveform shape */
 49 };
 50 
 51 /*
 52  *  This describes an FM note by its voice, octave, frequency number (10bit)
 53  *  and key on/off.
 54  */
 55 
 56 struct snd_dm_fm_note {
 57         unsigned char voice;    /* 0-17 voice channel */
 58         unsigned char octave;   /* 3 bits: what octave to play */
 59         unsigned int fnum;      /* 10 bits: frequency number */
 60         unsigned char key_on;   /* set for active, clear for silent */
 61 };
 62 
 63 /*
 64  *  FM parameters that apply globally to all voices, and thus are not "notes"
 65  */
 66 
 67 struct snd_dm_fm_params {
 68         unsigned char am_depth;         /* amplitude modulation depth (1=hi) */
 69         unsigned char vib_depth;        /* vibrato depth (1=hi) */
 70         unsigned char kbd_split;        /* keyboard split */
 71         unsigned char rhythm;           /* percussion mode select */
 72 
 73         /* This block is the percussion instrument data */
 74         unsigned char bass;
 75         unsigned char snare;
 76         unsigned char tomtom;
 77         unsigned char cymbal;
 78         unsigned char hihat;
 79 };
 80 
 81 /*
 82  *  FM mode ioctl settings
 83  */
 84 
 85 #define SNDRV_DM_FM_IOCTL_INFO          _IOR('H', 0x20, struct snd_dm_fm_info)
 86 #define SNDRV_DM_FM_IOCTL_RESET         _IO ('H', 0x21)
 87 #define SNDRV_DM_FM_IOCTL_PLAY_NOTE     _IOW('H', 0x22, struct snd_dm_fm_note)
 88 #define SNDRV_DM_FM_IOCTL_SET_VOICE     _IOW('H', 0x23, struct snd_dm_fm_voice)
 89 #define SNDRV_DM_FM_IOCTL_SET_PARAMS    _IOW('H', 0x24, struct snd_dm_fm_params)
 90 #define SNDRV_DM_FM_IOCTL_SET_MODE      _IOW('H', 0x25, int)
 91 /* for OPL3 only */
 92 #define SNDRV_DM_FM_IOCTL_SET_CONNECTION        _IOW('H', 0x26, int)
 93 /* SBI patch management */
 94 #define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40)
 95 
 96 #define SNDRV_DM_FM_OSS_IOCTL_RESET             0x20
 97 #define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE         0x21
 98 #define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE         0x22
 99 #define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS        0x23
100 #define SNDRV_DM_FM_OSS_IOCTL_SET_MODE          0x24
101 #define SNDRV_DM_FM_OSS_IOCTL_SET_OPL           0x25
102 
103 /*
104  * Patch Record - fixed size for write
105  */
106 
107 #define FM_KEY_SBI      "SBI\032"
108 #define FM_KEY_2OP      "2OP\032"
109 #define FM_KEY_4OP      "4OP\032"
110 
111 struct sbi_patch {
112         unsigned char prog;
113         unsigned char bank;
114         char key[4];
115         char name[25];
116         char extension[7];
117         unsigned char data[32];
118 };
119 
120 #endif /* __SOUND_ASOUND_FM_H */
121 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php