FreeBSD kernel sound device code
Todo List
globalScope> Global chn_init (struct pcm_channel *c, void *devinfo, int dir, int direction)
Should this be moved somewhere else? The primary buffer is allocated by the driver or via DMA map setup, and tmpbuf seems to only come into existence in sndbuf_resize().
globalScope> Global chn_write (struct pcm_channel *c, struct uio *buf)
Evaluate whether EAGAIN is truly desirable. 4Front drivers behave like this, but I'm not sure if it at all violates the "write should be allowed to block" model.
globalScope> Global dsp_ioctl (struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
Actually test SNDCTL_DSP_CURRENT_IPTR.
globalScope> Global dsp_oss_audioinfo (struct cdev *, oss_audioinfo *)

Verify correctness of Doxygen tags. ;)

SNDCTL_AUDIOINFO::caps - Make drivers keep these in pcmchan::caps?

song_name - depends first on SNDCTL_[GS]ETSONG

label - depends on SNDCTL_[GS]ETLABEL

port_number - routing information?

handle - haven't decided how to generate this yet; bus, vendor, device IDs?

globalScope> Global dsp_oss_audioinfo (struct cdev *, oss_audioinfo *)

Verify correctness of Doxygen tags. ;)

SNDCTL_AUDIOINFO::caps - Make drivers keep these in pcmchan::caps?

song_name - depends first on SNDCTL_[GS]ETSONG

label - depends on SNDCTL_[GS]ETLABEL

port_number - routing information?

handle - haven't decided how to generate this yet; bus, vendor, device IDs?

globalScope> Global dsp_oss_policy (struct pcm_channel *wrch, struct pcm_channel *rdch, int policy)
When SNDCTL_DSP_COOKEDMODE is supported, it'll be necessary to work with hardware drivers directly.
globalScope> Global dsp_oss_syncgroup (struct pcm_channel *wrch, struct pcm_channel *rdch, oss_syncgroup *group)
As far as memory allocation, should we assume that things are okay and allocate with M_WAITOK before acquiring channel locks, freeing later if not?
globalScope> Global dsp_oss_syncstart (int sg_id)
Is PRIBIO correct/
globalScope> Global mixer_get_recroute (struct snd_mixer *m, int *route)

Ask about error code

can user set a multi-device mask? (== or &?)

globalScope> Global mixer_oss_mixerinfo (struct cdev *i_dev, oss_mixerinfo *mi)
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."
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.
globalScope> Global sound_oss_sysinfo (oss_sysinfo *)

Collect num{midis,timers}.

Fill in "busy devices" fields.

globalScope> Global sound_oss_sysinfo (oss_sysinfo *)

Collect num{midis,timers}.

Fill in "busy devices" fields.