Re: [Audacity-devel] fix portaudio to get proper stream time?
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Gale A. <ga...@au...> - 2010-10-01 10:10:23
|
| From Vaughan Johnson <va...@au...> | Wed, 29 Sep 2010 17:09:58 -0700 | Subject: [Audacity-devel] fix portaudio to get proper stream time? > According to > http://audacity.238276.n2.nabble.com/system-portaudio-td4119856.html#a4122945, > "we are using 1st July 2009 SVN snapshot (r1416), and will do until > after the stable release unless a really good reason not to comes up." > > Not sure what criteria would be "really good reason", and a new stable > PortAudio release is who-knows-when. Also, Richard commented in that > thread that "Not much is currently making it into portaudio upstream > (because the available comitters refuse to commit without a level of > review which they can't give...)", so it seems likely that anything in > the current snapshot has been pretty heavily vetted. > > In addition to the problem you mention, an update might have some help > in fixing bugs 11, 12, and 29 > (http://bugzilla.audacityteam.org/show_bug.cgi?id=11, > http://bugzilla.audacityteam.org/show_bug.cgi?id=12, and > http://bugzilla.audacityteam.org/show_bug.cgi?id=29). > > I barely know this code, have made only a few changes in AudioIO.cpp in > the past, but I've begun looking into bug 29 > (http://bugzilla.audacityteam.org/show_bug.cgi?id=29). I think the > problem is actually in AudioIO or portmixer rather than portaudio-v19, > but it's possible something related in PortAudio has been fixed, and > might be applicable. Likewise for bugs 11 & 12. > > The snapshot we're currently using is not all that old compared to the > stable PortAudio version, i.e., a little over a year vs nearly 3 years. > The version we're using has been tested in only 4 Audacity betas (I > think, since 1.3.9 in Sep 2009), so it's not that heavily tested, > really. So, overall, my sentiment is to vote for #1. In addition to bugs 11, 12 and 29 there is the "moonphase" problem I raised on -devel in the Spring where users with stereo external USB devices only get mono offered in the Audacity recording channels (or only get stereo for devices that offer multiple channels without ASIO). Since April this year I've seen 21 confirmed reports on Windows (mostly Vista/7 but also XP) and 12 on OS X (plus reports before then). Unfortunately the reports only started after 1.3.8 was released i.e. the first version to include our current PortAudio version. I didn't add it to Bugzilla at the time but I think we should record it there as a P3. Many different recent and older devices are involved, so I'm satisfied there is some issue. Changing device drivers to later or earlier versions was never said to help; all the user needed to do get stereo or multi-channel recording again was to revert to 1.3.7 or 1.2.6. On "gut feeling" I would suggest we go for #1, too, at least experimentally. I could then see if the latest PortAudio helps any of the above cases. If it doesn't, we haven't lost anything providing other bugs aren't introduced. It might also do something (who knows) for the oft-reported Linux problems where recordings from any device stop after a few seconds if you use software playthrough (these don't seem to be confined to 1.3.8+). Gale > On 9/28/2010 11:18 AM, Roger Dannenberg wrote: > > On Audacity's version of PortAudio (v19) under OS X, the audio output > > time (timeInfo->outputBufferDacTime) is incorrectly reported as a time > > offset from the start time of the stream. It should be reported as the > > system time. This is a problem for Midi playback synchronization. > > > > The lastest PortAudio code fixes the problem, but the latest "stable" > > release, Dec 7, 2007, of PortAudio exhibits the problem as do the > > sources in Audacity. > > > > I'm wondering how to proceed. I see at least these options: > > 1) Use the latest PortAudio code. Perhaps risky because the Audacity > > version is older and more tested. > > 2) Patch the Audacity PortAudio code using bits of the latest PortAudio > > code only to fix the timestamp computation on OS X. > > 3) Patch the Audacity PortAudio code with an approximation, e.g. set the > > timestamp to the current system time + the buffer size. > > 4) Add some system-dependent code in AudioIO.cpp in order to ignore > > PortAudio timestamps under OS X and use some approximation instead. > > > > Options 2 or 3 could be under EXPERIMENTAL_MIDI_OUT, but that would at > > least require the addition of "#include "experimental.h"" into PortAudio > > sources or passing a define to the compiler. > > > > I'm in favor of 1 or 2, but willing to go along with any solution, > > including new ones. What do you think? > > > > -Roger |