Commit Graph

21 Commits

Author SHA1 Message Date
Paul Licameli 0053c61c08 Do not dither samples as they pass through RingBuffer...
... See allocation of RingBuffers in AudioIO.

Playback buffers always used floatSample format so this change has no
effect on them.

But we also want no extra dithering applied during recording, where the capture
format might be narrower than float.
2021-05-27 11:38:10 -04:00
Paul Licameli 389ab0c8d0 Fewer calls to RingBuffer::Put in case of trailing zeroes...
... so there is only one update per track of the atomics in RingBuffer in each
pass of the loop in FillBuffers, which will be needed to synchronize RingBuffer
and TimeQueue correctly.
2018-08-25 20:08:09 -04:00
Paul Licameli d76597287a Need acquire ordering in RingBuffer::Clear() too; and comments 2018-06-21 15:23:45 -04:00
Paul Licameli fcdfd68d73 Stricter memory ordering in RingBuffer 2018-06-21 13:40:01 -04:00
Paul Licameli 22f48d31e1 Rewrite RingBuffer with standard atomics...
... Contrary to the old comments, this class was no longer thread safe with
multi-core, because of the possibility of out-of-order reads and writes.

Use the minimal necessary memory ordering, not the default and maybe expensive
std::memory_order_seq_cst

At least one clicky recording has been seen where many small groups of
samples, a common power in two in size, seem to get displaced rightward.

I suspect out of order reads and writes might have caused that and this commit
might prevent it.
2018-06-19 14:04:34 -04:00
Paul Licameli a0bf2892fa Revert "Possibly correct some cases of clicky playback or corrupt recording..."
This reverts commit 6dca4f7859.
2018-06-13 19:07:39 -04:00
Paul Licameli 8407ef1e6c Revert "Fix compilation on Windows."
This reverts commit 21e4847b90.
2018-06-13 19:06:51 -04:00
Paul Licameli 5803c31801 Revert "Fixes for new ring buffers..."
This reverts commit 92d27c618b.
2018-06-13 19:06:41 -04:00
Paul Licameli 92d27c618b Fixes for new ring buffers...
... A problem was that play button did not pop back up when one of the
tracks was mute.

Also no longer need mac-specific conditional compilation.
2018-05-24 16:35:12 -04:00
James Crook 21e4847b90 Fix compilation on Windows. 2018-03-18 10:40:11 +00:00
Paul Licameli 6dca4f7859 Possibly correct some cases of clicky playback or corrupt recording...
... By reusing portaudio's ring buffer class, which has more safe
inter-thread synchronization with memory fences
2018-03-17 23:44:50 -04:00
Paul Licameli 9777d3e880 Alert user to drop-outs during recording...
1) When the program detects this, insert zeroes into the recording to keep the
other good parts synchronized.

2) When recording stops, a message box alerts the user, and a label track is
added showing the lost parts, labelled with consecutive numbers.

3) A menu item visible in alpha builds only is added to Tools, to simulate
recording errors at random times and test the reporting feature.
2018-01-15 14:48:39 -05:00
Paul Licameli ad04187a41 Change sampleCount arguments, variables, return values to size_t...
... whenever they really describe the size of a buffer that fits in memory, or
of a block file (which is never now more than a megabyte and so could be fit in
memory all at once), or a part thereof.
2016-09-15 21:03:17 -04:00
Paul Licameli 2910005780 Rewrite RingBuffer methods with size_t arguments and returns 2016-09-06 12:39:58 -04:00
Paul Licameli 321d5259a2 More uses of SampleBuffer, eliminating explicit DeleteSamples calls 2016-02-01 10:16:00 -05:00
benjamin.drung@gmail.com 277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
lllucius 292336c776 Fix pointer calc as discussed here:
http://audacity.238276.n2.nabble.com/Interesting-critter-when-recording-td7559588.html

Figured it'd be best to get this in early on in the 2.0.6 cycle.
2013-10-25 14:22:36 +00:00
lllucius e5a4eecb25 Reverting r12591 as it was not complete and we're too close to
freeze to risk fixing it now.  Will readdress after 2.0.5 is 
released.

Basically, RingBuffer is ill equiped to handle an input stride
other than 1.

Thanks to Peter for testing this for me.
2013-10-07 12:37:15 +00:00
martynshaw99 4ce2643d5f Remove the
// Indentation settings for Vim and Emacs
etc. lines from all files, as Campbell's patch (except for other changes to Languages.cpp)
2013-09-24 00:14:37 +00:00
lllucius f7aca4b474 Another case where extra deinterleaving isn't necessary. CopySamples() can do
the job quite nicely...well, given the "stride" information he needs.  And in
some cases, it will just use memcpy() so it may improve capture performance a
bit more.
2013-09-23 20:36:39 +00:00
ra e74978ba77 Locate and position the current Audacity source code, and clear a variety of old junk out of the way into junk-branches 2010-01-23 19:44:49 +00:00