Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement stream/VAD timeout #18

Closed
kristiankielhofner opened this issue May 8, 2023 · 2 comments
Closed

Implement stream/VAD timeout #18

kristiankielhofner opened this issue May 8, 2023 · 2 comments

Comments

@kristiankielhofner
Copy link
Contributor

kristiankielhofner commented May 8, 2023

I am still seeing cases where VAD/wake end never happens.

In testing I had a device stream continuously for 12 hours before I finally pulled the power...

It's very difficult to reproduce but:

  1. It makes testing/development frustrating for me. I believe my issues are related to wifi environment but I have experienced this in multiple completely different environments - Wisconsin (two Unifi APs) and California (Qualcomm and Meditek AP). FWIR stintel has yet to observe this issue.

  2. We don't (currently) have a use case where endless streaming makes sense anyway.

We should implement a timeout based on either seconds (10, maybe?), number of audio chunks, something to timeout streaming no matter what.

It seems that if I wait for a few seconds after the display indicates ready it's much less likely to occur.

@stintel
Copy link
Collaborator

stintel commented May 19, 2023

I do sometimes press the cancel button because VAD/WAKE end don't trigger. This happens very often right after booting the device. This might be related to espressif/esp-sr#47 (comment):

Why we choose raw data for the first time is that the BSS algorithm need to take some time to converge.

I've also seen some variations. Say wake word and then don't say anything:

I (00:16:15.053) WILLOW: AUDIO_REC_WAKEUP_START

I (00:16:25.053) WILLOW: AUDIO_REC_WAKEUP_END

In this case "Say command..." stays on the display, and the backlight stays on, but we can say a new command and it will work.

Another variation I'm seeing when just saying the wake word and nothing after:

I (00:25:01.486) WILLOW: AUDIO_REC_WAKEUP_START

W (28278) AFE_SR: ERROR! rb_out slow!!!

W (28338) AFE_SR: ERROR! rb_out slow!!!

W (28398) AFE_SR: ERROR! rb_out slow!!!
...

The message keeps repeating and the device is unresponsive.

@stintel
Copy link
Collaborator

stintel commented May 22, 2023

Another variation I'm seeing when just saying the wake word and nothing after:

I (00:25:01.486) WILLOW: AUDIO_REC_WAKEUP_START

W (28278) AFE_SR: ERROR! rb_out slow!!!

W (28338) AFE_SR: ERROR! rb_out slow!!!

W (28398) AFE_SR: ERROR! rb_out slow!!!
...

The message keeps repeating and the device is unresponsive.

This one appears to have been caused by CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y in my sdkconfig.

stintel added a commit that referenced this issue May 22, 2023
Add a timer that sends MSG_STOP N seconds after starting, where N is the
value of CONFIG_WILLOW_STREAM_TIMEOUT.

We don't need this for the following case, audio_rec_cfg_t.wakeup_time
already takes care of it:

I (00:16:15.053) WILLOW: AUDIO_REC_WAKEUP_START

I (00:16:25.053) WILLOW: AUDIO_REC_WAKEUP_END

Closes #18.
stintel added a commit that referenced this issue May 22, 2023
Add a timer that sends MSG_STOP N seconds after starting, where N is the
value of CONFIG_WILLOW_STREAM_TIMEOUT.

We don't need this for the following case, audio_rec_cfg_t.wakeup_time
already takes care of it:

I (00:16:15.053) WILLOW: AUDIO_REC_WAKEUP_START

I (00:16:25.053) WILLOW: AUDIO_REC_WAKEUP_END

Closes #18.
stintel added a commit that referenced this issue May 22, 2023
Add a timer that sends MSG_STOP N seconds after starting, where N is the
value of CONFIG_WILLOW_STREAM_TIMEOUT.

We don't need this for the following case, audio_rec_cfg_t.wakeup_time
already takes care of it:

I (00:16:15.053) WILLOW: AUDIO_REC_WAKEUP_START

I (00:16:25.053) WILLOW: AUDIO_REC_WAKEUP_END

Closes #18.
stintel added a commit that referenced this issue May 25, 2023
Add a timer that sends MSG_STOP N seconds after starting, where N is the
value of CONFIG_WILLOW_STREAM_TIMEOUT.

We don't need this for the following case, audio_rec_cfg_t.wakeup_time
already takes care of it:

I (00:16:15.053) WILLOW: AUDIO_REC_WAKEUP_START

I (00:16:25.053) WILLOW: AUDIO_REC_WAKEUP_END

Default to 5s which should be long enough for most commands. And max
timeout 30s which matches Whisper's default max without chunking.

Closes #18.
stintel added a commit that referenced this issue May 26, 2023
Add a timer that sends MSG_STOP N seconds after starting, where N is the
value of CONFIG_WILLOW_STREAM_TIMEOUT.

We don't need this for the following case, audio_rec_cfg_t.wakeup_time
already takes care of it:

I (00:16:15.053) WILLOW: AUDIO_REC_WAKEUP_START

I (00:16:25.053) WILLOW: AUDIO_REC_WAKEUP_END

Default to 5s which should be long enough for most commands. And max
timeout 30s which matches Whisper's default max without chunking.

Closes #18.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants