mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
- added the hwdep DSP loader API functions.
- updated the internal asound.h.
This commit is contained in:
parent
c25bf7ef7b
commit
74f0165c97
4 changed files with 336 additions and 3 deletions
|
|
@ -44,6 +44,12 @@ extern "C" {
|
|||
/** HwDep information container */
|
||||
typedef struct _snd_hwdep_info snd_hwdep_info_t;
|
||||
|
||||
/** 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;
|
||||
|
||||
/** HwDep interface */
|
||||
typedef enum _snd_hwdep_iface {
|
||||
SND_HWDEP_IFACE_OPL2 = 0, /**< OPL2 raw driver */
|
||||
|
|
@ -53,7 +59,9 @@ typedef enum _snd_hwdep_iface {
|
|||
SND_HWDEP_IFACE_EMU10K1, /**< EMU10K1 driver */
|
||||
SND_HWDEP_IFACE_YSS225, /**< YSS225 driver */
|
||||
SND_HWDEP_IFACE_ICS2115, /**< ICS2115 driver */
|
||||
SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_ICS2115 /**< last know hwdep interface */
|
||||
SND_HWDEP_IFACE_SSCAPE, /**< Ensoniq SoundScape ISA card (MC68EC000) */
|
||||
SND_HWDEP_IFACE_VX, /**< Digigram VX cards */
|
||||
SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_VX /**< last know hwdep interface */
|
||||
} snd_hwdep_iface_t;
|
||||
|
||||
/** open for reading */
|
||||
|
|
@ -84,6 +92,8 @@ int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned
|
|||
int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
|
||||
int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock);
|
||||
int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info);
|
||||
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);
|
||||
int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg);
|
||||
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);
|
||||
|
|
@ -102,6 +112,36 @@ 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);
|
||||
|
||||
size_t snd_hwdep_dsp_status_sizeof(void);
|
||||
/** allocate #snd_hwdep_dsp_status_t container on stack */
|
||||
#define snd_hwdep_dsp_status_alloca(ptr) do { assert(ptr); *ptr = (snd_hwdep_dsp_status_t *) alloca(snd_hwdep_dsp_status_sizeof()); memset(*ptr, 0, snd_hwdep_dsp_status_sizeof()); } while (0)
|
||||
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 */
|
||||
#define snd_hwdep_dsp_image_alloca(ptr) do { assert(ptr); *ptr = (snd_hwdep_dsp_image_t *) alloca(snd_hwdep_dsp_image_sizeof()); memset(*ptr, 0, snd_hwdep_dsp_image_sizeof()); } while (0)
|
||||
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);
|
||||
|
||||
void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int index);
|
||||
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);
|
||||
|
||||
/** \} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@
|
|||
#define _snd_rawmidi_status sndrv_rawmidi_status
|
||||
|
||||
#define _snd_hwdep_info sndrv_hwdep_info
|
||||
#define _snd_hwdep_dsp_status sndrv_hwdep_dsp_status
|
||||
#define _snd_hwdep_dsp_image sndrv_hwdep_dsp_image
|
||||
|
||||
#define _snd_seq_queue_tempo sndrv_seq_queue_tempo
|
||||
#define _snd_seq_client_info sndrv_seq_client_info
|
||||
|
|
|
|||
|
|
@ -104,9 +104,10 @@ enum sndrv_hwdep_iface {
|
|||
SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
|
||||
SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
|
||||
SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
|
||||
SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */
|
||||
|
||||
/* Don't forget to change the following: */
|
||||
SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SSCAPE,
|
||||
SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_VX,
|
||||
};
|
||||
|
||||
struct sndrv_hwdep_info {
|
||||
|
|
@ -118,9 +119,27 @@ struct sndrv_hwdep_info {
|
|||
unsigned char reserved[64]; /* reserved for future */
|
||||
};
|
||||
|
||||
/* generic DSP loader */
|
||||
struct sndrv_hwdep_dsp_status {
|
||||
unsigned int version; /* R: driver-specific version */
|
||||
unsigned char id[32]; /* R: driver-specific ID string */
|
||||
unsigned int num_dsps; /* R: number of DSP images to transfer */
|
||||
unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */
|
||||
unsigned int chip_ready; /* R: 1 = initialization finished */
|
||||
};
|
||||
|
||||
struct sndrv_hwdep_dsp_image {
|
||||
unsigned int index; /* W: DSP index */
|
||||
unsigned char name[64]; /* W: ID (e.g. file name) */
|
||||
unsigned char *image; /* W: binary image */
|
||||
size_t length; /* W: size of image in bytes */
|
||||
};
|
||||
|
||||
enum {
|
||||
SNDRV_HWDEP_IOCTL_PVERSION = _IOR ('H', 0x00, int),
|
||||
SNDRV_HWDEP_IOCTL_INFO = _IOR ('H', 0x01, struct sndrv_hwdep_info),
|
||||
SNDRV_HWDEP_IOCTL_DSP_STATUS = _IOR('H', 0x02, struct sndrv_hwdep_dsp_status),
|
||||
SNDRV_HWDEP_IOCTL_DSP_LOAD = _IOW('H', 0x03, struct sndrv_hwdep_dsp_image)
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
@ -129,7 +148,7 @@ enum {
|
|||
* *
|
||||
*****************************************************************************/
|
||||
|
||||
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2)
|
||||
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3)
|
||||
|
||||
typedef unsigned long sndrv_pcm_uframes_t;
|
||||
typedef long sndrv_pcm_sframes_t;
|
||||
|
|
@ -423,6 +442,7 @@ enum {
|
|||
SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, struct sndrv_pcm_sw_params),
|
||||
SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct sndrv_pcm_status),
|
||||
SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, sndrv_pcm_sframes_t),
|
||||
SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22),
|
||||
SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct sndrv_pcm_channel_info),
|
||||
SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40),
|
||||
SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue