Closed lucabaldini closed 8 years ago
Some background information, based on a discussion with Massimo.
The inner loop of the data acquisition is a (blocking) USB read command looking like
unsigned long dataBufferDimension = SRAM_DIM*2;
unsigned char dataBuffer[SRAM_DIM*2];
while (m_running) {
errorCode = m_usbController->readData(dataBuffer, &dataBufferDimension);
}
The FPGA is always sending 2 * 2**18 = 2* 262144 = 2 * SRAM_DIM = 524288
bytes or 512 kB of data at each transfer, no matter what the readout configuration (full frame, windowed with small buffer or windowed with long buffer) is.
The amount of usable data in the buffer read from the USB port depends on the readout mode and is effectively:
2 * NWORDS = 2 * 13200 * 8 = 211200
bytes in full frame mode (exactly one event).< 10000
bytes in windowed mode with the small buffer (with the last event being truncated).< 2 * 2**18 = 2* 262144 = 2 * SRAM_DIM = 524288
bytes (with the last event being truncated).A first quick fix committed
diff --git a/daq/xpoldetector.cpp b/daq/xpoldetector.cpp
index 9851bc8..bd4be38 100644
--- a/daq/xpoldetector.cpp
+++ b/daq/xpoldetector.cpp
@@ -157,4 +157,4 @@ unsigned short int xpoldetector::kSmallBufferMode = 0x1;
unsigned short int xpoldetector::kLargeBufferMode = ~xpoldetector::kSmallBuffer
int xpoldetector::kSmallBufferSize = 10000;
-int xpoldetector::kLargeBufferSize = 211968; //rounded to 207 1024 data blocks
+int xpoldetector::kLargeBufferSize = 2*262144;
I am closing this one, noting that we shall revisit this if and when we address issue #85
Which means that we're throwing away half of the data. Needless to say, this is important to fix.