alexa / alexa-smart-screen-sdk

⛔️ DEPRECATED Active at https://github.com/alexa/avs-device-sdk
Apache License 2.0
76 stars 25 forks source link

AudioPlayer status change during user interaction #139

Closed zhaokai3000 closed 2 years ago

zhaokai3000 commented 2 years ago

IMPORTANT: Before you create an issue, please take a look at our Issue Reporting Guide.

Briefly summarize your issue:

When the device is playing music or flash briefings, if user try to interact with alexa, for example set a reminder, the status of audio player which plays the music or flash briefings change shortly between the interaction. On some device, the status change may cause music or news being played shortly between the interaction.

What is the expected behavior?

Music and flash briefings shouldn't be played during user interaction.

What behavior are you observing?

Music and flash briefings being played shortly between user interaction.

Provide the steps to reproduce the issue, if applicable:

  1. start music or flash briefings;
  2. set a reminder and follow the hints.

Tell us about your environment:

What version of the AVS Device SDK are you using?

  <x.y.z>

2.9.2

Tell us what hardware you're using:

Tell us about your OS (Type & version):

Have you tried the same use case with AVS Device SDK SampleApp?

log for alexa smart screen sdk running on a ubuntu machine: log.txt As you can see in the log, the audio player status changes shortly from paused to playing and back to paused between the user interaction. 2022-08-22 02:08:41.892 [ 4] 0 AudioPlayer:changeState:fromState=PAUSED,toState=PLAYING ...... 2022-08-22 02:08:41.902 [ 4] 0 AudioPlayer:changeState:fromState=PLAYING,toState=PAUSED

On the ubuntu machine, the time maybe around 10 milliseconds, but on my arm device, the time sometimes could be more than 100 milliseconds. https://user-images.githubusercontent.com/16895712/185832438-a3f92dc8-4ae2-41df-abdd-85f05280a5df.mp4

dtpancha commented 2 years ago

Hi @zhaokai3000, we believe that this is the expected behavior. In the time between the interaction, the AudioPlayer will regain focus as AFML is unable to determine that a new directive will be sent from Alexa in the interim. This gap is likely to be very small on a more powerful device, but larger on a less powerful one. We will close this issue if you have no further questions.

zhaokai3000 commented 2 years ago

Hi @zhaokai3000, we believe that this is the expected behavior. In the time between the interaction, the AudioPlayer will regain focus as AFML is unable to determine that a new directive will be sent from Alexa in the interim. This gap is likely to be very small on a more powerful device, but larger on a less powerful one. We will close this issue if you have no further questions.

Well, I could understand this, but the user experience is not so good and our tester think this is intruding sounds between interaction and should not happen.

VaruPan commented 2 years ago

Thanks a lot for reaching out. We acknowledge this as a design challenge with asynchronous management of audio and visual directives. As long as ducking is enabled, local player will continue playing media unless told by Alexa otherwise.

You can disable this feature by toggling the following flag https://developer.amazon.com/en-US/docs/alexa/avs-device-sdk/cmake-parameters.html#audio

For more information on Interaction model, please follow the this link - https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/interaction-model.html#foreground-vs-background-channels