Hi,
./wakeWordAgent -e sensory works fine, but ./wakeWordAgent -e kitt_ai still doesn’t. With Snowboy it is very easy to change the wakeword, and for that kitt_ai is needed.
Output:
INFO:main: Starting Wake Word Agent
INFO:WakeWordAgent: State set to IDLE(2)
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
INFO:KittAiSnowboyWakeWordEngine: thread started
INFO:WakeWordIPCSocket::mainLoop thread started
INFO:WakeWordIPCSocket: init socket on port:5123
INFO:WakeWordAgent: thread started
INFO:Not connected! Make sure AVS client is running
ALSA lib pcm_file.c:358:(snd_pcm_file_write_bytes) write failed: Bad file descriptor
ALSA lib pcm_file.c:358:(snd_pcm_file_write_bytes) write failed: Bad file descriptor
ALSA lib pcm_file.c:358:(snd_pcm_file_write_bytes) write failed: Bad file descriptor
ALSA lib pcm_file.c:358:(snd_pcm_file_write_bytes) write failed: Bad file descriptor
ALSA lib pcm_file.c:358:(snd_pcm_file_write_bytes) write failed: Bad file descriptor
ALSA lib pcm_file.c:358:(snd_pcm_file_write_bytes) write failed: Bad file descriptor
wakeWordAgent: pcm_file.c:397: snd_pcm_file_add_frames: Assertion `file->wbuf_used_bytes < file->wbuf_size_bytes’ failed.
Aborted
i got it working with the kernel_modules, but hal after that is not working anymore so i had to change the wakeworkagent not to use the everloop anymore, but kitt_ai works with that, eventually the official alexa sample will work out of the box with it.:
The Kitt_ai uses portaudio, that is why you should use the kernel modules to access the mics. The problem is that the current MALOS/HAL packages are not compatible with the kernel modules.
The solution, for now, to have both mics and LEDs working in this demo would be to:
With other words the new kernel modules which bring Pyaudio / Portaudio support break MALOS Python everloop examples. Is there an analogous solution like the above for HAL?
While installing the kernel module (https://github.com/matrix-io/matrixio-kernel-modules):
“make” fails:
make -C /lib/modules/4.14.21-v7+/build M=/home/pi/matrixio-kernel-modules modules
make[1]: *** /lib/modules/4.14.21-v7+/build: No such file or directory. Stop.
Makefile:17: recipe for target ‘all’ failed
make: *** [all] Error 2
It seems like you have a newer kernel installed than the standard Raspbian kernel. The Makefile uses “uname -r” to find out which version to build against. For this you should have the corresponding header files in /lib/modules/xxx.
If you are using anything other than Raspbian stretch, you may need to adjust the Makefile to point to the correct header.
My outputs on raspbian stretch:
# uname - r
4.9.59-v7+
# dpkg -l | grep raspberrypi-kernel
ii raspberrypi-kernel 1.20171029-1 armhf Raspberry Pi bootloader
ii raspberrypi-kernel-headers 1.20171029-1 armhf Header files for the Raspberry Pi Linux kernel
Ah you have used rpi-update, then you could have pulled the current sources with rpi-source, but I would recommend to stay with the current standard kernel, I suppose the developers of the Matrix will also use the official version (apt-version).
The problem is that the kernel drivers are claiming the SPI device for themselves, at least at the moment. They probably want to avoid that too many processes are writing to it in parallel, but they have already adapted the HAL driver for the everloop kernel module in a branch.
As i don’t see such a branch for MALOS i assume we still need to wait until we can have both, i.e. mics with PyAudio / Portaudio support (kernel modules) and MALOS Python everloop examples.
git clone https://github.com/matrix-io/matrix-creator-hal.git
cd matrix-creator-hal
git fetch
git checkout ac/kernel_space
mkdir build
cd build
cmake ..
make
sudo make install
Hmm, recording is now ok, also Alexa with pushing a button in the java client, but the everloop demo does not generate an error, but nothing happens. And ./wakeWordAgent -e kitt_ai results in "can’t open device*