[Solved] Matrix Voice and Alexa SDK no audio output issue

Using a seperate SD card with a fresh Raspbian Stretch install I followed the Alexa SDK guide. It looks like it’s working but I can not hear Alexa’s response. I did test the speaker to make sure it was working. Here is the “Speaking” output from the app when asking Alexa what time it is:


2018-04-04 16:53:26.356 [ c] 0 HTTP2Stream:libcurl:streamId=23,text=Curl_http_done: called premature == 0
2018-04-04 16:53:26.357 [ c] 0 AudioInputProcessor:onSendCompleted:status=SUCCESS
2018-04-04 16:53:26.357 [ c] 0 HTTP2Transport:cleanupFinishedStream:streamId=23,result=200
2018-04-04 16:53:26.357 [ c] 0 HTTP2StreamPool:releaseStream:streamId=23,numAcquiredStreams=1
2018-04-04 16:53:26.358 [ c] 0 HTTP2Transport:processNextOutgoingMessage:jsonContent={“event”:{“header”:{“namespace”:“SpeechSynthesizer”,“name”:“SpeechStarted”,“messageId”:“5e51f0f5-e25a-4fd9-8bc9-433d0a604ee5”},“payload”:{“token”:“amzn1.as-ct.v1.Domain:Application:NotificationsV4#ACRI#DeviceTTSRendererV4_1b19bded-8401-4568-a3cb-e98d6f470756”}}}
2018-04-04 16:53:26.359 [ c] 0 HTTP2StreamPool:getStream:streamId=25,numAcquiredStreams=2
2018-04-04 16:53:26.359 [ c] 9 HTTP2Transport:insertActiveStream:handle=0x2262048
2018-04-04 16:53:26.360 [ c] 0 HTTP2Stream:libcurl:streamId=25,text=Found bundle for host avs-alexa-na.amazon.com: 0x2182bb0 [can multiplex]
2018-04-04 16:53:26.361 [ c] 0 HTTP2Stream:libcurl:streamId=25,text=Conn: 0 (0x218bb88) Receive pipe weight: (-1/0), penalized: (nil)
2018-04-04 16:53:26.361 [ c] 0 HTTP2Stream:libcurl:streamId=25,text=Multiplexed connection found!
2018-04-04 16:53:26.361 [ c] 0 HTTP2Stream:libcurl:streamId=25,text=Found connection 0, with requests in the pipe (1)
2018-04-04 16:53:26.361 [ c] 0 HTTP2Stream:libcurl:streamId=25,text=Re-using existing connection! (#0) with host avs-alexa-na.amazon.com
2018-04-04 16:53:26.362 [ c] 0 HTTP2Stream:libcurl:streamId=25,text=Using Stream ID: 19 (easy handle 0x2262048)
2018-04-04 16:53:26.492 [ 16] 9 BaseStreamSource:onNeedDataCalled:size=4096
2018-04-04 16:53:26.493 [ 2] 9 BaseStreamSource:handleNeedDataCalled
2018-04-04 16:53:26.597 [ c] 0 HTTP2Stream:receivedRequestId:value=x-amzn-requestid: 024652fffe78bc6a-00004557-001f8ac9-8eae5e13e5859080-76625a96-5
2018-04-04 16:53:26.597 [ c] 0 HTTP2Stream:libcurl:streamId=25,text=Curl_http_done: called premature == 0
2018-04-04 16:53:26.597 [ c] 0 HTTP2Transport:cleanupFinishedStream:streamId=25,result=204
2018-04-04 16:53:26.597 [ c] 0 HTTP2StreamPool:releaseStream:streamId=25,numAcquiredStreams=1
2018-04-04 16:53:26.597 [ c] 0 CurlEasyHandleWrapper:reset:responseCode=HTTP_RESPONSE_SUCCESS_NO_CONTENT
2018-04-04 16:53:27.542 [ 2] 9 MediaPlayer:messageReceived:type=eos,source=audio-pipeline
2018-04-04 16:53:27.842 [ 2] 9 BaseStreamSource:~BaseStreamSource
2018-04-04 16:53:27.843 [ 2] 0 MediaPlayer:callingOnPlaybackFinished:currentId=4
2018-04-04 16:53:27.843 [ 2] 9 SpeechSynthesizer:onPlaybackFinished:callbackSourceId=4
2018-04-04 16:53:27.843 [ 2] 9 MediaPlayer:tearDownTransientPipelineElements
2018-04-04 16:53:27.843 [ 2] 0 MediaPlayer:saveOffsetBeforeTeardown:offset=1968
2018-04-04 16:53:27.843 [ 9] 0 SpeechSynthesizer:executePlaybackFinished
2018-04-04 16:53:27.843 [ 9] 9 SpeechSynthesizer:setCurrentStateLocked:state=FINISHED
2018-04-04 16:53:27.843 [ 9] 0 SpeechSynthesizer:executeProvideState:stateRequestToken=0
2018-04-04 16:53:27.844 [ 9] 0 ContextManager:updateStateLocked:action=updatedState,state={“token”:“amzn1.as-ct.v1.Domain:Application:NotificationsV4#ACRI#DeviceTTSRendererV4_1b19bded-8401-4568-a3cb-e98d6f470756”,“offsetInMilliseconds”:0,“playerActivity”:“FINISHED”},namespace=SpeechSynthesizer,name=SpeechState
2018-04-04 16:53:27.844 [ 9] 0 EventBuilder:buildJsonEventString:messageId=f292d958-615b-4bc7-9599-f309503650af,namespace=SpeechSynthesizer,name=SpeechFinished
2018-04-04 16:53:27.845 [ 9] 9 HTTP2Transport:enqueueRequest:jsonContent={“event”:{“header”:{“namespace”:“SpeechSynthesizer”,“name”:“SpeechFinished”,“messageId”:“f292d958-615b-4bc7-9599-f309503650af”},“payload”:{“token”:“amzn1.as-ct.v1.Domain:Application:NotificationsV4#ACRI#DeviceTTSRendererV4_1b19bded-8401-4568-a3cb-e98d6f470756”}}}
2018-04-04 16:53:27.845 [ 9] 9 SpeechSynthesizer:setHandlingCompleted
2018-04-04 16:53:27.845 [ 9] 0 DirectiveProcessor:onHandlingCompeted:messageId=55efc48a-5f4a-4195-9985-8590b014a5c4,directiveBeingPreHandled=(nullptr)
2018-04-04 16:53:27.846 [ 9] 0 CapabilityAgent:removingMessageIdFromMap:messageId=55efc48a-5f4a-4195-9985-8590b014a5c4
2018-04-04 16:53:27.902 [ c] 0 HTTP2Transport:processNextOutgoingMessage:jsonContent={“event”:{“header”:{“namespace”:“SpeechSynthesizer”,“name”:“SpeechFinished”,“messageId”:“f292d958-615b-4bc7-9599-f309503650af”},“payload”:{“token”:“amzn1.as-ct.v1.Domain:Application:NotificationsV4#ACRI#DeviceTTSRendererV4_1b19bded-8401-4568-a3cb-e98d6f470756”}}}
2018-04-04 16:53:27.903 [ c] 0 HTTP2StreamPool:getStream:streamId=27,numAcquiredStreams=2
2018-04-04 16:53:27.903 [ c] 9 HTTP2Transport:insertActiveStream:handle=0x2262048
2018-04-04 16:53:27.904 [ c] 0 HTTP2Stream:libcurl:streamId=27,text=Found bundle for host avs-alexa-na.amazon.com: 0x2182bb0 [can multiplex]
2018-04-04 16:53:27.904 [ c] 0 HTTP2Stream:libcurl:streamId=27,text=Conn: 0 (0x218bb88) Receive pipe weight: (-1/0), penalized: (nil)
2018-04-04 16:53:27.904 [ c] 0 HTTP2Stream:libcurl:streamId=27,text=Multiplexed connection found!
2018-04-04 16:53:27.904 [ c] 0 HTTP2Stream:libcurl:streamId=27,text=Found connection 0, with requests in the pipe (1)
2018-04-04 16:53:27.904 [ c] 0 HTTP2Stream:libcurl:streamId=27,text=Re-using existing connection! (#0) with host avs-alexa-na.amazon.com
2018-04-04 16:53:27.905 [ c] 0 HTTP2Stream:libcurl:streamId=27,text=Using Stream ID: 1b (easy handle 0x2262048)
2018-04-04 16:53:28.045 [ e] 0 DialogUXStateAggregator:setState:from=SPEAKING,to=IDLE

It would seem I can’t upload a .txt file with the entire output, only images.

Yea, I had that issue yesterday. Had to post non image files on my web site and then link to them.


Link to output: https://drive.google.com/file/d/1FOjP3sv-EtAF2-hM6BSjSc9Zse6ZotIY/view?usp=sharing

Try pressing p then enter to adust speaker settings. Look at the output in your text file. There is a Menu in there with a list of options.

My volume is plenty loud, but Alexa talks really slow and in a deep voice (I assume because she is talking really slow).

Have to work on getting this to auto start at boot.

Yeah, I was playing around with that. Volume is at 100 but still nothing.

I can hear the following: sudo aplay /usr/share/sounds/alsa/Front_Center.wav

Bizzare that we are both having different issues.

I did have to stop the install because there were errors. Had to purge and do again. Don’t know if it was because of the apt command instead of apt-get (not sure if there is a difference), but it installed without error the second time (I used apt-get).

I just played that wav file and it too is playing in slow motion. Gotta get that resolved.

The Front_Center.wav file plays at normal speed for me. My install had no errors. Guess I’ll try it from scratch again.

I had to create an .asoundrc for user Pi. Then I saw that one was created for root, and copied that one over.

aplay now plays at normal speed!

But, I ran the Alexa Demo and it plays faster but still slow, but now my aplay is playing slowly.

what does your .asoundrc file look like? Is it just in /home/pi? Do you have an asound.conf file anywhere as well?

Sounds are slow again. Somehow the SDK is doing something.

The .asoundrc I am currently using is the one that was created in /root

I copied it to /etc/asound.conf and to /home/pi

Looks like this:

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

Ok, I’ll butt out of your thread unless there is something I’ll be able to help with.

The slowness was because I’m using Stretch. It was reported as Issue #3 in the SDK Guide on github.

I did find that in order to save your alsamixer settings, this won’t work:

sudo alsactl store

There is an error with sound card #2.

you have to do this:

sudo alsactl store 0
sudo alsactl store 1


Good to see you found the fix to the slow speaking Alexa :slight_smile:
Perhaps the next stop is to get Kitt_ai working? So far I failed in that.

Is this one better than Alexa? I’m not real fond of having to renew a License every 30 days.

You can use any word to trigger Alexa. I prefer “computer”. You can also use different sounds to indicate “listening” etc. StarTrek comes to mind :grin:
And indeed, renewing licences is a nono.

Well, still nothing after 3 fresh installs. I tried a different speaker that I can turn the volume up higher on and I do hear some clicks when I say Alexa and static during SPEAKING for what that’s worth. Not giving up though.

1 Like

Trying to replicate your error here now. Can you share an output from the calling of
bash ./startsample.sh
until a first interaction e.g. “Alexa, how are you”.

I want to make a diff between your output and mine.

Thank you

Thanks so much for your help. Here’s a link to the output of “Alexa, how are you”


Issue resolved!! Woohoo! After some more digging I found the following which resolved my issue:

“The SDK uses the autoaudiosink element, which automatically selects the best sink to use based on your system’s configuration. Step 1). Run this command: gst-launch-1.0 -m audiotestsrc ! autoaudiosink. If the system is working, you will hear a test tone. If the system is not working, you will hear no test tone. -m will help you determine which sink is selected, and allow you to troubleshoot that sink. Example: autoaudiosink0-actual-sink-osxaudio” (tag): GstMessageTag, taglist=(taglist)“taglist,\ description=(string)“audiotest\\ wave”;;. In this example, the log suggests that osxaudio is used. Step 2). Run this command gst-launch-1.0 -m audiotestsrc ! alsasink. If you hear a test tone, modify the value on line 599 from m_pipeline.audioSink = gst_element_factory_make(“autoaudiosink”, “audio_sink”); to m_pipeline.audioSink = gst_element_factory_make(“alsasink”, “audio_sink”);.”

I edited line 599 per the above info of /home/pi/avs-device-sdk/MediaPlayer/src/MediaPlayer.cpp and then re-ran setup.sh.

Thanks again to everyone.



Glad to hear that @vanderwoude, I will add to that the Troubleshooting Guide link where I guess that text is from.
I am marking this post as [Solved] and improving the title :slight_smile: too, let me know if you are fine with that.

Thank you for posting the resolution here.