LSP 2.00 Davinci Linux Audio Driver Guide
Total Page:16
File Type:pdf, Size:1020Kb
2.00 DaVinci Linux Audio Driver User's Guide Literature Number: SPRUG98 September 2008 2 SPRUG98–September 2008 Submit Documentation Feedback Preface SPRUG98–September 2008 Read This First About This Manual This user guide provides an overview of the audio driver by providing the driver architecture, design, and supported features. It also provides information on architecture, user Interface, and the sample applications. This user guide defines and describes the usage of user level and platform level interfaces of the ALSA Audio driver. How to Use This Manual This document includes the following Sections: • Chapter 1 - Introduction, provides an overview and supported features of the driver. • Chapter 2 - Architecture, describes the driver architecture and design concepts. • Chapter 3 - Software Interface, describes the application and driver interfaces. • Chapter 4 - Sample Applications, provides an overview about the examples provided along with the release package. Related Documentation From Texas Instruments The following documents are the reference documents from Texas Instruments. To obtain a copy of any of these TI documents, visit the Texas Instruments website at www.ti.com. • TMS320DM646x DMSoC Multichannel Audio Serial Port (McASP) User's Guide (SPRUER1) describes the operation of the multichannel audio serial port (McASP) in the TMS320DM646x Digital Media System-on-Chip (DMSoC). • TLVAIC32 Data Sheet (SLAS479B) provides the features and description of TLVAIC32. Related Documentation You can use the following document to supplement this user guide: • ALSA Project Homepage • ALSA User Space Library SPRUG98–September 2008 Read This First 3 Submit Documentation Feedback Terms and Abbreviations www.ti.com Terms and Abbreviations The following terms and abbreviations are used in this document. Term/Abbreviation Description ALSA Advanced Linux Sound Architecture API Application Programming Interface DIT Digital Audio Interface Transmission DMA Direct Memory Access EDMA Enhanced Direct Memory Access EVM Evaluation Module PCM Pulse Code Modulation I2C Inter-Integrated Circuit I2S Inter-Integrated Sound McASP Multi Channel Audio Serial Port OSS Open Sound System TDM Time-Division Multiplexed Trademarks DaVinci is a trademark of Texas Instruments. 4 Read This First SPRUG98–September 2008 Submit Documentation Feedback Chapter 1 SPRUG98–September 2008 Introduction This chapter provides an overview and the supported features and constraints of the driver. Topic .................................................................................................. Page 1.1 Overview ................................................................................... 6 1.2 Features .................................................................................... 6 1.3 Constraints ................................................................................ 6 SPRUG98–September 2008 Introduction 5 Submit Documentation Feedback Overview www.ti.com 1.1 Overview The AIC32 codec transmits and receives audio data on DM700 DaVinci™HD. The AIC32 codec is connected via Multi-Channel Audio Serial Port (McASP) interface, a communication peripheral. McASP functions as a general-purpose audio serial port optimized for the needs of multi-channel audio applications. The McASP is useful for time-division multiplexed (TDM) stream, Inter-Integrated Sound (I2S) protocols, and inter component digital audio interface transmission (DIT). AIC32 supports I2S, Left/Right-Justified, DSP, and TDM Modes. 1.2 Features The ALSA Audio driver supports the following features: • ALSA framework • Simultaneous record and play back capability (full-duplex mode). • The McASP and Codec can work as slave and master or visa versa. This is not a runtime option, but a compile time option. • When Codec is the master and McASP is the slave, the driver supports 34 sample rates (from 7350 Hz - 96000 Hz). When McASP is the master and Codec is the slave, there are only two sampling rates supported (22050Hz and 44100 Hz). • Mono and stereo modes • I2S mode of operation • Interleaved access mode • Mixer support • Uses EDMA for data transfer 1.3 Constraints OSS framework is not supported by the audio driver. Formats other than I2S such as TDM, Left and Right Justified are currently not supported. Opening of the same stream (Play/Record) multiple times is not supported The audio driver will support a single input (RECORD) and single output stream (PLAY). The audio driver will not allow opening the same stream (Play/Record) multiple times concurrently. 6 Introduction SPRUG98–September 2008 Submit Documentation Feedback Chapter 2 SPRUG98–September 2008 Architecture This chapter provides a Functional Overview and the System architecture and design aspects of the driver. Topic .................................................................................................. Page 2.1 Functional Overview ................................................................... 8 2.2 Software Design Interfaces .......................................................... 9 SPRUG98–September 2008 Architecture 7 Submit Documentation Feedback Functional Overview www.ti.com 2.1 Functional Overview The Advanced Linux Sound Architecture (ALSA) provides audio functionality to the Linux operating system. ALSA has the following significant features: • Efficient support for all types of audio interfaces, from consumer sound cards to professional multi-channel audio interfaces. • Fully modularized sound drivers • SMP and thread-safe design • User space library (alsa-lib) to simplify application programming and provide higher level functionality • Support for the older Open Sound System (OSS) API, providing binary compatibility for most OSS programs The system diagram is presented in Figure 2-1. Figure 2-1. System Diagram PCLKCR0/1/3 LOSPCP (SystemCtrlRegs) (SystemCtrlRegs) SYSCLK ClockEnables LSPCLK Peripheral I/O SPI-A/B,SCI-A Registers VBus16 ClockEnables /2 Peripheral I/O HECC-A,LIN-A Registers VBus32 ClockEnables GPIO Peripheral Mux I/O ECAP1,EQEP1 Registers VBus32 ClockEnables Peripheral I/O ETPWM1/.../5+OTTO Registers VBus32/VBUS32DP ClockEnables Peripheral I/O I2C-A Registers CPU-VBus16 ClockEnables ADC CPU-VBus16 16Ch 12-Bit ADC Registers Analog CPU&MCLA-Mem32 GPIO Mux ClockEnables COMP 6 COMP1/2/3 Registers VBus32/VBUS32DP ClockEnables DAC 10-BitDAC1/2/3 Registers VBus32/VBUS32DP 8 Architecture SPRUG98–September 2008 Submit Documentation Feedback www.ti.com Software Design Interfaces 2.2 Software Design Interfaces 2.2.1 ALSA Audio Applications The ALSA audio applications are compatible with the ALSA standard. They communicate with the ALSA user space library to receive/transmit audio data. Many applications that support ALSA could be downward compatible with OSS. But for this, the OSS emulation layer has to be enabled in the Linux kernel during the configuration time. 2.2.2 Mixer Applications The mixer applications control the overall behavior of the codec. These include setting of the volume in the codec and so on. This interface does not support data transfer. However, it is useful if only the control of the codec is desired. 2.2.3 ALSA Library The Advanced Linux Sound Architecture comes with a Kernel API and a library API. Application programmers should use the library API rather than the kernel API. The library offers 100% of the functionality of the kernel API, but adds major improvements in usability, making the application code simpler and better looking. 2.2.4 ALSA Kernel API The ALSA kernel API provides the basic infrastructure of ALSA and the hardware drivers. The top layer takes care of the detection of the device(s), creation of ALSA components and various destructors. The middle layer (ALSA common layer) has the device manager and provides the implementations for native ALSA modules like PCM, synth, rawmidi etc. 2.2.5 Davinci-HD ALSA Audio Driver The Davinci-HD audio base driver provides a codec-independent interface for the audio driver for OMAP processor-based platforms. It is necessary for each audio driver to implement the low-level functions to access its hardware. The driver encapsulates all the generic routines which are required to handle audio data and is codec independent in nature. 2.2.6 AIC32 Codec ALSA Driver The AIC32 component is codec specific and in turn may use the helper drivers to communicate with the actual codec. This includes the responsibilities of data transfer and control of the codec. The codec driver may expose a mixer device to give better codec specific control to the user space applications. 2.2.7 Helper Driver These are lower level helper drivers which provide APIs for access to specific communication media. This includes connectivity drivers such as McASP (for data) and I2C (for control). SPRUG98–September 2008 Architecture 9 Submit Documentation Feedback 10 Architecture SPRUG98–September 2008 Submit Documentation Feedback Chapter 3 SPRUG98–September 2008 Software Interfaces This chapter describes the Application Interface, Proc Interface and driver Interface for the ALSA Audio driver. Topic .................................................................................................. Page 3.1 Application Interface ................................................................. 12 3.2 User Space Interactions............................................................. 13 3.3 Driver Interface ......................................................................... 18 SPRUG98–September 2008 Software Interfaces 11 Submit Documentation Feedback Application