2001-09-13 11:38:32 +00:00
|
|
|
/**
|
2005-01-17 17:34:31 +00:00
|
|
|
* \file include/hwdep.h
|
2001-09-13 11:38:32 +00:00
|
|
|
* \brief Application interface library for the ALSA driver
|
2007-10-15 10:24:55 +02:00
|
|
|
* \author Jaroslav Kysela <perex@perex.cz>
|
2001-09-13 11:38:32 +00:00
|
|
|
* \author Abramo Bagnara <abramo@alsa-project.org>
|
|
|
|
|
* \author Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
* \date 1998-2001
|
|
|
|
|
*
|
|
|
|
|
* Application interface library for the ALSA driver
|
2005-01-17 17:34:31 +00:00
|
|
|
*/
|
|
|
|
|
/*
|
2001-09-13 11:38:32 +00:00
|
|
|
* This library is free software; you can redistribute it and/or modify
|
2001-12-30 09:22:54 +00:00
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
* published by the Free Software Foundation; either version 2.1 of
|
2001-09-13 11:38:32 +00:00
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2001-12-30 09:22:54 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2001-09-13 11:38:32 +00:00
|
|
|
*
|
2001-12-30 09:22:54 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2001-09-13 11:38:32 +00:00
|
|
|
* License along with this library; if not, write to the Free Software
|
2017-11-14 14:29:26 +01:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-09-13 11:38:32 +00:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __ALSA_HWDEP_H
|
|
|
|
|
#define __ALSA_HWDEP_H
|
2000-01-10 10:07:53 +00:00
|
|
|
|
2001-11-14 11:40:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-07-11 15:48:27 +00:00
|
|
|
/**
|
|
|
|
|
* \defgroup HwDep Hardware Dependant Interface
|
|
|
|
|
* The Hardware Dependant Interface.
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
2001-08-15 12:12:16 +00:00
|
|
|
/** dlsym version for interface entry callback */
|
|
|
|
|
#define SND_HWDEP_DLSYM_VERSION _dlsym_hwdep_001
|
|
|
|
|
|
2001-03-29 10:11:38 +00:00
|
|
|
/** HwDep information container */
|
2001-02-05 15:44:42 +00:00
|
|
|
typedef struct _snd_hwdep_info snd_hwdep_info_t;
|
|
|
|
|
|
2003-02-19 15:39:35 +00:00
|
|
|
/** HwDep DSP status container */
|
|
|
|
|
typedef struct _snd_hwdep_dsp_status snd_hwdep_dsp_status_t;
|
|
|
|
|
|
|
|
|
|
/** HwDep DSP image container */
|
|
|
|
|
typedef struct _snd_hwdep_dsp_image snd_hwdep_dsp_image_t;
|
|
|
|
|
|
2001-07-13 10:00:19 +00:00
|
|
|
/** HwDep interface */
|
2001-03-29 11:18:16 +00:00
|
|
|
typedef enum _snd_hwdep_iface {
|
2001-08-20 13:15:30 +00:00
|
|
|
SND_HWDEP_IFACE_OPL2 = 0, /**< OPL2 raw driver */
|
|
|
|
|
SND_HWDEP_IFACE_OPL3, /**< OPL3 raw driver */
|
|
|
|
|
SND_HWDEP_IFACE_OPL4, /**< OPL4 raw driver */
|
|
|
|
|
SND_HWDEP_IFACE_SB16CSP, /**< SB16CSP driver */
|
|
|
|
|
SND_HWDEP_IFACE_EMU10K1, /**< EMU10K1 driver */
|
|
|
|
|
SND_HWDEP_IFACE_YSS225, /**< YSS225 driver */
|
|
|
|
|
SND_HWDEP_IFACE_ICS2115, /**< ICS2115 driver */
|
2003-02-19 15:39:35 +00:00
|
|
|
SND_HWDEP_IFACE_SSCAPE, /**< Ensoniq SoundScape ISA card (MC68EC000) */
|
|
|
|
|
SND_HWDEP_IFACE_VX, /**< Digigram VX cards */
|
2003-09-08 17:26:17 +00:00
|
|
|
SND_HWDEP_IFACE_MIXART, /**< Digigram miXart cards */
|
|
|
|
|
SND_HWDEP_IFACE_USX2Y, /**< Tascam US122, US224 & US428 usb */
|
2004-11-09 13:12:35 +00:00
|
|
|
SND_HWDEP_IFACE_EMUX_WAVETABLE, /**< EmuX wavetable */
|
|
|
|
|
SND_HWDEP_IFACE_BLUETOOTH, /**< Bluetooth audio */
|
2005-04-29 15:29:29 +00:00
|
|
|
SND_HWDEP_IFACE_USX2Y_PCM, /**< Tascam US122, US224 & US428 raw USB PCM */
|
|
|
|
|
SND_HWDEP_IFACE_PCXHR, /**< Digigram PCXHR */
|
|
|
|
|
SND_HWDEP_IFACE_SB_RC, /**< SB Extigy/Audigy2NX remote control */
|
2014-08-18 18:45:17 +09:00
|
|
|
SND_HWDEP_IFACE_HDA, /**< HD-audio */
|
|
|
|
|
SND_HWDEP_IFACE_USB_STREAM, /**< direct access to usb stream */
|
|
|
|
|
SND_HWDEP_IFACE_FW_DICE, /**< TC DICE FireWire device */
|
|
|
|
|
SND_HWDEP_IFACE_FW_FIREWORKS, /**< Echo Audio Fireworks based device */
|
|
|
|
|
SND_HWDEP_IFACE_FW_BEBOB, /**< BridgeCo BeBoB based device */
|
2014-11-29 01:03:34 +09:00
|
|
|
SND_HWDEP_IFACE_FW_OXFW, /**< Oxford OXFW970/971 based device */
|
2015-10-06 01:08:59 +09:00
|
|
|
SND_HWDEP_IFACE_FW_DIGI00X, /* Digidesign Digi 002/003 family */
|
|
|
|
|
SND_HWDEP_IFACE_FW_TASCAM, /* TASCAM FireWire series */
|
2017-04-22 00:28:00 +09:00
|
|
|
SND_HWDEP_IFACE_LINE6, /* Line6 USB processors */
|
2017-04-22 00:28:01 +09:00
|
|
|
SND_HWDEP_IFACE_FW_MOTU, /* MOTU FireWire series */
|
|
|
|
|
SND_HWDEP_IFACE_FW_FIREFACE, /* RME Fireface series */
|
2014-08-18 18:45:17 +09:00
|
|
|
|
2017-04-22 00:28:01 +09:00
|
|
|
SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_FIREFACE, /**< last known hwdep interface */
|
2001-03-29 11:18:16 +00:00
|
|
|
} snd_hwdep_iface_t;
|
2001-01-30 16:51:26 +00:00
|
|
|
|
2001-07-13 10:00:19 +00:00
|
|
|
/** open for reading */
|
2000-01-10 10:07:53 +00:00
|
|
|
#define SND_HWDEP_OPEN_READ (O_RDONLY)
|
2001-07-13 10:00:19 +00:00
|
|
|
/** open for writing */
|
2000-01-10 10:07:53 +00:00
|
|
|
#define SND_HWDEP_OPEN_WRITE (O_WRONLY)
|
2001-07-13 10:00:19 +00:00
|
|
|
/** open for reading and writing */
|
2000-01-10 10:07:53 +00:00
|
|
|
#define SND_HWDEP_OPEN_DUPLEX (O_RDWR)
|
2002-01-28 18:11:45 +00:00
|
|
|
/** open mode flag: open in nonblock mode */
|
2000-01-10 10:07:53 +00:00
|
|
|
#define SND_HWDEP_OPEN_NONBLOCK (O_NONBLOCK)
|
|
|
|
|
|
2001-07-13 10:00:19 +00:00
|
|
|
/** HwDep handle type */
|
|
|
|
|
typedef enum _snd_hwdep_type {
|
|
|
|
|
/** Kernel level HwDep */
|
|
|
|
|
SND_HWDEP_TYPE_HW,
|
|
|
|
|
/** Shared memory client HwDep (not yet implemented) */
|
|
|
|
|
SND_HWDEP_TYPE_SHM,
|
|
|
|
|
/** INET client HwDep (not yet implemented) */
|
2002-02-05 11:36:20 +00:00
|
|
|
SND_HWDEP_TYPE_INET
|
2001-07-13 10:00:19 +00:00
|
|
|
} snd_hwdep_type_t;
|
|
|
|
|
|
2001-03-29 10:11:38 +00:00
|
|
|
/** HwDep handle */
|
2001-02-01 07:52:30 +00:00
|
|
|
typedef struct _snd_hwdep snd_hwdep_t;
|
|
|
|
|
|
2001-07-13 10:00:19 +00:00
|
|
|
int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode);
|
2001-02-12 23:51:49 +00:00
|
|
|
int snd_hwdep_close(snd_hwdep_t *hwdep);
|
|
|
|
|
int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space);
|
2014-09-17 07:07:03 +09:00
|
|
|
int snd_hwdep_poll_descriptors_count(snd_hwdep_t *hwdep);
|
2001-11-30 17:36:45 +00:00
|
|
|
int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
|
2001-07-13 10:00:19 +00:00
|
|
|
int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock);
|
2001-02-12 23:51:49 +00:00
|
|
|
int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info);
|
2003-02-19 15:39:35 +00:00
|
|
|
int snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *status);
|
|
|
|
|
int snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block);
|
2001-03-29 17:50:28 +00:00
|
|
|
int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg);
|
2001-02-12 23:51:49 +00:00
|
|
|
ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size);
|
|
|
|
|
ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size);
|
2000-01-10 10:07:53 +00:00
|
|
|
|
2001-07-11 15:48:27 +00:00
|
|
|
size_t snd_hwdep_info_sizeof(void);
|
2001-07-13 10:00:19 +00:00
|
|
|
/** allocate #snd_hwdep_info_t container on stack */
|
2007-10-25 15:36:03 +02:00
|
|
|
#define snd_hwdep_info_alloca(ptr) __snd_alloca(ptr, snd_hwdep_info)
|
2001-07-11 15:48:27 +00:00
|
|
|
int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr);
|
|
|
|
|
void snd_hwdep_info_free(snd_hwdep_info_t *obj);
|
|
|
|
|
void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src);
|
|
|
|
|
|
|
|
|
|
unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj);
|
|
|
|
|
int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj);
|
|
|
|
|
const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj);
|
|
|
|
|
const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj);
|
|
|
|
|
snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj);
|
|
|
|
|
void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val);
|
|
|
|
|
|
2003-02-19 15:39:35 +00:00
|
|
|
size_t snd_hwdep_dsp_status_sizeof(void);
|
|
|
|
|
/** allocate #snd_hwdep_dsp_status_t container on stack */
|
2007-10-25 15:36:03 +02:00
|
|
|
#define snd_hwdep_dsp_status_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_status)
|
2003-02-19 15:39:35 +00:00
|
|
|
int snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t **ptr);
|
|
|
|
|
void snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t *obj);
|
|
|
|
|
void snd_hwdep_dsp_status_copy(snd_hwdep_dsp_status_t *dst, const snd_hwdep_dsp_status_t *src);
|
|
|
|
|
|
|
|
|
|
unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj);
|
|
|
|
|
const char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj);
|
|
|
|
|
unsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t *obj);
|
|
|
|
|
unsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t *obj);
|
|
|
|
|
unsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t *obj);
|
|
|
|
|
|
|
|
|
|
size_t snd_hwdep_dsp_image_sizeof(void);
|
|
|
|
|
/** allocate #snd_hwdep_dsp_image_t container on stack */
|
2007-10-25 15:36:03 +02:00
|
|
|
#define snd_hwdep_dsp_image_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_image)
|
2003-02-19 15:39:35 +00:00
|
|
|
int snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t **ptr);
|
|
|
|
|
void snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t *obj);
|
|
|
|
|
void snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src);
|
|
|
|
|
|
|
|
|
|
unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj);
|
|
|
|
|
const char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj);
|
|
|
|
|
const void *snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t *obj);
|
|
|
|
|
size_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t *obj);
|
|
|
|
|
|
2004-09-21 10:35:57 +00:00
|
|
|
void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int _index);
|
2003-02-19 15:39:35 +00:00
|
|
|
void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name);
|
|
|
|
|
void snd_hwdep_dsp_image_set_image(snd_hwdep_dsp_image_t *obj, void *buffer);
|
|
|
|
|
void snd_hwdep_dsp_image_set_length(snd_hwdep_dsp_image_t *obj, size_t length);
|
|
|
|
|
|
2001-11-14 11:40:46 +00:00
|
|
|
/** \} */
|
|
|
|
|
|
2000-01-10 10:07:53 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-09-13 11:38:32 +00:00
|
|
|
#endif /* __ALSA_HWDEP_H */
|
|
|
|
|
|