I actually have been digging a bit into this issue myself since I am working on a project using the same hardware configuration (Raspberry Pi Zero W with Adafruit MEMS microphone and 3W Speaker Bonnet). Basically, it seems that linux/sound/soc.h
has introduced some breaking changes with the latest kernel version — here's my output after entering the make
command in the readme:
$ make KERNEL_SRC=/lib/modules/$(uname -r)/build all
make -C /lib/modules/5.4.51+/build M=/home/pi/hifimems-kmod modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.51+' CC [M] /home/pi/hifimems-kmod/hifimems-soundcard.o
/home/pi/hifimems-kmod/hifimems-soundcard.c:54:3: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_dai_name’; did you mean ‘stream_name’?
.cpu_dai_name = "bcm2708-i2s.0",
^~~~~~~~~~~~
stream_name
/home/pi/hifimems-kmod/hifimems-soundcard.c:54:18: error: initialization of ‘struct snd_soc_dai_link_component *’ from incompatible pointer type ‘char *’ [-Werror=incompatible-pointer-types]
.cpu_dai_name = "bcm2708-i2s.0",
^~~~~~~~~~~~~~~
/home/pi/hifimems-kmod/hifimems-soundcard.c:54:18: note: (near initialization for ‘snd_rpi_hifimems_soundcard_dai[0].cpus’)
/home/pi/hifimems-kmod/hifimems-soundcard.c:55:3: error: ‘struct snd_soc_dai_link’ has no member named ‘codec_dai_name’; did you mean ‘stream_name’?
.codec_dai_name = "hifimems-hifi",
^~~~~~~~~~~~~~
stream_name
/home/pi/hifimems-kmod/hifimems-soundcard.c:55:20: warning: initialization of ‘unsigned int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
.codec_dai_name = "hifimems-hifi",
^~~~~~~~~~~~~~~
/home/pi/hifimems-kmod/hifimems-soundcard.c:55:20: note: (near initialization for ‘snd_rpi_hifimems_soundcard_dai[0].num_cpus’)
/home/pi/hifimems-kmod/hifimems-soundcard.c:56:3: error: ‘struct snd_soc_dai_link’ has no member named ‘platform_name’; did you mean ‘platforms’?
.platform_name = "bcm2708-i2s.0",
^~~~~~~~~~~~~
platforms
/home/pi/hifimems-kmod/hifimems-soundcard.c:56:19: error: initialization of ‘struct snd_soc_dai_link_component *’ from incompatible pointer type ‘char *’ [-Werror=incompatible-pointer-types]
.platform_name = "bcm2708-i2s.0",
^~~~~~~~~~~~~~~
/home/pi/hifimems-kmod/hifimems-soundcard.c:56:19: note: (near initialization for ‘snd_rpi_hifimems_soundcard_dai[0].codecs’)
/home/pi/hifimems-kmod/hifimems-soundcard.c:57:3: error: ‘struct snd_soc_dai_link’ has no member named ‘codec_name’; did you mean ‘stream_name’?
.codec_name = "hifimems-codec",
^~~~~~~~~~
stream_name
/home/pi/hifimems-kmod/hifimems-soundcard.c:57:16: warning: initialization of ‘unsigned int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
.codec_name = "hifimems-codec",
^~~~~~~~~~~~~~~~
/home/pi/hifimems-kmod/hifimems-soundcard.c:57:16: note: (near initialization for ‘snd_rpi_hifimems_soundcard_dai[0].num_codecs’)
/home/pi/hifimems-kmod/hifimems-soundcard.c: In function ‘snd_rpi_hifimems_soundcard_probe’:
/home/pi/hifimems-kmod/hifimems-soundcard.c:86:9: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_dai_name’; did you mean ‘stream_name’?
dai->cpu_dai_name = NULL;
^~~~~~~~~~~~
stream_name
/home/pi/hifimems-kmod/hifimems-soundcard.c:87:7: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_of_node’
dai->cpu_of_node = i2s_node;
^~
/home/pi/hifimems-kmod/hifimems-soundcard.c:88:9: error: ‘struct snd_soc_dai_link’ has no member named ‘platform_name’; did you mean ‘platforms’?
dai->platform_name = NULL;
^~~~~~~~~~~~~
platforms
/home/pi/hifimems-kmod/hifimems-soundcard.c:89:9: error: ‘struct snd_soc_dai_link’ has no member named ‘platform_of_node’; did you mean ‘platforms’?
dai->platform_of_node = i2s_node;
^~~~~~~~~~~~~~~~
platforms
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:266: /home/pi/hifimems-kmod/hifimems-soundcard.o] Error 1
make[1]: *** [Makefile:1709: /home/pi/hifimems-kmod] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.51+'
make: *** [Makefile:5: all] Error 2
I know it's been a while since you've updated this project, I just thought I would bring this to your attention while I attempt to see if I can update the soundcard code to fit with the new ALSA API. If you have any tips or advice it is welcome!