here are the exact steps I did (NB I did NOT run rpi-update as that gives a very nasty warning and I think it actually makes things worse...)
see
https://learn.adafruit.com/adafruit-i2s ... g-and-test
edit /boot/config.txt to uncomment dtparam=i2s=on
sudo nano /etc/modules : Add snd-bcm2835 on its own line
sudo reboot
lsmod | grep snd - should see snd_bcm2835 & i2s
kernel:
sudo apt-get install git bc libncurses5-dev bison flex libssl-dev
sudo wget
https://raw.githubusercontent.com/notro ... rpi-source -O /usr/bin/rpi-source
sudo chmod +x /usr/bin/rpi-source
/usr/bin/rpi-source -q --tag-update
rpi-source --skip-gcc
If the script pauses at this prompt: Code coverage for fuzzing (KCOV) [N/y/?] (NEW) - just press enter
sudo mount -t debugfs debugs /sys/kernel/debug
git clone
https://github.com/PaulCreaser/rpi-i2s-audio
cd rpi-i2s-audio
sudo cat /sys/kernel/debug/asoc/dais
this should show the *.i2s module you need to reference:
20203000.i2s : PiZero
3f203000.i2s : Pi2 and Pi3
fe203000.i2s : Pi4
edit my_loader.c to change 3f203000 to fe203000 in both places (for pi4)
sudo apt-get install raspberrypi-kernel-headers
make -C /lib/modules/$(uname -r )/build M=$(pwd) modules
sudo insmod my_loader.ko
modinfo my_loader.ko should show relevant version (matches uname -r)
sudo insmod my_loader.ko
this should go in cleanly, dmesg shows:
[ 422.528852] my_loader: disagrees about version of symbol module_layout
[ 602.627904] my_loader: loading out-of-tree module taints kernel.
[ 602.639081] request module load 'bcm2708-dmaengine': 0
[ 602.641010] register platform device 'asoc-simple-card': 0
[ 602.642762] Hello World

[ 602.660789] asoc-simple-card asoc-simple-card.0: snd-soc-dummy-dai <-> fe203000.i2s mapping ok
not sure about the disagrees line though