FreeBSD kernel sound device code
|
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/eventhandler.h>
#include <sys/ioccom.h>
#include <sys/filio.h>
#include <sys/sockio.h>
#include <sys/fcntl.h>
#include <sys/selinfo.h>
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/uio.h>
#include <sys/syslog.h>
#include <sys/errno.h>
#include <sys/malloc.h>
#include <sys/bus.h>
#include <machine/resource.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <sys/limits.h>
#include <sys/mman.h>
#include <sys/poll.h>
#include <sys/sbuf.h>
#include <sys/soundcard.h>
#include <sys/sndstat.h>
#include <sys/sysctl.h>
#include <sys/kobj.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <dev/sound/pcm/buffer.h>
#include <dev/sound/pcm/matrix.h>
#include <dev/sound/pcm/matrix_map.h>
#include <dev/sound/pcm/channel.h>
#include <dev/sound/pcm/feeder.h>
#include <dev/sound/pcm/mixer.h>
#include <dev/sound/pcm/dsp.h>
#include <dev/sound/clone.h>
#include <dev/sound/unit.h>
Go to the source code of this file.
Data Structures | |
struct | snddev_info |
Macros | |
#define | KOBJMETHOD_END { NULL, NULL } |
#define | PCM_SOFTC_SIZE (sizeof(struct snddev_info)) |
#define | SND_STATUSLEN 64 |
#define | SOUND_MODVER 5 |
#define | SOUND_MINVER SOUND_MODVER |
#define | SOUND_PREFVER SOUND_MODVER |
#define | SOUND_MAXVER SOUND_MODVER |
#define | PCMMAXUNIT (snd_max_u()) |
#define | PCMMAXDEV (snd_max_d()) |
#define | PCMMAXCHAN (snd_max_c()) |
#define | PCMMAXCLONE PCMMAXCHAN |
#define | PCMUNIT(x) (snd_unit2u(dev2unit(x))) |
#define | PCMDEV(x) (snd_unit2d(dev2unit(x))) |
#define | PCMCHAN(x) (snd_unit2c(dev2unit(x))) |
#define | PCMMINOR(x) (x) |
#define | SND_MAXHWCHAN 256 |
#define | SND_MAXVCHANS SND_MAXHWCHAN |
#define | SD_F_SIMPLEX 0x00000001 |
#define | SD_F_AUTOVCHAN 0x00000002 |
#define | SD_F_SOFTPCMVOL 0x00000004 |
#define | SD_F_DYING 0x00000008 |
#define | SD_F_DETACHING 0x00000010 |
#define | SD_F_BUSY 0x00000020 |
#define | SD_F_MPSAFE 0x00000040 |
#define | SD_F_REGISTERED 0x00000080 |
#define | SD_F_BITPERFECT 0x00000100 |
#define | SD_F_VPC 0x00000200 /* volume-per-channel */ |
#define | SD_F_EQ 0x00000400 /* EQ */ |
#define | SD_F_EQ_ENABLED 0x00000800 /* EQ enabled */ |
#define | SD_F_EQ_BYPASSED 0x00001000 /* EQ bypassed */ |
#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_MASK |
#define | SD_F_PRIO_RD 0x10000000 |
#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 |
#define | PCM_ALIVE(x) |
#define | PCM_REGISTERED(x) |
#define | PCM_DETACHING(x) ((x)->flags & SD_F_DETACHING) |
#define | RANGE(var, low, high) |
#define | DSP_BUFFSIZE (8192) |
#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_16BIT (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE) |
#define | AFMT_G711 (AFMT_MU_LAW | AFMT_A_LAW) |
#define | AFMT_8BIT (AFMT_G711 | AFMT_U8 | AFMT_S8) |
#define | AFMT_SIGNED |
#define | AFMT_BIGENDIAN |
#define | AFMT_CONVERTIBLE |
#define | AFMT_VCHAN (AFMT_CONVERTIBLE & ~AFMT_G711) |
#define | AFMT_PASSTHROUGH AFMT_AC3 |
#define | AFMT_PASSTHROUGH_RATE 48000 |
#define | AFMT_PASSTHROUGH_CHANNEL 2 |
#define | AFMT_PASSTHROUGH_EXTCHANNEL 0 |
#define | AFMT_ENCODING_MASK 0xf00fffff |
#define | AFMT_CHANNEL_MASK 0x07f00000 |
#define | AFMT_CHANNEL_SHIFT 20 |
#define | AFMT_CHANNEL_MAX 0x7f |
#define | AFMT_EXTCHANNEL_MASK 0x08000000 |
#define | AFMT_EXTCHANNEL_SHIFT 27 |
#define | AFMT_EXTCHANNEL_MAX 1 |
#define | AFMT_ENCODING(v) ((v) & AFMT_ENCODING_MASK) |
#define | AFMT_EXTCHANNEL(v) |
#define | AFMT_CHANNEL(v) |
#define | AFMT_BIT(v) |
#define | AFMT_BPS(v) (AFMT_BIT(v) >> 3) |
#define | AFMT_ALIGN(v) (AFMT_BPS(v) * AFMT_CHANNEL(v)) |
#define | SND_FORMAT(f, c, e) |
#define | AFMT_U8_NE AFMT_U8 |
#define | AFMT_S8_NE AFMT_S8 |
#define | AFMT_SIGNED_NE (AFMT_S8_NE | AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE) |
#define | AFMT_NE |
#define | SND_DEV_CTL 0 /* Control port /dev/mixer */ |
#define | SND_DEV_SEQ 1 /* Sequencer /dev/sequencer */ |
#define | SND_DEV_MIDIN 2 /* Raw midi access */ |
#define | SND_DEV_DSP 3 /* Digitized voice /dev/dsp */ |
#define | SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */ |
#define | SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */ |
#define | SND_DEV_STATUS 6 /* /dev/sndstat */ |
#define | SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */ |
#define | SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */ |
#define | SND_DEV_PSS SND_DEV_SNDPROC /* ? */ |
#define | SND_DEV_NORESET 10 |
#define | SND_DEV_DSPHW_PLAY 11 /* specific playback channel */ |
#define | SND_DEV_DSPHW_VPLAY 12 /* specific virtual playback channel */ |
#define | SND_DEV_DSPHW_REC 13 /* specific record channel */ |
#define | SND_DEV_DSPHW_VREC 14 /* specific virtual record channel */ |
#define | SND_DEV_DSPHW_CD 15 /* s16le/stereo 44100Hz CD */ |
#define | SND_DEV_DSP_MMAP 16 /* /dev/dsp_mmap */ |
#define | SND_DEV_DSP_AC3 17 /* /dev/dsp_ac3 */ |
#define | SND_DEV_DSP_MULTICH 18 /* /dev/dsp_multich */ |
#define | SND_DEV_DSP_SPDIFOUT 19 /* /dev/dsp_spdifout */ |
#define | SND_DEV_DSP_SPDIFIN 20 /* /dev/dsp_spdifin */ |
#define | SND_DEV_LAST SND_DEV_DSP_SPDIFIN |
#define | SND_DEV_MAX PCMMAXDEV |
#define | DSP_DEFAULT_SPEED 8000 |
#define | ON 1 |
#define | OFF 0 |
#define | BVDDB(x) if (bootverbose) x |
#define | DEB(x) |
#define | snd_mtxlock(m) mtx_lock(m) |
#define | snd_mtxunlock(m) mtx_unlock(m) |
#define | SND_DECLARE_FILE(version) _SND_DECLARE_FILE(__LINE__, version) |
#define | _SND_DECLARE_FILE(uniq, version) __SND_DECLARE_FILE(uniq, version) |
#define | __SND_DECLARE_FILE(uniq, version) |
#define | DV_F_DRQ_MASK 0x00000007 /* mask for secondary drq */ |
#define | DV_F_DUAL_DMA 0x00000010 /* set to use secondary dma channel */ |
#define | DV_F_DEV_MASK 0x0000ff00 /* force device type/class */ |
#define | DV_F_DEV_SHIFT 8 /* force device type/class */ |
#define | PCM_MODE_MIXER 0x01 |
#define | PCM_MODE_PLAY 0x02 |
#define | PCM_MODE_REC 0x04 |
#define | PCM_LOCKOWNED(d) mtx_owned((d)->lock) |
#define | PCM_LOCK(d) mtx_lock((d)->lock) |
#define | PCM_UNLOCK(d) mtx_unlock((d)->lock) |
#define | PCM_TRYLOCK(d) mtx_trylock((d)->lock) |
#define | PCM_LOCKASSERT(d) mtx_assert((d)->lock, MA_OWNED) |
#define | PCM_UNLOCKASSERT(d) mtx_assert((d)->lock, MA_NOTOWNED) |
#define | PCM_WAIT(x) |
#define | PCM_ACQUIRE(x) |
#define | PCM_RELEASE(x) |
#define | PCM_ACQUIRE_QUICK(x) |
#define | PCM_RELEASE_QUICK(x) |
#define | PCM_BUSYASSERT(x) |
#define | PCM_GIANT_ENTER(x) |
#define | PCM_GIANT_EXIT(x) |
#define | PCM_GIANT_LEAVE(x) |
#define | PCM_KLDSTRING(a) "" |
Typedefs | |
typedef int(* | sndstat_handler) (struct sbuf *s, device_t dev, int verbose) |
Functions | |
SYSCTL_DECL (_hw_snd) | |
int | pcm_setvchans (struct snddev_info *d, int direction, int newcnt, int num) |
int | pcm_chnalloc (struct snddev_info *d, struct pcm_channel **ch, int direction, pid_t pid, char *comm, int devunit) |
int | pcm_chnrelease (struct pcm_channel *c) |
int | pcm_chnref (struct pcm_channel *c, int ref) |
int | pcm_inprog (struct snddev_info *d, int delta) |
struct pcm_channel * | pcm_chn_create (struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, int dir, int num, void *devinfo) |
int | pcm_chn_destroy (struct pcm_channel *ch) |
int | pcm_chn_add (struct snddev_info *d, struct pcm_channel *ch) |
int | pcm_chn_remove (struct snddev_info *d, struct pcm_channel *ch) |
int | pcm_addchan (device_t dev, int dir, kobj_class_t cls, void *devinfo) |
unsigned int | pcm_getbuffersize (device_t dev, unsigned int minbufsz, unsigned int deflt, unsigned int maxbufsz) |
int | pcm_register (device_t dev, void *devinfo, int numplay, int numrec) |
int | pcm_unregister (device_t dev) |
int | pcm_setstatus (device_t dev, char *str) |
u_int32_t | pcm_getflags (device_t dev) |
void | pcm_setflags (device_t dev, u_int32_t val) |
void * | pcm_getdevinfo (device_t dev) |
int | snd_setup_intr (device_t dev, struct resource *res, int flags, driver_intr_t hand, void *param, void **cookiep) |
void * | snd_mtxcreate (const char *desc, const char *type) |
void | snd_mtxfree (void *m) |
void | snd_mtxassert (void *m) |
int | sndstat_register (device_t dev, char *str, sndstat_handler handler) |
int | sndstat_registerfile (char *str) |
int | sndstat_unregister (device_t dev) |
int | sndstat_unregisterfile (char *str) |
void | sound_oss_sysinfo (oss_sysinfo *) |
Handle OSSv4 SNDCTL_SYSINFO ioctl. More... | |
int | sound_oss_card_info (oss_card_info *) |
Variables | |
int | pcm_veto_load |
int | snd_unit |
int | snd_maxautovchans |
int | snd_verbose |
devclass_t | pcm_devclass |
struct unrhdr * | pcmsg_unrhdr |
Unit number allocator for syncgroup IDs. More... | |
#define __SND_DECLARE_FILE | ( | uniq, | |
version | |||
) |
#define _SND_DECLARE_FILE | ( | uniq, | |
version | |||
) | __SND_DECLARE_FILE(uniq, version) |
#define AFMT_16BIT (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE) |
#define AFMT_24BIT (AFMT_S24_LE | AFMT_S24_BE | AFMT_U24_LE | AFMT_U24_BE) |
#define AFMT_32BIT (AFMT_S32_LE | AFMT_S32_BE | AFMT_U32_LE | AFMT_U32_BE) |
#define AFMT_ALIGN | ( | v | ) | (AFMT_BPS(v) * AFMT_CHANNEL(v)) |
#define AFMT_BIGENDIAN |
#define AFMT_BIT | ( | v | ) |
#define AFMT_CHANNEL | ( | v | ) |
#define AFMT_CONVERTIBLE |
#define AFMT_ENCODING | ( | v | ) | ((v) & AFMT_ENCODING_MASK) |
#define AFMT_EXTCHANNEL | ( | v | ) |
#define AFMT_NE |
#define AFMT_SIGNED |
#define AFMT_SIGNED_NE (AFMT_S8_NE | AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE) |
#define AFMT_VCHAN (AFMT_CONVERTIBLE & ~AFMT_G711) |
#define DV_F_DRQ_MASK 0x00000007 /* mask for secondary drq */ |
#define PCM_ACQUIRE | ( | x | ) |
#define PCM_ACQUIRE_QUICK | ( | x | ) |
#define PCM_ALIVE | ( | x | ) |
#define PCM_BUSYASSERT | ( | x | ) |
#define PCM_DETACHING | ( | x | ) | ((x)->flags & SD_F_DETACHING) |
#define PCM_GIANT_ENTER | ( | x | ) |
#define PCM_GIANT_EXIT | ( | x | ) |
#define PCM_GIANT_LEAVE | ( | x | ) |
#define PCM_REGISTERED | ( | x | ) |
#define PCM_RELEASE | ( | x | ) |
#define PCM_RELEASE_QUICK | ( | x | ) |
#define PCM_SOFTC_SIZE (sizeof(struct snddev_info)) |
#define PCM_UNLOCKASSERT | ( | d | ) | mtx_assert((d)->lock, MA_NOTOWNED) |
#define PCM_WAIT | ( | x | ) |
#define PCMCHAN | ( | x | ) | (snd_unit2c(dev2unit(x))) |
#define PCMDEV | ( | x | ) | (snd_unit2d(dev2unit(x))) |
#define PCMMAXCLONE PCMMAXCHAN |
#define PCMUNIT | ( | x | ) | (snd_unit2u(dev2unit(x))) |
#define RANGE | ( | var, | |
low, | |||
high | |||
) |
#define SD_F_BITS |
#define SD_F_EQ_DEFAULT (SD_F_EQ | SD_F_EQ_ENABLED) |
#define SD_F_EQ_MASK |
#define SD_F_PRIO_SET (SD_F_PRIO_RD | SD_F_PRIO_WR) |
#define SND_DECLARE_FILE | ( | version | ) | _SND_DECLARE_FILE(__LINE__, version) |
#define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */ |
#define SND_DEV_DSPHW_PLAY 11 /* specific playback channel */ |
#define SND_DEV_DSPHW_VPLAY 12 /* specific virtual playback channel */ |
#define SND_DEV_DSPHW_VREC 14 /* specific virtual record channel */ |
#define SND_DEV_LAST SND_DEV_DSP_SPDIFIN |
#define SND_DEV_PSS SND_DEV_SNDPROC /* ? */ |
#define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */ |
#define SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */ |
#define SND_FORMAT | ( | f, | |
c, | |||
e | |||
) |
#define SND_MAXVCHANS SND_MAXHWCHAN |
#define SOUND_MAXVER SOUND_MODVER |
#define SOUND_MINVER SOUND_MODVER |
#define SOUND_PREFVER SOUND_MODVER |
typedef int(* sndstat_handler) (struct sbuf *s, device_t dev, int verbose) |
int pcm_addchan | ( | device_t | dev, |
int | dir, | ||
kobj_class_t | cls, | ||
void * | devinfo | ||
) |
Definition at line 692 of file sound.c.
References dev, snddev_info::dev, devinfo, dir, pcm_channel::name, PCM_BUSYASSERT, pcm_chn_add(), pcm_chn_create(), pcm_chn_destroy(), PCM_LOCK, and PCM_UNLOCK.
Referenced by ad1816_attach(), als_pci_attach(), aoa_attach(), atiixp_chip_post_init(), audio_soc_init(), cmi_attach(), cs4281_pci_attach(), emu_pci_attach(), emu_pcm_attach(), envy24_pci_attach(), envy24ht_pci_attach(), es_pci_attach(), ess_attach(), fm801_pci_attach(), hdaa_pcm_attach(), hdspe_pcm_attach(), ich_pci_attach(), m3_pci_attach(), mss_doattach(), nm_pci_attach(), pcmcsa_attach(), sb16_attach(), sb_attach(), sv_attach(), tr_pci_attach(), uaudio_attach_sub(), and via_attach().
int pcm_chn_add | ( | struct snddev_info * | d, |
struct pcm_channel * | ch | ||
) |
Definition at line 618 of file sound.c.
References snddev_info::channels, CHN_DEV, CHN_INSERT_SORT_ASCEND, snddev_info::devcount, pcm_channel::direction, PCM_BUSYASSERT, PCM_LOCKASSERT, PCMDIR_PLAY, PCMDIR_REC, snddev_info::playcount, snddev_info::pvchancount, snddev_info::reccount, snddev_info::rvchancount, SND_DEV_DSPHW_PLAY, SND_DEV_DSPHW_REC, SND_DEV_DSPHW_VPLAY, and SND_DEV_DSPHW_VREC.
Referenced by pcm_addchan(), and vchan_create().
struct pcm_channel * pcm_chn_create | ( | struct snddev_info * | d, |
struct pcm_channel * | parent, | ||
kobj_class_t | cls, | ||
int | dir, | ||
int | num, | ||
void * | devinfo | ||
) |
Definition at line 483 of file sound.c.
References buf, chan, pcm_channel::channels, CHN_CHAN, CHN_COMM_UNUSED, CHN_DEV, CHN_FOREACH, chn_init(), CHN_NAMELEN, pcm_channel::comm, pcm_channel::dev, snddev_info::dev, devinfo, dir, pcm_channel::direction, dsp_unit2name(), free, max, pcm_channel::methods, pcm_channel::name, pcm_channel::parentchannel, pcm_channel::parentsnddev, PCM_BUSYASSERT, PCM_LOCK, PCM_LOCKASSERT, PCM_UNLOCK, PCMDIR_PLAY, PCMDIR_PLAY_VIRTUAL, PCMDIR_REC, PCMDIR_REC_VIRTUAL, PCMTRIG_STOP, pcm_channel::pid, snddev_info::playcount, snddev_info::pvchancount, snddev_info::reccount, snddev_info::rvchancount, SND_DEV_DSPHW_PLAY, SND_DEV_DSPHW_REC, SND_DEV_DSPHW_VPLAY, SND_DEV_DSPHW_VREC, SND_MAXHWCHAN, SND_MAXVCHANS, snd_mkunit(), pcm_channel::trigger, and pcm_channel::unit.
Referenced by pcm_addchan(), and vchan_create().
int pcm_chn_destroy | ( | struct pcm_channel * | ch | ) |
Definition at line 596 of file sound.c.
References chn_kill(), pcm_channel::dev, free, pcm_channel::methods, pcm_channel::name, pcm_channel::parentsnddev, and PCM_BUSYASSERT.
Referenced by pcm_addchan(), pcm_killchan(), vchan_create(), and vchan_destroy().
int pcm_chn_remove | ( | struct snddev_info * | d, |
struct pcm_channel * | ch | ||
) |
Definition at line 650 of file sound.c.
References pcm_channel::channels, CHN_DEV, CHN_FOREACH, CHN_REMOVE, snddev_info::devcount, PCM_BUSYASSERT, PCM_LOCKASSERT, snddev_info::playcount, snddev_info::pvchancount, snddev_info::reccount, snddev_info::rvchancount, SND_DEV_DSPHW_PLAY, SND_DEV_DSPHW_REC, SND_DEV_DSPHW_VPLAY, and SND_DEV_DSPHW_VREC.
Referenced by pcm_killchan(), vchan_create(), and vchan_destroy().
int pcm_chnalloc | ( | struct snddev_info * | d, |
struct pcm_channel ** | ch, | ||
int | direction, | ||
pid_t | pid, | ||
char * | comm, | ||
int | devunit | ||
) |
Definition at line 273 of file sound.c.
References c, pcm_channel::channels, CHN_CHAN, CHN_COMM_UNKNOWN, CHN_F_BUSY, CHN_F_VIRTUAL, CHN_FOREACH, CHN_LOCK, CHN_UNLOCK, pcm_channel::comm, pcm_channel::direction, pcm_channel::flags, PCM_BUSYASSERT, pcm_setvchans(), PCMDIR_PLAY, PCMDIR_REC, pcm_channel::pid, snddev_info::pvchancount, snddev_info::rvchancount, SND_C_MASK, SND_D_MASK, SND_DEV_DSPHW_PLAY, SND_DEV_DSPHW_REC, SND_DEV_DSPHW_VPLAY, SND_DEV_DSPHW_VREC, snd_maxautovchans, SND_U_MASK, snd_unit2c(), snd_unit2d(), and pcm_channel::unit.
Referenced by dsp_open().
int pcm_chnref | ( | struct pcm_channel * | c, |
int | ref | ||
) |
Definition at line 387 of file sound.c.
References c, CHN_LOCKASSERT, pcm_channel::parentsnddev, PCM_BUSYASSERT, and pcm_channel::refcount.
Referenced by dsp_close(), dsp_get_volume_channel(), dsp_open(), and getchns().
int pcm_chnrelease | ( | struct pcm_channel * | c | ) |
Definition at line 373 of file sound.c.
References c, CHN_COMM_UNUSED, CHN_LOCKASSERT, CHN_UNLOCK, pcm_channel::comm, pcm_channel::flags, pcm_channel::parentsnddev, PCM_BUSYASSERT, and pcm_channel::pid.
Referenced by dsp_close(), dsp_open(), and getchns().
unsigned int pcm_getbuffersize | ( | device_t | dev, |
unsigned int | minbufsz, | ||
unsigned int | deflt, | ||
unsigned int | maxbufsz | ||
) |
Definition at line 840 of file sound.c.
References snddev_info::bufsz, dev, and RANGE.
Referenced by ad1816_attach(), als_resource_grab(), aoa_attach(), atiixp_pci_attach(), cmi_attach(), cs4281_pci_attach(), emu_pci_attach(), emu_pcm_init(), es_pci_attach(), ess_attach(), fm801_pci_attach(), hdaa_pcm_attach(), ich_pci_attach(), m3_pci_attach(), mss_doattach(), sb16_attach(), sb_attach(), sv_attach(), tr_pci_attach(), and via_attach().
void * pcm_getdevinfo | ( | device_t | dev | ) |
Definition at line 832 of file sound.c.
References dev, and snddev_info::devinfo.
Referenced by ad1816_detach(), als_pci_detach(), als_pci_resume(), als_pci_suspend(), atiixp_pci_detach(), atiixp_pci_resume(), atiixp_pci_suspend(), cmi_detach(), cmi_resume(), cmi_suspend(), cs4281_pci_detach(), cs4281_pci_resume(), cs4281_pci_suspend(), emu_pci_detach(), emu_pcm_detach(), envy24_pci_detach(), envy24ht_pci_detach(), es_init_sysctls(), es_pci_detach(), ess_detach(), ess_resume(), fm801_alloc_resource(), fm801_pci_detach(), ich_pci_detach(), ich_pci_resume(), ich_pci_suspend(), m3_pci_detach(), m3_pci_resume(), m3_pci_shutdown(), m3_pci_suspend(), mss_detach(), mss_resume(), mss_suspend(), nm_pci_detach(), nm_pci_resume(), nm_pci_suspend(), pcmcsa_detach(), pcmcsa_resume(), pcmcsa_suspend(), sb16_detach(), sb_detach(), sv_detach(), sv_resume(), sv_suspend(), sysctl_atiixp_polling(), sysctl_es137x_fixed_rate(), sysctl_es137x_latency_timer(), sysctl_es137x_spdif_enable(), sysctl_es_polling(), sysctl_via8233_dxs_src(), sysctl_via8233_spdif_enable(), sysctl_via_polling(), tr_pci_detach(), tr_pci_resume(), tr_pci_suspend(), and via_detach().
u_int32_t pcm_getflags | ( | device_t | dev | ) |
Definition at line 816 of file sound.c.
References dev, and snddev_info::flags.
Referenced by ac97_create(), ac97mix_init(), ad1816_alloc_resources(), chn_reset(), dsp_get_flags(), emu_pcm_attach(), envy24htmixer_init(), ess_attach(), hdaa_audio_ctl_ossmixer_init(), hdaa_pcm_attach(), hdspe_pcm_attach(), hdspemixer_init(), mss_doattach(), sb16_alloc_resources(), sb16_attach(), sb_attach(), and uaudio_pcm_setflags().
int pcm_inprog | ( | struct snddev_info * | d, |
int | delta | ||
) |
Definition at line 398 of file sound.c.
References snddev_info::inprog, and PCM_LOCKASSERT.
int pcm_register | ( | device_t | dev, |
void * | devinfo, | ||
int | numplay, | ||
int | numrec | ||
) |
Definition at line 1080 of file sound.c.
References snddev_info::channels, CHN_INIT, snddev_info::clones, snddev_info::cv, dev, snddev_info::dev, snddev_info::devcount, devinfo, snddev_info::devinfo, dsp_cdevinfo_init(), snddev_info::flags, snddev_info::inprog, snddev_info::lock, PCM_ACQUIRE_QUICK, pcm_veto_load, PCMMAXCLONE, PCMMAXUNIT, snddev_info::play_sysctl_tree, snddev_info::playcount, snddev_info::pvchancount, snddev_info::pvchanformat, snddev_info::pvchanrate, snddev_info::rec_sysctl_ctx, snddev_info::rec_sysctl_tree, snddev_info::reccount, snddev_info::rvchancount, snddev_info::rvchanformat, snddev_info::rvchanrate, SD_F_AUTOVCHAN, SD_F_BITPERFECT, SD_F_SIMPLEX, SD_F_VPC, snd_clone_create(), SND_CLONE_DEADLINE_DEFAULT, SND_CLONE_GC_ENABLE, SND_CLONE_GC_EXPIRED, SND_CLONE_GC_LASTREF, SND_CLONE_GC_UNREF, SND_CLONE_WAITOK, SND_D_MASK, snd_mtxcreate(), SND_U_MASK, sndstat_prepare_pcm(), sndstat_register(), and snddev_info::status.
Referenced by ad1816_attach(), als_pci_attach(), aoa_attach(), atiixp_chip_post_init(), audio_soc_init(), cmi_attach(), cs4281_pci_attach(), emu_pci_attach(), emu_pcm_attach(), envy24_pci_attach(), envy24ht_pci_attach(), es_pci_attach(), ess_attach(), fm801_pci_attach(), hdaa_pcm_attach(), hdspe_pcm_attach(), ich_pci_attach(), m3_pci_attach(), mss_doattach(), nm_pci_attach(), pcmcsa_attach(), sb16_attach(), sb_attach(), sv_attach(), tr_pci_attach(), uaudio_attach_sub(), and via_attach().
void pcm_setflags | ( | device_t | dev, |
u_int32_t | val | ||
) |
int pcm_setstatus | ( | device_t | dev, |
char * | str | ||
) |
Definition at line 766 of file sound.c.
References snddev_info::clones, dev, snddev_info::flags, pcm_best_unit(), PCM_BUSYASSERT, PCM_LOCK, PCM_RELEASE, pcm_setmaxautovchans(), pcm_sysinit(), PCM_UNLOCK, snddev_info::playcount, snddev_info::reccount, SD_F_AUTOVCHAN, SD_F_REGISTERED, SD_F_SIMPLEX, snd_clone_enable(), snd_maxautovchans, SND_STATUSLEN, snd_unit, snd_unit_auto, and snddev_info::status.
Referenced by ad1816_attach(), als_pci_attach(), aoa_attach(), atiixp_chip_post_init(), audio_soc_init(), cmi_attach(), cs4281_pci_attach(), emu_pci_attach(), emu_pcm_attach(), envy24_pci_attach(), envy24ht_pci_attach(), es_pci_attach(), ess_attach(), fm801_pci_attach(), hdaa_pcm_attach(), hdspe_pcm_attach(), ich_setstatus(), m3_pci_attach(), mss_doattach(), nm_pci_attach(), pcmcsa_attach(), sb16_attach(), sb_attach(), sv_attach(), tr_pci_attach(), uaudio_attach_sub(), and via_attach().
int pcm_setvchans | ( | struct snddev_info * | d, |
int | direction, | ||
int | newcnt, | ||
int | num | ||
) |
Definition at line 149 of file sound.c.
References AFMT_CONVERTIBLE, c, pcmchan_caps::caps, CHN_EMPTY, CHN_F_BUSY, CHN_F_HAS_VCHAN, CHN_F_VIRTUAL, CHN_FOREACH, CHN_FOREACH_SAFE, chn_getcaps(), CHN_LOCK, CHN_UNLOCK, snddev_info::dev, pcm_channel::direction, pcm_channel::flags, snddev_info::flags, snddev_info::pcm, PCM_BUSYASSERT, pcm_clonereset(), PCMDIR_PLAY, PCMDIR_REC, snddev_info::playcount, snddev_info::pvchancount, snddev_info::reccount, pcm_channel::refcount, snddev_info::rvchancount, SD_F_AUTOVCHAN, SND_MAXVCHANS, vchan_create(), and vchan_destroy().
Referenced by pcm_chnalloc(), pcm_setmaxautovchans(), and sysctl_dev_pcm_vchans().
int pcm_unregister | ( | device_t | dev | ) |
Definition at line 1170 of file sound.c.
References pcm_channel::channels, CHN_EMPTY, CHN_FOREACH, CHN_LOCK, CHN_UNLOCK, snddev_info::clones, snddev_info::cv, dev, dsp_cdevinfo_flush(), snddev_info::flags, snddev_info::inprog, snddev_info::lock, mixer_uninit(), pcm_channel::name, PCM_ACQUIRE, PCM_ALIVE, pcm_best_unit(), pcm_killchan(), PCM_LOCK, PCM_RELEASE, PCM_RELEASE_QUICK, PCM_UNLOCK, PCM_WAIT, pcm_channel::pid, snddev_info::play_sysctl_tree, snddev_info::rec_sysctl_ctx, snddev_info::rec_sysctl_tree, pcm_channel::refcount, SD_F_DETACHING, SD_F_DYING, snd_clone_busy(), snd_clone_destroy(), snd_clone_disable(), snd_clone_enable(), snd_mtxfree(), snd_unit, snd_unit_auto, and sndstat_unregister().
Referenced by ad1816_detach(), als_pci_detach(), atiixp_pci_detach(), cmi_detach(), cs4281_pci_detach(), emu_pci_detach(), emu_pcm_detach(), envy24_pci_detach(), envy24ht_pci_detach(), es_pci_detach(), ess_detach(), fm801_pci_detach(), hdaa_pcm_detach(), hdspe_pcm_detach(), ich_pci_detach(), m3_pci_detach(), mss_detach(), nm_pci_detach(), pcmcsa_detach(), sb16_detach(), sb_detach(), sv_detach(), tr_pci_detach(), uaudio_detach_sub(), and via_detach().
void snd_mtxassert | ( | void * | m | ) |
Definition at line 107 of file sound.c.
References m.
Referenced by sbc_lockassert().
void * snd_mtxcreate | ( | const char * | desc, |
const char * | type | ||
) |
Definition at line 88 of file sound.c.
Referenced by ac97_create(), ad1816_attach(), als_pci_attach(), atiixp_pci_attach(), chn_lockinit(), cmi_attach(), emu_pci_attach(), emu_pcm_attach(), envy24_pci_attach(), envy24ht_pci_attach(), es_pci_attach(), ess_alloc_resources(), hdac_attach(), hdspe_attach(), ich_pci_attach(), m3_pci_attach(), mixer_obj_create(), mss_doattach(), pcm_register(), sbc_lockinit(), spicds_create(), tr_pci_attach(), and via_attach().
void snd_mtxfree | ( | void * | m | ) |
Definition at line 98 of file sound.c.
Referenced by ac97_destroy(), ad1816_release_resources(), als_resource_free(), atiixp_release_resource(), chn_lockdestroy(), cmi_attach(), cmi_detach(), emu_pci_attach(), emu_pci_detach(), emu_pcm_attach(), emu_pcm_detach(), envy24_pci_attach(), envy24_pci_detach(), envy24ht_pci_attach(), envy24ht_pci_detach(), es_pci_attach(), es_pci_detach(), ess_release_resources(), hdac_attach(), hdac_detach(), hdspe_detach(), ich_pci_attach(), ich_pci_detach(), m3_pci_attach(), m3_pci_detach(), mixer_delete(), mixer_obj_create(), mixer_uninit(), mss_release_resources(), pcm_unregister(), sbc_lockdestroy(), spicds_destroy(), tr_pci_attach(), tr_pci_detach(), via_attach(), and via_detach().
int snd_setup_intr | ( | device_t | dev, |
struct resource * | res, | ||
int | flags, | ||
driver_intr_t | hand, | ||
void * | param, | ||
void ** | cookiep | ||
) |
Definition at line 117 of file sound.c.
References dev, snddev_info::flags, param, and SD_F_MPSAFE.
Referenced by ad1816_attach(), als_resource_grab(), atiixp_pci_attach(), cmi_attach(), cs4281_pci_attach(), csa_attach(), davbus_attach(), emu_pci_attach(), envy24_alloc_resource(), envy24ht_alloc_resource(), es_pci_attach(), ess_attach(), fm801_pci_attach(), gusc_attach(), i2s_attach(), ich_pci_attach(), m3_pci_attach(), mss_doattach(), nm_pci_attach(), pcmcsa_attach(), sb16_attach(), sb_attach(), sbc_attach(), sv_attach(), tr_pci_attach(), and via_attach().
int sndstat_register | ( | device_t | dev, |
char * | str, | ||
sndstat_handler | handler | ||
) |
Definition at line 1059 of file sndstat.c.
References dev, SNDSTAT_LOCK, SNDSTAT_UNLOCK, SS_TYPE_MIDI, SS_TYPE_MODULE, SS_TYPE_PCM, SS_TYPE_SEQUENCER, and type.
Referenced by pcm_register(), and sndstat_registerfile().
int sndstat_registerfile | ( | char * | str | ) |
Definition at line 1112 of file sndstat.c.
References sndstat_register().
int sndstat_unregister | ( | device_t | dev | ) |
Definition at line 1118 of file sndstat.c.
References dev, error, free, SNDSTAT_LOCK, and SNDSTAT_UNLOCK.
Referenced by pcm_unregister().
int sndstat_unregisterfile | ( | char * | str | ) |
Definition at line 1138 of file sndstat.c.
References error, free, SNDSTAT_LOCK, and SNDSTAT_UNLOCK.
int sound_oss_card_info | ( | oss_card_info * | si | ) |
Definition at line 1389 of file sound.c.
References snddev_info::dev, pcm_devclass, PCM_LOCK, PCM_REGISTERED, PCM_UNLOCK, PCM_UNLOCKASSERT, and snddev_info::status.
Referenced by dsp_ioctl(), and mixer_ioctl_cmd().
void sound_oss_sysinfo | ( | oss_sysinfo * | si | ) |
Handle OSSv4 SNDCTL_SYSINFO ioctl.
si | Pointer to oss_sysinfo struct where information about the sound subsystem will be written/copied. |
This routine returns information about the sound system, such as the current OSS version, number of audio, MIDI, and mixer drivers, etc. Also includes a bitmask showing which of the above types of devices are open (busy).
Need access to sound/midi/midi.c::midistat_lock in order to safely touch midi_devices and get a head count of, well, MIDI devices. midistat_lock is a global static (i.e., local to midi.c), but midi_devices is a regular global; should the mutex be publicized, or is there another way to get this information?
NB: MIDI/sequencer stuff is currently on hold.
si->openedmidi = " MIDI devices
Definition at line 1296 of file sound.c.
References c, pcm_channel::channels, CHN_F_BUSY, CHN_FOREACH, CHN_LOCK, CHN_UNLOCK, CHN_UNLOCKASSERT, snddev_info::devcount, pcm_channel::flags, mixer_count, pcm_devclass, PCM_LOCK, PCM_REGISTERED, PCM_UNLOCK, and PCM_UNLOCKASSERT.
Referenced by dsp_ioctl(), and mixer_ioctl_cmd().
SYSCTL_DECL | ( | _hw_snd | ) |
|
extern |
Definition at line 49 of file sound.c.
Referenced by chn_vpc_proc(), dsp_clone(), dsp_get_flags(), dsp_get_info(), dsp_oss_audioinfo(), dsp_set_flags(), mixer_clone(), mixer_oss_mixerinfo(), pcm_best_unit(), sound_oss_card_info(), sound_oss_sysinfo(), sysctl_dev_pcm_vchanformat(), sysctl_dev_pcm_vchanmode(), sysctl_dev_pcm_vchanrate(), sysctl_dev_pcm_vchans(), sysctl_hw_snd_default_unit(), sysctl_hw_snd_feeder_rate_quality(), and sysctl_hw_snd_maxautovchans().
|
extern |
Definition at line 51 of file sound.c.
Referenced by pcm_register(), and SLIST_HEAD().
|
extern |
Unit number allocator for syncgroup IDs.
Definition at line 78 of file sound.c.
Referenced by dsp_close(), dsp_oss_syncgroup(), dsp_oss_syncstart(), and sound_modevent().
|
extern |
Definition at line 59 of file sound.c.
Referenced by dsp_clone(), pcm_chnalloc(), pcm_clonereset(), pcm_setstatus(), SLIST_HEAD(), and sysctl_hw_snd_maxautovchans().
|
extern |
Definition at line 53 of file sound.c.
Referenced by dsp_clone(), mixer_clone(), pcm_setstatus(), pcm_unregister(), SLIST_HEAD(), and sysctl_hw_snd_default_unit().
|
extern |