typedef struct oss_audioinfo
{
  int dev;                      /* Audio device number */
  char name[64];
  int busy;                     /* 0, OPEN_READ, OPEN_WRITE or OPEN_READWRITE */
  int pid;
  int caps;                     /* DSP_CAP_INPUT, DSP_CAP_OUTPUT */
  int iformats, oformats;
  int magic;                    /* Reserved for internal use */
  char cmd[64];                 /* Command using the device (if known) */
  int card_number;
  int port_number;
  int mixer_dev;
  int real_device;              /* This is the right /dev/dsp# device to open */
  int enabled;                  /* 1=enabled, 0=device not ready at this moment */
  int flags;                    /* For internal use only - no practical meaning */
  int min_rate, max_rate;       /* Sample rate limits */
  int min_channels, max_channels;       /* Number of channels supported */
  int binding;                  /* DSP_BIND_FRONT, etc. 0 means undefined */
  int rate_source;
  char handle[32];
  int nrates, rates[20];        /* Please read the manual before using these */
  oss_longname_t song_name;     /* Song name (if given) */
  oss_label_t label_name;       /* Device label (if given) */
  int filler[195];
} oss_audioinfo;

This ioctl is meant to go straight to the hardware, reporting only what's supported natively by the hardware. That rules out emulating SNDCTL_DSP_GETCAPS/GETFMTS, because they both depend on the intermediate channel interface. Mailed netchild & ariff for advice.

field

TODO

dev

unit number?

name

device_get_desc()

busy

examine read and write channel flags for CHN_F_BUSY

pid

XXX -- this depends on the channel opened; with virtual channels, multiple processes may have a single HW device

caps

XXX -- need way to get to driver capabilties, formats, etc. w/o touching channel interface

iformats

XXX -- same caveat as caps

ofortmats

XXX -- same caveat as caps

cmd

XXX -- see pid

card_number

set to -1 for now (not very useful; OSS docs recommend not using this field)

song_name

write SNDCTL_{GET,SET}SONG first

label

write SNDCTL_{GET,SET}LABEL first

port_number

mixer_dev

real_device

unit number -- corresponds to /dev/dspN

devnode

cdev->si_name

enabled

device_t dev->state >= DS_ATTACHED

min_rate, max_rate

XXX -- same caveat as caps

min_channels, max_channels

1 = mono, 2 = stereo, etc.; XXX -- same caveat as caps

binding

not officially part of OSS; see SNDCTL_DSP_BIND_CHANNEL

rate_source

sample rate group? unsure.

handle

constant identifier -- (ex: PCI slot number, etc.) think about this later

nrates, rates

not exported by card drivers; would need to touch them all

RyanBeasley/ioctlref/SNDCTL_AUDIOINFO (last edited 2008-06-17T21:37:23+0000 by anonymous)