#Daisy 16 V2 audio adapter

<div class="text-success lead">
Audio adapter daisy module for Terra and Aria G25 boards based on Wolfson microelectronics WM8731 Audio CODEC
</div>

@include='daisy_eol'

<img src="./DAISY-16-V2.jpg"/> 

The audio codec used is the WM8731, is low power stereo codec with an 
integrated headphone driver, stereo line-out, stereo line-in and mono 
microphone level audio inputs.

WM8731 Codecs is supported by the Linux kernel and works with alsa drivers.

* [WM8731 datasheet](https://www.cirrus.com/products/wm8731/)

##Main features

* Stereo 24-bit, multi-bit sigma delta ADCs and DACs are used with oversampling digital interpolation and decimation filters.
* Highly Efficient Headphone Driver
* Audio Performance : ADC SNR 90dB at 3.3V , DAC SNR 100dB at 3.3V
* Low Power : Playback only 22mW
* Selectable ADC High Pass Filter
* Microphone Input and Electret Bias with Side Tone Mixer
* Dimension: 40x40mm

##Pinout

| PIN    | Aria G25        |
|--------|-----------------|
|  1 3V3 | W24             |
|  2 RF  | W16 (PA29)      |
|  3 RD  | W14 (PA27)      |
|  4 TK  | W11 (PA24)      |
|  5 TF  | W12 (PA25)      |
|  6 TD  | W13 (PA26)      |
|  7 SDA | W17 (PA30-SDA0) |
|  8 SCL | W18 (PA31-SCL0) |
|  9 RK  | W15 (PA28)      |
| 10 GND | W1              |


##Wirings

The daisy connectors where to plug this board are:

| Board  | Daisy Connector |
|--------|-----------------|
| TERRA  | D16             |

## Kernel configuration and device tree binding

The Kernel configuration, device tree bindings and source patches 
are available on this article:

* @article='compile_linux_3_13'

## Schematics, datasheets and related links

* [Schematic DAISY-16-V2](http://www.acmesystems.it/download/schematics/schematic_daisy16_v2.pdf)

## Install alsa-utils

<pre class="minicom">
~# <b>apt-get install alsa-utils</b>
</pre>

Run *alsamixer*:

<pre class="minicom">
~# <b>alsamixer -V all</b>
</pre>

Configure *alsa* in this way:

<img src="./alsa_conf.png" width="600"/>

## Record and play

Save 5 second of stereo audio in a .wav file:

<pre class="minicom">
~# <b>arecord -d 5 -v -v -Dhw:0,0 -f cd record_line_in.wav</b>
</pre>

Play the .wav file:

<pre class="minicom">
~# <b>aplay record_line_in.wav</b>
</pre>

Change volume:

<pre class="minicom">
~# <b>amixer set Master 10%-</b>
</pre>



##Links
* [Forum](https://groups.google.com/forum/#!msg/acmesystems_it/GkbtaCsJ0pQ/45ilbURKMZwJ)
* @article='audio_examples'
* [Cyrrus Logic (Wolfson) WM8731 Audio Codec](https://www.cirrus.com/products/wm8731/)
* [Atmel at91sam9x5 wm8731 device tree binding](https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt?id=refs/tags/v3.13.5)
* [WM8731 audio CODEC device tree binding](https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/devicetree/bindings/sound/wm8731.txt?id=refs/tags/v3.13.5)

