|
|
@@ -19,6 +19,9 @@
|
|
|
#define AUDIO_STRM_ON 1
|
|
|
#define AUDIO_STRM_OFF 0
|
|
|
|
|
|
+#ifndef RVC_PA_ADJUST_LATENCY_PROTOCOL_VERSION
|
|
|
+#define RVC_PA_ADJUST_LATENCY_PROTOCOL_VERSION 13
|
|
|
+#endif
|
|
|
|
|
|
static uint32_t latency_ms = 10; // requested initial latency in milisec: 0 use max
|
|
|
static pa_usec_t latency = 0; //real latency in usec (for timestamping)
|
|
|
@@ -599,7 +602,7 @@ void* pulse_read_audio(void* data)
|
|
|
|
|
|
if (r < 0)
|
|
|
{
|
|
|
- audio_log_v(AUDIO_LOG_LEVEL_INFO, "AUDIO: (pulse audio) pa_stream_connect_record failed");
|
|
|
+ audio_log_v(AUDIO_LOG_LEVEL_INFO, "AUDIO: (pulse audio) pa_stream_connect_record failed for %s.", pa_context_errno(pa_ctx));
|
|
|
finish(pa_ctx, pa_ml);
|
|
|
return ((void*)-1);
|
|
|
}
|
|
|
@@ -670,9 +673,9 @@ void* pulse_write_audio(void* data)
|
|
|
pa_mlapi = pa_mainloop_get_api(pa_ml);
|
|
|
play_pa_ctx = pa_context_new(pa_mlapi, "rvc play api");
|
|
|
|
|
|
- if (pa_context_connect(pa_ctx, NULL, PA_CONTEXT_NOFLAGS, NULL) < 0) {
|
|
|
- audio_log_v(AUDIO_LOG_LEVEL_INFO, "AUDIO: PULSE - unable to connect to server: pa_context_connect failed");
|
|
|
- finish(pa_ctx, pa_ml);
|
|
|
+ if (PA_OK != pa_context_connect(play_pa_ctx, NULL, PA_CONTEXT_NOFLAGS, NULL)) {
|
|
|
+ audio_log_v(AUDIO_LOG_LEVEL_INFO, "AUDIO: PULSE - unable to connect to server: pa_context_connect failed for %s.", pa_context_errno(play_pa_ctx));
|
|
|
+ finish(play_pa_ctx, pa_ml);
|
|
|
return ((void*)-1);
|
|
|
}
|
|
|
|
|
|
@@ -712,6 +715,7 @@ void* pulse_write_audio(void* data)
|
|
|
audio_log_v(AUDIO_LOG_LEVEL_INFO, "pulse audio pa_stream_new failed (chan:%d rate:%d) for %s.", ss.channels, ss.rate, pa_context_errno(play_pa_ctx));
|
|
|
}
|
|
|
|
|
|
+ audio_log_v(AUDIO_LOG_LEVEL_INFO, "stream state is %d", pa_stream_get_state(playstream));
|
|
|
/* define the callbacks */
|
|
|
pa_stream_set_write_callback(playstream, stream_write_request_cb, (void*)audio_ctx);
|
|
|
|