From 07b1cc13cd15d02ea00d7f183b43be176252b4af Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Wed, 16 Nov 2011 12:48:32 +1100 Subject: [PATCH] Allows to change the ALSA buffer size In what is likely an ALSA bug, sometimes requiring 500ms buffer fails. Add a ALSABufferOverride parameter that allows to override the value. Value is in milliseconds. --- mythtv/libs/libmyth/audiooutputalsa.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mythtv/libs/libmyth/audiooutputalsa.cpp b/mythtv/libs/libmyth/audiooutputalsa.cpp index 2fe18469197..2bc3dfaf674 100644 --- a/mythtv/libs/libmyth/audiooutputalsa.cpp +++ b/mythtv/libs/libmyth/audiooutputalsa.cpp @@ -427,7 +427,9 @@ bool AudioOutputALSA::OpenDevice() return false; } - buffer_time = 500000; // buffer 0.5s worth of samples + // buffer 0.5s worth of samples + buffer_time = gCoreContext->GetNumSetting("ALSABufferOverride", 500) * 1000; + period_time = 4; // aim for an interrupt every (1/4th of buffer_time) err = SetParameters(pcm_handle, format, channels, samplerate,