aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
Diffstat (limited to 'src/output')
-rw-r--r--src/output/alsa_plugin.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/output/alsa_plugin.c b/src/output/alsa_plugin.c
index fb748fdec..489d4f32b 100644
--- a/src/output/alsa_plugin.c
+++ b/src/output/alsa_plugin.c
@@ -32,7 +32,6 @@ static const char default_device[] = "default";
enum {
MPD_ALSA_BUFFER_TIME_US = 500000,
- MPD_ALSA_PERIOD_TIME_US = 125000,
};
#define MPD_ALSA_RETRY_NR 5
@@ -118,8 +117,7 @@ alsa_configure(struct alsa_data *ad, const struct config_param *param)
ad->buffer_time = config_get_block_unsigned(param, "buffer_time",
MPD_ALSA_BUFFER_TIME_US);
- ad->period_time = config_get_block_unsigned(param, "period_time",
- MPD_ALSA_PERIOD_TIME_US);
+ ad->period_time = config_get_block_unsigned(param, "period_time", 0);
#ifdef SND_PCM_NO_AUTO_RESAMPLE
if (!config_get_block_bool(param, "auto_resample", true))
@@ -313,6 +311,13 @@ configure_hw:
goto error;
}
+ if (period_time_ro == 0 && buffer_time >= 10000) {
+ period_time_ro = period_time = buffer_time / 4;
+
+ g_debug("default period_time = buffer_time/4 = %u/4 = %u",
+ buffer_time, period_time);
+ }
+
if (period_time_ro > 0) {
period_time = period_time_ro;
cmd = "snd_pcm_hw_params_set_period_time_near";