The prototype of the ado_pcm_create() function is:
int32_t ado_pcm_create( ado_card_t *card,
char *name,
uint32_t flags,
char *id,
uint32_t play_subchns,
ado_pcm_cap_t *play_cap,
ado_pcm_hw_t *play_hw,
uint32_t cap_subchns,
ado_pcm_cap_t *cap_cap,
ado_pcm_hw_t *cap_hw,
ado_pcm_t **rpcm );
The arguments are:
- card
- The card argument that io-audio passed to your
Audio HW DLL's ctrl_init() function.
The library uses this argument as the card to link the new device onto.
- name, id
- Text names for the PCM device, usually a variation of the card name.
They're used only for information display by client applications.
- flags
- Information about the device for the use of client applications,
for example, indicating whether or not both the playback and capture
can be used at the same time.
These flags are informational only;
enforcing any of these conditions is done by code
and isn't based on these flags.
- play_subchns, cap_subchns
- The number of playback and capture subchannels supported.
If zero, the channel isn't supported.
- play_cap, cap_cap
- Structures listing the full capabilities of the device's playback
and capture channels.
These include format, rate, and voices
supported.
The upper driver layers use this information to verify a client request
before allowing the request to pass to the hardware.
This information is also passed back to the client
as the static capabilities of the device.
- play_hw, cap_hw
- Structures containing the playback and capture callback functions to be
called by the upper layers of the driver.
It's in these functions that you actually program the hardware.
For more information, see
"How does the PCM stream operate?"
later in this chapter.
- rpcm
- The location
in which to store a pointer to the internal PCM device structure.
You'll need this pointer for additional PCM function calls.