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 604 forks source link

Expect Speech Initiator Always Cleared after Stream Closed #1962

Closed jbgoog closed 2 years ago

jbgoog commented 3 years ago

Briefly summarize your issue:

What is the expected behavior?

What behavior are you observing?

When asking Alexa a mutliturn question, AVS will send an ExpectSpeech directive with an initiator payload.

This value gets stored on the m_precedingExpectSpeechInitiator field of AudioInputProcessor.cpp. When audio data finishes streaming to AVS, AudioInputProcessor::onSendCompleted is invoked with the status. This function calls executeResetState which then resetsm_precedingExpectSpeechInitiator

When the user tries to respond, the m_precedingExpectSpeechInitiator is null and the default initiator is used

Here are some logs:

MessageRequestHandler:attachmentRead:readStatus=1,bytesRead=0
MessageRequestHandler:onSendMimePartData:size=65536
MessageRequestHandler:attachmentRead:readStatus=1,bytesRead=0
MessageRequestHandler:onSendMimePartData:size=65536
MessageRequestHandler:attachmentRead:readStatus=1,bytesRead=0
MessageRequestHandler:onSendMimePartData:size=65536
MessageRequestHandler:attachmentRead:readStatus=1,bytesRead=0
MessageRequestHandler:onSendMimePartData:size=65536
MessageRequestHandler:attachmentRead:readStatus=1,bytesRead=0
MessageRequestHandler:onSendMimePartData:size=65536
MessageRequestHandler:attachmentRead:readStatus=1,bytesRead=0
MessageRequestHandler:onSendMimePartData:size=65536
MessageRequestHandler:attachmentRead:readStatus=1,bytesRead=0
MessageRequestHandler:onSendMimePartData:size=65536
MessageRequestHandler:attachmentRead:readStatus=1,bytesRead=0
AudioInputProcessor:executeStopCapture::creatingStopCaptureLambda
AudioInputProcessor:stopCapture:stopImmediately=true
AudioInputProcessor:setState:from=RECOGNIZING,to=BUSY
AudioInputProcessor:executeExpectSpeech:initiatorFound={"type"\:"EXPECT_SPEECH_PROMPT"}
AudioInputProcessor:setState:from=BUSY,to=EXPECTING_SPEECH
MessageRequestHandler:onSendMimePartData:size=65536
AudioInputProcessor:executeOnDialogUXStateChanged:newState=EXPECTING
MessageRequestHandler:attachmentRead:readStatus=4,bytesRead=0
MessageRequestHandler:getMimePartHeaderLines
MessageRequestHandler:onResponseFinished:status=COMPLETE,responseCode=200
MessageRequestHandler:reportMessageRequestAcknowledged
MessageRequestHandler:reportMessageRequestFinished
AudioInputProcessor:onSendCompleted:status=SUCCESS
AudioInputProcessor:stopCapture:reason=streamClosed
AudioInputProcessor:stopCapture::stopCaptureInvoked
AudioInputProcessor:resetState:dueToStatus=SUCCESS
AudioInputProcessor:executeResetState
AudioInputProcessor:setState:from=EXPECTING_SPEECH,to=IDLE
MessageRequestHandler:reportMessageRequestAcknowledged
MessageRequestHandler:reportMessageRequestFinished
AudioInputProcessor:executeOnDialogUXStateChanged:newState=IDLE
AudioInputProcessor:executeOnDialogUXStateChanged:newState=IDLE:resettingState
AudioInputProcessor:executeResetState

Provide the steps to reproduce the issue, if applicable:

  1. Set a recurring reminder "Set a reminder to feed the cat every day at 6 pm"
  2. Check the reminder has been created successfully.
  3. Delete reminder "Cancel reminder to feed the cat"
  4. Alexa will ask if you also want to delete subsequent reminders.
  5. Reply to "Yes".

Expected Behavior:

User should be able to delete all the reminders.

Observed Behavior:

Alexa will stay on the same question "do you want me to cancel all instances of this reminder?" over and over again. Amazon history shows that the multi-turn response is not nested on the same flow.

Tell us about your environment:

What version of the AVS Device SDK are you using?

kclchan commented 3 years ago

Hi @jbgoog, I wasn't able to reproduce the issue with v1.20.1 version of the SampleApp. Could you attach the full device log so we can see why this is happening in your case?

kclchan commented 2 years ago

I am closing this issue due to inactivity. If you have further questions, please open a new ticket and refer to this closed one.