[NO LONGER NECESSARY] Kernel Modules 4.19 Workaround

Hi, sorry I don’t get it to work…
I performed the kernel downgrade as in the earlier post.
when trying to follow the instruction I get the the module was not found:

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Version ‘0.1.6’ for ‘matrixio-kernel-modules’ was not found

When I try to install without the version number I get:

Error! Bad return status for module build on kernel: 4.14.79-v7+ (armv7l)

Consult /var/lib/dkms/matrixio/0.1/build/make.log for more information.

dpkg: error processing package matrixio-kernel-modules (–configure):

subprocess installed post-installation script returned error exit status 10

Processing triggers for libc-bin (2.24-11+deb9u4) …

Errors were encountered while processing:

matrixio-kernel-modules

E: Sub-process /usr/bin/dpkg returned an error code (1)

What am I doing wrong?

Hi @superholz,

Welcome to our community!

The kernel downgrade is no longer necessary. MATRIX devices and libraries now work with Linux kernel 4.19 on Raspbian Stretch. You can install Raspbian Stretch Desktop here and Stretch Lite here.

Then, you can install the latest MATRIX kernel modules as usual!

To undo your kernel downgrade and install the kernel modules, you can run the following commands one by one:

sudo apt-mark unhold raspberrypi-kernel

sudo apt-mark unhold raspberrypi-kernel-headers

sudo apt purge matrixio-kernel-modules

sudo apt purge raspberrypi-kernel-headers

sudo apt update && sudo apt upgrade

sudo reboot

sudo apt install matrixio-kernel-modules

sudo reboot

Best,
Samreen

Thank you for the reply. I performed the steps and was able to install the Matrix voice, great so far :slight_smile:
I want to use it with snips and because of the known audio problems I hoped to get it running with the lower kernel version. With the last version of Stretch there is still the kernel problem, correct?

Nope, our kernel modules are working well with the latest kernels on Raspbian Stretch :smiley: Snips should work too!

We fixed all the initial issues we had with that.

Try following our Snips setup guide and let me know how it goes!

Best,
Samreen

Hi Samreen,

yes the install in principle works flawlessly. I can install snips, I changed successfully the /etc/snips.toml to make use of the matrix voice. All the initial audo test work.

It starts getting frustrating when coming to the snips demo. It could be still that it has nothing to do with the matrix audio but maybe you have an idea how to solve it:

When snips discovers the wake word it tries to reply with playing a beep. This proces does not succeed and no further phrase is accepted:

[21:35:46] Watching on localhost:1883 (MQTT)

[21:35:49] [Hotword] detected on site default, for model hey_snips

[21:35:49] [Asr] was asked to stop listening on site default

[21:35:49] [Hotword] was asked to toggle itself ‘off’ on site default

[21:35:49] [Dialogue] session with id ‘c3cb1fac-8d7a-4180-96b6-ee6e81926a92’ was started on site default

[21:35:49] [AudioServer] was asked to play a wav of 41.1 kB with id ‘bdba4f93-7bbf-48bb-8e41-fff5fcc35970’ on site default

[21:36:05] [Dialogue] session with id ‘c3cb1fac-8d7a-4180-96b6-ee6e81926a92’ was ended on site default. The session was ended because one of the component didn’t respond in a timely manner

[21:36:05] [Asr] was asked to stop listening on site default

[21:36:05] [Hotword] was asked to toggle itself ‘on’ on site default

when I turn this audio feedback off in the /etc/snips.toml by setting

[snips-dialogue]
sound_feedback_disabled_default = true

snips does not play an audio as accnowledegement, and accept further phrases. Just to end up stuck again when the first audio should be sent to the speaker:

[21:43:16] Watching on localhost:1883 (MQTT)
[21:43:18] [Hotword] detected on site default, for model hey_snips
[21:43:18] [Asr] was asked to stop listening on site default
[21:43:18] [Hotword] was asked to toggle itself ‘off’ on site default
[21:43:18] [Dialogue] session with id ‘423a5440-c14a-4951-b6f5-b6198a1f4396’ was started on site default
[21:43:18] [Asr] was asked to listen on site default
[21:43:24] [Asr] captured text “what the weather today” in 5.0s
[21:43:24] [Asr] was asked to stop listening on site default
[21:43:24] [Nlu] was asked to parse input “what the weather today”
[21:43:25] [Nlu] detected intent searchWeatherForecast with confidence score 0.994 for input “what the weather today”
Slots ->
forecast_start_datetime -> 2019-08-12 00:00:00 +01:00 (confidence: 0.690)
[21:43:25] [Dialogue] New intent detected searchWeatherForecast with confidence 0.994
Slots ->
forecast_start_datetime -> 2019-08-12 00:00:00 +01:00 (confidence: 0.690)
[21:43:25] [Dialogue] was ask to end session with id 423a5440-c14a-4951-b6f5-b6198a1f4396 by saying ‘You asked for the weather today’
[21:43:25] [Tts] was asked to say “You asked for the weather today”
[21:43:25] [AudioServer] was asked to play a wav of 58.2 kB with id ‘9ac36433-90e4-4e3e-b8c1-f93267a0bcb7’ on site default
[21:43:40] [Dialogue] session with id ‘423a5440-c14a-4951-b6f5-b6198a1f4396’ was ended on site default. The session was ended because one of the component didn’t respond in a timely manner
[21:43:40] [Asr] was asked to stop listening on site default
[21:43:40] [Hotword] was asked to toggle itself ‘on’ on site default

my conclusion is that the audio input works fine with snips and the matrix one. The output is somehow corrupted and does not come through because the output process could not be successfully finished.

Im actually using the output on the raspberry board. But changing it to use the output on the matrix does not change anything.

I have read elsewhere that this has to do with sampling rates of what is sent and the setup is able to play. I also read that it is possible to solve it by some repiping of the audio signal by editing the asound.conf
Unfortunately I have still to less knowledge to do that in a targeted manner.
Any ideas are therefore still appreciated.

@superholz,

Your issues look very similar to ones I experienced with Snips when the new Linux kernels had come out. I posted this Snips workaround at the time which solved it for me.

I thought the issue had been solved since then on the Snips side, but it is possible that it is back. Please try the method in the post I linked and let me know if there is any improvement or any new symptoms.

Best,
Samreen

sound promising. I’m a bit confused because my /etc/asound.conf
looks quit different:

pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm “hw:0,0”
}
capture.pcm {
type plug
slave.pcm “hw:2,0”
}
}

This is likely because you may have run sam setup audio which overwrites the /etc/asound.conf file. Should still work for you, but instead you would put the rate 16000 in playback.pcm.

If you want to restore the MATRIX kernel module configuration, you can find it here.

Not to much hope here. I tried both using the existing asound.conf and added the rate statement and used the original one and edited. And I put the extra variable to the /etc/snips.toml.

Now snips is not recognizing anything any more. The sam test microphone /speaker however still works.

uhh I did that from the post further below and then it worked:

sudo snips-audio-server --mike “MATRIXIO-SOUND: - (hw:2,0)” -v

but I think that is temporary? How to I “preserve” in the audio settings?

@superholz,

Huh, very interesting. This may be an obvious question, but your mike= line in /etc/snips.toml is uncommented, right? With exactly this line?

mike = "MATRIXIO-SOUND: - (hw:2,0)"

I am being particular about this as sam test speaker and sam test microphone can work even if /etc/snips.toml config is wrong. I have experienced this myself. I think those commands depend only on /etc/asound.conf.

Please let me know!

Best,
Samreen

I think the .toml is correct:

[snips-audio-server]
# frame = 256
# bind = "default@mqtt"
mike = "MATRIXIO-SOUND: - (hw:2,0)"
Environment = "PA_ALSA_PLUGHW=1"
# disable_playback = false
# disable_capture = false

I had changed the asound.conf back to the settings you pointed me to. Could that be an issue that is is not in a format that snips needs? However I will try later today.

I reset the /etc/snips.toml and did the sam audio setup again. Then added the 16000 sample rate statement. After that nothing works. Snips services are running but even wake word is not detected.
When I use

sudo snips-audio-server --mike “MATRIXIO-SOUND: - (hw:2,0)” -v

I get this error:

....
[21:35:08.087717] DEBUG:snips_audio_portaudio : Attempt 36

[21:35:08.187892] DEBUG:snips_audio_portaudio : Attempt 37

[21:35:08.288072] DEBUG:snips_audio_portaudio : Attempt 38

[21:35:08.388245] DEBUG:snips_audio_portaudio : Attempt 39

[21:35:08.488437] DEBUG:snips_audio_portaudio : Attempt 40

[21:35:08.588641] DEBUG:snips_audio_portaudio : Attempt 41

[21:35:08.688820] DEBUG:snips_audio_portaudio : Attempt 42

[21:35:08.788995] DEBUG:snips_audio_portaudio : Attempt 43

[21:35:08.889180] DEBUG:snips_audio_portaudio : Attempt 44

[21:35:08.989358] DEBUG:snips_audio_portaudio : Attempt 45

[21:35:09.089539] DEBUG:snips_audio_portaudio : Attempt 46

[21:35:09.189718] DEBUG:snips_audio_portaudio : Attempt 47

[21:35:09.289909] DEBUG:snips_audio_portaudio : Attempt 48

[21:35:09.390087] DEBUG:snips_audio_portaudio : Attempt 49

[21:35:09.491179] INFO :snips_broadcast_mqtt_server: Starting broadcasting audio on hermes for site "default"

[21:35:09.491323] ERROR:snips_broadcast_mqtt_server: audio loop for default crashed: Can not read a stopped source

After setting back the asound.conf settings you posted with the rate statement added it worked again but also only when manually setting the matrix audio as interface by

sudo snips-audio-server --mike “MATRIXIO-SOUND: - (hw:2,0)” -v

A workaround would be I guess to implement somewhere in a startup script to fire these command? Still strange why the settings from the /etc/snips.toml are obviously partly ignored, or are not correct.

Hi @superholz,

Were you able to get this working?

I installed Snips and tested again on Raspbian Stretch 4.19, and it worked for me after implementing rate 16000 in my /etc/asound.conf because of the Snips portaudio issue that seems to be back.

You are correct about a workaround being starting the Snips service with the mike specified in rc.local so it starts on boot.

If you are still having problems, you can send over your Snips error logs and we can try to help troubleshoot.

Best,
Samreen

…thanks für asking. No, I spend another few hours on it without success. I tried to implement the command executed after startup. But then something went wrong and I had troubles getting the snips-audio-server to a “running” state. I also tried the settings posted
Finally I had to stop quite frustrated. So indeed if you can troubleshoot I would give it another try and start again from a virgin Stretch install.
Which /etc/asound.conf did you use to alter? The one that is created by the snips audio setup or the one you linked me to?
Does the Raspberry Pi version may matter if using a 3 or a 3+?

Sorry for your frustration.

Raspberry Pi version 3 or 3B+ should all work.

I used Raspbian Stretch Lite 4.19 and followed this guide exactly. No sam setup audio. After this, test with an eye on sam watch. If it doesn’t work, then place rate 16000 in /etc/asound.conf in the speaker section as shown below and test “hey snips” again.

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

I hope this works for you!

Best,
Samreen

Okay, I followed exactly and omitted the snips audio setup. I had to add the rate 16000 and after that indeed it works :slight_smile: unbelievable but nice. I hope that it will keep working.
It could be that in former tests I did install snips before the matrix voice. Could that make a difference?

thanks for you description. with portaudio it works fine!!! :slight_smile:
the difference to the unstable alsa seems to be the audio-format (mono, 16000) works very good.

in alsa sometimes it is stereo, 22050. it is not stable.

in portaudio it is mono 16000. it is stable.

1 Like

Hi Samreen,
I am also struggeling with the kernel modules of matrix-io.
I am using a fresh install from raspberry 4.19.66.
Installed the kernel modules as describeld in your posts above and in the setup guide.
The installation went fine without any errors.
But during reboot the modules are not loaded
here is an extract of the log:

daemon.log:Dec 1 13:47:58 raspberrypi systemd-modules-load[97]: Failed to find module ‘matrixio-regmap’
daemon.log:Dec 1 13:47:58 raspberrypi systemd-modules-load[97]: Failed to find module ‘matrixio-everloop’

daemon.log:Dec 1 13:48:01 raspberrypi matrix-init.bash[357]: can’t open any device

Do you have any hint what is wrong wit my installation?

Best regards
Reinhard

Reinhard,

Our matrixio-kernel-module package was recently updated and there were some issues during the update that have temporarily broken the package.

We are working on fixing this and will notify you as soon as it has been resolved. A temporary solution could be compiling the kernel modules from source for your project.

Before doing this, I would recommend a purge of the package installation.

sudo apt purge matrixio-kernel-modules

We apologize for any inconvenience caused. Please reach out if issues persist!

Best,
Samreen