ALSA project - the C library reference
pcm_plugin.h
Go to the documentation of this file.
1 
15 /*
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.
20  *
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.
25  *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29  *
30  */
31 
32 #ifndef __ALSA_PCM_PLUGIN_H
33 #define __ALSA_PCM_PLUGIN_H
34 
42 #define SND_PCM_PLUGIN_RATE_MIN 4000
43 #define SND_PCM_PLUGIN_RATE_MAX 768000
45 /* ROUTE_FLOAT should be set to 0 for machines without FP unit - like iPAQ */
46 #ifdef HAVE_SOFT_FLOAT
47 #define SND_PCM_PLUGIN_ROUTE_FLOAT 0
48 #else
49 #define SND_PCM_PLUGIN_ROUTE_FLOAT 1
50 #endif
51 
52 #define SND_PCM_PLUGIN_ROUTE_RESOLUTION 16
54 #if SND_PCM_PLUGIN_ROUTE_FLOAT
57 #define SND_PCM_PLUGIN_ROUTE_HALF 0.5
58 #define SND_PCM_PLUGIN_ROUTE_FULL 1.0
59 #else
62 #define SND_PCM_PLUGIN_ROUTE_HALF (SND_PCM_PLUGIN_ROUTE_RESOLUTION / 2)
63 #define SND_PCM_PLUGIN_ROUTE_FULL SND_PCM_PLUGIN_ROUTE_RESOLUTION
64 #endif
65 
66 /*
67  * Hardware plugin
68  */
69 int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
70  int card, int device, int subdevice,
71  snd_pcm_stream_t stream, int mode,
72  int mmap_emulation, int sync_ptr_ioctl);
73 int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
74  snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf,
75  snd_pcm_stream_t stream, int mode);
76 
77 /*
78  * Copy plugin
79  */
80 int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name,
81  snd_pcm_t *slave, int close_slave);
82 int _snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name,
83  snd_config_t *root, snd_config_t *conf,
84  snd_pcm_stream_t stream, int mode);
85 
86 /*
87  * Linear conversion plugin
88  */
89 int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name,
90  snd_pcm_format_t sformat, snd_pcm_t *slave,
91  int close_slave);
92 int _snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name,
93  snd_config_t *root, snd_config_t *conf,
94  snd_pcm_stream_t stream, int mode);
95 
96 /*
97  * Linear<->Float conversion plugin
98  */
99 int snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name,
100  snd_pcm_format_t sformat, snd_pcm_t *slave,
101  int close_slave);
102 int _snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name,
103  snd_config_t *root, snd_config_t *conf,
104  snd_pcm_stream_t stream, int mode);
105 
106 /*
107  * Linear<->mu-Law conversion plugin
108  */
109 int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name,
110  snd_pcm_format_t sformat, snd_pcm_t *slave,
111  int close_slave);
112 int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name,
113  snd_config_t *root, snd_config_t *conf,
114  snd_pcm_stream_t stream, int mode);
115 
116 /*
117  * Linear<->a-Law conversion plugin
118  */
119 int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name,
120  snd_pcm_format_t sformat, snd_pcm_t *slave,
121  int close_slave);
122 int _snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name,
123  snd_config_t *root, snd_config_t *conf,
124  snd_pcm_stream_t stream, int mode);
125 
126 /*
127  * Linear<->Ima-ADPCM conversion plugin
128  */
129 int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name,
130  snd_pcm_format_t sformat, snd_pcm_t *slave,
131  int close_slave);
132 int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name,
133  snd_config_t *root, snd_config_t *conf,
134  snd_pcm_stream_t stream, int mode);
135 
136 /*
137  * IEC958 subframe conversion plugin
138  */
139 int snd_pcm_iec958_open(snd_pcm_t **pcmp, const char *name,
140  snd_pcm_format_t sformat, snd_pcm_t *slave,
141  int close_slave,
142  const unsigned char *status_bits,
143  const unsigned char *preamble_vals,
144  int hdmi_mode);
145 int _snd_pcm_iec958_open(snd_pcm_t **pcmp, const char *name,
146  snd_config_t *root, snd_config_t *conf,
147  snd_pcm_stream_t stream, int mode);
148 
149 /*
150  * Route plugin for linear formats
151  */
153  unsigned int tt_csize, unsigned int tt_ssize,
154  unsigned int *tt_cused, unsigned int *tt_sused,
155  int schannels);
157  unsigned int *tt_csize,
158  unsigned int *tt_ssize);
159 int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
160  snd_pcm_format_t sformat, int schannels,
162  unsigned int tt_ssize,
163  unsigned int tt_cused, unsigned int tt_sused,
164  snd_pcm_t *slave, int close_slave);
165 int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
166  snd_config_t *root, snd_config_t *conf,
167  snd_pcm_stream_t stream, int mode);
168 
169 /*
170  * Rate plugin for linear formats
171  */
172 int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
173  snd_pcm_format_t sformat, unsigned int srate,
174  const snd_config_t *converter,
175  snd_pcm_t *slave, int close_slave);
176 int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
177  snd_config_t *root, snd_config_t *conf,
178  snd_pcm_stream_t stream, int mode);
179 
180 /*
181  * Hooks plugin
182  */
183 int snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
184  snd_pcm_t *slave, int close_slave);
185 int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
186  snd_config_t *root, snd_config_t *conf,
187  snd_pcm_stream_t stream, int mode);
188 
189 /*
190  * LADSPA plugin
191  */
192 int snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
193  const char *ladspa_path,
194  unsigned int channels,
195  snd_config_t *ladspa_pplugins,
196  snd_config_t *ladspa_cplugins,
197  snd_pcm_t *slave, int close_slave);
198 int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
199  snd_config_t *root, snd_config_t *conf,
200  snd_pcm_stream_t stream, int mode);
201 
202 /*
203  * Jack plugin
204  */
205 
217 int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
218  snd_config_t *playback_conf,
219  snd_config_t *capture_conf,
220  snd_pcm_stream_t stream, int mode);
221 
233 int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
234  snd_config_t *root, snd_config_t *conf,
235  snd_pcm_stream_t stream, int mode);
236 
237 
240 #endif /* __ALSA_PCM_PLUGIN_H */
struct _snd_config snd_config_t
Internal structure for a configuration node object.
Definition: conf.h:74
float snd_pcm_route_ttable_entry_t
Definition: pcm_plugin.h:56
int _snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new A-Law conversion PCM.
Definition: pcm_alaw.c:508
int snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, snd_pcm_t *slave, int close_slave)
Creates a new hooks PCM.
Definition: pcm_hooks.c:216
int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, int card, int device, int subdevice, snd_pcm_stream_t stream, int mode, int mmap_emulation, int sync_ptr_ioctl)
Creates a new hw PCM.
Definition: pcm_hw.c:1757
int _snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new linear<->float conversion PCM.
Definition: pcm_lfloat.c:466
int snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave)
Creates a new linear conversion PCM.
Definition: pcm_lfloat.c:382
int _snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new copy PCM.
Definition: pcm_copy.c:262
int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new hooks PCM.
Definition: pcm_hooks.c:482
int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave)
Creates a new Mu-Law conversion PCM.
Definition: pcm_mulaw.c:439
int _snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new linear conversion PCM.
Definition: pcm_linear.c:509
int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new Ima-ADPCM conversion PCM.
Definition: pcm_adpcm.c:633
int snd_pcm_route_determine_ttable(snd_config_t *tt, unsigned int *tt_csize, unsigned int *tt_ssize)
Determine route matrix sizes.
Definition: pcm_route.c:1134
int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new hw PCM.
Definition: pcm_hw.c:1884
int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new Jack PCM (internal)
int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, snd_pcm_t *slave, int close_slave)
Creates a new copy PCM.
Definition: pcm_copy.c:184
int snd_pcm_iec958_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave, const unsigned char *status_bits, const unsigned char *preamble_vals, int hdmi_mode)
Creates a new IEC958 subframe conversion PCM.
Definition: pcm_iec958.c:564
int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new rate PCM.
Definition: pcm_rate.c:1688
int _snd_pcm_iec958_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new IEC958 subframe conversion PCM.
Definition: pcm_iec958.c:686
int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new Mu-Law conversion PCM.
Definition: pcm_mulaw.c:523
int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, snd_config_t *playback_conf, snd_config_t *capture_conf, snd_pcm_stream_t stream, int mode)
Creates a new Jack PCM.
int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable, unsigned int tt_csize, unsigned int tt_ssize, unsigned int *tt_cused, unsigned int *tt_sused, int schannels)
Load route matrix.
Definition: pcm_route.c:1235
int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new Route & Volume PCM.
Definition: pcm_route.c:1297
int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, unsigned int srate, const snd_config_t *converter, snd_pcm_t *slave, int close_slave)
Creates a new rate PCM.
Definition: pcm_rate.c:1504
int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave)
Creates a new linear conversion PCM.
Definition: pcm_linear.c:427
int snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name, const char *ladspa_path, unsigned int channels, snd_config_t *ladspa_pplugins, snd_config_t *ladspa_cplugins, snd_pcm_t *slave, int close_slave)
Creates a new LADSPA<->ALSA Plugin.
Definition: pcm_ladspa.c:1586
int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave)
Creates a new A-Law conversion PCM.
Definition: pcm_alaw.c:424
int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, int schannels, snd_pcm_route_ttable_entry_t *ttable, unsigned int tt_ssize, unsigned int tt_cused, unsigned int tt_sused, snd_pcm_t *slave, int close_slave)
Creates a new Route & Volume PCM.
Definition: pcm_route.c:1025
int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
Creates a new LADSPA<->ALSA PCM.
Definition: pcm_ladspa.c:1733
int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave)
Creates a new Ima-ADPCM conversion PCM.
Definition: pcm_adpcm.c:550
struct _snd_pcm snd_pcm_t
Definition: pcm.h:422
snd_pcm_format_t
Definition: pcm.h:129
snd_pcm_stream_t
Definition: pcm.h:105