Home > OS >  One of Linux with ALSA sound card driver: with ALSA architecture overview
One of Linux with ALSA sound card driver: with ALSA architecture overview

Time:11-01

,
1, hardware

By visible on, when the playback of audio, usually the CPU through the bus sent PCM CODEC audio data, then the CODEC DA conversion, amplification and gain a series of processing, finally transmitted to the speaker, the recording process on the other hand,
2, software architecture

User space with alsa library for the application to provide a unified API interface, so that we can hide the driver layer implementation details, simplify the implementation of the application difficulty, kernel space, with alsa soc is to encapsulate with alsa driver is unified, in order to compatible with different platforms, driven style more unified at the same time, will further discuss below,
3, audio driven architecture

2, structure
1, the file structure with alsa equipment
CRW - rw + 1 root audio - 116, August 2011-02-23 21:38 controlC0
CRW - rw + 1 root audio - 116, April 2011-02-23 21:38 midiC0D0
CRW - rw + 1 root audio - 116, July 2011-02-23 pcmC0D0c "
CRW - rw + 1 root audio - 116, 2011-02-23 21:56 pcmC0D0p
CRW - rw + 1 root audio - 116, 5 2011-02-23 21:38 pcmC0D1p
CRW - rw + 1 root audio - 116, 3 2011-02-23 21:38 seq
CRW - rw + 1 root audio - 116, 2 2011-02-23 21:38 timer

We can see the following file:
ControlC0 - & gt; For the control of sound card, channel selection, for example, mixing, the microphone control etc.
MidiC0D0 - & gt; Used to play MIDI audio
PcmC0D0c -> for the recording of the PCM equipment
PcmC0D0p -> play PCM equipment
Seq -> sequencer
Timer timer -->
Among them, the C0D0 represents the sound card 0 0, the equipment in a pcmC0D0c last c represents the capture, pcmC0D0p last p represents the playback, these are all with alsa driver - the naming rules, can be seen from the above list, I hung up the six under the sound card of equipment, according to the actual sound card, driver can actually hang a wider variety of equipment, in include/sound/core h, defines the following types of equipment:
Usually, we are more interested in PCM and control the two devices,
2, the directory structure
Sound
/core
/oss
/seq
/ioctl32
/include
/drivers
/i2c
/synth
/emux
/pci
/(CARDS)
/isa
/(CARDS)
/arm
/PPC
/Sparc
/usb
/pcmcia/(CARDS)
/oss
/soc
/codecs

The core this directory contains with ALSA driver layer, it is the core part of the whole with ALSA driver
The core/oss contains the PCM and simulate the old oss architecture Mixer module
The core/seq about sequencer related code
Include with ALSA driver public header file directory, the directory of header files need to be exported to user space applications, usually, the driver module private header files should not be placed here
A few drivers with CPU, BUS architecture has nothing to do with the common code of
I2c with ALSA own i2c control code
At the top of pci pci soundcard directories and subdirectories contains various pci sound card code
At the top of the isa isa sound card directories and subdirectories contains various isa sound card code
Intermediate for soc system - on - chip system code
Soc/codecs in the light of the codec of the soc system, code that has nothing to do with the platform
  • Related