From: Pierre Ossman Date: Wed, 19 Apr 2006 11:55:46 +0000 (+0000) Subject: WaveOut needs to have rather large chunks. This is about as low as we can X-Git-Tag: submit/2.0-panda/20130828.192557~3834 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1513ce68448aea2c1b21e782151a8be8f17f8e1;p=profile%2Fivi%2Fpulseaudio-panda.git WaveOut needs to have rather large chunks. This is about as low as we can go without getting underflows. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@759 fefdeb5f-60dc-0310-8127-8f9354f1896f --- diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c index 45ed10b..ef602e8 100644 --- a/src/modules/module-waveout.c +++ b/src/modules/module-waveout.c @@ -113,6 +113,9 @@ static void do_write(struct userdata *u) LeaveCriticalSection(&u->crit); + if (free_frags == u->fragments) + pa_log_debug(__FILE__": WaveOut underflow!"); + while (free_frags) { hdr = &u->ohdrs[u->cur_ohdr]; if (hdr->dwFlags & WHDR_PREPARED) @@ -194,6 +197,9 @@ static void do_read(struct userdata *u) LeaveCriticalSection(&u->crit); + if (free_frags == u->fragments) + pa_log_debug(__FILE__": WaveIn overflow!"); + while (free_frags) { hdr = &u->ihdrs[u->cur_ihdr]; if (hdr->dwFlags & WHDR_PREPARED) @@ -443,8 +449,8 @@ int pa__init(pa_core *c, pa_module*m) { goto fail; } - nfrags = 20; - frag_size = 1024; + nfrags = 5; + frag_size = 8192; if (pa_modargs_get_value_s32(ma, "fragments", &nfrags) < 0 || pa_modargs_get_value_s32(ma, "fragment_size", &frag_size) < 0) { pa_log(__FILE__": failed to parse fragments arguments"); goto fail; @@ -516,7 +522,7 @@ int pa__init(pa_core *c, pa_module*m) { u->oremain = u->fragment_size; - u->poll_timeout = pa_bytes_to_usec(u->fragments * u->fragment_size / 3, &ss); + u->poll_timeout = pa_bytes_to_usec(u->fragments * u->fragment_size / 10, &ss); pa_gettimeofday(&tv); pa_timeval_add(&tv, u->poll_timeout);