Skip to content

Commit 12e31ce

Browse files
committed
Improve playback time with big channel counts
1 parent 51735fe commit 12e31ce

5 files changed

Lines changed: 16 additions & 2 deletions

File tree

Builds/VisualStudio2013/open-ephys.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ VisualStudioVersion = 12.0.31101.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}"
66
EndProject
7+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DE917D74-FAF2-41E9-BE61-CD40C62EB7D0}"
8+
ProjectSection(SolutionItems) = preProject
9+
Performance1.psess = Performance1.psess
10+
EndProjectSection
11+
EndProject
712
Global
813
GlobalSection(SolutionConfigurationPlatforms) = preSolution
914
Debug|Win32 = Debug|Win32

Source/Processors/AudioNode/AudioNode.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void AudioNode::addInputChannel(GenericProcessor* sourceNode, int chan)
111111

112112
int channelIndex = getNextChannel(false);
113113

114-
setPlayConfigDetails(channelIndex+1,0,44100.0,128);
114+
//setPlayConfigDetails(channelIndex+1,0,44100.0,128);
115115

116116
auto dataChannel = sourceNode->getDataChannel(chan);
117117
auto dataChannelCopy = new DataChannel(*dataChannel);
@@ -121,6 +121,11 @@ void AudioNode::addInputChannel(GenericProcessor* sourceNode, int chan)
121121

122122
}
123123

124+
void AudioNode::updatePlaybackBuffer()
125+
{
126+
setPlayConfigDetails(dataChannelArray.size(), 0, 44100.0, 128);
127+
}
128+
124129
void AudioNode::setParameter(int parameterIndex, float newValue)
125130
{
126131
// change left channel, right channel, or volume

Source/Processors/AudioNode/AudioNode.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ class AudioNode : public GenericProcessor
112112
/** Establishes a connection between a channel of a GenericProcessor and the AudioNode. */
113113
void addInputChannel(GenericProcessor* source, int chan);
114114

115+
/** Updates the audio buffer size*/
116+
void updatePlaybackBuffer();
117+
115118
/** A pointer to the AudioNode's editor. */
116119
ScopedPointer<AudioEditor> audioEditor;
117120

Source/Processors/ProcessorGraph/ProcessorGraph.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ void ProcessorGraph::updateConnections(Array<SignalChainTabButton*, CriticalSect
375375
} // end while source != 0
376376
} // end "tabs" for loop
377377

378+
getAudioNode()->updatePlaybackBuffer();
378379
//Update RecordNode internal channel mappings
379380
Array<EventChannel*> extraChannels;
380381
getMessageCenter()->addSpecialProcessorChannels(extraChannels);

Source/Processors/RecordNode/RecordNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ RecordNode::RecordNode()
5454
settingsNeeded = false;
5555

5656
// 128 inputs, 0 outputs
57-
setPlayConfigDetails(getNumInputs(),getNumOutputs(),44100.0,1024);
57+
setPlayConfigDetails(getNumInputs(),getNumOutputs(),44100.0,128);
5858
m_recordThread = new RecordThread(engineArray);
5959
m_dataQueue = new DataQueue(WRITE_BLOCK_LENGTH, DATA_BUFFER_NBLOCKS);
6060
m_eventQueue = new EventMsgQueue(EVENT_BUFFER_NEVENTS);

0 commit comments

Comments
 (0)