Skip to content

Compare: Sound_Card_WM8960_Hi Fi_HAT

New page
82 changes: 2 additions & 80 deletions Sound_Card_WM8960_Hi-Fi_HAT.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,3 @@
[see original thread in the forum](https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/549)
As the official repo does not work anymore (drivers are not developed anymore for the new kernel) we recommend to use the following drivers:
https://github.com/respeaker/seeed-voicecard.

![WM8960-Audio-HAT-8 1](https://user-images.githubusercontent.com/46578616/59069426-58b28d00-88b7-11e9-980a-00a1fbbf7574.jpg)

## Hardware Pinout:

![pinout](https://user-images.githubusercontent.com/46578616/61009566-57232b80-a373-11e9-8be7-21b52a0e43f8.JPG)


* User Manual: https://www.waveshare.com/wiki/WM8960_Audio_HAT
* Install Driver / Test Sound (working) with this Manual: https://www.waveshare.com/w/upload/5/54/WM8960_Audio_HAT_User_Manual_EN.pdf
* On the installation of RPi-Jukebox-RFID, use AUDIOiFace="playback".
* you **must ** disable the service for the gpio buttons or modify the original gpio python script
`sudo nano /home/pi/RPi-Jukebox-RFID/scripts/gpio-buttons.py`


## Install:

Clone the driver and install it with commands:

`git clone https://github.com/waveshare/WM8960-Audio-HAT`

`cd WM8960-Audio-HAT`

`sudo ./install.sh`

`sudo reboot`

## Test Sound:

`speaker-test -c2`

| GPIO | Pin | WM8960 Hi-Fi Sound Card |
|------|-----|-------------------------|
| 2 | 3 | I2C_SDA P_SDA |
| 3 | 5 | I2C_SCL P_SCL |
| 8 | 24 | |
| 9 | 23 | |
| 10 | 19 | |
| 11 | 21 | |
| 16 | 36 | |
| 18 | 12 | I2S_CLK P18 |
| 19 | 35 | I2S_LRCLK P19 |
| 20 | 38 | I2S_ADC |
| 21 | 40 | I2S_DAC |
| 24 | 18 | |
| 25 | 22 | |
| 26 | 37 | |

## Test Button:

| GPIO | Pin | WM8960 Hi-Fi Sound Card |
|------|-----|-------------------------|
|P17| 11 | Configurable |

set gpio17

`echo "17" > /sys/class/gpio/export`

`echo "in" > /sys/class/gpio/gpio17/direction`

read gpio status

`cat /sys/class/gpio/gpio17/value`

"1" when not pressed
"0" when pressed

release gpio17 (to avoid error: Device or resource busy)
`echo 17 > /sys/class/gpio/unexport`

## Example mpd.conf ALSA output

```
audio_output {
type "alsa"
name "Alsa Device"
mixer_type "Software"
mixer_device "bcm2835-i2s-wm8960-hifi"
mixer_control "Playback"
}