Date: Sun, 23 Nov 1997 21:28:55 +0200 From: Mark Murray <mark@grondar.za> To: Mark Murray <mark@grondar.za> Cc: Amancio Hasty <hasty@rah.star-gate.com>, John-Mark Gurney <jmg@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-sys@FreeBSD.ORG Subject: Re: cvs commit: src/sys/i386/isa/snd ad1848.c clones.c dmabuf.c sb_dsp.c sbcard.h sound.c sound.h soundcard.h Message-ID: <199711231928.VAA13709@greenpeace.grondar.za>
next in thread | raw e-mail | index | archive | help
This is a multipart MIME message. --==_Exmh_-16957282400 Content-Type: text/plain; charset=us-ascii Mark Murray wrote: > Please could you sound developers merge your changes and requirements > into The Right Place (tm) being sys/i386/includes/soundcard.h, and > remove sys/i386/isa/snd/soundcard.h? This will have the added benefit > of not requiring evil symlinks to make Luigi's code work. Sorry - I forgot to add the diffs. Attached. M -- Mark Murray Join the anti-SPAM movement: http://www.cauce.org --==_Exmh_-16957282400 Content-Type: text/plain; name="soundcard.h.diff"; charset=us-ascii Content-Description: soundcard.h.diff Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="soundcard.h.diff" --- soundcard.h Sat Oct 25 21:45:53 1997 +++ ../isa/snd/soundcard.h Thu Oct 30 21:17:07 1997 @@ -1,32 +1,35 @@ -#ifndef SOUNDCARD_H -#define SOUNDCARD_H /* + * soundcard.h + * * Copyright by Hannu Savolainen 1993 + * Modified for the new FreeBSD sound driver by Luigi Rizzo, 1997 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in th= e - * documentation and/or other materials provided with the distributio= n. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE= - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F - * SUCH DAMAGE. - * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. * = + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ = +#ifndef SOUNDCARD_H +#define SOUNDCARD_H /* = * If you make modifications to this file, please contact me before * distributing the modified version. There is already enough = @@ -46,50 +49,165 @@ **********************************************************************= */ = -#define SOUND_VERSION 301 +#include <sys/types.h> +#ifndef _IOWR +#include <sys/ioccom.h> +#endif /* !_IOWR */ = /* - * Supported card ID numbers (Should be somewhere else?) + * The first part of this file contains the new FreeBSD sound ioctl + * interface. Tries to minimize the number of different ioctls, and + * to be reasonably general. + * + * 970821: some of the new calls have not been implemented yet. */ = -#define SNDCARD_ADLIB 1 -#define SNDCARD_SB 2 -#define SNDCARD_PAS 3 -#define SNDCARD_GUS 4 -#define SNDCARD_MPU401 5 -#define SNDCARD_SB16 6 -#define SNDCARD_SB16MIDI 7 -#define SNDCARD_UART6850 8 -#define SNDCARD_GUS16 9 -#define SNDCARD_MSS 10 -#define SNDCARD_PSS 11 -#define SNDCARD_SSCAPE 12 -#define SNDCARD_PSS_MPU 13 -#define SNDCARD_PSS_MSS 14 -#define SNDCARD_SSCAPE_MSS 15 -#define SNDCARD_TRXPRO 16 -#define SNDCARD_TRXPRO_SB 17 -#define SNDCARD_TRXPRO_MPU 18 -#define SNDCARD_MAD16 19 -#define SNDCARD_MAD16_MPU 20 -#define SNDCARD_CS4232 21 -#define SNDCARD_CS4232_MPU 22 -#define SNDCARD_MAUI 23 -#define SNDCARD_PSEUDO_MSS 24 -#define SNDCARD_AWE32 25 +/* + * the following three calls extend the generic file descriptor + * interface. AIONWRITE is the dual of FIONREAD, i.e. returns the max + * number of bytes for a write operation to be non-blocking. + * + * AIOGSIZE/AIOSSIZE are used to change the behaviour of the device, + * from a character device (default) to a block device. In block mode, + * (not to be confused with blocking mode) the main difference for the + * application is that select() will return only when a complete + * block can be read/written to the device, whereas in character mode + * select will return true when one byte can be exchanged. For audio + * devices, character mode makes select almost useless since one byte + * will always be ready by the next sample time (which is often only a + * handful of microseconds away). = + * Use a size of 0 or 1 to return to character mode. + */ +#define AIONWRITE _IOR('A', 10, int) /* get # bytes to write */ +struct snd_size { + int play_size; + int rec_size; +}; +#define AIOGSIZE _IOR('A', 11, struct snd_size)/* read current blocks= ize */ +#define AIOSSIZE _IOWR('A', 11, struct snd_size) /* sets blocksize *= / = /* - * IOCTL Commands for /dev/sequencer + * The following constants define supported audio formats. The + * encoding follows voxware conventions, i.e. 1 bit for each supported + * format. We extend it by using bit 31 (RO) to indicate full-duplex + * capability, and bit 29 (RO) to indicate that the card supports/ + * needs different formats on capture & playback channels. + * Bit 29 (RW) is used to indicate/ask stereo. */ = -#ifndef _IOWR -#include <sys/ioccom.h> -#endif /* !_IOWR */ +# define AFMT_QUERY 0x00000000 /* Return current fmt */ +# define AFMT_MU_LAW 0x00000001 +# define AFMT_A_LAW 0x00000002 +# define AFMT_IMA_ADPCM 0x00000004 +# define AFMT_U8 0x00000008 +# define AFMT_S16_LE 0x00000010 /* Little endian signed 16*/ +# define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */ +# define AFMT_S8 0x00000040 +# define AFMT_U16_LE 0x00000080 /* Little endian U16 */ +# define AFMT_U16_BE 0x00000100 /* Big endian U16 */ +# define AFMT_MPEG 0x00000200 /* MPEG (2) audio */ + +# define AFMT_STEREO 0x10000000 /* can do/want stereo */ + +/* + * the following are really capabilities + */ +# define AFMT_WEIRD 0x20000000 /* weird hardware... */ + /* + * AFMT_WEIRD reports that the hardware might need to operate + * with different formats in the playback and capture + * channels when operating in full duplex. + * As an example, SoundBlaster16 cards only support U8 in one + * direction and S16 in the other one, and applications should + * be aware of this limitation. + */ +# define AFMT_FULLDUPLEX 0x80000000 /* can do full duplex */ + +/* + * The following structure is used to get/set format and sampling rate. + * While it would be better to have things such as stereo, bits per + * sample, endiannes, etc split in different variables, it turns out + * that formats are not that many, and not all combinations are possible= =2E + * So we followed the Voxware approach of associating one bit to each + * format. + */ + +typedef struct _snd_chan_param { + u_long play_rate; /* sampling rate */ + u_long rec_rate; /* sampling rate */ + u_long play_format; /* everything describing the format */ + u_long rec_format; /* everything describing the format */ +} snd_chan_param; +#define AIOGFMT _IOR('f', 12, snd_chan_param) /* get format */ +#define AIOSFMT _IOWR('f', 12, snd_chan_param) /* sets format */ + +/* + * The following structure is used to get/set the mixer setting. + * Up to 32 mixers are supported, each one with up to 32 channels. + */ +typedef struct _snd_mix_param { + u_char subdev; /* which output */ + u_char line; /* which input */ + u_char left,right; /* volumes, 0..255, 0 =3D mute */ +} snd_mix_param ; + +/* XXX AIOGMIX, AIOSMIX not implemented yet */ +#define AIOGMIX _IOWR('A', 13, snd_mix_param) /* return mixer status */ +#define AIOSMIX _IOWR('A', 14, snd_mix_param) /* sets mixer status */ + +/* + * channel specifiers used in AIOSTOP and AIOSYNC + */ +#define AIOSYNC_PLAY 0x1 /* play chan */ +#define AIOSYNC_CAPTURE 0x2 /* capture chan */ +/* AIOSTOP stop & flush a channel, returns the residual count */ +#define AIOSTOP _IOWR ('A', 15, int) + +/* alternate method used to notify the sync condition */ +#define AIOSYNC_SIGNAL 0x100 +#define AIOSYNC_SELECT 0x200 + +/* what the 'pos' field refers to */ +#define AIOSYNC_READY 0x400 +#define AIOSYNC_FREE 0x800 + +typedef struct _snd_sync_parm { + long chan ; /* play or capture channel, plus modifier */ + long pos; +} snd_sync_parm; +#define AIOSYNC _IOWR ('A', 15, snd_sync_parm) /* misc. synchronization = */ + +/* + * The following is used to return device capabilities. If the structure= + * passed to the ioctl is zeroed, default values are returned for rate + * and formats, a bitmap of available mixers is returned, and values + * (inputs, different levels) for the first one are returned. + * + * If formats, mixers, inputs are instantiated, then detailed info + * are returned depending on the call. + */ +typedef struct _snd_capabilities { + u_long rate_min, rate_max; /* min-max sampling rate */ + u_long formats; + u_long bufsize; /* DMA buffer size */ + u_long mixers; /* bitmap of available mixers */ + u_long inputs; /* bitmap of available inputs (per mixer) */ + u_short left, right; /* how many levels are supported */ +} snd_capabilities; +#define AIOGCAP _IOWR('A', 15, snd_capabilities) /* get capabilities */ + +/* + * here is the old (Voxware) ioctl interface + */ + +/* + * IOCTL Commands for /dev/sequencer + */ = #define SNDCTL_SEQ_RESET _IO ('Q', 0) #define SNDCTL_SEQ_SYNC _IO ('Q', 1) #define SNDCTL_SYNTH_INFO _IOWR('Q', 2, struct synth_info) -#define SNDCTL_SEQ_CTRLRATE _IOWR('Q', 3, int) /* Set/get timer resolut= ion (hz) */ +#define SNDCTL_SEQ_CTRLRATE _IOWR('Q', 3, int) /* Set/get timer res.(hz)= */ #define SNDCTL_SEQ_GETOUTCOUNT _IOR ('Q', 4, int) #define SNDCTL_SEQ_GETINCOUNT _IOR ('Q', 5, int) #define SNDCTL_SEQ_PERCMODE _IOW ('Q', 6, int) @@ -353,16 +471,15 @@ #define SEQ_AFTERTOUCH 9 #define SEQ_CONTROLLER 10 = -/******************************************* +/* * Midi controller numbers - ******************************************* - * Controllers 0 to 31 (0x00 to 0x1f) and - * 32 to 63 (0x20 to 0x3f) are continuous - * controllers. - * In the MIDI 1.0 these controllers are sent using - * two messages. Controller numbers 0 to 31 are used - * to send the MSB and the controller numbers 32 to 63 - * are for the LSB. Note that just 7 bits are used in MIDI bytes. + * + * Controllers 0 to 31 (0x00 to 0x1f) and 32 to 63 (0x20 to 0x3f) + * are continuous controllers. + * In the MIDI 1.0 these controllers are sent using two messages. + * Controller numbers 0 to 31 are used to send the MSB and the + * controller numbers 32 to 63 are for the LSB. Note that just 7 bits + * are used in MIDI bytes. */ = #define CTL_BANK_SELECT 0x00 @@ -377,10 +494,7 @@ /* undefined 0x09 */ #define CTL_PAN 0x0a #define CTL_EXPRESSION 0x0b -/* undefined 0x0c */ -/* undefined 0x0d */ -/* undefined 0x0e */ -/* undefined 0x0f */ +/* undefined 0x0c - 0x0f */ #define CTL_GENERAL_PURPOSE1 0x10 #define CTL_GENERAL_PURPOSE2 0x11 #define CTL_GENERAL_PURPOSE3 0x12 @@ -388,15 +502,18 @@ /* undefined 0x14 - 0x1f */ = /* undefined 0x20 */ -/* The controller numbers 0x21 to 0x3f are reserved for the */ -/* least significant bytes of the controllers 0x00 to 0x1f. */ -/* These controllers are not recognised by the driver. */ = -/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */ -/* 0=3DOFF and 127=3DON (intermediate values are possible) */ +/* + * The controller numbers 0x21 to 0x3f are reserved for the + * least significant bytes of the controllers 0x00 to 0x1f. + * These controllers are not recognised by the driver. + * + * Controllers 64 to 69 (0x40 to 0x45) are on/off switches. + * 0=3DOFF and 127=3DON (intermediate values are possible) + */ #define CTL_DAMPER_PEDAL 0x40 -#define CTL_SUSTAIN 0x40 /* Alias */ -#define CTL_HOLD 0x40 /* Alias */ +#define CTL_SUSTAIN CTL_DAMPER_PEDAL /* Alias */ +#define CTL_HOLD CTL_DAMPER_PEDAL /* Alias */ #define CTL_PORTAMENTO 0x41 #define CTL_SOSTENUTO 0x42 #define CTL_SOFT_PEDAL 0x43 @@ -413,7 +530,7 @@ #define CTL_TREMOLO_DEPTH 0x5c #define CTL_CHORUS_DEPTH 0x5d #define CTL_DETUNE_DEPTH 0x5e -#define CTL_CELESTE_DEPTH 0x5e /* Alias for the above one */ +#define CTL_CELESTE_DEPTH CTL_DETUNE_DEPTH /* Alias for the above one */= #define CTL_PHASER_DEPTH 0x5f #define CTL_DATA_INCREMENT 0x60 #define CTL_DATA_DECREMENT 0x61 @@ -461,10 +579,11 @@ * be written using exactly one write() call. Other events cannot * be mixed to the same write. * = - * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to= the = - * /dev/sequencer. Don't write other data together with the instrument s= tructure - * Set the key field of the structure to FM_PATCH. The device field is u= sed to - * route the patch to the corresponding device. + * For FM synths (YM3812/OPL3) use struct sbi_instrument and write + * it to the /dev/sequencer. Don't write other data together with + * the instrument structure Set the key field of the structure to + * FM_PATCH. The device field is used to route the patch to the + * corresponding device. * * For Gravis UltraSound use struct patch_info. Initialize the key field= * to GUS_PATCH. @@ -528,7 +647,7 @@ int dummies[18]; /* Reserve space */ }; = -/******************************************** +/* * ioctl commands for the /dev/midi## */ typedef struct { @@ -541,7 +660,7 @@ #define SNDCTL_MIDI_MPUMODE _IOWR('m', 1, int) #define SNDCTL_MIDI_MPUCMD _IOWR('m', 2, mpu_command_rec) = -/******************************************** +/* * IOCTL commands for /dev/dsp and /dev/audio */ = @@ -551,64 +670,63 @@ #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) #define SNDCTL_DSP_GETBLKSIZE _IOR('P', 4, int) #define SNDCTL_DSP_SETBLKSIZE _IOW('P', 4, int) -#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT +#define SNDCTL_DSP_SETFMT _IOWR('P',5, int) /* Selects ONE fmt*/ + +/* + * SOUND_PCM_WRITE_CHANNELS is not that different + * from SNDCTL_DSP_STEREO + */ #define SOUND_PCM_WRITE_CHANNELS _IOWR('P', 6, int) #define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int) #define SNDCTL_DSP_POST _IO ('P', 8) + +/* + * SNDCTL_DSP_SETBLKSIZE and the following two calls mostly do + * the same thing, i.e. set the block size used in DMA transfers. + */ #define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int) #define SNDCTL_DSP_SETFRAGMENT _IOWR('P',10, int) = = -/* Audio data formats (Note! U8=3D8 and S16_LE=3D16 for compatibility) *= / #define SNDCTL_DSP_GETFMTS _IOR ('P',11, int) /* Returns a mask */ -#define SNDCTL_DSP_SETFMT _IOWR('P',5, int) /* Selects ONE fmt*/ -# define AFMT_QUERY 0x00000000 /* Return current fmt */ -# define AFMT_MU_LAW 0x00000001 -# define AFMT_A_LAW 0x00000002 -# define AFMT_IMA_ADPCM 0x00000004 -# define AFMT_U8 0x00000008 -# define AFMT_S16_LE 0x00000010 /* Little endian signed 16*/ -# define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */ -# define AFMT_S8 0x00000040 -# define AFMT_U16_LE 0x00000080 /* Little endian U16 */ -# define AFMT_U16_BE 0x00000100 /* Big endian U16 */ -# define AFMT_MPEG 0x00000200 /* MPEG (2) audio */ - /* * Buffer status queries. */ typedef struct audio_buf_info { - int fragments; /* # of available fragments (partially used - * ones not counted) */ + int fragments; /* # of avail. frags (partly used ones not counted) *= / int fragstotal; /* Total # of fragments allocated */ int fragsize; /* Size of a fragment in bytes */ = - int bytes; /* Available space in bytes (includes - * partially used fragments) */ + int bytes; /* Avail. space in bytes (includes partly used fragments)= */ /* Note! 'bytes' could be more than fragments*fragsize */ } audio_buf_info; = #define SNDCTL_DSP_GETOSPACE _IOR ('P',12, audio_buf_info) #define SNDCTL_DSP_GETISPACE _IOR ('P',13, audio_buf_info) + +/* + * SNDCTL_DSP_NONBLOCK is the same (but less powerful, since the + * action cannot be undone) of FIONBIO. The same can be achieved + * by opening the device with O_NDELAY + */ #define SNDCTL_DSP_NONBLOCK _IO ('P',14) + #define SNDCTL_DSP_GETCAPS _IOR ('P',15, int) -#define DSP_CAP_REVISION 0x000000ff /* Bits for revision level (0 to 255= ) */ +#define DSP_CAP_REVISION 0x000000ff /* revision level (0 to 255) */ #define DSP_CAP_DUPLEX 0x00000100 /* Full duplex record/playback */ #define DSP_CAP_REALTIME 0x00000200 /* Real time capability */ -#define DSP_CAP_BATCH 0x00000400 /* Device has some kind of */ - -/* internal buffers which may */ -/* cause some delays and */ -/* decrease precision of timing */ -# define DSP_CAP_COPROC 0x00000800 /* Has a coprocessor */ -/* Sometimes it's a DSP */ -/* but usually not */ -# define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */ -# define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */ - - +#define DSP_CAP_BATCH 0x00000400 + /* + * Device has some kind of internal buffers which may + * cause some delays and decrease precision of timing + */ +#define DSP_CAP_COPROC 0x00000800 + /* Has a coprocessor, sometimes it's a DSP but usually not */ +#define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */ = -#define SNDCTL_DSP_GETCAPS _IOR ('P',15, int) +/* + * What do these function do ? + */ #define SNDCTL_DSP_GETTRIGGER _IOR ('P',16, int) #define SNDCTL_DSP_SETTRIGGER _IOW ('P',16, int) #define PCM_ENABLE_INPUT 0x00000001 @@ -620,6 +738,9 @@ int ptr; /* Current DMA pointer value */ } count_info; = +/* + * GETIPTR and GETISPACE are not that different... same for out. + */ #define SNDCTL_DSP_GETIPTR _IOR ('P',17, count_info) #define SNDCTL_DSP_GETOPTR _IOR ('P',18, count_info) = @@ -632,33 +753,15 @@ #define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, buffmem_desc) #define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) = +/* + * I guess these are the readonly version of the same + * functions that exist above as SNDCTL_DSP_... + */ #define SOUND_PCM_READ_RATE _IOR ('P', 2, int) #define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int) #define SOUND_PCM_READ_BITS _IOR ('P', 5, int) #define SOUND_PCM_READ_FILTER _IOR ('P', 7, int) = -/* Some alias names */ -#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT -#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED -#define SOUND_PCM_POST SNDCTL_DSP_POST -#define SOUND_PCM_RESET SNDCTL_DSP_RESET -#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC -#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE -#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT -#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS -#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT -#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE -#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE -#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK -#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS -#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER -#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER -#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO -#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR -#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR -#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF -#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF - /* * ioctl calls to be used in communication with coprocessors and * DSP chips. @@ -700,7 +803,7 @@ #define SNDCTL_COPR_SENDMSG _IOW ('C', 8, copr_msg) #define SNDCTL_COPR_RCVMSG _IOR ('C', 9, copr_msg) = -/********************************************* +/* * IOCTL commands for /dev/mixer */ = @@ -738,8 +841,10 @@ #define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */ #define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */ = -/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */ -/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space *= / +/* + * Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) + * Not counted to SOUND_MIXER_NRDEVICES, but use the same number space + */ #define SOUND_ONOFF_MIN 28 #define SOUND_ONOFF_MAX 30 #define SOUND_MIXER_MUTE 28 /* 0 or 1 */ @@ -843,6 +948,9 @@ = #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) = +#define LEFT_CHN 0 +#define RIGHT_CHN 1 + /* * Level 2 event types for /dev/sequencer */ @@ -1158,4 +1266,32 @@ ( seqbuf_dump(), write(seqfd, (char*)(patchx), len) ) = #endif -#endif + +/* + * Here I have moved all the aliases for ioctl names. + */ + +#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT +#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT +#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT + +#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED +#define SOUND_PCM_POST SNDCTL_DSP_POST +#define SOUND_PCM_RESET SNDCTL_DSP_RESET +#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC +#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE +#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT +#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS +#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE +#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE +#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK +#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS +#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER +#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER +#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO +#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR +#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR +#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF +#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF + +#endif /* SOUNDCARD_H */ --==_Exmh_-16957282400--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711231928.VAA13709>