pulseif->pactx = NULL;
}
- if (!(pulseif->pactx = pactx = pa_context_new(api, "srs"))) {
+ if (!(pulseif->pactx = pactx = pa_context_new(api, "sphinx"))) {
mrp_log_error("pa_context_new() failed");
return;
}
int32_t silen;
if (rate < 8000.0 || rate > 48000.0) {
- mrp_log_error("invalid sample rate %.1lf KHz", rate / 1000.0);
+ mrp_log_error("sphinx plugin: invalid sample rate %.1lf KHz",
+ rate / 1000.0);
return -1;
}
if (!pulseif->conup) {
- mrp_log_error("attempt to create input stream when not connected");
+ mrp_log_error("sphinx plugin: attempt to create input stream "
+ "when not connected");
return -1;
}
size = hwm + extra;
if (ctx->verbose) {
- mrp_debug("calibration requires %u samples (%.3lf sec)",
- calsiz / sizeof(int16),
+ mrp_debug("sphinx plugin: calibration requires %u samples "
+ "(%.3lf sec)", calsiz / sizeof(int16),
(double)(calsiz / sizeof(int16)) / (double)rate);
}
case PA_STREAM_CREATING:
CHECK_STREAM(pulseif, stream);
- mrp_debug("pulseaudio input stream creating");
+ mrp_debug("sphinx plugin: pulseaudio input stream creating");
break;
case PA_STREAM_TERMINATED:
CHECK_STREAM(pulseif, stream);
- mrp_log_info("pulseaudio input stream terminated");
+ mrp_log_info("sphinx plugin: pulseaudio input stream terminated");
pulseif->stream = NULL;
break;
case PA_STREAM_READY:
CHECK_STREAM(pulseif, stream);
- mrp_log_info("pulseaudio input stream is ready", __FUNCTION__);
+ mrp_log_info("sphinx plugin: pulseaudio input stream is ready");
break;
case PA_STREAM_FAILED:
default:
if ((err = pa_context_errno(pactx))) {
- if (!(strerr = pa_strerror(err)))
- mrp_log_error("pulseaudio input stream error");
+ if (!(strerr = pa_strerror(err))) {
+ mrp_log_error("sphinx plugin: pulseaudio input stream "
+ "error");
+ }
else {
- mrp_log_error("pulseaudio input stream error: %s", strerr);
+ mrp_log_error("sphinx plugin: pulseaudio input stream "
+ "error: %s", strerr);
}
}
break;
return;
confused:
- mrp_log_error("%s(): confused with data structures", __FUNCTION__);
+ mrp_log_error("sphinx plugin: %s() confused with data structures",
+ __FUNCTION__);
return;
#undef CHECK_STREAM
size_t size;
if (pulseif->stream != stream) {
- mrp_log_error("%s(): confused with internal data structures",
- __FUNCTION__);
+ mrp_log_error("sphinx plugin: %s() confused with internal "
+ "data structures", __FUNCTION__);
return;
}
const char *strerr;
if (!pactx) {
- mrp_log_error("%s() called with zero context", __FUNCTION__);
+ mrp_log_error("sphinx plugin: %s() called with zero context",
+ __FUNCTION__);
return;
}
if (pulseif->pactx != pactx) {
- mrp_log_error("%s(): Confused with data structures", __FUNCTION__);
+ mrp_log_error("sphinx plugin: %s(): Confused with data structures",
+ __FUNCTION__);
return;
}
case PA_CONTEXT_CONNECTING:
pulseif->conup = false;
- mrp_debug("connecting to pulseaudio server");
+ mrp_debug("sphinx plugin: connecting to pulseaudio server");
break;
case PA_CONTEXT_AUTHORIZING:
pulseif->conup = false;
- mrp_debug(" authorizing");
+ mrp_debug(" sphinx plugin: authorizing");
break;
case PA_CONTEXT_SETTING_NAME:
pulseif->conup = false;
- mrp_debug(" setting name");
+ mrp_debug(" sphinx plugin: setting name");
break;
case PA_CONTEXT_READY:
pulseif->conup = true;
- mrp_log_info("pulseaudio connection established");
+ mrp_log_info("sphinx plugin: pulseaudio connection established");
stream_create(ctx);
break;
case PA_CONTEXT_TERMINATED:
- mrp_log_info("pulseaudio connection terminated");
+ mrp_log_info("sphinx plugin: pulseaudio connection terminated");
goto disconnect;
case PA_CONTEXT_FAILED:
if ((err = pa_context_errno(pactx)) != 0) {
if ((strerr = pa_strerror(err)) == NULL)
strerr = "<unknown>";
- mrp_log_error("pulseaudio server connection error: %s", strerr);
+ mrp_log_error("sphinx plugin: pulseaudio server connection "
+ "error: %s", strerr);
}
disconnect:
(void)idx;
- if (pulseif->pactx != pactx)
- mrp_log_error("%s(): confused with data structures", __FUNCTION__);
+ if (pulseif->pactx != pactx) {
+ mrp_log_error("sphinx plugin: %s() confused with data structures",
+ __FUNCTION__);
+ }
else {
switch (type) {
case PA_SUBSCRIPTION_EVENT_SOURCE:
- mrp_debug("Event source");
+ mrp_debug("sphinx plugin: event source");
break;
case PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT:
- mrp_debug("Event source output");
+ mrp_debug("sphinx plugin: event source output");
break;
default:
- mrp_debug("Event %d", type);
+ mrp_debug("sphinx plugin: event %d", type);
break;
}
}