update 12/02/25
Installation PI5 / PI4 / ZERO (recommended)
Good news is that the driver is now directly included in the kernel, just be sure to be updated with the last Pi OS version. Also update your Pi firmware:
sudo apt-get update
sudo apt-get upgrade
Once done you should be up to date
open a terminal and type:
sudo nano /boot/firmware/config.txt
and at the end of the file add:
dtoverlay=wm8960-soundcard.dtbo
press CTRL X and save file and reboot
on next reboot you should see on top right corner :
to test open a window :
arecord -f cd -d5 > test.wav
Say something smart
aplay test.wav
you sholud hear something smart
to tweak setting open a terminal and run alsamixer select the WM8960 card by pressing F6
Alternative Lightweight Automatic Installation Without Driver (Zero or lite OS version)
This method works without a driver by sending IĀ²C commands to initialize the codec at startup. It is ideal for lightweight installations, such as on the Raspberry Pi Zero series, you will only have basic control with this method : microphone, speaker and jack out but without fine control.
Steps:
-
Open a terminal and run the following commands:
git clone https://github.com/RASPIAUDIO/ULTRA.git cd ULTRA bash install.sh
-
Enable IĀ²C in
raspi-config
:- Navigate to 3-Interface Options > 5 IĀ²C.
- Select Enable.
- Reboot your system.
you should have this on the desktop
Playing Audio:
- After rebooting, check if your sound cards are recognized. You should see the speaker icon on the desktop.
Alternative Lightweight Manual Installation Without Driver (Zero or lite OS version) (If the Auto-Install Script Failed)
-
Clone the GitHub repository:
git clone https://github.com/RASPIAUDIO/ULTRA.git
-
Copy the file to execute at startup:
cd ULTRA gcc -o ultra ultra.c chmod 777 ultra cp ultra /etc
check if the script run as it should:
/etc/ultra
you should see this :
-
Set the script to execute at startup:
-
Open
rc.local
for editing:sudo nano /etc/rc.local
-
Modify the file to look like this:
-
```
- Configure the sound card:
-
Open
config.txt
:sudo nano /boot/firmware/config.txt
-
Comment out the existing audio line by adding
#
in front:#dtparam=audio=on
-
Add the overlay for the sound card:
dtoverlay=googlevoicehat-soundcard
-
Save the file and reboot your system.
-
Pinout:
GPIO | PIN | FUNCTION |
GPIO2 | PIN3 | I2C SDA |
GPIO3 | PIN5 | I2C SCL |
GPIO25 | PIN22 | LED |
PIN17 | 3.3v | |
PIN25 39 6 14 | GND | |
GPIO19 | PIN35 | I2S LRCLK |
PIN2 4 | 5v | |
GPIO18 | PIN12 | I2S CLK |
GPIO20 | PIN38 | I2S ADC |
GPIO21 | PIN40 | I2S DAC |
GPIO23 | PIN16 | BUTTON (this pin as an external pull up) |
Device number
this will be usefull in the alsa mixer to understand what input is connected to which microphones
Onbard microphones:
Linput1
Rinput1
External microphone jack input:
Linput2
Rinput2
Line input
Linput3
Rinput3
External speakers/speaker output:
SPK_L
SPK_R
Presets
You will notice that alsamixer have a LOT of settings with that dac so it could be confusing at first to do what you want. So I made a few basic scripts to select different devices, these Alasa presets are here : GitHub - RASPIAUDIO/WM8960-Audio-HAT: The drivers of [WM8960 Audio HAT] for Raspberry Pi look for the preset_* files
For example download this Onboard microphones input and headphones output:
For example to only enable the headphones and onboard speakers :
alsactl --file preset_onboard_microphones_input1 restore 0
sudo arecord -f cd -Dhw:0
Here are others scripts I have made:
External microphone input and headphones output:
preset_external_jack_microphone_input2
Onboard microphones input and headphones output:
preset_onboard_microphones_input1
Onboard microphones with high gain input and headphones output:
preset_onboard_microphones_input1_alotofgain
Headphones output:
preset_headphone_jack_output_only
External line input and headphones output:
preset_lineIN-jack_input3
Headphones ans speakers output:
preset_onboard_Speakers_and_headphone_jack_output
To save your own preset:
alsactl --file Mycustom_presets store
To restore your own preset:
alsactl --file Mycustom_presets restore