alexa-pi / AlexaPi

Alexa client for all your devices! # No active development. PRs welcome # consider https://github.com/respeaker/avs instead
MIT License
1.33k stars 396 forks source link

After Hello and "YES" Alexa do not say nothing. USB mic works well! #288

Closed masteruan closed 6 years ago

masteruan commented 7 years ago

Thank you for reporting an issue with AlexaPi.

Make sure you are running the latest version of AlexaPi, and look through issues before submitting.

Check out our Wiki, and make sure to look at Debugging, and Audio debugging in particular before filing an issue.

In order to help troubleshooting, be sure to include the following information:

Output of the audio debugging script.

Your OS (including version) where you are running AlexaPi: Raspbian JESSIE

Your hardware platform and model you are running on:

USB Kinobo mic
analog stereo output

Python release (python2 --version):

python2

Description of problem:

When I send a request to alexa alexa do not respond

Expected:

Problem-relevant config.yaml entries:


/opt/AlexaPi/src/main.py -d

DEBUG:

2017-07-26 15:27:17 DEBUG: Setting up playback handler: VlcHandler
2017-07-26 15:27:18 INFO: Checking Internet Connection ...
2017-07-26 15:27:18 DEBUG: Starting new HTTPS connection (1): api.amazon.com
2017-07-26 15:27:23 DEBUG: https://api.amazon.com:443 "GET /auth/o2/token HTTP/1.1" 404 29
2017-07-26 15:27:23 INFO: Connection OK
2017-07-26 15:27:23 INFO: AVS token: Requesting a new one
2017-07-26 15:27:23 DEBUG: Starting new HTTPS connection (1): api.amazon.com
2017-07-26 15:27:29 DEBUG: https://api.amazon.com:443 "POST /auth/o2/token HTTP/1.1" 200 979
2017-07-26 15:27:29 INFO: AVS token: Obtained successfully
2017-07-26 15:27:29 DEBUG: Stopping audio play
2017-07-26 15:27:29 DEBUG: Playing audio: /opt/AlexaPi/src/resources/hello.mp3
2017-07-26 15:27:29 DEBUG: Player State: State.Opening
2017-07-26 15:27:30 DEBUG: Player State: State.Playing
2017-07-26 15:27:30 DEBUG: Started play. 
2017-07-26 15:27:32 DEBUG: Player State: State.Ended
2017-07-26 15:27:32 DEBUG: Finished play. 

I say: "Alexa" -- YES -- "What time is it?"

2017-07-26 15:28:16 DEBUG: Stopping audio play
2017-07-26 15:28:16 DEBUG: Playing audio: /opt/AlexaPi/src/resources/alexayes.mp3
2017-07-26 15:28:16 DEBUG: Player State: State.Opening
2017-07-26 15:28:16 DEBUG: Player State: State.Playing
2017-07-26 15:28:16 DEBUG: Started play. 
2017-07-26 15:28:16 DEBUG: Player State: State.Ended
2017-07-26 15:28:16 DEBUG: Finished play. 
2017-07-26 15:28:16 DEBUG: Setting up recording
2017-07-26 15:28:17 DEBUG: Start recording
2017-07-26 15:28:17 DEBUG: Starting new HTTPS connection (1): access-alexa-na.amazon.com
2017-07-26 15:28:22 DEBUG: Start sending speech to Alexa Voice Service
2017-07-26 15:28:30 DEBUG: End recording
2017-07-26 15:28:30 DEBUG: Finished sending speech to Alexa Voice Service
2017-07-26 15:28:31 DEBUG: Processing Request Response...
2017-07-26 15:28:31 DEBUG: Request Response is null (This is OKAY!)
EmerickH commented 7 years ago

Hello, see my new audio setup guide.

Emerick

masteruan commented 7 years ago

I've followed your audio guide...but nothing... :-(

EmerickH commented 7 years ago

Try to use pulse. CAUTION: there was a mistake in the guide, it's not /var/AlexaPi/config.yaml but /etc/AlexaPi/config.yaml !

Emerick

masteruan commented 7 years ago

After installation of pulse method, I open the pavucontrol panel, but I do not see the input device. After with alsa configuration when I saw "Alexa", Alexa say yes now with pulse I can hear "hello" but when I talk "Alexa" do not respond me and in the debug console nothing appears.

This mistake where are? <<there was a mistake in the guide, it's not /var/AlexaPi/config.yaml but /etc/AlexaPi/config.yaml !>> In the pulse guide? or general installation Alexa guide? Thanks

EmerickH commented 7 years ago

@masteruan I changed everything, it was in the Alsa guide. Can you give me the output of arecord -L?

Emerick

masteruan commented 7 years ago

@EmerickH this is the output of arecord -L pi@raspberrypi:~ $ arecord -L null Discard all samples (playback) or generate zero samples (capture) pulse PulseAudio Sound Server default Playback/recording through the PulseAudio sound server sysdefault:CARD=Device Default Audio Device front:CARD=Device,DEV=0 USB Audio Device, USB Audio Front speakers surround21:CARD=Device,DEV=0 USB Audio Device, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=Device,DEV=0 USB Audio Device, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=Device,DEV=0 USB Audio Device, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=Device,DEV=0 USB Audio Device, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=Device,DEV=0 USB Audio Device, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=Device,DEV=0 USB Audio Device, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=Device,DEV=0 USB Audio Device, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=Device,DEV=0 USB Audio Device, USB Audio Direct sample mixing device dsnoop:CARD=Device,DEV=0 USB Audio Device, USB Audio Direct sample snooping device hw:CARD=Device,DEV=0 USB Audio Device, USB Audio Direct hardware device without any conversions plughw:CARD=Device,DEV=0 USB Audio Device, USB Audio Hardware device with all software conversions

bkems commented 7 years ago

I have the exact same issue. I was wondering if the audio is in the expected format and if not how i'd fix that. I've also followed the steps in the guide, but I get the same issue still. It would be nice to be able to verify that the audio I am sending is ok to rule that out. It's odd though, because the wakeword works fine - saying 'alexa" wakes it up reliably.

maso27 commented 7 years ago

Wakeword detection and Alexa's responses are entirely separate software.

Have you tried "Checking if your system audio works" in the audio debugging section of the wiki?

My bet is you have the microphone sensitivity up too high and your voice is getting distorted. So when the audio is sent to amazon's servers it doesn't know what to do with it.

There's also a step right below that, called "Checking AlexaPi's Recordings".

bkems commented 7 years ago

An issue I had was the absence of an MP3 decoder. https://www.virtuit.com.au/2017/08/22/creating-alexa-device-raspberry-pi/ has a description of my experiences that might help.

Sent from Outlook Mobilehttps://aka.ms/qtex0l


From: MJ12358 notifications@github.com Sent: Sunday, September 10, 2017 5:19:29 AM To: alexa-pi/AlexaPi Cc: Guy Morton; Comment Subject: Re: [alexa-pi/AlexaPi] After Hello and "YES" Alexa do not say nothing. USB mic works well! (#288)

I am having similar issues. The wake word detection works but on any captured audio I receive the following error using debug:

Exception in thread Thread-4: Traceback (most recent call last): File "/user/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.__kwargs) File "/opt/AlexaPi/src/main.py", line 542, in trigger_process alexa_speech_recognizer(audio_stream) File "/opt/AlexaPi/src/main.py", line 351, in alexa_speech_recognizer process_response(resp) File "/opt/AlexaPi/src/main.py", line 442, in process_response with open(filename, 'wb') as f: IOError: [Errno 2] No such file or directory: '/tmp/AlexaPi-runtime-######/$STRINGOFJUNK.mp3'

Playback of the recording.wav file within /tmp/AlexaPi-runtime-###### plays without distortion!

Any thoughts? Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Falexa-pi%2FAlexaPi%2Fissues%2F288%23issuecomment-328298096&data=01%7C01%7Cguy.morton%40bksv.com%7C41455cfa17f24b984b7f08d4f7b7b21a%7C6cce74a3397545e09893b072988b30b6%7C0&sdata=ISSfdy4c2FUoUqk1t2VIihI2bb%2BmhRcLLUOBuJgN5pI%3D&reserved=0, or mute the threadhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHfep-vTjtmCujggIcqkNYVNyUkFkSXoks5sguTBgaJpZM4OkF2y&data=01%7C01%7Cguy.morton%40bksv.com%7C41455cfa17f24b984b7f08d4f7b7b21a%7C6cce74a3397545e09893b072988b30b6%7C0&sdata=BnUJZbfZzjVYlBXBpXHSCPXZ9d6yGjlztzMVRkLWHtk%3D&reserved=0.

This e-mail is confidential and may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail. Please then delete the e-mail and do not disclose its contents to any other person.

renekliment commented 6 years ago

Closing due to inactivity. Feel free to reopen.

Gandalf1783 commented 4 years ago

Well then i'd like to repopen the conversation.

Im Using Raspi 4, an Behringer Xenyx 302 usb which i confirmed working with aplay /usr/share/sounds/alsa/Front_Center.wav Now my problem: I dont know which format i should use... Thanks everybody ^^

btw, this is the output of aplay -L:

pi@raspberrypi:~ $ arecord -L null Discard all samples (playback) or generate zero samples (capture) default output sysdefault:CARD=CODEC USB Audio CODEC, USB Audio Default Audio Device front:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio Front speakers surround21:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio Direct sample mixing device dsnoop:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio Direct sample snooping device hw:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio Direct hardware device without any conversions plughw:CARD=CODEC,DEV=0 USB Audio CODEC, USB Audio Hardware device with all software conversions