Alexa SampleApp doesn't react; no LEDs or recognition (RaspberryPi3A+ and Matrix Voice)

I’m new to the Matrix Community, so first of all hi everyone!
I’m also new to RPIs - so please excuse my inexperience. :grimacing:

Before starting with my issues, I guess it’s good to let you know some of my general setup conditions.

1st hardware setup:

  • RaspberryPi 3A+
  • different USB-PowerSupplies with at least 2A (one is 2.5A)
  • MatrixVoice boards (with ESP and w/o)

2nd software setup:

  • I tried freshly installed different Raspbian versions (Buster, Jessie, currently Stretch)
  • I followed the Alexa tutorial and almost everything worked out fine (due to performance issues I had to limit the make-jobs to only one at a time and to increase the swap size)

Finally, I can reproduce the setup with slightly different approaches like choosing another Raspbian version or changing some repositories… I will always reach a state where I’m able to build and run the Matrix HAL examples like everloop as well as arecording from the mics without any issues. Thus, the Matrix board itself seems to work fine. And on the other hand, if I start the AVS SampleApp it’s also running properly in terms of no obvious errors in the debugging output. And it will also succesfully authorize my device until it finally reaches the “Alexa is idle” level.

BUT Alexa doesn’t recognize any of my words, and not only the wakeword since pressing h to surround a spoken command doesn’t work neither. As I said the connection to the Alexa service seems to be fine. I also checked the AVS developer log to find any words in their history… However, this seem to be a problem with the AVS SDK interfacing the Matrix board since there are no LEDs turned on with the SampleApp running.

Here are some listings which might help regarding common issues I researched:

1. GPIOs

pi@raspberrypi:~ $ sudo cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-53, parent: platform/3f200000.gpio, pinctrl-bcm2835:
 gpio-18  (                    |sysfs               ) out hi
 gpio-24  (                    |sysfs               ) out hi
 gpio-25  (                    |sysfs               ) out hi
 gpio-26  (                    |sysfs               ) out hi
 gpio-29  (                    |led0                ) out lo

gpiochip2: GPIOs 488-503, parent: spi/spi0.0, matrixio-gpio, can sleep:

gpiochip1: GPIOs 504-511, parent: platform/soc:firmware:expgpio, raspberrypi-exp-gpio, can sleep:
 gpio-506 (                    |led1                ) out lo

There should be more IOs mapped I guess…

2. GPIO Status

pi@raspberrypi:~ $ gpio readall
 +-----+-----+---------+------+---+---Pi 3A+-+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |
 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |  OUT | 0 |  7 || 8  | 1 | ALT5 | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 0 | ALT5 | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |  OUT | 0 | 11 || 12 | 1 | OUT  | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 1 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |  OUT | 0 | 15 || 16 | 1 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 1 | OUT  | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI | ALT0 | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO | ALT0 | 0 | 21 || 22 | 1 | OUT  | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK | ALT0 | 1 | 23 || 24 | 1 | OUT  | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 0 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 0 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 1 | OUT  | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |  OUT | 1 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 3A+-+---+------+---------+-----+-----+

3. I2C is enabled but…

pi@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

4. SPI is enabled but I only find spidev0.1

pi@raspberrypi:~ $ ls /dev/
autofs           iio:device1        mmcblk0p2           ram6       tty13  tty32  tty51       uhid     vcsm
block            initctl            mqueue              ram7       tty14  tty33  tty52       uinput   vcsm-cma
btrfs-control    input              net                 ram8       tty15  tty34  tty53       urandom  vcsu
bus              kmsg               network_latency     ram9       tty16  tty35  tty54       v4l      vcsu1
cachefiles       log                network_throughput  random     tty17  tty36  tty55       vchiq    vcsu2
char             loop0              null                raw        tty18  tty37  tty56       vcio     vcsu3
console          loop1              ppp                 rfkill     tty19  tty38  tty57       vc-mem   vcsu4
cpu_dma_latency  loop2              ptmx                serial0    tty2   tty39  tty58       vcs      vcsu5
cuse             loop3              pts                 serial1    tty20  tty4   tty59       vcs1     vcsu6
disk             loop4              ram0                shm        tty21  tty40  tty6        vcs2     vhci
fb0              loop5              ram1                snd        tty22  tty41  tty60       vcs3     video10
fd               loop6              ram10               spidev0.1  tty23  tty42  tty61       vcs4     video11
full             loop7              ram11               stderr     tty24  tty43  tty62       vcs5     video12
fuse             loop-control       ram12               stdin      tty25  tty44  tty63       vcs6     watchdog
gpiochip0        mapper             ram13               stdout     tty26  tty45  tty7        vcsa     watchdog0
gpiochip1        matrixio_everloop  ram14               tty        tty27  tty46  tty8        vcsa1    zero
gpiochip2        matrixio_regmap    ram15               tty0       tty28  tty47  tty9        vcsa2
gpiomem          mem                ram2                tty1       tty29  tty48  ttyAMA0     vcsa3
hwrng            memory_bandwidth   ram3                tty10      tty3   tty49  ttyMATRIX0  vcsa4
i2c-1            mmcblk0            ram4                tty11      tty30  tty5   ttyprintk   vcsa5
iio:device0      mmcblk0p1          ram5                tty12      tty31  tty50  ttyS0       vcsa6

5. dmesg

pi@raspberrypi:~ $ dmesg | grep matrix
[    2.731982] matrixio_core: loading out-of-tree module taints kernel.
[    3.732385] matrixio-mic matrixio-mic: DMA mask not set
[    3.732654] matrixio-mic matrixio-mic: MATRIXIO mic array audio driver loaded (IRQ=166)
[    3.733715] matrixio-playback matrixio-playback: DMA mask not set
[    3.734223] matrixio-codec matrixio-codec: DMA mask not set
[    3.734700] matrixio-codec matrixio-codec: snd-soc-dummy-dai <-> matrixio-mic.0 mapping ok
[    3.734817] matrixio-codec matrixio-codec: snd-soc-dummy-dai <-> matrixio-pcm-out.0 mapping ok
[    3.751508] matrixio-gpio matrixio-gpio: DMA mask not set
[    3.753614] matrixio-env matrixio-env: DMA mask not set
[    3.764100] matrixio-imu matrixio-imu: DMA mask not set
[    4.526595] matrixio-uart matrixio-uart: DMA mask not set

The last days I followed a lot of possible solutions for at least similar problems that I found. But it became frustrating… :slightly_frowning_face:
I’m really looking forward to get any help. Unfortunately, I won’t be able to answer before next Tuesday. :speak_no_evil:

Thank you in advance!

Ok, I couldn’t get it work so far.

Let me try to focus on some points that I may not understand or at least verify whether I do understand it correctly:

With regard to the communicaton and system architecture, in the documentation I just found a very general block diagram saying the RPI connector is connected to the FPGA. With the further information about the RPI GPIO mapping you give in the pinout section, I conclude that only a few pins a really connected to the FPGA in sense of having a function…

What to be ignored (Assumption):
Lets assume that I don’t use / don’t have the ESP32 then I could ignore the IOs associated to its function (RPI PINS: GPIO14, 15, 24, 25). Furthermore, I don’t see any reason for the need of using the JTAG debugging interface, assuming that this may not influence the general function of the Matrix board as long as a don’t flash the FPGA with some of my own firmware stuff and therefore may need any debugging option. So RPI PINS GPIO17, 27, 22, 23 could be ignored, too.

What to be used (Assumption):
Then we have MIC_IRQ_0… This should in my case been mapped to: [ 3.732654] matrixio-mic matrixio-mic: MATRIXIO mic array audio driver loaded (IRQ=166) and should signal any kind of hardware activation of the mics? Thus, RPI GPIO 6 should be neccessary.

Furthermore, we have all the SPI pins (5 in total)… RPI SPI_CE0_N and RPI SPI_CE1_N mean that we have two SPI slaves on the Matrix side selected by the RPI. Thus, I should also find two of them with ls /dev/spi but I only see spidev0.1 as mentioned earlier. And I should find the associated GPIO Pins (RPI GPIO7, 8) in my ...debug/gpio output? And with gpio readall I can see CE1 to be configured in input mode what doesn’t make sense in my eyes…

Last but not least, we have two pins used for I²C on RPI GPIO2 and RPI GPIO3. I don’t know why the Matrix function is not given? However, as mentioned earlier, with i2cdetect -y 1 I don’t see any addresses of any I²C slaves or whatever on the Matrix side.

I don’t know which bus is used for which prupose. Without having had a deeper insight in your code I would make a guess and assume that you use the SPI bus for transfering data in full-duplex, e.g sound data originally coming from the mics as well as data from all the other sensors or actors like LEDs.

Please correct me if I’m wrong. :grimacing:

@GetKarter,

Welcome to the community and apologies for the delayed response.

I have not recently tried to set up the Alexa demo and I have yet to try setting up Alexa with Raspbian Buster + Linux kernel 4.19. I will attempt this next week and let you know my progress. The Hackster guide was created with Raspbian Stretch + Linux kernel 4.14 I believe, so there may be quite a few updates needed now.

I believe your issues have more to do with the AVS side of things rather than issues with MATRIX packages. Though, there is a current MATRIX kernel module issue going around after the Linux kernel update to 5.4 (you can check your Linux kernel with uname -a) for which you can downgrade to 4.19 following the steps here.

As for your analysis of the RPi pins and their corresponding MATRIX Voice functions, what you wrote seems generally reasonable.

You only see spidev0.1 as only one of the chip select pins are being used in the code and that is to communicate all the data between the FPGA and RPi.

As for I2C, those pins are connected to the FPGA via the PCB but are not being used at all. The connection is there for if anybody chooses to utilize them via FPGA Verilog code.

You can see the MATRIX Voice FPGA code here. The UCF file defines all the pins that are being used and the system.v file is a good overall view.

I will let you know my progress with Alexa. Let me know if you have further questions or progress!

Best,
Samreen

1 Like

Hi Samreen,

first of all thx for your reply!

I’m currently using kernel 4.19 and I also tried older ones even if I’m not able the name the accurately now. However, I’m still not making any progress and would be grateful if you manage to find the time to reproduce my setup. :wink: