Cheesychase
Posts: 6
Joined: Fri Nov 13, 2020 11:05 pm

A beginner's guide to the Wolfson Audio Card - my story so far

Sun Nov 15, 2020 8:01 am

Hello everyone,

Here is the story : I bought a few years ago an old Raspberry Pi (I think it is a model 1B with 512MB RAM-and the P6 connector) and a Wolfson Audio Card in order to have a little machine capable of recording audio with a decent quality.
After something like 4 years of procrastination, I decided to start to use and configure the hardware. But what seemed at first an easy task will make me scratch my head, because both hardware and drivers are now quite old. And on top of that, I am a complete beginner.
So here is why I have decided to sum-up everything I have learned from others here if someday, someone wants to start a similar project.

1-The hardware

The Wolfson audio card is now discontinued, but is still available on the 2nd hand market. More info on this product here.

After a few tests, it appears that the quality of your SD card is critical. As the hardware is now outdated, and that the audio recording/editing will at one point or another lead you to manipulate big files, a quick and fast data access really helps. The manufacturer recommends a C6 Class SD card to capture audio, but it is way too slow if you want a smooth experience.
I have bought a U3/V30 32GB SD Card (SanDisk Extreme SDHC UHS-1) that reads up to 90MB/s and writes up to 30MB/s, and the system responsiveness has now greatly improved.

2 - Getting ready

This audio card comes with specific drivers, and if you want to use the distribution of your choice, you will have to compile the Kernel with these drivers. As I am a complete beginner with the Raspberry environment, this is an option I ditched quickly.

An alternative is to use the pre-compiled distribution available on element14, but it seems that its size for a zip archive is too high, and some might experience some trouble while unzipping it. And I did.

So I finally found help in this element 14 forum post where there is a lighter distribution made available. The download link still works in 2020.

Then, I have used balenaEtcher to create my bootable SD Card following these instructions.

I thought : I'm ready to fire up! But, as the distribution is now a bit old, the road to using my Raspberry Pi as an audio device was still a long and windy road.
Last edited by Cheesychase on Sun Nov 15, 2020 9:56 am, edited 2 times in total.

Cheesychase
Posts: 6
Joined: Fri Nov 13, 2020 11:05 pm

Re: A beginner's guide to the Wolfson Audio Card - my story so far

Sun Nov 15, 2020 8:01 am

3-Booting for the first time

So here we are. I boot the machine for the first time. The config menu opens up, and do a few adjustments

There are more informations here about this menu, for my part, I have modified a few things such as :
[*]The keyboard layout, as I am living in an AZERTY world
[*]Enable boot on the graphical interface
[*]Used the Overclocking first step (800 MHz if I am correct)
[*]Forced the audio through the 3,5mm output (This is to avoid audio output to go through HDMI)

It's time to launch !

Once your Raspbian is loaded and working, now is the time to perform a few updates and download software. But as the distribution is old, it is now unsupported, and there are a few things to do in order to be able to access to the servers again.
So, let's start with setting up a root account, so we can get our hands in the configuration :

Code: Select all

sudo passwd
You'll then see :

Code: Select all

pi@raspberrypi:~ $ sudo passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
(More info about this here)

You can now change user and login with the user 'root' and the password you just set. You are now able to modify the system files, so use this account cautiously.

The deposit path is specified in the etc/apt/sources.list file. Open it with a text editor and replace the first line with :

Code: Select all

deb http://legacy.raspbian.org/raspbian/ wheezy main contrib non-free rpi
(Please, no debates here about using an out of date OS. I am trying to make an old piece of hardware work, this system will be offline most of the time, and is just meant to capture audio.)

Then run :

Code: Select all

apt-get update
Now we can get some software :
Run

Code: Select all

sudo apt-get install lxmusic xmms2 xmms2-plugin-all volumeicon-alsa mpg123 mplayer  

Code: Select all

sudo apt-get install audacity
Some codecs :

Code: Select all

sudo apt-get install libmp3lame-dev
Some helpful software :
Gparted, as you want to manage partitions if you have a large SD card.

Code: Select all

sudo apt-get install gparted
Chromium

Code: Select all

sudo apt-get install chromium
Last edited by Cheesychase on Sun Nov 15, 2020 9:55 am, edited 4 times in total.

Cheesychase
Posts: 6
Joined: Fri Nov 13, 2020 11:05 pm

Re: A beginner's guide to the Wolfson Audio Card - my story so far

Sun Nov 15, 2020 8:02 am

So once I have my system running, how does it work?
In the several tutorial I have read, I understood that some command lines were required to have the card working. In fact, the card does not work out of the box, and it is necessary to enter a command to activate and set up every input and output you intend to use.

I typed in the following instructions :

Code: Select all

Playback_to_Headset.sh 
Playback_to_Lineout.sh
Record_from_lineIn.sh 
Unfortunately it didn't work, as the system returned the bash commands could not be found. Just a silly mistake, the bash instructions were in another folder in the distribution I had installed. So if you intend to use the same distribution as mine, the correct instructions should be :

Code: Select all

home/pi/use_case_scripts/Playback_to_Headset.sh 
home/pi/use_case_scripts/Playback_to_Lineout.sh
home/pi/use_case_scripts/Record_from_lineIn.sh 
As my intentions are to always use these input/outputs, I have added these instructions in the script etc/rc.local

So now, I am able to listen and record sounds with my wolfson card, and it works from the startup.
Last edited by Cheesychase on Wed Nov 25, 2020 9:43 am, edited 1 time in total.

Cheesychase
Posts: 6
Joined: Fri Nov 13, 2020 11:05 pm

Re: A beginner's guide to the Wolfson Audio Card - my story so far

Sun Nov 15, 2020 8:37 am

For further development

User avatar
DougieLawson
Posts: 42157
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: A beginner's guide to the Wolfson Audio Card - my story so far

Sun Nov 15, 2020 11:12 am

Cheesychase wrote:
Sun Nov 15, 2020 8:01 am


Once your Raspbian is loaded and working, now is the time to perform a few updates and download software. But as the distribution is old, it is now unsupported, and there are a few things to do in order to be able to access to the servers again.
You don't need to use Wheezy. My Wolfson card on a 2012 RPi1B works perfectly with RaspiOS Buster.
You just need to add the right stuff to /boot/config.txt

Code: Select all

dtparam=audio=on
dtoverlay=rpi-cirrus-wm5102
dtoverlay=i2s-mmap
hdmi_force_hotplug=1
hdmi_group=1
hdmi_mode=16
dtparam=spi=on
dtparam=i2c_arm=on
disable_splash=1


I can even re-initialise it by removing all the kernel modules with rmmod and reloading them.

Code: Select all

[2938485.378668] LDO1: supplied by RPi-Cirrus 1v8
[2938485.414687] arizona spi0.0: WM5102 revision C
[2938485.418414] wm8804 1-003b: revision E
[2938485.443097] debugfs: File ':soc:spi@7e204000:wm5102@0' in directory 'domains' already present!
[2938485.458592] Adding alias for supply MICVDD,(null) -> MICVDD,spi0.0
[2938485.459901] Adding alias for supply MICVDD,(null) -> MICVDD,spi0.0
[2938485.459928] Adding alias for supply DBVDD2,(null) -> DBVDD2,spi0.0
[2938485.459945] Adding alias for supply DBVDD3,(null) -> DBVDD3,spi0.0
[2938485.459959] Adding alias for supply CPVDD,(null) -> CPVDD,spi0.0
[2938485.459975] Adding alias for supply SPKVDDL,(null) -> SPKVDDL,spi0.0
[2938485.459989] Adding alias for supply SPKVDDR,(null) -> SPKVDDR,spi0.0
[2938485.872761] MICVDD: supplied by RPi-Cirrus 1v8
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

Cheesychase
Posts: 6
Joined: Fri Nov 13, 2020 11:05 pm

Re: A beginner's guide to the Wolfson Audio Card - my story so far

Sun Nov 15, 2020 1:30 pm

DougieLawson wrote:
Sun Nov 15, 2020 11:12 am

You don't need to use Wheezy. My Wolfson card on a 2012 RPi1B works perfectly with RaspiOS Buster.
This is good news, I was unable to find if the Wolfson drivers were finally included in the newer Raspbian versions, and as it seems that the card support dropped quickly (plus the fact they were only physically compatible with older Pi hardware), I prefered to start with a software I knew once worked.

Is the newer RaspiOs light enough for our old RPi1B?

Thanks for the info. I'll finish my setup with my current configuration, as I finally happen to understand how the card works and have encouraging results, but I'll try a newer distribution soon.

User avatar
DougieLawson
Posts: 42157
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: A beginner's guide to the Wolfson Audio Card - my story so far

Sun Nov 15, 2020 1:49 pm

Your problem is you were looking for "Wolfson" after the board was taken over by "Cirrus".
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

Return to “Graphics, sound and multimedia”