ALSA project - the C library reference
Loading...
Searching...
No Matches
hwdep.h
Go to the documentation of this file.
1
11/*
12 * This library is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as
14 * published by the Free Software Foundation; either version 2.1 of
15 * the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 *
26 */
27
28#if !defined(__ASOUNDLIB_H) && !defined(ALSA_LIBRARY_BUILD)
29/* don't use ALSA_LIBRARY_BUILD define in sources outside alsa-lib */
30#warning "use #include <alsa/asoundlib.h>, <alsa/hwdep.h> should not be used directly"
31#include <alsa/asoundlib.h>
32#endif
33
34#ifndef __ALSA_HWDEP_H
35#define __ALSA_HWDEP_H
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
48#define SND_HWDEP_DLSYM_VERSION _dlsym_hwdep_001
49
51typedef struct _snd_hwdep_info snd_hwdep_info_t;
52
54typedef struct _snd_hwdep_dsp_status snd_hwdep_dsp_status_t;
55
57typedef struct _snd_hwdep_dsp_image snd_hwdep_dsp_image_t;
58
60typedef enum _snd_hwdep_iface {
61 SND_HWDEP_IFACE_OPL2 = 0,
62 SND_HWDEP_IFACE_OPL3,
63 SND_HWDEP_IFACE_OPL4,
64 SND_HWDEP_IFACE_SB16CSP,
65 SND_HWDEP_IFACE_EMU10K1,
66 SND_HWDEP_IFACE_YSS225,
67 SND_HWDEP_IFACE_ICS2115,
68 SND_HWDEP_IFACE_SSCAPE,
69 SND_HWDEP_IFACE_VX,
70 SND_HWDEP_IFACE_MIXART,
71 SND_HWDEP_IFACE_USX2Y,
72 SND_HWDEP_IFACE_EMUX_WAVETABLE,
73 SND_HWDEP_IFACE_BLUETOOTH,
74 SND_HWDEP_IFACE_USX2Y_PCM,
75 SND_HWDEP_IFACE_PCXHR,
76 SND_HWDEP_IFACE_SB_RC,
77 SND_HWDEP_IFACE_HDA,
78 SND_HWDEP_IFACE_USB_STREAM,
79 SND_HWDEP_IFACE_FW_DICE,
80 SND_HWDEP_IFACE_FW_FIREWORKS,
81 SND_HWDEP_IFACE_FW_BEBOB,
82 SND_HWDEP_IFACE_FW_OXFW,
83 SND_HWDEP_IFACE_FW_DIGI00X, /* Digidesign Digi 002/003 family */
84 SND_HWDEP_IFACE_FW_TASCAM, /* TASCAM FireWire series */
85 SND_HWDEP_IFACE_LINE6, /* Line6 USB processors */
86 SND_HWDEP_IFACE_FW_MOTU, /* MOTU FireWire series */
87 SND_HWDEP_IFACE_FW_FIREFACE, /* RME Fireface series */
88
89 SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_FIREFACE,
90} snd_hwdep_iface_t;
91
93#define SND_HWDEP_OPEN_READ (O_RDONLY)
95#define SND_HWDEP_OPEN_WRITE (O_WRONLY)
97#define SND_HWDEP_OPEN_DUPLEX (O_RDWR)
99#define SND_HWDEP_OPEN_NONBLOCK (O_NONBLOCK)
100
102typedef enum _snd_hwdep_type {
104 SND_HWDEP_TYPE_HW,
106 SND_HWDEP_TYPE_SHM,
108 SND_HWDEP_TYPE_INET
109} snd_hwdep_type_t;
110
112typedef struct _snd_hwdep snd_hwdep_t;
113
114int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode);
115int snd_hwdep_close(snd_hwdep_t *hwdep);
116int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space);
117int snd_hwdep_poll_descriptors_count(snd_hwdep_t *hwdep);
118int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
119int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock);
120int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info);
121int snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *status);
122int snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block);
123int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg);
124ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size);
125ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size);
126
127size_t snd_hwdep_info_sizeof(void);
129#define snd_hwdep_info_alloca(ptr) __snd_alloca(ptr, snd_hwdep_info)
130int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr);
131void snd_hwdep_info_free(snd_hwdep_info_t *obj);
132void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src);
133
134unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj);
135int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj);
136const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj);
137const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj);
138snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj);
139void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val);
140
141size_t snd_hwdep_dsp_status_sizeof(void);
143#define snd_hwdep_dsp_status_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_status)
144int snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t **ptr);
145void snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t *obj);
146void snd_hwdep_dsp_status_copy(snd_hwdep_dsp_status_t *dst, const snd_hwdep_dsp_status_t *src);
147
148unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj);
149const char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj);
150unsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t *obj);
151unsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t *obj);
152unsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t *obj);
153
154size_t snd_hwdep_dsp_image_sizeof(void);
156#define snd_hwdep_dsp_image_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_image)
157int snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t **ptr);
158void snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t *obj);
159void snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src);
160
161unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj);
162const char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj);
163const void *snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t *obj);
164size_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t *obj);
165
166void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int _index);
167void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name);
168void snd_hwdep_dsp_image_set_image(snd_hwdep_dsp_image_t *obj, void *buffer);
169void snd_hwdep_dsp_image_set_length(snd_hwdep_dsp_image_t *obj, size_t length);
170
173#ifdef __cplusplus
174}
175#endif
176
177#endif /* __ALSA_HWDEP_H */
178
size_t snd_hwdep_dsp_image_sizeof()
get size of the snd_hwdep_dsp_image_t structure in bytes
Definition hwdep.c:631
int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj)
get hwdep card number
Definition hwdep.c:381
int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space)
get poll descriptors
Definition hwdep.c:266
const char * snd_hwdep_info_get_id(const snd_hwdep_info_t *obj)
get hwdep driver identifier
Definition hwdep.c:403
void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src)
copy one snd_hwdep_info_t structure to another
Definition hwdep.c:370
int snd_hwdep_close(snd_hwdep_t *hwdep)
close HwDep handle
Definition hwdep.c:209
void snd_hwdep_dsp_image_set_image(snd_hwdep_dsp_image_t *obj, void *image)
set the DSP block image pointer
Definition hwdep.c:760
int snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t **info)
allocate a new snd_hwdep_dsp_status_t structure
Definition hwdep.c:539
void snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src)
copy one snd_hwdep_dsp_image_t structure to another
Definition hwdep.c:671
void snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t *info)
frees the snd_hwdep_dsp_status_t structure
Definition hwdep.c:555
ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size)
write bytes using HwDep handle
Definition hwdep.c:474
unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj)
get the driver version of dsp loader
Definition hwdep.c:577
void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val)
set hwdep device number
Definition hwdep.c:436
int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
get returned events from poll descriptors
Definition hwdep.c:297
void snd_hwdep_dsp_image_set_length(snd_hwdep_dsp_image_t *obj, size_t length)
set the DSP block length
Definition hwdep.c:749
int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock)
set nonblock mode
Definition hwdep.c:313
int snd_hwdep_info_malloc(snd_hwdep_info_t **info)
allocate a new snd_hwdep_info_t structure
Definition hwdep.c:343
const char * snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj)
get the name of the DSP block
Definition hwdep.c:693
int snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block)
load the DSP block
Definition hwdep.c:515
int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void *arg)
do hardware dependent ioctl
Definition hwdep.c:462
unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *info)
get hwdep device number
Definition hwdep.c:392
const char * snd_hwdep_info_get_name(const snd_hwdep_info_t *obj)
get hwdep driver name
Definition hwdep.c:414
snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj)
get hwdep protocol interface
Definition hwdep.c:425
ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size)
read bytes using HwDep handle
Definition hwdep.c:488
const char * snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj)
get the driver id of dsp loader
Definition hwdep.c:588
int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t *info)
get information about HwDep handle
Definition hwdep.c:448
unsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t *info)
get the bit flags of the loaded dsp blocks
Definition hwdep.c:610
void snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t *info)
frees the snd_hwdep_dsp_image_t structure
Definition hwdep.c:660
void snd_hwdep_info_free(snd_hwdep_info_t *info)
frees the snd_hwdep_info_t structure
Definition hwdep.c:359
int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode)
Opens a new connection to the HwDep interface.
Definition hwdep.c:169
void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name)
set the name of the DSP block
Definition hwdep.c:737
unsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t *obj)
get number of dsp blocks
Definition hwdep.c:599
int snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *info)
get the DSP status information
Definition hwdep.c:502
void snd_hwdep_dsp_status_copy(snd_hwdep_dsp_status_t *dst, const snd_hwdep_dsp_status_t *src)
copy one snd_hwdep_dsp_status_t structure to another
Definition hwdep.c:566
int snd_hwdep_poll_descriptors_count(snd_hwdep_t *hwdep)
get count of poll descriptors for HwDep handle
Definition hwdep.c:253
unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj)
get the DSP block index
Definition hwdep.c:682
size_t snd_hwdep_info_sizeof()
get size of the snd_hwdep_info_t structure in bytes
Definition hwdep.c:330
const void * snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t *obj)
get the image pointer of the DSP block
Definition hwdep.c:715
void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int index)
set the DSP block index
Definition hwdep.c:726
unsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t *obj)
get the chip status of dsp loader
Definition hwdep.c:621
size_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t *obj)
get the length of the DSP block
Definition hwdep.c:704
int snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t **info)
allocate a new snd_hwdep_dsp_image_t structure
Definition hwdep.c:644
size_t snd_hwdep_dsp_status_sizeof()
get size of the snd_hwdep_dsp_status_t structure in bytes
Definition hwdep.c:526