|
From: | malc |
Subject: | [Qemu-devel] Re: [PATCH] alsaaudio: increase default buffer sizes |
Date: | Fri, 2 May 2008 23:48:42 +0400 (MSD) |
On Fri, 2 May 2008, Jan Kiszka wrote:
Sound though the ALSA driver is skipping here unless I increase the buffer size. OSS seems to use 16K as well, and 1K was obviously to small for recording anyway. [ PS: Can someone explain to me why I also have to override the DAC/ADC_FIXED_FREQ to 48000 to make ALSA work? Suboptimal... ]
How exactly it doesn't work if you don't override it? Do you get any messages prefixed with "alsa:"? As for the defaults they were set to 1024/256 because that's what was needed to make it sound on par with OSS on the two machines i had at the time. By the by: OSSs fragment size is specified in bytes, ALSAs on the other hand in frames. So 16*1024 in the patch bellow means(considering S16/stereo) 65536 bytes large buffer and 1024 bytes large period. For OSS it's 16K bytes buffer and 4096 bytes period.
Signed-off-by: Jan Kiszka <address@hidden> --- audio/alsaaudio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: b/audio/alsaaudio.c =================================================================== --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -58,7 +58,7 @@ static struct { int period_size_out_overridden; int verbose; } conf = { -#define DEFAULT_BUFFER_SIZE 1024 +#define DEFAULT_BUFFER_SIZE 16*1024 #define DEFAULT_PERIOD_SIZE 256 #ifdef HIGH_LATENCY .size_in_usec_in = 1, @@ -72,8 +72,8 @@ static struct { .buffer_size_out = 400000, .period_size_out = 400000 / 4, #else - .buffer_size_in = DEFAULT_BUFFER_SIZE * 4, - .period_size_in = DEFAULT_PERIOD_SIZE * 4, + .buffer_size_in = DEFAULT_BUFFER_SIZE, + .period_size_in = DEFAULT_PERIOD_SIZE, .buffer_size_out = DEFAULT_BUFFER_SIZE, .period_size_out = DEFAULT_PERIOD_SIZE, .buffer_size_in_overridden = 0,
-- mailto:address@hidden
[Prev in Thread] | Current Thread | [Next in Thread] |