# WM8960 Audio HAT
The drivers of [WM8960 Audio HAT] for Raspberry Pi.
http://www.waveshare.net/shop/WM8960-Audio-HAT.htm
http://www.waveshare.com/wm8960-audio-hat.htm
### Install wm8960-soundcard
Get the wm8960 soundcard source code. and install all linux kernel drivers
```bash
git clone https://github.com/waveshare/WM8960-Audio-HAT
cd WM8960-Audio-HAT
sudo ./install.sh
sudo reboot
```
While the upstream wm8960 codec is not currently supported by current Pi kernel builds, upstream wm8960 has some bugs, we had fixed it. we must it build manually.
Check that the sound card name matches the source code wm8960-soundcard.
```bash
pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: wm8960soundcard [wm8960-soundcard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: wm8960soundcard [wm8960-soundcard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
```
If you want to change the alsa settings, You can use `sudo alsactl --file=/etc/wm8960-soundcard/wm8960_asound.state store` to save it.
### Usage:
```bash
#It will capture sound an playback on hw:1
arecord -f cd -Dhw:1 | aplay -Dhw:1
```
```bash
#capture sound
#arecord -d 10 -r 16000 -c 1 -t wav -f S16_LE test.wav
arecord -D hw:1,0 -f S32_LE -r 16000 -c 2 test.wav
```
```bash
#play sound file test.wav
aplay -D hw:1,0 test.wav
```
### uninstall wm8960-soundcard
If you want to upgrade the driver , you need uninstall the driver first.
```bash
pi@raspberrypi:~/WM8960-Audio-HAT $ sudo ./uninstall.sh
...
------------------------------------------------------
Please reboot your raspberry pi to apply all settings
Thank you!
------------------------------------------------------
```
Enjoy !
没有合适的资源?快使用搜索试试~ 我知道了~
WM8960-Audio-HAT:Raspberry Pi的[WM8960音频HAT]驱动程序
共16个文件
sh:3个
conf:2个
c:2个
5星 · 超过95%的资源 需积分: 24 6 下载量 52 浏览量
2021-05-05
10:52:36
上传
评论
收藏 35KB ZIP 举报
温馨提示
WM8960音频HAT Raspberry Pi的[WM8960音频HAT]驱动程序。 安装wm8960-声卡 获取wm8960声卡源代码。 并安装所有linux内核驱动程序 git clone https://github.com/waveshare/WM8960-Audio-HAT cd WM8960-Audio-HAT sudo ./install.sh sudo reboot 虽然当前的Pi内核版本当前不支持上游wm8960编解码器,但上游wm8960有一些错误,我们已对其进行修复。 我们必须手动构建。 检查声卡名称是否与源代码wm8960-soundcard相匹配。 pi@raspberrypi: ~ $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA],
资源详情
资源评论
资源推荐
收起资源包目录
WM8960-Audio-HAT-master.zip (16个子文件)
WM8960-Audio-HAT-master
wm8960-soundcard.c 18KB
builddtbo.sh 176B
wm8960.c 39KB
wm8960-soundcard.dts 2KB
install.sh 3KB
asound.conf 620B
wm8960-soundcard.service 198B
dkms.conf 257B
uninstall.sh 1KB
LICENSE 34KB
README.md 2KB
Makefile 485B
wm8960-soundcard 734B
wm8960_asound.state 12KB
wm8960-soundcard.dtbo 2KB
wm8960.h 3KB
共 16 条
- 1
dilikong
- 粉丝: 24
- 资源: 4598
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1