FreeBSD kernel sound device code
|
Go to the source code of this file.
Functions | |
char * | dsp_unit2name (char *, size_t, int) |
int | dsp_oss_audioinfo (struct cdev *, oss_audioinfo *) |
Handler for SNDCTL_AUDIOINFO. More... | |
void | dsp_cdevinfo_init (struct snddev_info *) |
void | dsp_cdevinfo_flush (struct snddev_info *) |
Variables | |
struct cdevsw | dsp_cdevsw |
void dsp_cdevinfo_flush | ( | struct snddev_info * | d | ) |
Definition at line 349 of file dsp.c.
References free, PCM_BUSYASSERT, and PCM_UNLOCKASSERT.
Referenced by pcm_unregister().
void dsp_cdevinfo_init | ( | struct snddev_info * | d | ) |
Definition at line 332 of file dsp.c.
References DSP_CDEVINFO_CACHESIZE, PCM_BUSYASSERT, and PCM_UNLOCKASSERT.
Referenced by pcm_register().
int dsp_oss_audioinfo | ( | struct cdev * | i_dev, |
oss_audioinfo * | ai | ||
) |
Handler for SNDCTL_AUDIOINFO.
Gathers information about the audio device specified in ai->dev. If ai->dev == -1, then this function gathers information about the current device. If the call comes in on a non-audio device and ai->dev == -1, return EINVAL.
This routine is supposed to go practically straight to the hardware, getting capabilities directly from the sound card driver, side-stepping the intermediate channel interface.
Note, however, that the usefulness of this command is significantly decreased when requesting info about any device other than the one serving the request. While each snddev_channel refers to a specific device node, the converse is not true. Currently, when a sound device node is opened, the sound subsystem scans for an available audio channel (or channels, if opened in read+write) and then assigns them to the si_drv[12] private data fields. As a result, any information returned linking a channel to a specific character device isn't necessarily accurate.
dev | device on which the ioctl was issued |
ai | ioctl request data container |
0 | success |
EINVAL | ai->dev specifies an invalid device |
cmd
- OSSv4 docs: "Only supported under Linux at
this moment." Cop-out, I know, but I'll save running around in the process table for later. Is there a risk of leaking information?SNDCTL_AUDIOINFO::caps
- Make drivers keep these in pcmchan::caps? magic
- OSSv4 docs: "Reserved for internal use
by OSS."card_number
- OSSv4 docs: "Number of the sound
card where this device belongs or -1 if this
information is not available. Applications
should normally not use this field for any
purpose."song_name
- depends first on SNDCTL_[GS]ETSONGlabel
- depends on SNDCTL_[GS]ETLABEL port_number
- routing information? real_device
- OSSv4 docs: "Obsolete."flags
- OSSv4 docs: "Reserved for future use."binding
- OSSv4 docs: "Reserved for future use."handle
- haven't decided how to generate this yet; bus, vendor, device IDs? Definition at line 2587 of file dsp.c.
References AFMT_CHANNEL, buf, pcmchan_caps::caps, snddev_info::channels, CHN_F_BUSY, CHN_F_VIRTUAL, CHN_FOREACH, chn_getcaps(), chn_getrates(), CHN_LOCK, CHN_NAMELEN, CHN_UNLOCK, CHN_UNLOCKASSERT, snddev_info::dev, pcm_channel::direction, dsp_cdevsw, DSP_REGISTERED, dsp_unit2name(), pcm_channel::flags, pcmchan_caps::fmtlist, fmts, pcmchan_caps::maxspeed, pcmchan_caps::minspeed, snddev_info::mixer_dev, pcm_channel::name, pcm_devclass, PCM_LOCK, PCM_RDCH, PCM_REGISTERED, PCM_UNLOCK, PCM_UNLOCKASSERT, PCM_WRCH, PCMDIR_PLAY, PCMUNIT, pcm_channel::pid, rates, and pcm_channel::unit.
Referenced by dsp_ioctl(), and mixer_ioctl_cmd().
char * dsp_unit2name | ( | char * | buf, |
size_t | len, | ||
int | unit | ||
) |
Definition at line 2534 of file dsp.c.
References alias, buf, dsp_cdevs, len, name, sep, snd_unit2c(), snd_unit2d(), snd_unit2u(), type, and pcm_channel::unit.
Referenced by dsp_oss_audioinfo(), pcm_chn_create(), and vchan_sync().
|
extern |
Definition at line 86 of file dsp.c.
Referenced by dsp_clone(), and dsp_oss_audioinfo().