FreeBSD kernel sound device code
|
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pcm/ac97.h>
#include <dev/sound/pcm/vchan.h>
#include <dev/sound/pcm/dsp.h>
#include <dev/sound/pcm/sndstat.h>
#include <dev/sound/version.h>
#include <sys/limits.h>
#include <sys/sysctl.h>
#include "feeder_if.h"
Go to the source code of this file.
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
SYSCTL_INT (_hw_snd, OID_AUTO, default_auto, CTLFLAG_RWTUN, &snd_unit_auto, 0, "assign default unit to a newly attached device") | |
SYSCTL_NODE (_hw, OID_AUTO, snd, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "Sound driver") | |
static void | pcm_sysinit (device_t) |
SYSCTL_STRING (_hw_snd, OID_AUTO, version, CTLFLAG_RD, &snd_driver_version, 0, "driver version/arch") | |
static int | sndstat_prepare_pcm (SNDSTAT_PREPARE_PCM_ARGS) |
void * | snd_mtxcreate (const char *desc, const char *type) |
void | snd_mtxfree (void *m) |
void | snd_mtxassert (void *m) |
int | snd_setup_intr (device_t dev, struct resource *res, int flags, driver_intr_t hand, void *param, void **cookiep) |
static void | pcm_clonereset (struct snddev_info *d) |
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) |
static void | pcm_setmaxautovchans (struct snddev_info *d, int num) |
static int | sysctl_hw_snd_default_unit (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_hw_snd, OID_AUTO, default_unit, CTLTYPE_INT|CTLFLAG_RWTUN|CTLFLAG_ANYBODY|CTLFLAG_NEEDGIANT, 0, sizeof(int), sysctl_hw_snd_default_unit, "I", "default sound device") | |
static int | sysctl_hw_snd_maxautovchans (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_hw_snd, OID_AUTO, maxautovchans, CTLTYPE_INT|CTLFLAG_RWTUN|CTLFLAG_NEEDGIANT, 0, sizeof(int), sysctl_hw_snd_maxautovchans, "I", "maximum virtual channel") | |
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) |
static int | pcm_killchan (device_t dev) |
static int | pcm_best_unit (int old) |
int | pcm_setstatus (device_t dev, char *str) |
uint32_t | pcm_getflags (device_t dev) |
void | pcm_setflags (device_t dev, uint32_t val) |
void * | pcm_getdevinfo (device_t dev) |
unsigned int | pcm_getbuffersize (device_t dev, unsigned int minbufsz, unsigned int deflt, unsigned int maxbufsz) |
static int | sysctl_dev_pcm_bitperfect (SYSCTL_HANDLER_ARGS) |
static u_int8_t | pcm_mode_init (struct snddev_info *d) |
int | pcm_register (device_t dev, void *devinfo, int numplay, int numrec) |
int | pcm_unregister (device_t dev) |
void | sound_oss_sysinfo (oss_sysinfo *si) |
Handle OSSv4 SNDCTL_SYSINFO ioctl. More... | |
int | sound_oss_card_info (oss_card_info *si) |
static int | sound_modevent (module_t mod, int type, void *data) |
DEV_MODULE (sound, sound_modevent, NULL) | |
MODULE_VERSION (sound, SOUND_MODVER) | |
Variables | |
devclass_t | pcm_devclass |
int | pcm_veto_load = 1 |
int | snd_unit = -1 |
static int | snd_unit_auto = -1 |
int | snd_maxautovchans = 16 |
static char | snd_driver_version [] |
struct unrhdr * | pcmsg_unrhdr = NULL |
Unit number allocator for syncgroup IDs. More... | |
DEV_MODULE | ( | sound | , |
sound_modevent | , | ||
NULL | |||
) |
MODULE_VERSION | ( | sound | , |
SOUND_MODVER | |||
) |
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().
|
static |
Definition at line 740 of file sound.c.
References pcm_devclass, PCM_REGISTERED, snddev_info::playcount, and snddev_info::reccount.
Referenced by pcm_setstatus(), and pcm_unregister().
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().
|
static |
Definition at line 131 of file sound.c.
References snddev_info::clones, max, PCM_BUSYASSERT, PCMMAXCLONE, snddev_info::playcount, snddev_info::pvchancount, snddev_info::reccount, snddev_info::rvchancount, snd_clone_gc(), snd_clone_setmaxunit(), and snd_maxautovchans.
Referenced by pcm_setmaxautovchans(), and pcm_setvchans().
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().
uint32_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.
|
static |
Definition at line 721 of file sound.c.
References pcm_channel::channels, CHN_FIRST, dev, error, PCM_BUSYASSERT, pcm_chn_destroy(), pcm_chn_remove(), PCM_LOCK, and PCM_UNLOCK.
Referenced by pcm_unregister().
|
static |
Definition at line 1019 of file sound.c.
References snddev_info::mixer_dev, PCM_MODE_MIXER, PCM_MODE_PLAY, PCM_MODE_REC, snddev_info::playcount, and snddev_info::reccount.
Referenced by pcm_sysinit().
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, |
uint32_t | val | ||
) |
Definition at line 824 of file sound.c.
References dev, snddev_info::flags, and val.
Referenced by ac97_create(), ac97mix_init(), ad1816_alloc_resources(), dsp_set_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().
|
static |
Definition at line 408 of file sound.c.
References PCM_BUSYASSERT, pcm_clonereset(), pcm_setvchans(), PCMDIR_PLAY, PCMDIR_REC, snddev_info::pvchancount, and snddev_info::rvchancount.
Referenced by pcm_setstatus(), and sysctl_hw_snd_maxautovchans().
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().
|
static |
Definition at line 1034 of file sound.c.
References snddev_info::bufsz, dev, feeder_eq_initsys(), snddev_info::flags, pcm_mode_init(), SD_F_AUTOVCHAN, SD_F_EQ, sysctl_dev_pcm_bitperfect(), and vchan_initsys().
Referenced by pcm_setstatus().
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().
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
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().
|
static |
Definition at line 81 of file sound.c.
References SNDSTAT_PREPARE_PCM_BEGIN, and SNDSTAT_PREPARE_PCM_END.
Referenced by pcm_register().
|
static |
Definition at line 1425 of file sound.c.
References data, midi_modevent(), pcmsg_unrhdr, and type.
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().
|
static |
Definition at line 870 of file sound.c.
References snddev_info::flags, PCM_ACQUIRE, PCM_LOCK, PCM_REGISTERED, PCM_RELEASE, PCM_RELEASE_QUICK, PCM_UNLOCK, PCM_WAIT, req, SD_F_BITPERFECT, and val.
Referenced by pcm_sysinit().
|
static |
Definition at line 429 of file sound.c.
References snddev_info::channels, CHN_EMPTY, error, pcm_devclass, PCM_REGISTERED, req, snd_unit, and snd_unit_auto.
|
static |
Definition at line 452 of file sound.c.
References error, PCM_ACQUIRE_QUICK, pcm_devclass, PCM_REGISTERED, PCM_RELEASE_QUICK, pcm_setmaxautovchans(), req, snd_maxautovchans, and SND_MAXVCHANS.
SYSCTL_INT | ( | _hw_snd | , |
OID_AUTO | , | ||
default_auto | , | ||
CTLFLAG_RWTUN | , | ||
& | snd_unit_auto, | ||
0 | , | ||
"assign default unit to a newly attached device" | |||
) |
SYSCTL_NODE | ( | _hw | , |
OID_AUTO | , | ||
snd | , | ||
CTLFLAG_RD| | CTLFLAG_MPSAFE, | ||
0 | , | ||
"Sound driver" | |||
) |
SYSCTL_PROC | ( | _hw_snd | , |
OID_AUTO | , | ||
default_unit | , | ||
CTLTYPE_INT|CTLFLAG_RWTUN|CTLFLAG_ANYBODY| | CTLFLAG_NEEDGIANT, | ||
0 | , | ||
sizeof(int) | , | ||
sysctl_hw_snd_default_unit | , | ||
"I" | , | ||
"default sound device" | |||
) |
SYSCTL_PROC | ( | _hw_snd | , |
OID_AUTO | , | ||
maxautovchans | , | ||
CTLTYPE_INT|CTLFLAG_RWTUN| | CTLFLAG_NEEDGIANT, | ||
0 | , | ||
sizeof(int) | , | ||
sysctl_hw_snd_maxautovchans | , | ||
"I" | , | ||
"maximum virtual channel" | |||
) |
SYSCTL_STRING | ( | _hw_snd | , |
OID_AUTO | , | ||
version | , | ||
CTLFLAG_RD | , | ||
& | snd_driver_version, | ||
0 | , | ||
"driver version/arch" | |||
) |
devclass_t pcm_devclass |
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().
int pcm_veto_load = 1 |
Definition at line 51 of file sound.c.
Referenced by pcm_register(), and SLIST_HEAD().
struct unrhdr* pcmsg_unrhdr = NULL |
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().
|
static |
int snd_maxautovchans = 16 |
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().
int snd_unit = -1 |
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().
|
static |
Definition at line 55 of file sound.c.
Referenced by pcm_setstatus(), pcm_unregister(), and sysctl_hw_snd_default_unit().