Home‎ > ‎Sergey's Projects‎ > ‎

Audio Block for Intel Edison

Introduction

Audio Block is an add-on board for Intel Edison compute module. It provides audio playback and recording capabilities using the I2S/DSP interface present in the Intel Edison. Audio Block supports stereo output (either as a line output, or as a headphones output using a built-in amplifier), a stereo line input, or and microphone input.

Audio Block board size is only 1.2" x 2.8" (30.58 mm x 71.22 mm). The board's form-factor is compatible with SparkFun's stackable Edison blocks. So that it can be easily integrated in Intel Edison based projects together with SparkFun blocks.

Hardware Documentation

Description

Audio Block is based on Wolfson Microelectronics WM8731 codec. This codec implements stereo ADC and DAC, mixer, and an audio amplifier for headphones. The digital part of the codec is powered using 1.8 V supply provided by Intel Edison module. To improve audio quality the analog part is powered by 3.0 V supply provided by an on-board low-noise LDO - Texas Instruments TPS79330. Audio Block features two 70-pin Hirose Electric DF40 connectors, that provide connectivity to Intel Edison and compatible SparkFun blocks.

Design Files

See the files section at bottom of this page for the KiCad design files, Gerber PCB files, schematic, and the PCB layout PDF printouts. 

Connectors

P1 - Line Input

Connector type: 3.5 mm jack
 Pin Function
 Sleeve Ground
 Ring Right channel
 Tip Left channel

P2 - Line Output

Connector type: 3.5 mm jack
 Pin Function
 Sleeve Ground
 Ring Right channel
 Tip Left channel

P3 - Headphones Output

Connector type: 3.5 mm jack
 Pin Function
 Sleeve   Ground
 Ring Right channel
 Tip Left channel

P4 - Microphone Input

Connector type: pin header, 2 pins
 Pin Function
 1 Microphone input / bias voltage
 2 Ground

P5 - Intel Edison Host Connector

This connector allows connecting additional SparkFun Edison blocks on top of the Audio Block.
Connector type: Hirose Electric DF40 header, 70 pins.
Please refer to Intel Edison Compute Module Hardware Guide, section 3.8 for pin assignment.

P6 - Intel Edison Device Connector

This connector allows connecting Intel Edison module, or additional SparkFun Edison blocks underneath the Audio Block.
Connector type: Hirose Electric DF40 receptacle, 70 pins, 3.0 mm height.
Please refer to Intel Edison Compute Module Hardware Guide, section 3.8 for pin assignment.

P7 - VSYS - Power Supply Voltage

This connector can be used to supply power to the Audio Block, Intel Edison compute modules, and other SparkFun Edison modules. Note that Audio Block does not have voltage regulator, so the VSYS voltage must be in 3.15 V - 4.5 V range. Do not use this connector if power is supplied by other SparkFun Edison modules, e.g. Base Block, Console, or Battery modules.
Connector type: pin header, 2 pins
 Pin Function
 1 Main power supply voltage - 3.15 V - 4.5 V  
 2 Ground

P8 - Power Button

Connector type: pin header, 2 pins
 Pin Function
 1 ~PWRBTN signal to Intel Edison
 2 Ground

Bill of Materials

Link to the project on Mouser.com - View and order all components except of PCB.

Link to the project on OSHPark.com - View and order PCB.

 Component type  Reference Description Quantity Possible sources and notes
 PCB  Audio Block V1.0 Printed Circuit Board 1 Order from OSH Park or your favorite PCB manufacturers using Gerber files provided below.
 Capacitor C1, C2 22 pF, 50 V multilayer ceramic capacitor, 0603 SMT 2 Mouser: 77-VJ0603A220JXACBC
 Capacitor C3 - C5 220 pF, 50 V multilayer ceramic capacitor, 0603 SMT 2 Mouser: 77-VJ0603A221GXAPBC
 Capacitor C6 10 nF, 50 V multilayer ceramic capacitor, 0603 SMT 1 Mouser: 77-VJ0603Y103KXACBC
 Capacitor C7 - C11 100 nF, 16 V multilayer ceramic capacitor, 0603 SMT 5 Mouser: 77-VJ0603Y104JXJPBC
 Capacitor C12 - C14 1 uF, 20 V tantalum capacitor, 1206 SMT 3 Mouser: 74-593D105X9020A2TE3
 Capacitor C15 - C18 10 uF, 10 V multilayer ceramic capacitor, 0805 SMT 4 Mouser: 810-C2012X5R1A106K-3
 Capacitor C19 - C20 10 uF, 16 V tantalum capacitor, 1206 SMT 2 Mouser: 74-593D106X9016A2TE3
 Capacitor C20 - C21 220 uF, 10 V tantalum capacitor, 1210 SMT 2 Mouser: 581-TLNT227M010R1300
 Connector P1 - P3 3.5 mm phone jack, SMT 3 Mouser: 502-35RASMT2BHNTRX
 Connector P4, P7, P8 Pin header, 2 pins, 0.1" lead pitch 3 Optional. Can solder wires directly to the pads or use right angle connector to reduce the board height. It is possible to use a single 6 pin header instead of three 2 pin headers.
 Connector P5 70 pin Hirose Electric DF40 header 1 Mouser: 798-DF40C70DP04V51
 Connector P6 70 pin Hirose Electric DF40 receptacle, 3.0 mm height 1 Mouser: 798-DF40HC3070DS4V51
 Resistor R1 - R6 33 ohm resistor, 0603 SMT 6 Mouser: 71-CRCW0603-33-E3
 Resistor R7 - R8 100 ohm resistor, 0603 SMT 2 Mouser: 71-CRCW0603100RFKEB
 Resistor R9 330 ohm resistor, 0603 SMT 1 Mouser: 71-CRCW0603-330-E3
 Resistor R10 680 ohm resistor, 0603 SMT 1 Mouser: 71-CRCW0603-680-E3
 Resistor R11 - R14 5.6 kohm resistor, 0603 SMT 4 Mouser: 71-CRCW0603-5.6K-E3
 Resistor R15 - R19 47 kohm resistor, 0603 SMT 5 Mouser: 71-CRCW0603-47K-E3
 Resistor R20 220 ohm resistor, 0603 SMT 1 Mouser: 71-CRCW0603-220-E3
 Optional. Used for power button circuit. No need to install if using SparkFun modules to provide power.
 Resistor R21 10 kohm resistor, 0603 SMT 1 Mouser: 71-CRCW0603-10K-E3
 Optional. Used for power button circuit. No need to install if using SparkFun modules to provide power.
 Crystal Oscillator X1 12.288 MHz crystal oscillator, SMT 1 Mouser: 815-ABM3-12.2-D2Y-T
 Integrated Circuit U1 WM8731S audio codec 1 Mouser: 238-WM8731SEDS/V
 Integrated Circuit U2 TPS79330DBVR 3.0 V low-dropout regulator 1 Mouser: 595-TPS79330DBVR

Assembly Notes

Soldering

Due to the size limitations and components availability Audio Block is made completely using SMT components. It it is not too difficult to solder SMT components it with some practice. Here are some tips:

  • Have a well lighten, clean workspace. A lamp with magnifier is highly recommended.
  • Use a low power (25W or so) soldering iron with thin tip, better yet a temperature controlled soldering station. Keep the tip of soldering iron clean.
  • Use a lot of flux. Flux pen or paste is recommended.
  • Use thin solder with flux. Use desoldering braid to remove accidental solder bridges or excess solder.
  • I found it convenient first to put some solder on a first pad of a component (or on two opposite pads in case of an IC. When put the component using tweezers and heat the pad at the same time. Next double check component orientation and solder remaining pads. Note that tantalum capacitors are polarized, so the orientation is important.
  • First solder 70 pin connectors.
  • Next solder ICs and crystal oscillator.
  • After that solder resistors and capacitors. Make sure that tantalum capacitors are oriented properly.
  • Finally solder 3.5 mm connectors, and pin headers (if desired).
  • Clean the flux residue with alcohol.
  • Search the Internet for SMT soldering tutorials and videos.

Block Stacking

Hirose Electric DF40 connectors are not designed to handle a lot of mechanical load. Use standoffs, screws and nuts to hold Intel Edison compute module, Audio Block, and any additional SparkFun Edison blocks together. This hardware pack can be used for this purpose (note that screw ends on standoffs are a bit long, use a file to shorten them as needed).

Errata

  • P5 connector footprint is missing 4 pads in the corners (mechanical only pads). This does not affect board functionality.

Software Support

Simple I2S Audio Setup Using Intel Firmware Image

Please see my blog post for the simple I2S audio setup procedure using the latest Intel firmware image.

Compile Linux Kernel with ALSA ASoC Machine Driver for Edison and WM8731

This section provides steps needed to build a firmware image that includes an Edison-specific ALSA ASoC machine driver for WM873 codec. The instructions below assume that you have a Linux machine with recent Linux distribution, and have basic knowledge working on this machine. Please see Intel Edison Board Support Package User Guide for complete firmware process documentation.

Step 0. Install build tools

The command below assumes Debian-like Linux distribution, such as Ubuntu. You might need to use different method to install these tools on other distributions.
sudo apt-get install build-essential git diffstat gawk chrpath texinfo libtool gcc-multilib

Step 1. Download and unpack Edison BSP

Download Edison BSP from Intel and unpack it to your disk:
wget http://downloadmirror.intel.com/24910/eng/edison-src-ww18-15.tgz
tar xzvf edison-src-ww18-15.tgz

Step 2. Download the WM8731 patch

Download edison-wm8731.patch from the files section at the bottom of this page. You can either use your web browser or wget command. Once it is downloaded move it to the unpacked BSP:
wget -O edison-wm8731.patch 'http://www.malinov.com/Home/sergeys-projects/audio-block-for-intel-edison/edison-wm8731.patch?attredirects=0&d=1'
mv edison-wm8731.patch edison-src/meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/files/
Open .bbappend file for Linux kernel in your favorite text editor:
vi edison-src/meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/linux-yocto_3.10.bbappend
Append the following line at the bottom of the file:
SRC_URI += "file://edison-wm8731.patch"

Step 3. Compile the image

cd edison-src/
make setup
make image
The resulting image will be located in out/current/build/toFlash/ directory. You can use included flashall.sh (Linux), flashall.bat (Windows), or Intel's Phone Flash Tool Lite to flash the image to your Edison board.

Step 4. Configure kernel to load wm8731 machine driver

Connect serial console to your Edison board and reboot it. Press any key at 'Hit any key to stop autoboot:' prompt to get to the boot shell.
Use setenv command to set the audio_codec_name boot environment variable, followed by saveenv command to save the environment to MMC, and finally use boot command to boot Linux on your Edison.
setenv audio_codec_name 'audio_codec="wm8731"'
saveenv
boot
You might get "Media Audio Port: ASoC: no backend DAIs enabled for Media Audio Port" error messages, which will be fixed in the next step.

Step 5. Configure ALSA settings

Run the commands below on your Edison to set the audio routing to SSP2 (the I2S port on Edison the Audio Block is connected to):
#playback
amixer -c 1 cset name='codec_out interleaver slot 0' 1
amixer -c 1 cset name='codec_out interleaver slot 1' 2
amixer -c 1 cset name='codec_out interleaver slot 2' 3
amixer -c 1 cset name='codec_out interleaver slot 3' 4
amixer -c 1 cset name='codec_out0 mix 0 pcm0_in' 1
amixer -c 1 cset name='codec_out1 mix 0 pcm0_in' 1
amixer -c 1 cset name='media0_out mix 0 media1_in' 1

amixer -c 1 cset name='media1_in gain 0 volume' 80%,80%
amixer -c 1 cset name='media1_in gain 0 rampduration' 50
amixer -c 1 cset name='media1_in gain 0 mute' 0

amixer -c 1 cset name='pcm0_in gain 0 volume' 80%,80%
amixer -c 1 cset name='pcm0_in gain 0 rampduration' 50
amixer -c 1 cset name='pcm0_in gain 0 mute' 0

amixer -c 1 cset name='codec_out0 gain 0 volume' 80%,80%
amixer -c 1 cset name='codec_out0 gain 0 rampduration' 50
amixer -c 1 cset name='codec_out0 gain 0 mute' 0

amixer -c 1 cset name='codec_out1 gain 0 volume' 80%,80%
amixer -c 1 cset name='codec_out1 gain 0 rampduration' 50
amixer -c 1 cset name='codec_out1 gain 0 mute' 0

#capture
# dmic - recv data from slot 0,1 into codec_in0 L&R
amixer -c 1 cset name='codec_in deinterleaver codec_in0_0' 'slot 0'
amixer -c 1 cset name='codec_in deinterleaver codec_in0_1' 'slot 1'
amixer -c 1 cset name='codec_in deinterleaver codec_in1_0' 'slot 2'
amixer -c 1 cset name='codec_in deinterleaver codec_in1_1' 'slot 3'

# capture media
amixer -c 1 cset name='pcm1_out mix 0 codec_in0' 1
amixer -c 1 cset name='pcm1_out gain 0 volume' 80%,80%
amixer -c 1 cset name='pcm1_out gain 0 rampduration' 50
amixer -c 1 cset name='pcm1_out gain 0 mute' 0

# capture input
amixer -c 1 cset name='codec_in0 gain 0 volume' 80%,80%
amixer -c 1 cset name='codec_in0 gain 0 rampduration' 50
amixer -c 1 cset name='codec_in0 gain 0 mute' 0

# unmute the wm8731
amixer -c 1 cset name='Output Mixer HiFi Playback Switch' 1

# save the ALSA configuration
alsactl store
Edit /usr/share/alsa/alsa.conf and set the default card to card '1'. Change:
defaults.ctl.card 0
defaults.pcm.card 0
To:
defaults.ctl.card 1
defaults.pcm.card 1

Install audio applications

There is a variety of audio applications available at AlexT repository. Follow these instructions to configure repository on your Edison. Once the repository is configured you can use opkg command to install the packages. For example run the following command to install mpg123 MP3 player:
opkg install mpg123

Ċ
Sergey Kiselev,
Jun 23, 2015, 10:38 AM
ą
Sergey Kiselev,
Jun 23, 2015, 10:42 AM
ċ
Edison_Audio_Block - KiCad - 1.0.zip
(59k)
Sergey Kiselev,
Jun 23, 2015, 10:38 AM
Ċ
Sergey Kiselev,
Jun 23, 2015, 10:38 AM
ą
Sergey Kiselev,
Jun 23, 2015, 10:42 AM
ċ
Edison_Audio_Block - gerber - 1.0.zip
(49k)
Sergey Kiselev,
Jun 23, 2015, 10:38 AM
ą
Sergey Kiselev,
Jun 23, 2015, 10:42 AM
ą
Sergey Kiselev,
Jun 23, 2015, 10:42 AM
ą
Sergey Kiselev,
Jun 26, 2015, 11:24 AM
ċ
edison-wm8731.patch
(22k)
Sergey Kiselev,
Jun 24, 2015, 3:13 PM
Comments