shivasiddharth / Assistants-Pi

Headless Google Assistant and Alexa on Raspberry Pi
345 stars 116 forks source link

Failed to create sample application #126

Closed Friday8229 closed 4 years ago

Friday8229 commented 5 years ago

Hi I installed alexa on a fresh raspbian stretch by chosing the option 2 all of the things went well until I got this error

pi@raspberrypi:~ $ sudo /home/pi/Assistants-Pi/Alexa/startsample.sh
2019-07-26 18:13:45.305 [ 1] I sdkVersion: 1.9.0 configFile /home/pi/Assistants-Pi/Alexa/build/Integration/AlexaClientSDKConfig.json Running app with log level: INFO #################################################

NOTIFICATION INDICATOR STATE: OFF

#################################################

Expression 'alsa_snd_config_update()' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1353 Expression 'BuildDeviceList( alsaHostApi )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 766 2019-07-26 18:13:45.581 [ 1] C PortAudioMicrophoneWrapper:Failed to initialize PortAudio:errorCode=-9999 2019-07-26 18:13:45.581 [ 1] C PortAudioMicrophoneWrapper:Failed to initialize PortAudioMicrophoneWrapper 2019-07-26 18:13:45.581 [ 1] C SampleApplication:Failed to create PortAudioMicrophoneWrapper! 2019-07-26 18:13:46.327 [ 1] C SampleApplication:Failed to initialize SampleApplication 2019-07-26 18:13:46.408 [ 2] E HttpPost:doPostFailed:reason=curl_easy_performFailed,result=35,error=SSL connect error 2019-07-26 18:13:46.410 [ 2] E CBLAuthDelegate:parseLWAResponseFailed:reason=parseJsonFailed,position=0,error=The document is empty. Failed to create to SampleApplication!

And i think it is related to the microphone or the sound.

Output of .asoudrc

pcm.!default { type hw card -1 device 0 } }

Output of asound.conf

pcm.!default { type hw card -1 device 0 } }

Friday8229 commented 5 years ago

I tried installing portaudio but nothing helped.

HomeLuch commented 5 years ago

Hi, After looking for so long today, I was able to resolve this issue in my device by modifying Startsample.sh. Added env PA_ALSA_PLUGHW=1in front of the ./SampleApp. thus, env PA_ALSA_PLUGHW=1 ./SampleApp "/home/pi/Assistants-Pi/Alexa/build/Integration/AlexaClientSDKConfig.json" "/home/pi/Assistants-Pi/Alexa/third-party/alexa-rpi/models" INFO

Found it here: https://github.com/alexa/avs-device-sdk/issues/1413