User Tools

Site Tools


blackfin:uclinux_bf537setup_ad1836

Hardware Setting

On DSP BF537 EZkit board find Switch 7(Audio Selection Switch) set it exact as shown below:

1 = OFF
2 = ON
3 = ON
4 = OFF
5 = OFF
6 = OFF
7 = OFF
8 = OFF

To setup hardware for AD1836A card refer to this link:http://docs.blackfin.uclinux.org/doku.php?id=ad1836a Very Important: put your card on sport 0 connector, because we choose sport 0 in kernel configuration

Adding Kernel Support - As a module

To add support for the AD1836A audio card to the kernel build system, a few things must be enabled properly for things to work.

Linux Kernel Configuration 
    Sound  ---> 
      [M] Sound card support
       Advanced Linux Sound Architecture  --->
        [ ] OSS Sequencer API
        [M] OSS Mixer API 
        [M] OSS PCM (digital audio) API
        ALSA Blackfin devices  --->
           [M] 1836 Audio support for BF53x 
                   Interface between Blackfin and ADI1836 (TDM interace) --->
                5.1 Channels or 3 seperate stereos (3 stereos) --->
           (0)   Blackfin Audio SPORT port (NEW)
           (4)   Blackfin Audio SPI channel selection bit (NEW)

Go to uclinux-dist directory and do menuconfig as following command:

 arwillis@ece-vision1-pc:~/uclinux-dist$ make menuconfig

Then locate

Kernel/Library/Defaults Selection  --->  in the window configuration
inside   Kernel/Library/Defaults Selection  --->  navigate to choose this option:
                     [ ] Customize Kernel Settings (NEW)  
Use space or enter key to select it after that save and exit..
A new configuration window should appear : Linux Kernel Configuration 
navigate find  Device Drivers  --->   press enter
inside the device drivers configuration window find   Sound  --->  option press enter
then make sure your configuration is right as shown above, and don't forget to select
ALSA Blackfin devices  --->1836 driver is under this option.
when you done this step, go back the Device drivers navigate and locate the option of 
  Character devices  --->   
then select it by press enter, under Character devices directory, make sure you select
those two options:
 [*] Blackfin BF53x ADSP SPI ADC support  
 [*] Blackfin BF53x SPORT support  

Save and exit the menuconfig. Now we have built the driver into kernel, go back to uclinux-dist directory issue the following command:

 arwillis@ece-vision1-pc:~/uclinux-dist$  make

Take about few minutes……….when it is done, copy the new image file to tftpboot folder.

arwillis@pc:~/uclinux-dist$ cp images/uImage /home/arwillis/bf537/tftpboot/uImage-bf537-1.00

Reset your DSP board you should see this line in your boot message:

Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50 2006 UTC).
dma_alloc_init: dma_page @ 0x00c53000 - 256 pages at 0x03f00000
ALSA device list:
  #0: ADI ad1836 at PF4 SPORT0 rx/tx dma 3/4 err irq 45

Test AD1836A

Check to make sure that the audio device is compiled into your kernel. If the special directory /proc/asound/AD1836A/ is in the root filesystem, the audio driver is compiled in.

      root:~> ls -l /proc/asound/ad1836/
      -r--r--r--    1 0        0               0 id
      -rw-r--r--    1 0        0               0 oss_mixer
      dr-xr-xr-x    3 0        0               0 pcm0c
      dr-xr-xr-x    3 0        0               0 pcm0p
      -rw-r--r--    1 0        0               0 registers

Execute following command on your DSP board;

root:~> modprobe snd-ad1836
root:~> modprobe snd-pcm-oss
root:~> lsmod
Module                  Size  Used by
snd_pcm_oss            31952  0
snd_mixer_oss          11436  1 snd_pcm_oss
snd_ad1836             14876  0
snd_pcm                49628  2 snd_pcm_oss,snd_ad1836
snd_timer              13644  1 snd_pcm
snd_page_alloc          3940  1 snd_pcm
snd                    32032  5 snd_pcm_oss,snd_mixer_oss,snd_ad1836,snd_pcm,snd_timer
soundcore               4032  1 snd
root:~> tone
TONE: generating sine wave at 1000 Hz...

If you can hear the 1k Hz tone, then you are ready to go! for more audio test see the link:http://docs.blackfin.uclinux.org/doku.php?id=ad1836a_setup

blackfin/uclinux_bf537setup_ad1836.txt · Last modified: 2009/10/07 17:57 (external edit)