home kinesia products products
Embedded Linux Information

  1. Building the 2.4.x Kernel Basics
  2. Network Configuration
  3. Developing Applications and Modules for uClinux 2.4.x
  4. Connection between Linux PC and 44B0X Target Board
  5. LCD Configuration
  6. Audio Configuration
  7. Sharp ARM 9 Root FS with FC
  8. Modifying SDL-1.2.11 to support USB mouse for ARM

Audio Configuration of uClinux 2.4.x for 44B0X

by Tong Lai Yu, Felix Lo, John Jiang, and Ken Liu November 2005

The Audio driver is ported from some S3C2410 Audio drivers and they are placed under Here.

We are using audio chip WM8711 which consists of I2C interface and I2S interface. The I2C interface is used for controlling the Mixer, setting the Power management and configurating the audio codec.

I2C Interface
At the functions, init_s3c44b0x_iic_bus & s3c44b0x_wm8711_init,
We need to enable the hardware of I2C and define the interrupt call back function.

I2S Interface
The TX hardware configuration is



Initialization of the audio driver

DMA Transfrer
The audio is transferred to the I2S interface via DMA transfer with the outgoing FIFO. However, at the S3C44B0X, there are only one DMA transfer for I2S (BDMA0). Therefore, if you need to do recording at the same time, there is no DMA transfer but use the incoming FIFO only.

Prescaler
For the speed of Audio playback, it depends on the Master Clock. Therefore, for different audio sample rate, we need to change the Master clock and the prescler so that the audio can be played in a corrected speed.

Audio Buffer
The audio buffering is the most complicated part in the audio driver. It consists of audio buffers, dma physical bufferes, Buffer queue and semaphore.
  • It calls audio_setup_buf. It will allocate 8 audio buffers for recording the size and the physical address of each DMA buffer. Therefore, this method will setup the physical DMA buffer via call consistent_alloc. It will loop inside this method if I pass the flag GFP_DMA. It will allocate an continuous memory for 8 Physical DMA Buffers.
  • When the audio data has come, it will call wm8711_audio_write. It copies the audio data and places it into the queue via s3c44b0x_dma_queue_buffer.

    Semaphore
    We have allocated 8 audio buffers. When these 8 buffers have been used, there will be no place for audio data. Therefore semaphore is used. When the audio data has placed into the buffer, the semaphore will help to lock it until the data has been transferred. If the audio data has placed into a lock buffer, it will wait until it has get the semaphore.

    Difficulty
    The audio buffer seems that it only works in single thread or multi-thread sound system.