FreeBSD kernel sound device code
|
Go to the source code of this file.
Macros | |
#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. More... | |
int | mixer_hwvol_init (device_t dev) |
void | mixer_hwvol_mute_locked (struct snd_mixer *m) |
void | mixer_hwvol_mute (device_t dev) |
void | mixer_hwvol_step_locked (struct snd_mixer *m, int l_step, int r_step) |
void | mixer_hwvol_step (device_t dev, int left_step, int right_step) |
int | mixer_busy (struct snd_mixer *m) |
int | mix_get_locked (struct snd_mixer *m, u_int dev, int *pleft, int *pright) |
int | mix_set_locked (struct snd_mixer *m, u_int dev, int left, int right) |
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) |
device_t | mix_get_dev (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. More... | |
void | mix_setmutedevs (struct snd_mixer *m, u_int32_t v) |
u_int32_t | mix_getdevs (struct snd_mixer *m) |
u_int32_t | mix_getrecdevs (struct snd_mixer *m) |
u_int32_t | mix_getmutedevs (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_DECLARE | ( | name | ) | static DEFINE_CLASS(name, name ## _methods, MIXER_SIZE) |
#define MIXER_SIZE |
#define MIXER_TYPE_PRIMARY 0 /* mixer_init() */ |
#define MIXER_TYPE_SECONDARY 1 /* mixer_create() */ |
int mix_get | ( | struct snd_mixer * | m, |
u_int | dev | ||
) |
Definition at line 1016 of file mixer.c.
References dev, m, mixer_get(), snd_mtxlock, and snd_mtxunlock.
Referenced by chn_syncstate(), and sysctl_es137x_single_pcm_mixer().
device_t mix_get_dev | ( | struct snd_mixer * | m | ) |
Definition at line 1066 of file mixer.c.
References m.
Referenced by uaudio_mixer_init_sub(), uaudio_mixer_set(), uaudio_mixer_setrecsrc(), and uaudio_mixer_uninit_sub().
int mix_get_locked | ( | struct snd_mixer * | m, |
u_int | dev, | ||
int * | pleft, | ||
int * | pright | ||
) |
Definition at line 1576 of file mixer.c.
References dev, m, and mixer_get().
int mix_get_type | ( | struct snd_mixer * | m | ) |
Definition at line 1058 of file mixer.c.
References m, and pcmchan_matrix::type.
u_int32_t mix_getchild | ( | struct snd_mixer * | m, |
u_int32_t | dev | ||
) |
void * mix_getdevinfo | ( | struct snd_mixer * | m | ) |
Definition at line 645 of file mixer.c.
References m.
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(), 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(), onyx_init(), onyx_set(), 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 627 of file mixer.c.
References m.
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_getmutedevs | ( | struct snd_mixer * | m | ) |
Definition at line 633 of file mixer.c.
References m.
Referenced by mixer_ioctl_cmd().
u_int32_t mix_getparent | ( | struct snd_mixer * | m, |
u_int32_t | dev | ||
) |
Definition at line 611 of file mixer.c.
Referenced by chn_syncstate().
u_int32_t mix_getrecdevs | ( | struct snd_mixer * | m | ) |
Definition at line 639 of file mixer.c.
References m.
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 1044 of file mixer.c.
References m, mixer_getrecsrc(), snd_mtxlock, and snd_mtxunlock.
Referenced by sysctl_es137x_single_pcm_mixer().
int mix_set | ( | struct snd_mixer * | m, |
u_int | dev, | ||
u_int | left, | ||
u_int | right | ||
) |
Definition at line 1002 of file mixer.c.
References dev, left, m, mixer_set(), right, snd_mtxlock, and snd_mtxunlock.
Referenced by emu_dspmixer_set(), hdaa_audio_ctl_set_defaults(), and sysctl_es137x_single_pcm_mixer().
int mix_set_locked | ( | struct snd_mixer * | m, |
u_int | dev, | ||
int | left, | ||
int | right | ||
) |
void mix_setdevs | ( | struct snd_mixer * | m, |
u_int32_t | v | ||
) |
Definition at line 489 of file mixer.c.
References snddev_info::flags, m, SD_F_EQ, and SD_F_SOFTPCMVOL.
Referenced by ac97mix_init(), ad1816mix_init(), alsmix_init(), burgundy_init(), cmimix_init(), emu_dspmixer_init(), emu_efxmixer_init(), envy24htmixer_init(), envy24mixer_init(), es1370_mixinit(), essmix_init(), hdaa_audio_ctl_ossmixer_init(), hdspemixer_init(), mssmix_init(), onyx_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_setmutedevs | ( | struct snd_mixer * | m, |
u_int32_t | v | ||
) |
Definition at line 351 of file mixer.c.
References mixer, and mixer_set().
Referenced by mixer_hwvol_mute_locked(), and mixer_ioctl_cmd().
void mix_setparentchild | ( | struct snd_mixer * | m, |
u_int32_t | parent, | ||
u_int32_t | childs | ||
) |
Definition at line 579 of file mixer.c.
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 602 of file mixer.c.
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 529 of file mixer.c.
References m, and snd_mixernames.
Referenced by ac97mix_init(), ad1816mix_init(), alsmix_init(), cmimix_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 1030 of file mixer.c.
References m, mixer_setrecsrc(), snd_mtxlock, snd_mtxunlock, and src.
Referenced by emu_dspmixer_setrecsrc(), hdaa_autorecsrc_handler(), and sysctl_es137x_single_pcm_mixer().
int mixer_busy | ( | struct snd_mixer * | m | ) |
Definition at line 994 of file mixer.c.
References m.
Referenced by sysctl_es137x_single_pcm_mixer().
struct snd_mixer * mixer_create | ( | device_t | dev, |
kobj_class_t | cls, | ||
void * | devinfo, | ||
const char * | desc | ||
) |
Definition at line 712 of file mixer.c.
References desc, dev, devinfo, m, mixer_count, mixer_obj_create(), and MIXER_TYPE_SECONDARY.
Referenced by emu_dspmixer_init().
int mixer_delete | ( | struct snd_mixer * | m | ) |
Definition at line 693 of file mixer.c.
References m, mixer_count, MIXER_TYPE_SECONDARY, snd_mtxfree(), and pcmchan_matrix::type.
Referenced by emu_dspmixer_uninit().
struct mtx * mixer_get_lock | ( | struct snd_mixer * | m | ) |
Definition at line 1567 of file mixer.c.
References m.
Referenced by onyx_set(), 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 916 of file mixer.c.
References dev, m, mixer_get_devt(), and sysctl_hw_snd_hwvol_mixer().
Referenced by m3_pci_attach(), and uaudio_attach_sub().
void mixer_hwvol_mute | ( | device_t | dev | ) |
Definition at line 943 of file mixer.c.
References dev, m, mixer_get_devt(), mixer_hwvol_mute_locked(), snd_mtxlock, and snd_mtxunlock.
Referenced by m3_intr().
void mixer_hwvol_mute_locked | ( | struct snd_mixer * | m | ) |
Definition at line 937 of file mixer.c.
References m, and mix_setmutedevs().
Referenced by mixer_hwvol_mute(), and uaudio_hid_rx_callback().
void mixer_hwvol_step | ( | device_t | dev, |
int | left_step, | ||
int | right_step | ||
) |
Definition at line 981 of file mixer.c.
References dev, m, mixer_get_devt(), mixer_hwvol_step_locked(), snd_mtxlock, and snd_mtxunlock.
Referenced by m3_intr().
void mixer_hwvol_step_locked | ( | struct snd_mixer * | m, |
int | l_step, | ||
int | r_step | ||
) |
Definition at line 956 of file mixer.c.
References left, m, mixer_get(), mixer_set(), and right.
Referenced by mixer_hwvol_step(), and uaudio_hid_rx_callback().
int mixer_init | ( | device_t | dev, |
kobj_class_t | cls, | ||
void * | devinfo | ||
) |
Definition at line 725 of file mixer.c.
References dev, devinfo, snddev_info::eqpreamp, snddev_info::flags, m, mixer_cdevsw, mixer_count, snddev_info::mixer_dev, mixer_obj_create(), mixer_set(), mixer_setrecsrc(), MIXER_TYPE_PRIMARY, PCMMINOR, 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(), als_pci_attach(), atiixp_chip_post_init(), cmi_attach(), cs4281_pci_attach(), davbus_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 1278 of file mixer.c.
References dsp_oss_audioinfo(), m, mix_getdevs(), mix_getmutedevs(), mix_getrecdevs(), mix_setmutedevs(), MIXER_CMD_CDEV, mixer_get(), mixer_get_recroute(), mixer_getrecsrc(), mixer_mixerinfo(), 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 1439 of file mixer.c.
References m, mixer_cdevsw, snddev_info::mixer_dev, PCM_DETACHING, 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 860 of file mixer.c.
References dev, m, mixer_get_devt(), mixer_set(), mixer_setrecsrc(), snd_mtxlock, and snd_mtxunlock.
Referenced by als_pci_resume(), atiixp_pci_resume(), cmi_resume(), cs4281_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 805 of file mixer.c.
References dev, m, mixer_count, snddev_info::mixer_dev, mixer_get_devt(), mixer_set(), mixer_setrecsrc(), MIXER_TYPE_PRIMARY, snd_mtxfree(), snd_mtxlock, snd_mtxunlock, and pcmchan_matrix::type.
Referenced by pcm_unregister(), and uaudio_detach_sub().
|
extern |
Keeps a count of mixer devices; used only by OSSv4 SNDCTL_SYSINFO ioctl.
Definition at line 113 of file mixer.c.
Referenced by mixer_create(), mixer_delete(), mixer_init(), mixer_uninit(), and sound_oss_sysinfo().