pcm: add defaults.pcm.minperiodtime parsing

Some broken applications like Audacious don't set any timing parameters.
While the alsa-lib behaviour is to select the smallest period size and
biggest buffer size, the result is the generation of thousands
interrupts per second.

The default value in alsa.conf is 5000usec.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2010-08-11 19:45:40 +02:00
parent e6d5dcf1f6
commit 09879a4bb5
4 changed files with 21 additions and 2 deletions

View file

@ -2058,7 +2058,7 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
const char *str;
char *buf = NULL, *buf1 = NULL;
int err;
snd_config_t *conf, *type_conf = NULL;
snd_config_t *conf, *type_conf = NULL, *tmp;
snd_config_iterator_t i, next;
const char *id;
const char *lib = NULL, *open_name = NULL;
@ -2191,6 +2191,12 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
snd_dlclose(h);
}
}
if (err >= 0) {
err = snd_config_search(pcm_root, "defaults.pcm.minperiodtime", &tmp);
if (err >= 0)
snd_config_get_integer(tmp, &(*pcmp)->minperiodtime);
err = 0;
}
if (type_conf)
snd_config_delete(type_conf);
free(buf);