[Solved] Matrixio-kernel-modules package installation vs clone and compile installation


Short Explanation:
I was able to use ODAS with sudo apt install matrixio-kernel-modules, but using

git clone https://github.com/matrix-io/matrixio-kernel-modules
cd matrixio-kernel-modules/src
make && make install

will give me error can't open any device when executing matrix-odas.
Both are started from fresh Raspbian lite installation. How can I solve this?

Long Explanation:
I want to implement FIR filter with ODAS. Given matrix-hal will block ALSA from accessing microphone from matrix creator ([ODAS and Matrix record mics does not work together]), I have to use the FIR inside matrixio-kernel-modules.

I followed the exact steps from ODAS Hackers IO, except the matrixio-kernel-modules installations. I installed kernel modules according to matrix-io github matrixio-kernel.

I tried the solution given by github/issue69, but the terminal output:

pi@raspberrypi:~ $ sudo rm /lib/modules/$(shell uname -r)/kernel/drivers/mfd/matrixio*.ko
-bash: shell: command not found
rm: cannot remove '/lib/modules//kernel/drivers/mfd/matrixio*.ko': No such file or directory

and when I run odas, the terminal output:


Any help or insight will be greatly appreciated.


Hi @superaylean,

I have a few questions for you.

Which files did you edit in the kernel modules?

Since you modified the kernel modules, I assume you followed these instructions to clone & compile from source. Just to make sure, did you remember to add the overlay setup?

Lastly, what was the result of just arecord after you installed the kernel modules? What error did you get that made you try github/issue69?



Thank you so much for responding in such a short time.

I didn’t edit any files in the kernel modules.

I first edited the fir_coeff.h, but when I ran ./matrix-odas, it outputted can't open any device; therefore, I start from fresh Raspbian lite with no modification on kernel modules to make sure my changes didn’t cause the error. However, I still got the error can't open any device. That’s why I try github/issue69.

I did add the overlay setup, added dtoverlay=matrixio at the bottom of /boot/config.txt.


Can you type the following and let me know your terminal output?
arecord -l


just noticed that at the end of my /boot/config.txt there another dtoverlay, should I comment this out?


dtoverlay=matrixio #i added this

and the terminal output of arecord -l :

**** List of CAPTURE Hardware Devices ****
card 1: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
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
Subdevice #7: subdevice #7
card 2: MATRIXIOSOUND [MATRIXIO-SOUND], device 0: matrixio.mic.0 snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

Thanks for your help!



Your /boot/config.txt file looks fine as it is! Those other lines should be there.

Can you show me what your /etc/asound.conf file looks like and also the output when you try to record something from the terminal using arecord?


I don’t have /etc/asound.conf.

I can record using this command:
arecord -D hw:2,0 -d 5 -f dat test.wav

and aplay does work with the test.wav.



Please make an /etc/asound.conf file with the following code:

pcm.!default {
  type asym
  capture.pcm "mic"
  playback.pcm "speaker"

pcm.mic {
   type softvol
   slave {
     pcm "array"
   control {
     name "MicArray Master"
        card 0

pcm.speaker {
  type plug
  slave {
    pcm "hw:0,0"

pcm.array {
  type plug
  slave {
    pcm "hw:2,0"

Then try arecord without -D and see if it works. If so, try the ODAS example again and see if that works.



It gives me this:

pi@raspberrypi:~ $ arecord -f dat -d 5 test.wav
arecord: main:788: audio open error: No such file or directory

and odas example still return can't open any device:

pi@raspberrypi:~/odas/bin $ ./matrix-odas &
[1] 609
pi@raspberrypi:~/odas/bin $ can't open any device


You should be able to record without specifying the device, if you have the /etc/asound.conf file I mentioned above.

Regarding the ODAS error, did you follow all the steps here?

Could you try running a basic HAL LED example and let us know the output?


I tried ./everloop_demo, and it give me can't not open any device.
Since I started from a fresh Raspbian lite this morning, I haven’t try github/issue69. Should I give it a shot?


Hi @superaylean,

It is difficult to pinpoint what is causing the error. It seems that there may have been an error during installation of our libraries.

I would recommend starting from a fresh install of Raspbian Stretch one more time. Then install MATRIX HAL and test an LED example. If that works, then try ODAS again following the instructions from our Hackster guide.

If the problem still persists, let us know and we will go from there.



I feel like cloning & compile installation of kernel modules blocks the access of matrix creator, since all HAL examples are running fine until these steps:

git clone https://github.com/matrix-io/matrixio-kernel-modules
cd matrixio-kernel-modules/src
make && make install
#add dtoverlay=matrixio to /boot/config.txt
sudo reboot

Above steps will result in output of can't open any device when executing any HAL examples.

Removing dtoverlay=matrixio from config.txt will enable HAL examples again, but it disable kernel modules.

Here is the ODAS output after removing dtoverlay=matrixio:



Thank you for your insight! We looked into it and it seems the compilation from source was missing a step that loads the regmap kernel module (which is required for HAL to work) along with some other modules.

We will be stress testing this more before updating the GitHub readme, but for now try this and see if it works for you as well.

git clone https://github.com/matrix-io/matrixio-kernel-modules
cd matrixio-kernel-modules/src
make && make install
#add dtoverlay=matrixio to /boot/config.txt
sudo cp ~/matrixio-kernel-modules/misc/matrixio.conf /etc/modules-load.d/
sudo cp ~/matrixio-kernel-modules/misc/asound.conf /etc/
sudo reboot

After this, the HAL examples should work even when the kernel modules are installed and arecord should work as desired.



Thanks so much for you help!!! It’s all working properly now.