alexa / avs-device-sdk

An SDK for commercial device makers to integrate Alexa directly into connected products.
https://developer.amazon.com/alexa/alexa-voice-service
Apache License 2.0
1.26k stars 602 forks source link

SampleApplication:Failed to create keyword detector! #1487

Closed tr4demarc closed 4 years ago

tr4demarc commented 5 years ago

Briefly summarize your issue:

Alexa SampleApp completes startup but fails to create keyword detector in the process. Error messages:

Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 933
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 933
2019-08-29 11:19:29.629 [  1] C SampleApplication:Failed to create keyword detector!

The result is that Alexa doesn't react to the hotword and is not usable.

What is the expected behavior?

Keyword detector should initialise and Alexa Sample App start up correctly.

What behavior are you observing?

After installing RetroPie on my Raspberry Pi my USB Mic stopped working that so far had been running fine with the Alexa SDK. Spent hours trying to fix it and eventually managed to get it working again although I'm not entirely sure what did the trick. My guess is it was the reinstall of alsa-utils and pulseaudio together with the uninstall of RetroPie which I ended up not being able to use due to sound issues that I wasn't able to fix. Now the Mic works again including playback and recording via aplay and arecord, but I have the issues above trying to run Alexa.

My startup uses PA_ALSA_PLUGHW=1:

cd build
env PA_ALSA_PLUGHW=1 /home/pi/build/SampleApp/src/SampleApp "/home/pi/build/Integration/AlexaClientSDKConfig.json" "/home/pi/third-party/alexa-rpi/models"

I did run it with DEBUG9 enabled but couldn't find anything obvious other than the expressions mentioned above failing.

Tell us about your environment:

Tell us what hardware you're using:

Tell us about your OS (Type & version):

timbeh commented 5 years ago

I think I am having the same issue right now. I have a Raspberry Pi Zero with the latest stretch version.

My command line output is: 2019-08-29 12:22:00.717 [ 4] 0 CBLAuthDelegate:receiveTokenResponseFailed:result=AUTHORIZATION_PENDING Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923 startsample.sh: line 3: 9832 Illegal instruction ./SampleApp "/home/pi/build/Integration/AlexaClientSDKConfig.json" "/home/pi/third-party/alexa-rpi/models" DEBUG9

dhpp commented 5 years ago

@tr4demarc - it sounds like RetroPie is affecting ALSA somehow, however RetroPie is not our target OS for reference testing, so not sure what we can add. I'd suggest you review our platform as listed here, perhaps that can help you debug anything that's missing.

@timbeh - have you looked into related threads on this forum such as #1438 and #1413?

tr4demarc commented 5 years ago

@dhpp Retropie is no longer installed and when it was, it was installed on top of Raspbian Buster (which I know is not yet officially supported) and not using a pre-made image.

caleighatamazon commented 4 years ago

Hi there, sorry for our late response on this. Are you still having problems?

kclchan commented 4 years ago

I am closing this issue due to inactivity. Please feel free to re-open it if it has been closed in error.