Writing an ALSA Driver
Table of Contents
List of Examples
Preface
Chapter 1. File Tree Structure
General
core directory
core/oss
core/ioctl32
core/seq
core/seq/oss
core/seq/instr
include directory
drivers directory
drivers/mpu401
drivers/opl3 and opl4
i2c directory
i2c/l3
synth directory
pci directory
isa directory
arm, ppc, and sparc directories
usb directory
pcmcia directory
oss directory
Chapter 2. Basic Flow for PCI Drivers
Outline
Full Code Example
Constructor
1) Check and increment the device index.
2) Create a card instance
3) Create a main component
4) Set the driver ID and name strings.
5) Create other components, such as mixer, MIDI, etc.
6) Register the card instance.
7) Set the PCI driver data and return zero.
Destructor
Header Files
Chapter 3. Management of Cards and Components
Card Instance
Components
ChipSpecific Data
1. Allocating via sndcardnew().
2. Allocating an extra device.
Registration and Release
Chapter 4. PCI Resource Managements
Full Code Example
Some Hafta's
Resource Allocation
PCI Entries
Chapter 5. PCM Interface
General
Full Code Example
Constructor
... And the Destructor?
Runtime Pointer The Chest of PCM Information
Hardware Description
PCM Configurations
DMA Buffer Information
Running Status
Private Data
Interrupt Callbacks
Operators
open callback
close callback
ioctl callback
hwparams callback
hwfree callback
prepare callback
trigger callback
pointer callback
copy and silence callbacks
ack callback
page callback
Interrupt Handler
Interrupts at the period (fragment) boundary
Highfrequent timer interrupts
On calling sndpcmperiodelapsed()
Atomicity
Constraints
Chapter 6. Control Interface
General
Definition of Controls
Control Names
Global capture and playback
Tonecontrols
3D controls
Mic boost
Access Flags
Callbacks
info callback
get callback
put callback
Callbacks are not atomic
Constructor
Change Notification
Chapter 7. API for AC97 Codec
General
Full Code Example
Constructor
Callbacks
Updating Registers in The Driver
Clock Adjustment
Proc Files
Multiple Codecs
Chapter 8. MIDI (MPU401UART) Interface
General
Constructor
Interrupt Handler
Chapter 9. Miscellaneous Devices
FM OPL3
HardwareDependent Devices
IEC958 (S/PDIF)
Chapter 10. Buffer and Memory Management
Buffer Types
External Hardware Buffers
NonContiguous Buffers
Vmalloc'ed Buffers
Chapter 11. Proc Interface
Chapter 12. Power Management
Chapter 13. Module Parameters
Chapter 14. How To Put Your Driver Into ALSA Tree
General
Driver with A Single Source File
Drivers with Several Source Files
Chapter 15. Useful Functions
sndprintk() and friends
sndassert()
sndruntimecheck()
sndBUG()
Chapter 16. Acknowledgments