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

assistant_sdk failed, error: OS Error #23

Open
sunjunlishi opened this issue Apr 9, 2018 · 6 comments
Open

assistant_sdk failed, error: OS Error #23

sunjunlishi opened this issue Apr 9, 2018 · 6 comments

Comments

@sunjunlishi
Copy link

sunjunlishi commented Apr 9, 2018

Init ok,and write data ok,but response always "OS Error";Some times ok.
ubuntu

@sunjunlishi
Copy link
Author

sunjunlishi commented Apr 9, 2018

mpChannel->GetState()
when state is GRPC_CHANNEL_IDLE,it is ok.
but when state is GRPC_CHANNEL_READY,the oper result will be bad.

@Fleker
Copy link
Collaborator

Fleker commented Apr 9, 2018

Is there any other information you can provide, such as a way to reproduce this error?

@sunjunlishi
Copy link
Author

run_assistant.cc

grpc::Status status = stream1->Finish();
if (!status.ok()) {
// Report the RPC failure.
std::cerr << "assistant_sdk failed, error: " <<
status.error_message() << std::endl;
return false;
}****

@sunjunlishi
Copy link
Author

sunjunlishi commented Apr 10, 2018


my use is saving channel state:

	mpChannel = CreateChannel(api_endpoint);
		assistant = std::unique_ptr<EmbeddedAssistant::Stub>(
			EmbeddedAssistant::NewStub(mpChannel));

every time use send and receive:

if (context != NULL)
{
delete context;
context = NULL;
}
context = new grpc::ClientContext;
context->set_fail_fast(false);
context->set_credentials(call_credentials);
stream1 = std::shared_ptr<ClientReaderWriter<ConverseRequest, ConverseResponse>>(std::move(assistant->Converse(context)));

::google::assistant::embedded::v1alpha1::ConverseConfig* converse_config = request1.mutable_config();
converse_config->mutable_audio_in_config()->set_encoding(AudioInConfig::LINEAR16);
converse_config->mutable_audio_in_config()->set_sample_rate_hertz(16000);
converse_config->mutable_audio_out_config()->set_encoding(AudioOutConfig::MP3);
converse_config->mutable_audio_out_config()->set_sample_rate_hertz(16000);

	stream1->Write(request1);
           while (stream1->Read(&response))
	{  
		if ((response.has_error() || response.has_audio_out() ||
			response.event_type() == ConverseResponse_EventType_END_OF_UTTERANCE))
		{
			//printf(" Synchronously stops audio input.");
			//audio_input->Stop();
		}

		if (response.has_audio_out())
		{
		
                      }
             }

it works ok on windows system,but some times error in ubuntu

@Fleker
Copy link
Collaborator

Fleker commented Apr 10, 2018

It looks like you're using an earlier version of the sample, such as using API version v1alpha1. You may want to consider updating to a newer version which uses v1alpha2 and has additional features like text input and output. It may also be slightly more reliable.

I am not familiar with the error that you've been getting.

@sunjunlishi
Copy link
Author

ok i will have a try

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