View Single Post
Old 10-19-2024, 11:46 AM   #14
noodler
Member
noodler began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Feb 2023
Device: none
I've taken a look at the code and found a fix by removing the line that sets a large buffer on the QAudioSink in piper.py:

Code:
self._audio_sink.setBufferSize(2 * 1024 * 1024)
With that line removed:
- the default buffer size on Ubuntu 22.04 is just 3794 bytes rather than 2097152 bytes
- piper tts now plays fine - no stutter or glitches (sounds great btw, looking forward to using it!)

It feels like the Nagle algorithm type issue i.e. QT/linux is waiting for enough data to be written into the buffer before processing it to avoid under runs but calibre only writes one utterance at a time and waits for it to be processed to sync the highlight. A single utterance is tiny relative to a 2MB buffer size so processing stalls.

Might count as a QT bug?

I guess might need to elevate buffer size to a setting given different platforms seem quite sensitive to it.

Last edited by noodler; 10-19-2024 at 11:51 AM.
noodler is offline   Reply With Quote