This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:linux-drivers:sound:adau1373 [30 Aug 2011 03:06] – [DAI sysclk] typo Lars-Peter Clausen | resources:tools-software:linux-drivers:sound:adau1373 [23 Feb 2017 12:47] (current) – Lars-Peter Clausen | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== ADAU1373 Sound CODEC Linux Driver ====== | ====== ADAU1373 Sound CODEC Linux Driver ====== | ||
+ | |||
===== Supported Devices ===== | ===== Supported Devices ===== | ||
- | This driver supports the\\ | + | * [[adi> |
- | [[adi> | + | |
- | ====== Source Code ====== | + | ===== Evaluation Boards ===== |
+ | * [[adi> | ||
+ | |||
+ | ===== Source Code ===== | ||
==== Status ==== | ==== Status ==== | ||
- | ^ Source | + | ^ Source ^ Mainlined? ^ |
- | | [[bfgit>linux-kernel?sound/ | + | | [[git.linux.org>sound/ |
==== Files ==== | ==== Files ==== | ||
Line 20: | Line 23: | ||
| include | [[git.linux.org> | | include | [[git.linux.org> | ||
- | ====== Example device initialization | + | ===== Example device initialization ===== |
{{page> | {{page> | ||
Line 100: | Line 103: | ||
| DAC2 Playback Volume | DAC2 Playback Volume | | | | DAC2 Playback Volume | DAC2 Playback Volume | | | ||
| Lineout1 Playback Volume | Lineout 1 Volume | | | | Lineout1 Playback Volume | Lineout 1 Volume | | | ||
- | | Lineout2 Playback Volume | Lineout | + | | Lineout2 Playback Volume | Lineout |
| Speaker Playback Volume | | Speaker Playback Volume | ||
| Headphone Playback Volume | Heaphone Out Volume| | | | Headphone Playback Volume | Heaphone Out Volume| | | ||
Line 180: | Line 183: | ||
^ Name ^ Supported by driver ^ Description ^ | ^ Name ^ Supported by driver ^ Description ^ | ||
- | | SND_SOC_DAIFMT_I2S | + | | SND_SOC_DAIFMT_I2S |
| SND_SOC_DAIFMT_RIGHT_J | yes | Right Justified mode | | | SND_SOC_DAIFMT_RIGHT_J | yes | Right Justified mode | | ||
| SND_SOC_DAIFMT_LEFT_J | | SND_SOC_DAIFMT_LEFT_J | ||
Line 296: | Line 299: | ||
====== ADAU1373 evaluation board driver ====== | ====== ADAU1373 evaluation board driver ====== | ||
+ | |||
+ | There is no dedicated Blackfin STAMP evaluation board for the ADAU1373. During test and driver development we used the [[adi> | ||
+ | |||
+ | It can be easily wired to the Blackfin STAMP SPORT header. | ||
===== Source ===== | ===== Source ===== | ||
Line 302: | Line 309: | ||
^ Source | ^ Source | ||
- | | [[bfgit>linux-kernel?sound/ | + | | [[git.linux.org>sound/ |
==== Files ==== | ==== Files ==== | ||
Line 309: | Line 316: | ||
| driver | | driver | ||
- | ===== Adding | + | ===== Kernel |
- | Skip this section if you want to build the driver into the kernel directly. | + | |
- | To add support for codec ADAU1373 to the kernel build system, a few things must be enabled properly for things to work.The configuration is as following: | + | |
< | < | ||
- | Linux Kernel Configuration | + | Device Drivers |
- | | + | [*] I2C support |
- | | + | [*] I2C Hardware Bus support |
- | < | + | *** I2C system bus drivers |
- | Advanced Linux Sound Architecture | + | <*> Blackfin TWI I2C support |
- | < | + | (100) |
- | < > Sequencer support | + | |
- | <M> OSS Mixer API | + | |
- | <M> OSS PCM (digital audio) API | + | |
- | System | + | |
- | <M> ALSA for SoC audio support | + | |
- | <M> SoC I2S Audio for the ADI BF5xx chip | + | |
- | <M> SoC ADAU1373 Audio support | + | |
- | < > SoC AC97 Audio support for BF5xx | + | |
- | | + | |
</ | </ | ||
- | <note important> | + | Enable ALSA SoC evaluation board driver: |
- | I2C bus is used to configure the codec. | + | |
- | </ | + | |
< | < | ||
- | Linux Kernel Configuration | + | Device Drivers |
- | | + | <M> Sound card support |
- | <*> I2C support | + | < |
- | --- I2C support | + | < |
- | I2C Hardware Bus Support | + | <M> Support for the EVAL-ADAU1373 boards on Blackfin |
- | <*> Blackfin | + | |
</ | </ | ||
- | Doing 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. | + | ===== Hardware configuration ===== |
+ | Connect the STAMP SPORT 0 port (P6) to the EVAL-ADAU1373 J23 and J28 headers. | ||
- | ==== Testing | + | Note that the SPORT has separate signals for the capture and playback clocks, while the ADAU1373 uses the same clock signals for both, so the EVAL-ADU1373 clock signal pins need to be connected to two STAMP pins each. |
- | 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: | + | ^ STAMP pin ^ EVAL-ADAU1373 pin ^ Function ^ |
+ | | P6-26 (SPORT 0 - PJ2_SCL) | J23-1 | I2C SCL | | ||
+ | | P6-24 (SPORT 0 - PJ3_SDA) | J23-3 | I2C SDA | | ||
+ | | P6-6 (SPORT 0 - PJ9_TSCLK0), P6-16 (SPORT 0 - PJ6_RSCLK0) | J28-6 (A_BCLK) | BCLK | | ||
+ | | P6-11 (SPORT 0 - PJ10_TFS0), P6-7 (SPORT 0 - PJ7_RFS0) | J28-8 (A_LRC) | LRCLK | | ||
+ | | P6-14 (SPORT 0 - PJ11_DT0PRI | J28-10 (A_DACDAT) | Playback data | | ||
+ | | P6-8 (SPORT 0 - PJ8_DR0PRI) | J28-12 (A_ADCDAT) | Captrue data | | ||
+ | | P6-33 | J28-1 | GND | | ||
- | - 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.1 | ||
- | dma rx:3 tx:4, err irq:15, regs: | ||
- | adau1371 Audio Codec 0.1< | ||
- | asoc: ADAU1373 <-> bf5xx-i2s-0 mapping ok | ||
- | ALSA device list: | ||
- | #0: bf5xx_adau1373 (ADAU1373) | ||
- | </ | ||
- | ==== Testing the audio module | + | ===== Driver testing ===== |
- | < | + | Load the driver and make sure the sound card is properly instantiated. |
- | root:~> **modprobe snd-pcm-oss** | + | |
- | root:~> **lsmod** | + | |
- | Module | + | |
- | snd_pcm_oss | + | |
- | snd_mixer_oss | + | |
- | snd_adau1373 | + | |
- | snd_soc_adau1373 | + | |
- | snd_soc_bf5xx | + | |
- | snd_soc_bf5xx_i2s | + | |
- | snd_soc_core | + | |
- | snd_pcm | + | |
- | snd_page_alloc | + | |
- | snd_timer | + | |
- | snd 31092 6 snd_pcm_oss, | + | |
- | soundcore | + | |
- | root:~> **tone** | + | <WRAP box bggreen>< |
- | TONE: generating sine wave at 1000 Hz... | + | < |
+ | root:/> modprobe snd-bf5xx-i2s | ||
+ | root:/> modprobe snd-soc-bf5xx-i2s | ||
+ | root:/> modprobe snd-soc-adau1373 | ||
+ | root:/> modprobe snd-soc-bfin-eval-adau1373 | ||
+ | dma rx:3 tx:4, err irq:45, regs: | ||
+ | asoc: ADAU1373 <-> bf5xx-i2s mapping ok | ||
</ | </ | ||
+ | </ | ||
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | root:/> modprobe snd-pcm-oss | ||
+ | root:/> tone | ||
+ | TONE: generating sine wave at 1000 Hz... | ||
- | ===== Testing Audio ===== | + | root:/> |
- | + | Recording WAVE 'stdin' | |
- | - Check the output < | + | Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo |
- | TONE: generating sine wave at 1000 Hz... | + | |
- | </xterm> You should hear something out of the headphone Jack on the top of J8. | + | |
- | | + | |
- | Simple mixer control | + | |
- | | + | |
- | Items: | + | |
- | Item0: ' | + | |
- | - Check to make sure mp3s work (assuming you have built mp3play), | + | |
- | - The first step is to download a mp3 file onto the platform. The '' | + | |
- | root:/ | + | |
- | </ | + | |
- | - Next, play it with mp3play: < | + | |
- | - You can play it in one step with: < | + | |
- | %%http:// | + | |
</ | </ | ||
- | - Optionally check to make sure the audio out is right: | + | </WRAP> |
- | Simple mixer control ' | + | |
- | Capabilities: | + | |
- | Items: ' | + | |
- | Item0: ' | + | |
- | root:~> **arecord -d 10 test.wav** | + | |
- | Recording WAVE " | + | |
- | root:~> **aplay test.wav** | + | |
- | Adjust playback volume can be done through command: | + | |
- | here 80 is the ratio. | + | |
- | </ | + | |
- | - You should also be able to do a " | + |