FreeBSD kernel sound device code
mixer.c File Reference
#include <dev/sound/pcm/sound.h>
#include "feeder_if.h"
#include "mixer_if.h"
Include dependency graph for mixer.c:

Go to the source code of this file.

Data Structures

struct  snd_mixer
 

Macros

#define MIXER_NAMELEN   16
 
#define MIXER_SET_UNLOCK(x, y)
 
#define MIXER_SET_LOCK(x, y)
 

Functions

 SND_DECLARE_FILE ("$FreeBSD$")
 
static MALLOC_DEFINE (M_MIXER, "mixer", "mixer")
 
 SYSCTL_INT (_hw_snd, OID_AUTO, vpc_mixer_bypass, CTLFLAG_RWTUN, &mixer_bypass, 0, "control channel pcm/rec volume, bypassing real mixer device")
 
static struct cdev * mixer_get_devt (device_t dev)
 
static int mixer_lookup (char *devname)
 
static int mixer_set_softpcmvol (struct snd_mixer *m, struct snddev_info *d, u_int left, u_int right)
 
static int mixer_set_eq (struct snd_mixer *m, struct snddev_info *d, u_int dev, u_int level)
 
static int mixer_set (struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev)
 
static int mixer_get (struct snd_mixer *mixer, int dev)
 
void mix_setmutedevs (struct snd_mixer *mixer, u_int32_t mutedevs)
 
static int mixer_setrecsrc (struct snd_mixer *mixer, u_int32_t src)
 
static int mixer_getrecsrc (struct snd_mixer *mixer)
 
static int mixer_get_recroute (struct snd_mixer *m, int *route)
 Retrieve the route number of the current recording device. More...
 
static int mixer_set_recroute (struct snd_mixer *m, int route)
 Select a device for recording. More...
 
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_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)
 
u_int32_t mix_getdevs (struct snd_mixer *m)
 
u_int32_t mix_getmutedevs (struct snd_mixer *m)
 
u_int32_t mix_getrecdevs (struct snd_mixer *m)
 
void * mix_getdevinfo (struct snd_mixer *m)
 
static struct snd_mixermixer_obj_create (device_t dev, kobj_class_t cls, void *devinfo, int type, const char *desc)
 
int mixer_delete (struct snd_mixer *m)
 
struct snd_mixermixer_create (device_t dev, kobj_class_t cls, void *devinfo, const char *desc)
 
int mixer_init (device_t dev, kobj_class_t cls, void *devinfo)
 
int mixer_uninit (device_t dev)
 
int mixer_reinit (device_t dev)
 
static int sysctl_hw_snd_hwvol_mixer (SYSCTL_HANDLER_ARGS)
 
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 left_step, int right_step)
 
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)
 
device_t mix_get_dev (struct snd_mixer *m)
 
static int mixer_open (struct cdev *i_dev, int flags, int mode, struct thread *td)
 
static int mixer_close (struct cdev *i_dev, int flags, int mode, struct thread *td)
 
static int mixer_ioctl_channel (struct cdev *dev, u_long cmd, caddr_t arg, int mode, struct thread *td, int from)
 
static int mixer_ioctl (struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
 
static void mixer_mixerinfo (struct snd_mixer *m, mixer_info *mi)
 
int mixer_ioctl_cmd (struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td, int from)
 
static void mixer_clone (void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev)
 
static void mixer_sysinit (void *p)
 
static void mixer_sysuninit (void *p)
 
 SYSINIT (mixer_sysinit, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, mixer_sysinit, NULL)
 
 SYSUNINIT (mixer_sysuninit, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, mixer_sysuninit, NULL)
 
int mixer_oss_mixerinfo (struct cdev *i_dev, oss_mixerinfo *mi)
 Handler for SNDCTL_MIXERINFO. More...
 
struct mtx * mixer_get_lock (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)
 

Variables

static int mixer_bypass = 1
 
static u_int16_t snd_mixerdefaults [SOUND_MIXER_NRDEVICES]
 
static char * snd_mixernames [SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES
 
static d_open_t mixer_open
 
static d_close_t mixer_close
 
static d_ioctl_t mixer_ioctl
 
static struct cdevsw mixer_cdevsw
 
int mixer_count = 0
 
static eventhandler_tag mixer_ehtag = NULL
 

Macro Definition Documentation

◆ MIXER_NAMELEN

#define MIXER_NAMELEN   16

Definition at line 49 of file mixer.c.

◆ MIXER_SET_LOCK

#define MIXER_SET_LOCK (   x,
 
)
Value:
do { \
if ((y) != 0) \
snd_mtxlock((x)->lock); \
} while (0)

Definition at line 144 of file mixer.c.

◆ MIXER_SET_UNLOCK

#define MIXER_SET_UNLOCK (   x,
 
)
Value:
do { \
if ((y) != 0) \
snd_mtxunlock((x)->lock); \
} while (0)

Definition at line 139 of file mixer.c.

Function Documentation

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_MIXER  ,
"mixer"  ,
"mixer"   
)
static

◆ mix_get()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mix_get_dev()

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().

Here is the caller graph for this function:

◆ mix_get_locked()

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().

Here is the call graph for this function:

◆ mix_get_type()

int mix_get_type ( struct snd_mixer m)

Definition at line 1058 of file mixer.c.

References m, and pcmchan_matrix::type.

◆ mix_getchild()

u_int32_t mix_getchild ( struct snd_mixer m,
u_int32_t  dev 
)

Definition at line 619 of file mixer.c.

References dev, and m.

◆ mix_getdevinfo()

◆ mix_getdevs()

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().

Here is the caller graph for this function:

◆ mix_getmutedevs()

u_int32_t mix_getmutedevs ( struct snd_mixer m)

Definition at line 633 of file mixer.c.

References m.

Referenced by mixer_ioctl_cmd().

Here is the caller graph for this function:

◆ mix_getparent()

u_int32_t mix_getparent ( struct snd_mixer m,
u_int32_t  dev 
)

Definition at line 611 of file mixer.c.

References dev, and m.

Referenced by chn_syncstate().

Here is the caller graph for this function:

◆ mix_getrecdevs()

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().

Here is the caller graph for this function:

◆ mix_getrecsrc()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mix_set()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mix_set_locked()

int mix_set_locked ( struct snd_mixer m,
u_int  dev,
int  left,
int  right 
)

Definition at line 1593 of file mixer.c.

References dev, left, m, mixer_set(), and right.

Here is the call graph for this function:

◆ mix_setdevs()

◆ mix_setmutedevs()

void mix_setmutedevs ( struct snd_mixer mixer,
u_int32_t  mutedevs 
)

Definition at line 351 of file mixer.c.

References mixer, and mixer_set().

Referenced by mixer_hwvol_mute_locked(), and mixer_ioctl_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mix_setparentchild()

void mix_setparentchild ( struct snd_mixer m,
u_int32_t  parent,
u_int32_t  childs 
)

Definition at line 579 of file mixer.c.

References m, and mask.

Referenced by ac97mix_init(), hdaa_audio_ctl_ossmixer_init(), and uaudio_mixer_init_sub().

Here is the caller graph for this function:

◆ mix_setrealdev()

void mix_setrealdev ( struct snd_mixer m,
u_int32_t  dev,
u_int32_t  realdev 
)

Definition at line 602 of file mixer.c.

References dev, and m.

Referenced by ac97mix_init(), hdaa_audio_ctl_ossmixer_init(), and uaudio_mixer_init_sub().

Here is the caller graph for this function:

◆ mix_setrecdevs()

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.

Parameters
mmixer device context container thing
vmask 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().

Here is the caller graph for this function:

◆ mix_setrecsrc()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_busy()

int mixer_busy ( struct snd_mixer m)

Definition at line 994 of file mixer.c.

References m.

Referenced by sysctl_es137x_single_pcm_mixer().

Here is the caller graph for this function:

◆ mixer_clone()

static void mixer_clone ( void *  arg,
struct ucred *  cred,
char *  name,
int  namelen,
struct cdev **  dev 
)
static

Definition at line 1382 of file mixer.c.

References dev, snddev_info::mixer_dev, name, pcm_devclass, PCM_REGISTERED, and snd_unit.

Referenced by mixer_sysinit().

Here is the caller graph for this function:

◆ mixer_close()

static int mixer_close ( struct cdev *  i_dev,
int  flags,
int  mode,
struct thread *  td 
)
static

Definition at line 1099 of file mixer.c.

References m, PCM_REGISTERED, snd_mtxlock, and snd_mtxunlock.

◆ mixer_create()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_delete()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_get()

static int mixer_get ( struct snd_mixer mixer,
int  dev 
)
static

Definition at line 338 of file mixer.c.

References dev, and mixer.

Referenced by mix_get(), mix_get_locked(), mixer_hwvol_step_locked(), and mixer_ioctl_cmd().

Here is the caller graph for this function:

◆ mixer_get_devt()

static struct cdev * mixer_get_devt ( device_t  dev)
static

Definition at line 118 of file mixer.c.

References dev, and snddev_info::mixer_dev.

Referenced by mixer_hwvol_init(), mixer_hwvol_mute(), mixer_hwvol_step(), mixer_reinit(), and mixer_uninit().

Here is the caller graph for this function:

◆ mixer_get_lock()

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().

Here is the caller graph for this function:

◆ mixer_get_recroute()

static int mixer_get_recroute ( struct snd_mixer m,
int *  route 
)
static

Retrieve the route number of the current recording device.

OSSv4 assigns routing numbers to recording devices, unlike the previous API which relied on a fixed table of device numbers and names. This function returns the routing number of the device currently selected for recording.

For now, this function is kind of a goofy compatibility stub atop the existing sound system. (For example, in theory, the old sound system allows multiple recording devices to be specified via a bitmask.)

Parameters
mmixer context container thing
Return values
0success
EIDRMno recording device found (generally not possible)
Todo:
Ask about error code
Todo:
can user set a multi-device mask? (== or &?)

Definition at line 430 of file mixer.c.

References m.

Referenced by mixer_ioctl_cmd().

Here is the caller graph for this function:

◆ mixer_getrecsrc()

static int mixer_getrecsrc ( struct snd_mixer mixer)
static

Definition at line 406 of file mixer.c.

References mixer.

Referenced by mix_getrecsrc(), and mixer_ioctl_cmd().

Here is the caller graph for this function:

◆ mixer_hwvol_init()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_hwvol_mute()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_hwvol_mute_locked()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_hwvol_step()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_hwvol_step_locked()

void mixer_hwvol_step_locked ( struct snd_mixer m,
int  left_step,
int  right_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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_init()

◆ mixer_ioctl()

static int mixer_ioctl ( struct cdev *  i_dev,
u_long  cmd,
caddr_t  arg,
int  mode,
struct thread *  td 
)
static

◆ mixer_ioctl_channel()

static int mixer_ioctl_channel ( struct cdev *  dev,
u_long  cmd,
caddr_t  arg,
int  mode,
struct thread *  td,
int  from 
)
static

◆ mixer_ioctl_cmd()

int mixer_ioctl_cmd ( struct cdev *  i_dev,
u_long  cmd,
caddr_t  arg,
int  mode,
struct thread *  td,
int  from 
)

◆ mixer_lookup()

static int mixer_lookup ( char *  devname)
static

Definition at line 128 of file mixer.c.

References snd_mixernames.

Referenced by sysctl_hw_snd_hwvol_mixer().

Here is the caller graph for this function:

◆ mixer_mixerinfo()

static void mixer_mixerinfo ( struct snd_mixer m,
mixer_info *  mi 
)
static

Definition at line 1265 of file mixer.c.

References m.

Referenced by mixer_ioctl_cmd().

Here is the caller graph for this function:

◆ mixer_obj_create()

static struct snd_mixer * mixer_obj_create ( device_t  dev,
kobj_class_t  cls,
void *  devinfo,
int  type,
const char *  desc 
)
static

Definition at line 651 of file mixer.c.

References desc, dev, devinfo, m, MIXER_TYPE_PRIMARY, MIXER_TYPE_SECONDARY, snd_mtxcreate(), snd_mtxfree(), snd_mtxlock, pcmchan_matrix::type, and type.

Referenced by mixer_create(), and mixer_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_open()

static int mixer_open ( struct cdev *  i_dev,
int  flags,
int  mode,
struct thread *  td 
)
static

Definition at line 1076 of file mixer.c.

References m, PCM_DETACHING, PCM_REGISTERED, snd_mtxlock, and snd_mtxunlock.

◆ mixer_oss_mixerinfo()

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).

Note
Caller must not hold any PCM device, channel, or mixer locks.

See http://manuals.opensound.com/developer/SNDCTL_MIXERINFO.html for more information.

Parameters
i_devcharacter device on which the ioctl arrived
arguser argument (oss_mixerinfo *)
Return values
EINVALoss_mixerinfo::dev specified a bad value
0success
Todo:
Fill in
See also
oss_mixerinfo::mixerhandle.
Note
From 4Front: "mixerhandle is an arbitrary string that identifies the mixer better than the device number (mixerinfo.dev). Device numbers may change depending on the order the drivers are loaded. However the handle should remain the same provided that the sound card is not moved to another PCI slot."
See also
oss_mixerinfo::magic is a reserved field.
From 4Front: "magic is usually 0. However some devices may have dedicated setup utilities and the magic field may contain an unique driver specific value (managed by [4Front])."

The only flag for

See also
oss_mixerinfo::caps is currently MIXER_CAP_VIRTUAL, which I'm not sure we really worry about.

Mixer extensions currently aren't supported, so leave

See also
oss_mixerinfo::nrext blank for now.
Todo:
Fill in
See also
oss_mixerinfo::priority (requires touching drivers?)
Note
The priority field is for mixer applets to determine which mixer should be the default, with 0 being least preferred and 10 being most preferred. From 4Front: "OSS drivers like ICH use higher values (10) because such chips are known to be used only on motherboards. Drivers for high end pro devices use 0 because they will never be the default mixer. Other devices use values 1 to 9 depending on the estimated probability of being the default device.

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().

Here is the caller graph for this function:

◆ mixer_reinit()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_set()

static int mixer_set ( struct snd_mixer m,
u_int  dev,
u_int32_t  muted,
u_int  lev 
)
static

Definition at line 247 of file mixer.c.

References child, dev, snddev_info::flags, m, mixer_set_eq(), MIXER_SET_LOCK, mixer_set_softpcmvol(), MIXER_SET_UNLOCK, r, SD_F_EQ, SD_F_MPSAFE, and SD_F_SOFTPCMVOL.

Referenced by mix_set(), mix_set_locked(), mix_setmutedevs(), mixer_hwvol_step_locked(), mixer_init(), mixer_ioctl_cmd(), mixer_reinit(), and mixer_uninit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_set_eq()

static int mixer_set_eq ( struct snd_mixer m,
struct snddev_info d,
u_int  dev,
u_int  level 
)
static

Definition at line 195 of file mixer.c.

References snddev_info::busy, c, chn_findfeeder(), CHN_FOREACH, CHN_LOCK, CHN_UNLOCK, dev, FEEDEQ_BASS, FEEDEQ_TREBLE, FEEDER_EQ, snddev_info::flags, snddev_info::lock, m, MIXER_SET_LOCK, MIXER_SET_UNLOCK, snddev_info::pcm, PCM_DETACHING, PCM_REGISTERED, and SD_F_MPSAFE.

Referenced by mixer_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_set_recroute()

static int mixer_set_recroute ( struct snd_mixer m,
int  route 
)
static

Select a device for recording.

This function sets a recording source based on a recording device's routing number. Said number is translated to an old school recdev mask and passed over mixer_setrecsrc.

Parameters
mmixer context container thing
Return values
0success(?)
EINVALUser specified an invalid device number
otherwiseerror from mixer_setrecsrc

Definition at line 465 of file mixer.c.

References m, and mixer_setrecsrc().

Referenced by mixer_ioctl_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixer_set_softpcmvol()

static int mixer_set_softpcmvol ( struct snd_mixer m,
struct snddev_info d,
u_int  left,
u_int  right 
)
static

◆ mixer_setrecsrc()

static int mixer_setrecsrc ( struct snd_mixer mixer,
u_int32_t  src 
)
static

Definition at line 373 of file mixer.c.

References snddev_info::flags, mixer, MIXER_SET_LOCK, MIXER_SET_UNLOCK, SD_F_MPSAFE, and src.

Referenced by mix_setrecsrc(), mixer_init(), mixer_ioctl_cmd(), mixer_reinit(), mixer_set_recroute(), and mixer_uninit().

Here is the caller graph for this function:

◆ mixer_sysinit()

static void mixer_sysinit ( void *  p)
static

Definition at line 1400 of file mixer.c.

References mixer_clone(), and mixer_ehtag.

Here is the call graph for this function:

◆ mixer_sysuninit()

static void mixer_sysuninit ( void *  p)
static

Definition at line 1408 of file mixer.c.

References mixer_ehtag.

◆ mixer_uninit()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD$"  )

◆ sysctl_hw_snd_hwvol_mixer()

static int sysctl_hw_snd_hwvol_mixer ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 890 of file mixer.c.

References dev, error, m, mixer_lookup(), req, snd_mixernames, snd_mtxlock, and snd_mtxunlock.

Referenced by mixer_hwvol_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYSCTL_INT()

SYSCTL_INT ( _hw_snd  ,
OID_AUTO  ,
vpc_mixer_bypass  ,
CTLFLAG_RWTUN  ,
mixer_bypass,
,
"control channel pcm/rec  volume,
bypassing real mixer device"   
)

◆ SYSINIT()

SYSINIT ( mixer_sysinit  ,
SI_SUB_DRIVERS  ,
SI_ORDER_MIDDLE  ,
mixer_sysinit  ,
NULL   
)

◆ SYSUNINIT()

SYSUNINIT ( mixer_sysuninit  ,
SI_SUB_DRIVERS  ,
SI_ORDER_MIDDLE  ,
mixer_sysuninit  ,
NULL   
)

Variable Documentation

◆ mixer_bypass

int mixer_bypass = 1
static

Definition at line 44 of file mixer.c.

Referenced by mixer_ioctl().

◆ mixer_cdevsw

struct cdevsw mixer_cdevsw
static
Initial value:
= {
.d_version = D_VERSION,
.d_open = mixer_open,
.d_close = mixer_close,
.d_ioctl = mixer_ioctl,
.d_name = "mixer",
}
static d_close_t mixer_close
Definition: mixer.c:99
static d_ioctl_t mixer_ioctl
Definition: mixer.c:100
static d_open_t mixer_open
Definition: mixer.c:98

Definition at line 102 of file mixer.c.

Referenced by mixer_init(), and mixer_oss_mixerinfo().

◆ mixer_close

d_close_t mixer_close
static

Definition at line 99 of file mixer.c.

◆ mixer_count

int mixer_count = 0

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().

◆ mixer_ehtag

eventhandler_tag mixer_ehtag = NULL
static

Definition at line 115 of file mixer.c.

Referenced by mixer_sysinit(), and mixer_sysuninit().

◆ mixer_ioctl

d_ioctl_t mixer_ioctl
static

Definition at line 100 of file mixer.c.

◆ mixer_open

d_open_t mixer_open
static

Definition at line 98 of file mixer.c.

◆ snd_mixerdefaults

u_int16_t snd_mixerdefaults[SOUND_MIXER_NRDEVICES]
static
Initial value:
= {
[SOUND_MIXER_VOLUME] = 75,
[SOUND_MIXER_BASS] = 50,
[SOUND_MIXER_TREBLE] = 50,
[SOUND_MIXER_SYNTH] = 75,
[SOUND_MIXER_PCM] = 75,
[SOUND_MIXER_SPEAKER] = 75,
[SOUND_MIXER_LINE] = 75,
[SOUND_MIXER_MIC] = 25,
[SOUND_MIXER_CD] = 75,
[SOUND_MIXER_IGAIN] = 0,
[SOUND_MIXER_LINE1] = 75,
[SOUND_MIXER_VIDEO] = 75,
[SOUND_MIXER_RECLEV] = 75,
[SOUND_MIXER_OGAIN] = 50,
[SOUND_MIXER_MONITOR] = 75,
}

Definition at line 78 of file mixer.c.

Referenced by mixer_init().

◆ snd_mixernames

char* snd_mixernames[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES
static

Definition at line 96 of file mixer.c.

Referenced by mix_setrecdevs(), mixer_init(), mixer_lookup(), and sysctl_hw_snd_hwvol_mixer().