Skip to content

<enhancement> reSpeaker 2-Mics Pi HAT v2.0 Drivers #22

@Gentoshi

Description

@Gentoshi

I built out these instructions for installing Respeaker PiHat v2 a while ago. Maybe they can be used to build out a V2 version of the PiHAT hardware?

https://joelchristian.com/cat/custom-home-assistant-smart-speaker#respeaker-driver-build-an

sudo apt install flex bison libssl-dev bc build-essential libncurses5-dev libncursesw5-dev linux-headers-$(uname -r) -y

git clone --depth=1 --branch rpi-6.6.y https://github.com/raspberrypi/linux.git

mkdir ~/tlv320aic3x_i2c_driver
cd ~/tlv320aic3x_i2c_driver

cp ~/linux/sound/soc/codecs/tlv320aic3x.c .
cp ~/linux/sound/soc/codecs/tlv320aic3x.h .
cp ~/linux/sound/soc/codecs/tlv320aic3x-i2c.c .

nano Makefile

obj-m += snd-soc-tlv320aic3x-i2c.o
snd-soc-tlv320aic3x-i2c-objs := tlv320aic3x.o tlv320aic3x-i2c.o

KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

all:
          $(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
        $(MAKE) -C $(KDIR) M=$(PWD) clean

install:
        sudo cp snd-soc-tlv320aic3x-i2c.ko /lib/modules/$(shell uname -r)/kernel/sound/soc/codecs/
        sudo depmod -a

make
sudo make install
sudo modprobe snd-soc-tlv320aic3x-i2c
cd ..
curl https://raw.githubusercontent.com/Seeed-Studio/seeed-linux-dtoverlays/refs/heads/master/overlays/rpi/respeaker-2mic-v2_0-overlay.dts -o respeaker-2mic-v2_0-overlay.dts
dtc -I dts respeaker-2mic-v2_0-overlay.dts -o respeaker-2mic-v2_0-overlay.dtbo
sudo dtoverlay respeaker-2mic-v2_0-overlay.dtbo
sudo cp respeaker-2mic-v2_0-overlay.dtbo /boot/firmware/overlays

sudo nano /boot/firmware/config.txt

Paste the following under the all section
dtoverlay=respeaker-2mic-v2_0-overlay

Enable I2C and SPI via Raspi-config

sudo reboot

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions