Before discussing the organization of the driver
you're about to write, it's useful to first discuss
the organization of the QNX audio system.
Let's consider an audio application sending data
to an audio card.
The QNX architecture for this is:
Figure 1. How the driver fits into the QNX audio system.
Everything to the right of the Process memory boundary is the audio driver.
To complete the audio driver for your
audio card, you have to build only the Audio HW DLL.
- Audio application
- Produces PCM data and then makes a series of QNX Audio API calls
to send this data to the Audio card.
For more information, see the QNX
Audio Developer's Guide.
- Client library (asoundlib.so)
- Translates the API calls into messages and sends them to the driver process
across the fully memory-protected boundary.
In addition to this, the client library
has a series of plugins that the application can use
to convert its data to and from various formats.
This means the driver has to support only native audio formats.
The client library plugins can be used to
make any necessary conversions. The mechanism by which
this is done is somewhat complicated and outside the scope
of this document, but it does allow for a simplified driver interface.
- io-audio
- The main controller for all audio drivers.
It's designed to support multiple audio cards simultaneously.
Its primary functions are mounting and unmounting
audio cards, and directing inbound messages to the correct card.
For information about starting io-audio, see the
QNX Utilities Reference.
- Driver shared library
- Provides a series of subroutines that the io-audio
and the Audio HW DLL modules need.
Due to the nature of our dynamically linked library system,
the driver shared library doesn't need
to be a separate file. Instead it's actually linked
into the io-audio module, but it's still
useful to think of it as a separate piece that any module can reach.
- Audio hardware DLL
- This is the piece you're developing.
It's the
bridge between the hardware and the rest of the audio system.
Thanks to the architecture, the amount of code inside
this module is quite small.
The audio HW DLL module is produced
as a DLL so that io-audio can load
and unload it at runtime so as to reduce its memory footprint.
- Mixer DLL
- If the card has a standard codec, you can use a mixer DLL to further reduce
the work required in writing the audio HW DLL.
For more information, see the
Supported Codecs
appendix.