2 * \file include/pcm_plugin.h
3 * \brief Common PCM plugin code
4 * \author Abramo Bagnara <abramo@alsa-project.org>
5 * \author Jaroslav Kysela <perex@perex.cz>
8 * Application interface library for the ALSA driver.
9 * See the \ref pcm_plugins page for more details.
11 * \warning Using of contents of this header file might be dangerous
12 * in the sense of compatibility reasons. The contents might be
13 * freely changed in future.
16 * This library is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU Lesser General Public License as
18 * published by the Free Software Foundation; either version 2.1 of
19 * the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #ifndef __ALSA_PCM_PLUGIN_H
35 * \defgroup PCM_Plugins PCM Plugins
37 * See the \ref pcm_plugins page for more details.
41 #define SND_PCM_PLUGIN_RATE_MIN 4000 /**< minimal rate for the rate plugin */
42 #define SND_PCM_PLUGIN_RATE_MAX 192000 /**< maximal rate for the rate plugin */
44 /* ROUTE_FLOAT should be set to 0 for machines without FP unit - like iPAQ */
45 #ifdef HAVE_SOFT_FLOAT
46 #define SND_PCM_PLUGIN_ROUTE_FLOAT 0 /**< use integers for route plugin */
48 #define SND_PCM_PLUGIN_ROUTE_FLOAT 1 /**< use floats for route plugin */
51 #define SND_PCM_PLUGIN_ROUTE_RESOLUTION 16 /**< integer resolution for route plugin */
53 #if SND_PCM_PLUGIN_ROUTE_FLOAT
54 /** route ttable entry type */
55 typedef float snd_pcm_route_ttable_entry_t;
56 #define SND_PCM_PLUGIN_ROUTE_HALF 0.5 /**< half value */
57 #define SND_PCM_PLUGIN_ROUTE_FULL 1.0 /**< full value */
59 /** route ttable entry type */
60 typedef int snd_pcm_route_ttable_entry_t;
61 #define SND_PCM_PLUGIN_ROUTE_HALF (SND_PCM_PLUGIN_ROUTE_RESOLUTION / 2) /**< half value */
62 #define SND_PCM_PLUGIN_ROUTE_FULL SND_PCM_PLUGIN_ROUTE_RESOLUTION /**< full value */
68 int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
69 int card, int device, int subdevice,
70 snd_pcm_stream_t stream, int mode,
71 int mmap_emulation, int sync_ptr_ioctl);
72 int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
73 snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf,
74 snd_pcm_stream_t stream, int mode);
79 int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name,
80 snd_pcm_t *slave, int close_slave);
81 int _snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name,
82 snd_config_t *root, snd_config_t *conf,
83 snd_pcm_stream_t stream, int mode);
86 * Linear conversion plugin
88 int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name,
89 snd_pcm_format_t sformat, snd_pcm_t *slave,
91 int _snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name,
92 snd_config_t *root, snd_config_t *conf,
93 snd_pcm_stream_t stream, int mode);
96 * Linear<->Float conversion plugin
98 int snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name,
99 snd_pcm_format_t sformat, snd_pcm_t *slave,
101 int _snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name,
102 snd_config_t *root, snd_config_t *conf,
103 snd_pcm_stream_t stream, int mode);
106 * Linear<->mu-Law conversion plugin
108 int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name,
109 snd_pcm_format_t sformat, snd_pcm_t *slave,
111 int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name,
112 snd_config_t *root, snd_config_t *conf,
113 snd_pcm_stream_t stream, int mode);
116 * Linear<->a-Law conversion plugin
118 int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name,
119 snd_pcm_format_t sformat, snd_pcm_t *slave,
121 int _snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name,
122 snd_config_t *root, snd_config_t *conf,
123 snd_pcm_stream_t stream, int mode);
126 * Linear<->Ima-ADPCM conversion plugin
128 int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name,
129 snd_pcm_format_t sformat, snd_pcm_t *slave,
131 int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name,
132 snd_config_t *root, snd_config_t *conf,
133 snd_pcm_stream_t stream, int mode);
136 * Route plugin for linear formats
138 int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable,
139 unsigned int tt_csize, unsigned int tt_ssize,
140 unsigned int *tt_cused, unsigned int *tt_sused,
142 int snd_pcm_route_determine_ttable(snd_config_t *tt,
143 unsigned int *tt_csize,
144 unsigned int *tt_ssize);
145 int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
146 snd_pcm_format_t sformat, int schannels,
147 snd_pcm_route_ttable_entry_t *ttable,
148 unsigned int tt_ssize,
149 unsigned int tt_cused, unsigned int tt_sused,
150 snd_pcm_t *slave, int close_slave);
151 int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
152 snd_config_t *root, snd_config_t *conf,
153 snd_pcm_stream_t stream, int mode);
156 * Rate plugin for linear formats
158 int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
159 snd_pcm_format_t sformat, unsigned int srate,
160 const snd_config_t *converter,
161 snd_pcm_t *slave, int close_slave);
162 int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
163 snd_config_t *root, snd_config_t *conf,
164 snd_pcm_stream_t stream, int mode);
169 int snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
170 snd_pcm_t *slave, int close_slave);
171 int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
172 snd_config_t *root, snd_config_t *conf,
173 snd_pcm_stream_t stream, int mode);
178 int snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
179 const char *ladspa_path,
180 unsigned int channels,
181 snd_config_t *ladspa_pplugins,
182 snd_config_t *ladspa_cplugins,
183 snd_pcm_t *slave, int close_slave);
184 int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
185 snd_config_t *root, snd_config_t *conf,
186 snd_pcm_stream_t stream, int mode);
191 int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
192 snd_config_t *playback_conf,
193 snd_config_t *capture_conf,
194 snd_pcm_stream_t stream, int mode);
195 int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
196 snd_config_t *root, snd_config_t *conf,
197 snd_pcm_stream_t stream, int mode);
202 #endif /* __ALSA_PCM_PLUGIN_H */