IntroductionAudio 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 DocumentationDescriptionAudio 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 FilesSee the files section at bottom of this page for the KiCad design files, Gerber PCB files, schematic, and the PCB layout PDF printouts. ConnectorsP1 - Line InputConnector type: 3.5 mm jack
P2 - Line OutputConnector type: 3.5 mm jack
P3 - Headphones OutputConnector type: 3.5 mm jack
P4 - Microphone InputConnector type: pin header, 2 pins
P5 - Intel Edison Host ConnectorThis 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 ConnectorThis 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 VoltageThis 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
P8 - Power ButtonConnector type: pin header, 2 pins
Bill of MaterialsLink 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.
Assembly NotesSolderingDue 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:
Block StackingHirose 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
Software SupportSimple I2S Audio Setup Using Intel Firmware ImagePlease 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 WM8731This 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 toolsThe 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 BSPDownload 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 patchDownload 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 SRC_URI += "file://edison-wm8731.patch" Step 3. Compile the imagecd 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 driverConnect 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 settingsRun 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 applicationsThere 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 |
Home > Sergey's Projects >