Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Recognize Event AttachmentReader Errors #118

Closed
simplistiq opened this issue Aug 28, 2017 · 2 comments
Closed

Recognize Event AttachmentReader Errors #118

simplistiq opened this issue Aug 28, 2017 · 2 comments

Comments

@simplistiq
Copy link

After a multiple recognize events, I am seeing the following. The only way out is to kill the SDK and then restart it again.

2017-08-28 22:07:26.967 [ 9] E SdsReader:seekFailed:reason=seekOverwrittenData
2017-08-28 22:07:26.967 [ 9] E InProcessAttachmentReader:ConstructorFailed:reason=could not create an SDS reader
2017-08-28 22:07:26.967 [ 9] E InProcessAttachmentReader:createFailed:reason=object not fully created
2017-08-28 22:07:26.967 [ 9] E AudioInputProcessor:executeRecognizeFailed:reason=Failed to create attachment reader

@kencecka
Copy link
Contributor

kencecka commented Aug 29, 2017

Hi @simplistiq,

These errors are symptomatic of a performance issue.

The SDS is a circular buffer, which you would typically write to continuously from your microphone input. The rate of writing is constrained by the AudioFormat - 16-bit samples at 16KHz means you should have a steady rate of 32KB/second. In a system which is working well, the cpu will be powerful enough to pull data out of the SDS faster than it is being written in, and the network connection to AVS will also be fast enough to stream data faster than it is being written in. This should generally keep the SDS drained so that it is nearly empty most of the time.

However, if you get into a situation where you are reading data from the SDS at a rate less than 32KB/second, there is a chance it will fill up and start overwriting data that you have not read yet. That is what the first error is telling us. There are a few reasons this might occur:

  1. Your network connection temporarily slowed down.
  2. Your CPU was temporarily busy with other things.
  3. Your network connection is chronically slow (less than 32KB/second)
  4. Your CPU is chronically overloaded

If the problem is caused by 1 or 2, you should be able to address it by increasing the size of the SDS so that it can accumulate more data during a temporary slowdown.

If the problem is caused by 3 or 4, you will need to evaluate system changes. Either scaling up the hardware, or optimizing other system components to free up CPU cycles and bandwidth.

Ken

@kencecka kencecka added the SDS label Aug 29, 2017
@kencecka
Copy link
Contributor

I forgot to add - the SampleApp instantiates the SDS here; this is where you would make changes to increase the SDS size.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants