Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/pcm/sound.h
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
#define SD_F_EQ_PC 0x00002000 /* EQ per-channel */ | #define SD_F_EQ_PC 0x00002000 /* EQ per-channel */ | ||||
#define SD_F_EQ_DEFAULT (SD_F_EQ | SD_F_EQ_ENABLED) | #define SD_F_EQ_DEFAULT (SD_F_EQ | SD_F_EQ_ENABLED) | ||||
#define SD_F_EQ_MASK (SD_F_EQ | SD_F_EQ_ENABLED | \ | #define SD_F_EQ_MASK (SD_F_EQ | SD_F_EQ_ENABLED | \ | ||||
SD_F_EQ_BYPASSED | SD_F_EQ_PC) | SD_F_EQ_BYPASSED | SD_F_EQ_PC) | ||||
#define SD_F_PRIO_RD 0x10000000 | #define SD_F_PRIO_RD 0x10000000 | ||||
#define SD_F_PRIO_WR 0x20000000 | #define SD_F_PRIO_WR 0x20000000 | ||||
#define SD_F_PRIO_SET (SD_F_PRIO_RD | SD_F_PRIO_WR) | |||||
#define SD_F_DIR_SET 0x40000000 | |||||
#define SD_F_TRANSIENT 0xf0000000 | |||||
#define SD_F_BITS "\020" \ | #define SD_F_BITS "\020" \ | ||||
"\001SIMPLEX" \ | "\001SIMPLEX" \ | ||||
"\002AUTOVCHAN" \ | "\002AUTOVCHAN" \ | ||||
"\003SOFTPCMVOL" \ | "\003SOFTPCMVOL" \ | ||||
"\004DYING" \ | "\004DYING" \ | ||||
"\005DETACHING" \ | "\005DETACHING" \ | ||||
"\006BUSY" \ | "\006BUSY" \ | ||||
"\007MPSAFE" \ | "\007MPSAFE" \ | ||||
"\010REGISTERED" \ | "\010REGISTERED" \ | ||||
"\011BITPERFECT" \ | "\011BITPERFECT" \ | ||||
"\012VPC" \ | "\012VPC" \ | ||||
"\013EQ" \ | "\013EQ" \ | ||||
"\014EQ_ENABLED" \ | "\014EQ_ENABLED" \ | ||||
"\015EQ_BYPASSED" \ | "\015EQ_BYPASSED" \ | ||||
"\016EQ_PC" \ | "\016EQ_PC" \ | ||||
"\035PRIO_RD" \ | "\035PRIO_RD" \ | ||||
"\036PRIO_WR" \ | "\036PRIO_WR" | ||||
"\037DIR_SET" | |||||
#define PCM_ALIVE(x) ((x) != NULL && (x)->lock != NULL && \ | #define PCM_ALIVE(x) ((x) != NULL && (x)->lock != NULL && \ | ||||
!((x)->flags & SD_F_DYING)) | !((x)->flags & SD_F_DYING)) | ||||
#define PCM_REGISTERED(x) (PCM_ALIVE(x) && \ | #define PCM_REGISTERED(x) (PCM_ALIVE(x) && \ | ||||
((x)->flags & SD_F_REGISTERED)) | ((x)->flags & SD_F_REGISTERED)) | ||||
#define PCM_DETACHING(x) ((x)->flags & SD_F_DETACHING) | #define PCM_DETACHING(x) ((x)->flags & SD_F_DETACHING) | ||||
#define PCM_CHANCOUNT(d) \ | #define PCM_CHANCOUNT(d) \ | ||||
(d->playcount + d->pvchancount + d->reccount + d->rvchancount) | (d->playcount + d->pvchancount + d->reccount + d->rvchancount) | ||||
/* many variables should be reduced to a range. Here define a macro */ | /* many variables should be reduced to a range. Here define a macro */ | ||||
#define RANGE(var, low, high) (var) = \ | #define RANGE(var, low, high) (var) = \ | ||||
(((var)<(low))? (low) : ((var)>(high))? (high) : (var)) | (((var)<(low))? (low) : ((var)>(high))? (high) : (var)) | ||||
#define DSP_BUFFSIZE (8192) | |||||
/* make figuring out what a format is easier. got AFMT_STEREO already */ | /* make figuring out what a format is easier. got AFMT_STEREO already */ | ||||
#define AFMT_32BIT (AFMT_S32_LE | AFMT_S32_BE | AFMT_U32_LE | AFMT_U32_BE) | #define AFMT_32BIT (AFMT_S32_LE | AFMT_S32_BE | AFMT_U32_LE | AFMT_U32_BE) | ||||
#define AFMT_24BIT (AFMT_S24_LE | AFMT_S24_BE | AFMT_U24_LE | AFMT_U24_BE) | #define AFMT_24BIT (AFMT_S24_LE | AFMT_S24_BE | AFMT_U24_LE | AFMT_U24_BE) | ||||
#define AFMT_16BIT (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE) | #define AFMT_16BIT (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE) | ||||
#define AFMT_G711 (AFMT_MU_LAW | AFMT_A_LAW) | #define AFMT_G711 (AFMT_MU_LAW | AFMT_A_LAW) | ||||
#define AFMT_8BIT (AFMT_G711 | AFMT_U8 | AFMT_S8) | #define AFMT_8BIT (AFMT_G711 | AFMT_U8 | AFMT_S8) | ||||
#define AFMT_SIGNED (AFMT_S32_LE | AFMT_S32_BE | AFMT_S24_LE | AFMT_S24_BE | \ | #define AFMT_SIGNED (AFMT_S32_LE | AFMT_S32_BE | AFMT_S24_LE | AFMT_S24_BE | \ | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | enum { | ||||
SND_DEV_DSPHW_PLAY, /* specific playback channel */ | SND_DEV_DSPHW_PLAY, /* specific playback channel */ | ||||
SND_DEV_DSPHW_VPLAY, /* specific virtual playback channel */ | SND_DEV_DSPHW_VPLAY, /* specific virtual playback channel */ | ||||
SND_DEV_DSPHW_REC, /* specific record channel */ | SND_DEV_DSPHW_REC, /* specific record channel */ | ||||
SND_DEV_DSPHW_VREC, /* specific virtual record channel */ | SND_DEV_DSPHW_VREC, /* specific virtual record channel */ | ||||
}; | }; | ||||
#define DSP_DEFAULT_SPEED 8000 | #define DSP_DEFAULT_SPEED 8000 | ||||
#define ON 1 | |||||
#define OFF 0 | |||||
extern int pcm_veto_load; | extern int pcm_veto_load; | ||||
extern int snd_unit; | extern int snd_unit; | ||||
extern int snd_verbose; | extern int snd_verbose; | ||||
extern devclass_t pcm_devclass; | extern devclass_t pcm_devclass; | ||||
extern struct unrhdr *pcmsg_unrhdr; | extern struct unrhdr *pcmsg_unrhdr; | ||||
/* | |||||
* some macros for debugging purposes | |||||
* DDB/DEB to enable/disable debugging stuff | |||||
* BVDDB to enable debugging when bootverbose | |||||
*/ | |||||
#define BVDDB(x) if (bootverbose) x | |||||
#ifndef DEB | #ifndef DEB | ||||
#define DEB(x) | #define DEB(x) | ||||
#endif | #endif | ||||
SYSCTL_DECL(_hw_snd); | SYSCTL_DECL(_hw_snd); | ||||
int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, | int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, | ||||
▲ Show 20 Lines • Show All 284 Lines • Show Last 20 Lines |