GithubHelp home page GithubHelp logo

gothack / hifimems-kmod Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 11.0 3 KB

Simple driver for Hifiberry and ICS43432 MEMS microphone compatible hardware

Makefile 6.73% C 93.27%
raspberrypi raspberry-pi hifiberry ics43432 adafruit-speaker-bonnet adafruit-mems sph0645

hifimems-kmod's Introduction

AoSC Driver Simple I2S Hifiberry and ICS43432 MEMS

Use Hifiberry-dac / Adafruit Speaker Bonnet and ICS43432 / SPH0645 I2S MEMS Mic simultaneously

Tested with:

Based on googlevoicehat-{codec,soundcard}.c by Peter Malkin.

Install

This was installed successfully on Linux 4.9.35+ on a Raspberry Pi Zero W

sudo apt-get install raspberrypi-kernel-headers

git clone https://github.com/GothAck/hifimems-kmod
cd hifimems-kmod

make KERNEL_SRC=/lib/modules/$(uname -r)/build all
sudo make KERNEL_SRC=/lib/modules/$(uname -r)/build modules_install

hifimems-kmod's People

Contributors

gothack avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hifimems-kmod's Issues

Make fails to find "modules" target

Steps to reproduce

  1. Clone hifimems-kmod and follow instructions in README.md
  2. Enter the command make KERNEL_SRC=/lib/modules/$(uname -r)/build all

Current behaviour (bug)

Make fails with the following output:

$ make KERNEL_SRC=/lib/modules/$(uname -r)/build all
make -C /lib/modules/5.4.64+/build M=/home/pi/hifimems-kmod modules
make[1]: Entering directory '/lib/modules/5.4.64+/build'
make[1]: *** No rule to make target 'modules'.  Stop.
make[1]: Leaving directory '/lib/modules/5.4.64+/build'
make: *** [Makefile:5: all] Error 2

Expected behaviour (correct)

Make compiles targets succesfully.

Other comment (optional)

Attempted on Raspbery Pi Zero W with Raspbian 5.4.64+

/label ~Bug

Make fails on Raspbian Buster (Linux 5.4.51+)

Hi there,

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!

The driver is not loading in Raspberry pi3 A+

Dmesg:
"hifimems_soundcard: loading out-of-tree module taints kernel."
"snd-hifimems-soundcard soc:sound: ASoC: CODEC DAI hifimems-hifi not registered - will retry"
"snd-hifimems-soundcard soc:sound: snd_soc_register_card() failed: -517"

Is it supported on new raspberry platforms?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.