Re: [Audacity-devel] Buffer size of audio
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Richard A. <ri...@au...> - 2006-03-27 19:31:11
|
Markus Meyer wrote: > I'm currently testing both RtAudio and Portaudio on my Linux/ALSA > machines, and audio often skips in both of them. With Dominic's recent > patch, a buffer size of 256 samples is allocated, and with Portaudio v19 > it seems, that with using paUnspecifiedBufferSize, a similar size is > allocated (maybe it's 512 samples or so, but the range should be about > the same). I know of some people who also have problems with audio > skipping, though they say that their computer should be able to handle > it. 256 samples amount to about 700usecs for one stereo channel of float > samples (256/(44100*2*4)=0.000725). Even with a hard-realtime Linux > extension like RTAI jitter can be in the range of hundreds of 100usecs > on many boards without special provisions (disabling power management > etc.). So my question is, why is this so low? IMHO, we could upgrade > this to 32kb or even a few hundred kbs, at least if the user is not > using software playthrough (most are not). It might also be a good idea > to make this configurable (most programs have an option for this). I would agree - various users ask about a preferences on audacity-help. I think the reason it happens is to do with an attempt to reduce the time offset of multitrack recordings by using the minimum possible buffer. I'm not at all sure that argument holds up, and anyway I think 700uS is far to short. I've yet to get audacity playing on my 350MHz PII (doesn't detect ALSA devices with RTAudio patch), but I doubt it will be able to do 700uS latency. Windows adds a lot of buffering between application and hardware, so there is an argument to keeping it small there (in other words, default it small when building for windows), but if there is no other buffer (e.g. with ALSA) then it surely needs to go bigger - 2-5mS (i.e. 2000 - 5000uS) is common even for studio-class machines using ASIO drivers. > On a related note, would anyone object if I update the PortAudio version > in lib-src to the newest version from PortAudio CVS? It seems to contain > lots of interesting bugfixes (with it, ALSA finally works on my machine, > and OS X Core support also seems to be improved a lot). I can't see any reason why not, unless we have patches in our CVS which haven't gone upstream and need to be ported over to the new build. I think the patch for OSS / ALSA Emulation / cursor runs at double speed problems might be in the OSS version, and as far as I know isn't in upstream. I don't know what Dominic might have done in the OS X stuff - I know the v18 code has a lot of project-specific fixes in it. Richard |