nemo_voice_agent.pipecat.services.nvidia.tts
nemo_voice_agent.pipecat.services.nvidia.tts
Retry wrapper around pipecat’s NvidiaTTSService.
Upstream treats any SynthesizeOnline exception as terminal for the stream
(pipecat/services/nvidia/tts.py: “Once SynthesizeOnline raises, no further
reliable audio is expected”). For a locally-hosted Riva server that is the
right call, but against NVCF the first request to a cold or rescheduled worker
routinely fails with::
StatusCode.DEADLINE_EXCEEDED: failed to establish link to worker
That is a routing/capacity condition, not a synthesis failure — the next
attempt normally succeeds within a second. Upstream’s terminal handling turns
it into a silently dropped bot turn: the pipeline gets an ErrorFrame and
the user simply hears nothing.
The STT side needs no equivalent: pipecat’s NvidiaSTTService already
reconnects on any grpc.RpcError via _handle_stream_drop ->
_do_reconnect, and does so turn-aware. Only TTS lacks a retry path.
Module Contents
Classes
Functions
Data
API
Bases: NvidiaTTSService
NvidiaTTSService that retries a synthesis stream that never produced audio.
Parameters:
Additional attempts after the first failure. 0 restores
upstream behaviour exactly.
Base delay between attempts; doubled each retry.
Forwarded to NvidiaTTSService.
Run the SynthesizeOnline stream, retrying establishment failures.
Overrides upstream’s single-shot handler. Same contract: forward each
response onto state.response_queue, push the exception on failure,
and always terminate with a None sentinel so _process_responses
can finish.
Retry is deliberately restricted to attempts that produced no audio. Once any frame has reached the audio context, re-running the request would splice a duplicate prefix into the middle of an utterance, which is worse than the dropped turn we are trying to avoid. Since “failed to establish link to worker” fails before the first response, the narrow rule still covers the case that motivated this class.
True when error is a gRPC failure that is worth retrying.