Skip to content

Commit a1ff28e

Browse files
committed
Increase ALSA audio buffer
Increase ALSA audio buffer requirement from 200ms to 400ms as playing TrueHD generated fair amount of buffer underruns on my machine
1 parent 5a516ab commit a1ff28e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mythtv/libs/libmyth/audiooutputalsa.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ bool AudioOutputALSA::IncPreallocBufferSize(int buffer_time)
238238
(buffer_time / 1000) *
239239
output_bytes_per_frame / 1024;
240240

241-
VBAUDIO(QString("Prealloc buffer cur: %1 max: %3").arg(cur).arg(max));
241+
VBAUDIO(QString("Prealloc buffer cur: %1 need: %2 max: %3")
242+
.arg(cur).arg(size).arg(max));
242243

243244
if (size > max)
244245
{
@@ -401,7 +402,7 @@ bool AudioOutputALSA::OpenDevice()
401402
}
402403

403404
period_time = 50000; // aim for an interrupt every 50ms
404-
buffer_time = period_time << 2; // buffer 200ms worth of samples
405+
buffer_time = period_time << 3; // buffer 400ms worth of samples
405406

406407
err = SetParameters(pcm_handle, format, channels, samplerate,
407408
buffer_time, period_time);

0 commit comments

Comments
 (0)