world leader in high performance signal processing
Trace: » ad1980

Adding Audio to the Kernel

AD1980 is no longer supported after 2010 release.

Adding Kernel Support - As a module

To add the support of AD1980/1 to the kernel build system, a few things must be enabled properly for things to work.The structure of the driver has been changed after 2008R1.5,so things are a bit different from then on.The configuration is as following:

 Linux Kernel Configuration 
    Sound  ---> 
      <M> Sound card support
       Advanced Linux Sound Architecture  --->
        <M> Advanced Linux Sound Architecture
        <M> OSS Mixer API 
        <M> OSS PCM (digital audio) API
        [*]     OSS PCM (digital audio) API - Include plugin system
        [*]   Support old ALSA API 
        [*]   Verbose procfs contents 
 
        Codec configuration for releases 2008R1/1.5:
        System on Chip audio support  --->
         <M> ALSA for SoC audio support
         <M> SoC Audio for ADI BF5xx chip 
         [*] Enable MMAP Support
         <M> SoC AC97 Audio support for BF5xx 
         (0) Set a SPORT for Sound chip

        Codec configuration for releases after 2008R1.5:
         System on Chip audio support  --->
         <M> ALSA for SoC audio support
         <M>   SoC AC97 Audio for the ADI BF5xx chip  
         [*]     Enable MMAP Support (NEW) 
         [ ]     Enable Multichannel Support (NEW)
         <M>   SoC AD1980/1 Audio support for BF5xx (NEW) 
         (0) Set a SPORT for Sound chip

Completing this will create modules (outside the kernel). The modules will be inserted automatically when it is needed. You can also build sound driver into kernel by replacing <M> with <*>.

Testing the built in kernel driver

If audio is configured as modules, skip this section. If audio is built into kernel and you have booted the kernel, there are a few things to check to ensure audio is working:

  1. Check the boot messages to see if you have booted the correct kernel. During kernel boot, it should print out:
    Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50 2006 UTC).
    ASoC version 0.13.2
    dma rx:0 tx:1, err irq:10, regs:ffc00800
    AD1980 SoC Audio Codec
    asoc: AC97 <-> bf5xx-ac97 mapping ok
    ALSA device list:
      #0: bf5xx-board (AD1980)

Testing the audio module

root:/> modprobe snd-ad1980
ASoC version 0.13.2
dma rx:0 tx:1, err irq:10, regs:ffc00800
AD1980 SoC Audio Codec
asoc: AC97 <-> bf5xx-ac97 mapping ok
root:~> modprobe snd-pcm-oss
root:~> lsmod
Module                  Size  Used by
snd_pcm_oss            30844  0 
snd_mixer_oss          11352  1 snd_pcm_oss
snd_ad1980              1128  0 
snd_bf5xx_ac97          3592  1 snd_ad1980
snd_soc_ad1980          5080  1 snd_ad1980
snd_soc_core           20728  2 snd_bf5xx_ac97,snd_soc_ad1980
snd_pcm                46644  3 snd_pcm_oss,snd_bf5xx_ac97,snd_soc_core
snd_timer              14052  1 snd_pcm
snd_page_alloc          4372  1 snd_pcm
ac97_bus                 784  1 snd_soc_core
snd                    31192  6 snd_pcm_oss,snd_mixer_oss,snd_soc_ad1980,snd_soc_core,snd_pcm,snd_timer
soundcore               3904  1 snd
snd_soc_bf5xx_ac97      3564  3 snd_ad1980,snd_bf5xx_ac97,snd_soc_ad1980
snd_soc_bf5xx_sport    10556  3 snd_ad1980,snd_bf5xx_ac97,snd_soc_bf5xx_ac97

root:~> tone
TONE: generating sine wave at 1000 Hz...

Testing Audio

Please refer to ssm2602_setup.

Multichannel support

AD1980/1 driver supports up to 5.1 channel audio after 2008R1.5.To enable it,please select following item when configure codec driver:

 [*]     Enable Multichannel Support (NEW)

This feature will consume much more memory for DMA transfer,So,4M DMA memory zone is needed.

 Blackfin Processor Options  ---> 
     Uncached DMA region (Enable 4M DMA region)  --->
Example for playing 5.1 channel audio

root:~>aplay -D plug:surround51 chan-id.wav

chan-id.wav can be found in http://www.halfgaar.net/surround-sound-in-linux

MMAP support

When driver works in mmap mode,it allows you to run several plays and/or captures at the same time.This feature
also consumes much more memory for DMA transfer.To enable it,please select following item when configure codec
driver:

[*] Enable MMAP Support

Example for playing 3 audio at the same time

root:~>aplay a.wav &
root:~>aplay b.wav &
root:~>aplay c.wav