mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
ensure that working buffers (for gain + mixing) are large enough.
See comment in code for explanation. Also comment some unused lines (for now) Conflicts: libs/ardour/audio_diskstream.cc
This commit is contained in:
parent
cabe8d31d9
commit
8097bdb21d
1 changed files with 12 additions and 8 deletions
|
|
@ -129,9 +129,13 @@ AudioDiskstream::~AudioDiskstream ()
|
||||||
void
|
void
|
||||||
AudioDiskstream::allocate_working_buffers()
|
AudioDiskstream::allocate_working_buffers()
|
||||||
{
|
{
|
||||||
_working_buffers_size = max (disk_write_chunk_frames, disk_read_chunk_frames);
|
/* with varifill buffer refilling, we compute the read size in bytes (to optimize
|
||||||
_mixdown_buffer = new Sample[_working_buffers_size];
|
for disk i/o bandwidth) and then convert back into samples. These buffers
|
||||||
_gain_buffer = new gain_t[_working_buffers_size];
|
need to reflect the maximum size we could use, which is 4MB reads, or 2M samples
|
||||||
|
using 16 bit samples.
|
||||||
|
*/
|
||||||
|
_mixdown_buffer = new Sample[2*1048576];
|
||||||
|
_gain_buffer = new gain_t[2*1048576];
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1246,8 +1250,8 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer, framecn
|
||||||
// << c->front()->playback_buf->bufsize() * bits_per_sample / 8 << " bps = " << bits_per_sample << endl;
|
// << c->front()->playback_buf->bufsize() * bits_per_sample / 8 << " bps = " << bits_per_sample << endl;
|
||||||
cerr << name () << " read samples = " << samples_to_read << " out of total space " << total_space << " in buffer of " << c->front()->playback_buf->bufsize() << " samples\n";
|
cerr << name () << " read samples = " << samples_to_read << " out of total space " << total_space << " in buffer of " << c->front()->playback_buf->bufsize() << " samples\n";
|
||||||
|
|
||||||
uint64_t before = g_get_monotonic_time ();
|
// uint64_t before = g_get_monotonic_time ();
|
||||||
uint64_t elapsed;
|
// uint64_t elapsed;
|
||||||
|
|
||||||
for (chan_n = 0, i = c->begin(); i != c->end(); ++i, ++chan_n) {
|
for (chan_n = 0, i = c->begin(); i != c->end(); ++i, ++chan_n) {
|
||||||
|
|
||||||
|
|
@ -1328,8 +1332,8 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer, framecn
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
elapsed = g_get_monotonic_time () - before;
|
// elapsed = g_get_monotonic_time () - before;
|
||||||
cerr << "\tbandwidth = " << (byte_size_for_read / 1048576.0) / (elapsed/1000000.0) << "MB/sec\n";
|
// cerr << "\tbandwidth = " << (byte_size_for_read / 1048576.0) / (elapsed/1000000.0) << "MB/sec\n";
|
||||||
|
|
||||||
file_frame = file_frame_tmp;
|
file_frame = file_frame_tmp;
|
||||||
assert (file_frame >= 0);
|
assert (file_frame >= 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue