Alexa cannot hear me (RPi 3b+)

Hi all,

I’ve followed this guide: https://www.hackster.io/matrix-labs/matrix-voice-and-matrix-creator-running-alexa-c-version-9b9d8d. However, when I run ./startsample.sh, Alexa cannot hear me (initially there was an audio output problem, but I fixed that by changing the configuration in the MediaPlayer.cpp to “alsasink”).

Hence, Alexa not only does not respond to the codeword “Alexa”, but I also cannot give it any verbal input. Using the keyboard controls to simulate holding/releasing the button (h + enter, h + enter), Alexa responds with “Sorry, I don’t know that”, etc, since it is actually receiving no input. I’ve also tested if the microphones on my Matrix Voice are working fine by recording and playing back a file, and they are. I’ve also tried different raspbian images (the recent buster & stretch releases), with no luck.

Is there something I’m missing here? Has anyone had this issue before, or any suggestions?

Can you post output of arecord -l and the contents of your /etc/asound.conf?

1 Like

Apologies for the delay, I was messing about and just got back to square one. Please see below:

pi@raspberrypi:~ $ 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

And for the contents of /etc/asound.conf:

pcm.!default {
type asym
capture.pcm “mic”
playback.pcm “speaker”
}

pcm.mic {
type softvol
slave {
pcm “array”
}
control {
name “MicArray Master”
card “MATRIXIOSOUND”
}
}

pcm.speaker {
type plug
slave {
pcm “hw:0,0”
}
}

pcm.array {
type plug
slave {
pcm “hw:MATRIXIOSOUND”
}
}

Note: For some reason my asound.conf in /etc is called asound.conf.backup. Also my kernel version is 4.19.42-v7+

That is because this script:
https://raw.githubusercontent.com/matrix-io/avs-device-sdk/master/tools/MatrixLabs/setup.sh
makes a backup. Search for Backup /etc/asound.conf in that script.

Is the content from the asound.conf or asound.conf.backup?
Can you post both?

You could try replacing pcm “hw:MATRIXIOSOUND” with pcm “hw:2,0”

The problem most defenitly lies in your asound.conf
The file created in the setup looks like this:

pcm.sc {
    type hw
    card 2
}
pcm.!default
{
  type asym
  playback.pcm {
    type hw
    card 0
    device 0
  }
  capture.pcm {
    type hw
    card 2
    device 0
  }
}

Did you change or run something after running the setup.sh script?

1 Like

Ok yes it makes a backup asound.conf at this point (renames the previous file for some reason):

echo "==============> Backup /etc/asound.conf =============="
echo

if [ -f "/etc/asound.conf" ]
then
  sudo mv -v /etc/asound.conf /etc/asound.conf.backup
fi 

So, I have a asound.conf in /home/pi/third-party/alexa-rpi/config:

pcm.!default
{
  type asym
  playback.pcm {
    type hw
    card 0
    device 0
  }
  capture.pcm {
    type plug
    slave {
      pcm {
        type hw
        card 1
        device 0
      }
    }
  }
}

Whereas the asound.conf.backup, as posted earlier, in /etc:

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

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

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

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

I changed “hw:MATRIXIOSOUND” with pcm “hw:2,0”, without any effect. Also, I followed the commands step by step for the C++ Alexa setup in the guide.

When running startsample.sh, is it an issue if I see the below logs for my issue?

019-07-11 06:09:20.971 [  a] 0 MessageRouter:connectionStatusChanged:reason=ACL_CLIENT_REQUEST,newStatus=CONNECTED
2019-07-11 06:09:20.971 [  5] 1 AlertsCapabilityAgent:executeOnConnectionStatusChanged:status=CONNECTED,reason=ACL_CLIENT_REQUEST
########################################
#       Alexa is currently idle!       #
########################################

2019-07-11 06:09:20.971 [  a] 0 HTTP2Transport:cleanupFinishedStream:streamId=3,result=204
2019-07-11 06:09:20.972 [  a] 0 HTTP2StreamPool:releaseStream:streamId=3,numAcquiredStreams=1
2019-07-11 06:09:20.972 [  a] 0 CurlEasyHandleWrapper:reset:responseCode=HTTP_RESPONSE_SUCCESS_NO_CONTENT
2019-07-11 06:09:20.972 [  a] 0 PostConnectSynchronizer:~PostConnectSynchronizer
2019-07-11 06:09:20.972 [  a] 5 PostConnectSynchronizer:stop
2019-07-11 06:09:20.972 [  a] 5 PostConnectSynchronizer:stopIgnored:reason=alreadyStopped

I suggest removing asound.conf in /home/pi/third-party/alexa-rpi/config.
It probably does not do anything, because a user config should be named .asoundsrc (see https://alsa-project.org/wiki/Asoundrc)

You state asound.conf.backup is in /etc, but there should be a asound.conf in there as well!
Is it missing and if so, create one with the contents I posted earlier.
If it is not missing, can you post the contents here?

The logging has nothing to do with it at this point :slight_smile:

Ok I removed the asound.conf in /home/pi/third-party/…

You state asound.conf.backup is in /etc, but there should be a asound.conf in there as well!
Is it missing and if so, create one with the contents I posted earlier.
If it is not missing, can you post the contents here?

I remember when I used other guides, there was a asound.conf file. Now if I try to rename the current asound.conf.backup, I get an error saying “Failed to start to SampleApp” when I run startsample.sh. So asound.conf is still missing…

Well… I tried downloading the raspbian image with Alexa already installed on it and followed the commands from step 4 onwards. All I had to do then is set the audio to “headphone 3.5mm” in raspi-config and also set the audio to “alsasink” as before, in MediaPlayer/src/MediaPlayer.cpp (line 589). At least Alexa can answer questions now, but still doesn’t respond to the wakeword…

Cool that the audio recording is working now :slight_smile:

I do not know anything about Alexa, I do not want any cloud connected audio capturing device in my house.

1 Like