|
FreeBSD kernel sound device code
|

Go to the source code of this file.
Defines | |
| #define | MIXER_CMD_DIRECT 0 /* send command within driver */ |
| #define | MIXER_CMD_CDEV 1 /* send command from cdev/ioctl */ |
| #define | MIXER_TYPE_PRIMARY 0 /* mixer_init() */ |
| #define | MIXER_TYPE_SECONDARY 1 /* mixer_create() */ |
| #define | MIXER_SIZE |
| #define | MIXER_DECLARE(name) static DEFINE_CLASS(name, name ## _methods, MIXER_SIZE) |
Functions | |
| struct snd_mixer * | mixer_create (device_t dev, kobj_class_t cls, void *devinfo, const char *desc) |
| int | mixer_delete (struct snd_mixer *m) |
| int | mixer_init (device_t dev, kobj_class_t cls, void *devinfo) |
| int | mixer_uninit (device_t dev) |
| int | mixer_reinit (device_t dev) |
| int | mixer_ioctl_cmd (struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td, int from) |
| int | mixer_oss_mixerinfo (struct cdev *i_dev, oss_mixerinfo *mi) |
| Handler for SNDCTL_MIXERINFO. | |
| int | mixer_hwvol_init (device_t dev) |
| void | mixer_hwvol_mute (device_t dev) |
| void | mixer_hwvol_step (device_t dev, int left_step, int right_step) |
| int | mixer_busy (struct snd_mixer *m) |
| int | mix_set (struct snd_mixer *m, u_int dev, u_int left, u_int right) |
| int | mix_get (struct snd_mixer *m, u_int dev) |
| int | mix_setrecsrc (struct snd_mixer *m, u_int32_t src) |
| u_int32_t | mix_getrecsrc (struct snd_mixer *m) |
| int | mix_get_type (struct snd_mixer *m) |
| void | mix_setdevs (struct snd_mixer *m, u_int32_t v) |
| void | mix_setrecdevs (struct snd_mixer *m, u_int32_t v) |
| Record mask of available recording devices. | |
| u_int32_t | mix_getdevs (struct snd_mixer *m) |
| u_int32_t | mix_getrecdevs (struct snd_mixer *m) |
| void | mix_setparentchild (struct snd_mixer *m, u_int32_t parent, u_int32_t childs) |
| void | mix_setrealdev (struct snd_mixer *m, u_int32_t dev, u_int32_t realdev) |
| u_int32_t | mix_getparent (struct snd_mixer *m, u_int32_t dev) |
| u_int32_t | mix_getchild (struct snd_mixer *m, u_int32_t dev) |
| void * | mix_getdevinfo (struct snd_mixer *m) |
| struct mtx * | mixer_get_lock (struct snd_mixer *m) |
Variables | |
| int | mixer_count |
| #define MIXER_CMD_CDEV 1 /* send command from cdev/ioctl */ |
Definition at line 65 of file mixer.h.
Referenced by mixer_ioctl(), and mixer_ioctl_cmd().
| #define MIXER_CMD_DIRECT 0 /* send command within driver */ |
Definition at line 64 of file mixer.h.
Referenced by dsp_ioctl().
| #define MIXER_DECLARE | ( | name | ) | static DEFINE_CLASS(name, name ## _methods, MIXER_SIZE) |
| #define MIXER_SIZE |
| #define MIXER_TYPE_PRIMARY 0 /* mixer_init() */ |
Definition at line 67 of file mixer.h.
Referenced by mixer_init(), mixer_obj_create(), and mixer_uninit().
| #define MIXER_TYPE_SECONDARY 1 /* mixer_create() */ |
Definition at line 68 of file mixer.h.
Referenced by mixer_create(), mixer_delete(), and mixer_obj_create().
Definition at line 967 of file mixer.c.
References snd_mixer::lock, mixer_get(), snd_mtxlock, and snd_mtxunlock.
Referenced by chn_syncstate(), and sysctl_es137x_single_pcm_mixer().


| int mix_get_type | ( | struct snd_mixer * | m | ) |
Definition at line 1009 of file mixer.c.
References snd_mixer::type.
| u_int32_t mix_getchild | ( | struct snd_mixer * | m, |
| u_int32_t | dev | ||
| ) |
Definition at line 586 of file mixer.c.
References snd_mixer::child, and dev.
| void* mix_getdevinfo | ( | struct snd_mixer * | m | ) |
Definition at line 606 of file mixer.c.
References snd_mixer::devinfo.
Referenced by ac97mix_init(), ac97mix_reinit(), ac97mix_set(), ac97mix_setrecsrc(), ac97mix_uninit(), ad1816mix_set(), ad1816mix_setrecsrc(), alsmix_set(), alsmix_setrecsrc(), burgundy_init(), burgundy_set(), cmimix_init(), cmimix_set(), cmimix_setrecsrc(), cs4231_mixer_set(), cs4231_mixer_setrecsrc(), emu_dspmixer_init(), emu_dspmixer_set(), emu_dspmixer_setrecsrc(), emu_dspmixer_uninit(), envy24htmixer_init(), envy24htmixer_reinit(), envy24htmixer_set(), envy24htmixer_setrecsrc(), envy24htmixer_uninit(), envy24mixer_init(), envy24mixer_reinit(), envy24mixer_set(), envy24mixer_setrecsrc(), envy24mixer_uninit(), es1370_mixinit(), es1370_mixset(), es1370_mixsetrecsrc(), essmix_init(), essmix_set(), essmix_setrecsrc(), hdaa_audio_ctl_ossmixer_init(), hdaa_audio_ctl_ossmixer_set(), hdaa_audio_ctl_ossmixer_setrecsrc(), hdspemixer_init(), hdspemixer_set(), mssmix_init(), mssmix_set(), mssmix_setrecsrc(), sb16mix_init(), sb16mix_set(), sb16mix_setrecsrc(), sbmix_init(), sbmix_set(), sbpromix_init(), sbpromix_set(), sbpromix_setrecsrc(), screamer_init(), screamer_set(), snapper_init(), snapper_set(), sv_mix_set(), sv_mix_setrecsrc(), tumbler_init(), tumbler_set(), ua_mixer_init(), ua_mixer_set(), ua_mixer_setrecsrc(), ua_mixer_uninit(), ymmix_init(), ymmix_set(), and ymmix_setrecsrc().
| u_int32_t mix_getdevs | ( | struct snd_mixer * | m | ) |
Definition at line 594 of file mixer.c.
References snd_mixer::devs.
Referenced by dsp_ioctl(), emu_dspmixer_init(), mixer_ioctl_channel(), mixer_ioctl_cmd(), sysctl_es137x_single_pcm_mixer(), and ymmix_init().

| u_int32_t mix_getparent | ( | struct snd_mixer * | m, |
| u_int32_t | dev | ||
| ) |
Definition at line 578 of file mixer.c.
References dev, and snd_mixer::parent.
Referenced by chn_syncstate().

| u_int32_t mix_getrecdevs | ( | struct snd_mixer * | m | ) |
Definition at line 600 of file mixer.c.
References snd_mixer::recdevs.
Referenced by emu_dspmixer_init(), es1370_mixsetrecsrc(), hdaa_audio_ctl_ossmixer_setrecsrc(), mixer_ioctl_cmd(), and sysctl_es137x_single_pcm_mixer().

| u_int32_t mix_getrecsrc | ( | struct snd_mixer * | m | ) |
Definition at line 995 of file mixer.c.
References snd_mixer::lock, mixer_getrecsrc(), snd_mtxlock, and snd_mtxunlock.
Referenced by sysctl_es137x_single_pcm_mixer().


Definition at line 953 of file mixer.c.
References snd_mixer::lock, mixer_set(), snd_mtxlock, and snd_mtxunlock.
Referenced by emu_dspmixer_set(), hdaa_audio_ctl_set_defaults(), and sysctl_es137x_single_pcm_mixer().


| void mix_setdevs | ( | struct snd_mixer * | m, |
| u_int32_t | v | ||
| ) |
Definition at line 456 of file mixer.c.
References snd_mixer::child, snd_mixer::dev, snd_mixer::devs, snddev_info::flags, snd_mixer::parent, SD_F_EQ, and SD_F_SOFTPCMVOL.
Referenced by ac97mix_init(), ad1816mix_init(), alsmix_init(), burgundy_init(), cmimix_init(), cs4231_mixer_init(), emu_dspmixer_init(), emu_efxmixer_init(), envy24htmixer_init(), envy24mixer_init(), es1370_mixinit(), essmix_init(), hdaa_audio_ctl_ossmixer_init(), hdspemixer_init(), mssmix_init(), sb16mix_init(), sbmix_init(), sbpromix_init(), screamer_init(), snapper_init(), sv_mix_init(), sysctl_es137x_single_pcm_mixer(), tumbler_init(), uaudio_mixer_init_sub(), and ymmix_init().

| void mix_setparentchild | ( | struct snd_mixer * | m, |
| u_int32_t | parent, | ||
| u_int32_t | childs | ||
| ) |
Definition at line 546 of file mixer.c.
References snd_mixer::child, mask, and snd_mixer::parent.
Referenced by ac97mix_init(), hdaa_audio_ctl_ossmixer_init(), and uaudio_mixer_init_sub().

| void mix_setrealdev | ( | struct snd_mixer * | m, |
| u_int32_t | dev, | ||
| u_int32_t | realdev | ||
| ) |
Definition at line 569 of file mixer.c.
References dev, and snd_mixer::realdev.
Referenced by ac97mix_init(), hdaa_audio_ctl_ossmixer_init(), and uaudio_mixer_init_sub().

| void mix_setrecdevs | ( | struct snd_mixer * | m, |
| u_int32_t | v | ||
| ) |
Record mask of available recording devices.
Calling functions are responsible for defining the mask of available recording devices. This function records that value in a structure used by the rest of the mixer code.
This function also populates a structure used by the SNDCTL_DSP_*RECSRC* family of ioctls that are part of OSSV4. All recording device labels are concatenated in ascending order corresponding to their routing numbers. (Ex: a system might have 0 => 'vol', 1 => 'cd', 2 => 'line', etc.) For now, these labels are just the standard recording device names (cd, line1, etc.), but will eventually be fully dynamic and user controlled.
| m | mixer device context container thing |
| v | mask of recording devices |
Definition at line 496 of file mixer.c.
References snd_mixer::dev, snd_mixer::enuminfo, snd_mixer::recdevs, and snd_mixernames.
Referenced by ac97mix_init(), ad1816mix_init(), alsmix_init(), cmimix_init(), cs4231_mixer_init(), emu_dspmixer_init(), emu_efxmixer_init(), envy24htmixer_init(), envy24mixer_init(), es1370_mixinit(), essmix_init(), hdaa_audio_ctl_ossmixer_init(), mssmix_init(), sb16mix_init(), sbmix_init(), sbpromix_init(), sv_mix_init(), sysctl_es137x_single_pcm_mixer(), and uaudio_mixer_init_sub().

| int mix_setrecsrc | ( | struct snd_mixer * | m, |
| u_int32_t | src | ||
| ) |
Definition at line 981 of file mixer.c.
References snd_mixer::lock, mixer_setrecsrc(), snd_mtxlock, and snd_mtxunlock.
Referenced by emu_dspmixer_setrecsrc(), hdaa_autorecsrc_handler(), and sysctl_es137x_single_pcm_mixer().


| int mixer_busy | ( | struct snd_mixer * | m | ) |
Definition at line 945 of file mixer.c.
References snd_mixer::busy.
Referenced by sysctl_es137x_single_pcm_mixer().

| struct snd_mixer* mixer_create | ( | device_t | dev, |
| kobj_class_t | cls, | ||
| void * | devinfo, | ||
| const char * | desc | ||
| ) | [read] |
Definition at line 673 of file mixer.c.
References mixer_count, mixer_obj_create(), and MIXER_TYPE_SECONDARY.
Referenced by emu_dspmixer_init().


| int mixer_delete | ( | struct snd_mixer * | m | ) |
Definition at line 654 of file mixer.c.
References snd_mixer::lock, mixer_count, MIXER_TYPE_SECONDARY, snd_mtxfree(), and snd_mixer::type.
Referenced by emu_dspmixer_uninit().


| struct mtx* mixer_get_lock | ( | struct snd_mixer * | m | ) | [read] |
Definition at line 1488 of file mixer.c.
References snd_mixer::lock.
Referenced by snapper_set(), tumbler_set(), ua_mixer_set(), ua_mixer_setrecsrc(), and uaudio_mixer_init_sub().

| int mixer_hwvol_init | ( | device_t | dev | ) |
Definition at line 875 of file mixer.c.
References snd_mixer::hwvol_mixer, snd_mixer::hwvol_step, mixer_get_devt(), and sysctl_hw_snd_hwvol_mixer().
Referenced by agg_attach(), and m3_pci_attach().


| void mixer_hwvol_mute | ( | device_t | dev | ) |
Definition at line 896 of file mixer.c.
References snd_mixer::hwvol_mixer, snd_mixer::hwvol_mute_level, snd_mixer::hwvol_muted, snd_mixer::lock, mixer_get(), mixer_get_devt(), mixer_set(), snd_mtxlock, and snd_mtxunlock.
Referenced by agg_intr(), and m3_intr().


| void mixer_hwvol_step | ( | device_t | dev, |
| int | left_step, | ||
| int | right_step | ||
| ) |
Definition at line 916 of file mixer.c.
References snd_mixer::hwvol_mixer, snd_mixer::hwvol_mute_level, snd_mixer::hwvol_muted, snd_mixer::hwvol_step, left, snd_mixer::level, snd_mixer::lock, mixer_get(), mixer_get_devt(), mixer_set(), right, snd_mtxlock, and snd_mtxunlock.
Referenced by agg_intr(), and m3_intr().


| int mixer_init | ( | device_t | dev, |
| kobj_class_t | cls, | ||
| void * | devinfo | ||
| ) |
Definition at line 686 of file mixer.c.
References snd_mixer::child, snd_mixer::devs, snddev_info::eqpreamp, snddev_info::flags, mixer_cdevsw, mixer_count, snddev_info::mixer_dev, mixer_obj_create(), mixer_set(), mixer_setrecsrc(), MIXER_TYPE_PRIMARY, snd_mixer::parent, PCMMINOR, snd_mixer::realdev, SD_F_EQ, SD_F_EQ_DEFAULT, SD_F_EQ_MASK, SD_F_SOFTPCMVOL, SND_DEV_CTL, snd_mixerdefaults, snd_mixernames, snd_mkunit(), and val.
Referenced by ad1816_attach(), agg_attach(), als_pci_attach(), atiixp_chip_post_init(), au_pci_attach(), cmi_attach(), cs4231_attach_common(), cs4281_pci_attach(), davbus_attach(), ds_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(), i2s_postattach(), 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 mixer_ioctl_cmd | ( | struct cdev * | i_dev, |
| u_long | cmd, | ||
| caddr_t | arg, | ||
| int | mode, | ||
| struct thread * | td, | ||
| int | from | ||
| ) |
Definition at line 1213 of file mixer.c.
References snd_mixer::busy, dsp_oss_audioinfo(), snd_mixer::enuminfo, snd_mixer::lock, mix_getdevs(), mix_getrecdevs(), MIXER_CMD_CDEV, mixer_get(), mixer_get_recroute(), mixer_getrecsrc(), mixer_oss_mixerinfo(), mixer_set(), mixer_set_recroute(), mixer_setrecsrc(), snd_mtxlock, snd_mtxunlock, sound_oss_card_info(), and sound_oss_sysinfo().
Referenced by dsp_ioctl(), and mixer_ioctl().


| int mixer_oss_mixerinfo | ( | struct cdev * | i_dev, |
| oss_mixerinfo * | mi | ||
| ) |
Handler for SNDCTL_MIXERINFO.
This function searches for a mixer based on the numeric ID stored in oss_miserinfo::dev. If set to -1, then information about the current mixer handling the request is provided. Note, however, that this ioctl may be made with any sound device (audio, mixer, midi).
See http://manuals.opensound.com/developer/SNDCTL_MIXERINFO.html for more information.
| i_dev | character device on which the ioctl arrived |
| arg | user argument (oss_mixerinfo *) |
| EINVAL | oss_mixerinfo::dev specified a bad value |
| 0 | success |
The only flag for
Mixer extensions currently aren't supported, so leave
XXX Described by Hannu@4Front, but not found in soundcard.h. strlcpy(mi->devnode, devtoname(d->mixer_dev), sizeof(mi->devnode)); mi->legacy_device = i;
Definition at line 1360 of file mixer.c.
References snd_mixer::dev, snd_mixer::lock, mixer_cdevsw, snddev_info::mixer_dev, snd_mixer::modify_counter, snd_mixer::name, pcm_devclass, PCM_LOCK, PCM_REGISTERED, PCM_UNLOCK, and PCM_UNLOCKASSERT.
Referenced by dsp_ioctl(), and mixer_ioctl_cmd().

| int mixer_reinit | ( | device_t | dev | ) |
Definition at line 821 of file mixer.c.
References snd_mixer::level, snd_mixer::lock, mixer_get_devt(), mixer_set(), mixer_setrecsrc(), snd_mixer::recsrc, snd_mtxlock, and snd_mtxunlock.
Referenced by agg_resume(), als_pci_resume(), atiixp_pci_resume(), cmi_resume(), cs4231_chan_fs(), cs4281_pci_resume(), ds_pci_resume(), ess_resume(), hdaa_resume(), ich_pci_resume(), m3_pci_resume(), nm_pci_resume(), sv_resume(), and tr_pci_resume().


| int mixer_uninit | ( | device_t | dev | ) |
Definition at line 766 of file mixer.c.
References snd_mixer::busy, snd_mixer::lock, mixer_count, snddev_info::mixer_dev, mixer_get_devt(), mixer_set(), mixer_setrecsrc(), MIXER_TYPE_PRIMARY, snd_mtxfree(), snd_mtxlock, snd_mtxunlock, and snd_mixer::type.
Referenced by pcm_unregister(), and uaudio_detach_sub().


| int mixer_count |
Keeps a count of mixer devices; used only by OSSv4 SNDCTL_SYSINFO ioctl.
Definition at line 112 of file mixer.c.
Referenced by mixer_create(), mixer_delete(), mixer_init(), mixer_uninit(), and sound_oss_sysinfo().