RoadTest: Wolfson Audio Card for Use with Raspberry Pi
Author: malakai
Creation date:
Evaluation Type: Evaluation Boards
Did you receive all parts the manufacturer stated would be included in the package?: True
What other parts do you consider comparable to this product?: null
What were the biggest problems encountered?: Incorporating the necessary files into Raspbian by default is still being worked on.
Detailed Review:
Full Run
Short Run
Grab the Jasper image from their website
Copy the image to the SD Card boot Pi. Run the configuration utility.
sudo raspi-config
expand rootfs, set localization, keyboard, and time.
reboot the Pi then update Raspbian
sudo apt-get update && sudo apt-get upgrade -y
Get Ragnar Jensen's kernel originally posted setup Re: Re: Wolfson modified Noobs raspbian zipped img Cannot unzip new download
File name is kernel_3_10_25_wolfson.tgz
Size is 17MB
https://drive.google.com/file/d/0BzIaxMH3N5O1RnJfcGVpdmY1T1E/edit?usp=sharing
md5sum dec8d63b3c42846e54082c7c6ff1834f
To install:
Become root: sudo -s
Go to root directory: cd /
Untar the archive: tar xvzf /path/to/where/you/saved/kernel_3_10_25_wolfson.tgz
Add the line
kernel=kernel_wolfson.img
to the file /boot/config.txt
· Reboot
If it doesn't work, you can revert to your original kernel by just removing the "kernel=kernel_wolfson.img" line from/boot/config.txt
wget http://www.element14.com/community/servlet/JiveServlet/download/104303-128960/wolfson_drivers.tar.gz
Extract the patch software into the home directory
tar -zxvf wolfson_drivers.tar.gz
A. Configuring the Jasper Client
Install Jasper Client
In the home directory of your Pi, clone the Jasper source code:
git clone https://github.com/jasperproject/jasper-client.git jasper
§ Jasper requires various Python libraries that we can install in one line with:
sudo pip install –upgrade setuptools
sudo pip install -r jasper/client/requirements.txt
Run crontab -e, then add the following line, if it’s not there already:
@reboot /home/pi/jasper/boot/boot.sh;
Set permissions inside the home directory:
sudo chmod 777 -R *
I run the script anyways as it doesn't always go right on reboot.
/home/pi/jasper/boot/boot.sh
sudo reboot
Restart your Raspberry Pi. Doing so will run boot.py, which generates the languagemodel.lm file in the client/ folder.
Using Ragnar Jensen’s .asoundrc file is the key to getting it to work
Backup the existing file
cp ~/.asoundrc .asound.backup
rm ~/.asoundrc
sudo nano ~/.asoundrc
Paste the contents of the modified ./asoundrc file listed below.
Getting Jasper to play requires that you can play a wav file using aplay with no arguments. Once that works, you want to remove the aplay hardware references(-D hw:x,x) in /boot/boot.py and /client/mic.py
Try this file:
aplay /home/pi/jasper/static/audio/jasper.wav
If you get it to play you have setup your system correctly and are good to go.
You may need to test the Wolfson files for the correct connection:
./asoundrc file contents modifications made by Ragnar Jensen
#######################################################################
#
# Use libsamplerate instead of internal resampler.
# You might have to: sudo apt-get install libasound2-plugins
# Or just comment out the next line if the internal one is good enough for your needs.
# defaults.pcm.rate_converter "samplerate"
######################################################################
#
# Wolfson Audio Card for Raspberry Pi
#
pcm.wolfson_pi_soundcard {
type hw
card sndrpiwsp
device 0
}
# Create a Master volume control
pcm.softvol {
type softvol
slave {
pcm "pduplex"
}
control {
name "Master"
card 0
}
}
pcm.!default {
type asym
playback.pcm "plug:softvol"
capture.pcm "pduplex"
}
#####################################################################
#
# Mixing and resampling goodness :-)
#
# Several clients can record and play back simultaneously.
# The dmix and dsnoop plugins operate at 48kHz by default, i.e. the sound card will be kept at 48kHz at all times.
# All playback streams are converted to 2 channels/48kHz/16bit.
# All recording streams are converted from the card's 2 channels/48kHz/16bit
# to the requested number of channels, sample rate and bit depth.
# We define one pcm device called "playmixer" for playback.
pcm.playmixer {
ipc_key 140324 # Any number will do, as long as it's unique in the system.
ipc_key_add_uid true
type dmix
slave.pcm "wolfson_pi_soundcard"
}
# Define another one called "recmixer" for capture.
# The sound card will run at 48kHz and input is resampled to the requested rate.
pcm.recmixer {
ipc_key 140325
ipc_key_add_uid true
type dsnoop
slave.pcm "wolfson_pi_soundcard"
}
# Define a duplex device, with both in- and outputs.
pcm.duplex {
type asym
playback.pcm "playmixer"
capture.pcm "recmixer"
}
# Add a "plug" plugin for the above "duplex" device.
# This is where all the converting takes place.
# Sample rate, number of channels, bit depth.
# By the way, who thought that "plug" was a good name for a plugin?
#
# Use this device for all your playback and recording resampling needs.
pcm.pduplex {
type plug
slave.pcm "duplex"
}
# A ctl device to keep xmms happy
ctl.pduplex {
type hw
card 0
}
# A DSP to keep the alsa-oss layer happy:
pcm.dsp0 {
type plug
slave.pcm "duplex"
}
ctl.mixer0 {
type hw
card 0
}