From e9b7a11cf6ff3f0261ffa04818128b6110cbe655 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Wed, 24 Aug 2016 16:23:43 +0200 Subject: [PATCH] in between --- .../include/UDPStandardImplementation.h | 21 +- .../src/UDPStandardImplementation.cpp | 245 ++++++++---------- 2 files changed, 122 insertions(+), 144 deletions(-) diff --git a/slsReceiverSoftware/include/UDPStandardImplementation.h b/slsReceiverSoftware/include/UDPStandardImplementation.h index 4be649189..587b88dbd 100644 --- a/slsReceiverSoftware/include/UDPStandardImplementation.h +++ b/slsReceiverSoftware/include/UDPStandardImplementation.h @@ -348,12 +348,11 @@ private: * Also copies carryovers from previous frame in front of buffer (gotthard and moench) * For eiger, it ignores packets less than onePacketSize * @param ithread listening thread index - * @param lSize number of bytes to listen to * @param cSize number of bytes carried on from previous buffer * @param temp temporary storage of previous buffer * @return the number of bytes actually received */ - int prepareAndListenBuffer(int ithread, int lSize, int cSize, char* temp); + int prepareAndListenBuffer(int ithread, int cSize, char* temp); /** * Called by startListening @@ -380,9 +379,10 @@ private: * @param ithread listening thread index * @param cSize number of bytes carried over to the next buffer to reunite with split frame * @param temp temporary buffer to store the split frame + * @param rc number of bytes received * @return packet count */ - uint32_t processListeningBuffer(int ithread, int cSize,char* temp); + uint32_t processListeningBuffer(int ithread, int &cSize,char* temp, int rc); /** * Thread started which writes packets to file. @@ -415,7 +415,7 @@ private: * @param ithread writing thread index * @param wbuffer writing buffer popped out from FIFO */ - void stopWriting(int ithread, char* wbuffer[]); + void stopWriting(int ithread, char* wbuffer); /** * Called by processWritingBuffer and processWritingBufferPacketByPacket @@ -425,7 +425,7 @@ private: * @param wbuffer writing buffer popped out from FIFO * @param npackets number of packets */ - void handleWithoutDataCompression(int ithread, char* wbuffer[],uint32_t npackets); + void handleWithoutDataCompression(int ithread, char* wbuffer,uint32_t npackets); /** * Calle by handleWithoutDataCompression @@ -492,9 +492,6 @@ private: #endif //**detector parameters*** - /** Size of 1 Frame including headers */ - int frameSize; - /** Size of 1 buffer processed at a time */ int bufferSize; @@ -529,8 +526,8 @@ private: /** Complete File name */ char completeFileName[MAX_NUMBER_OF_WRITER_THREADS][MAX_STR_LENGTH]; - /** Maximum Packets Per File **/ - int maxPacketsPerFile; + /** Maximum Frames Per File **/ + int maxFramesPerFile; /** If file created successfully for all Writer Threads */ bool fileCreateSuccess; @@ -545,7 +542,7 @@ private: uint64_t startAcquisitionIndex; /** Frame index at start of each real time acquisition (eg. for each scan) */ - uint64_t startFrameIndex[MAX_NUMBER_OF_WRITER_THREADS]; + uint64_t startFrameIndex; /** Actual current frame index of each time acquisition (eg. for each scan) */ uint64_t frameIndex[MAX_NUMBER_OF_WRITER_THREADS]; @@ -577,7 +574,7 @@ private: uint32_t numMissingPackets[MAX_NUMBER_OF_WRITER_THREADS]; /** Total Number of Missing Packets in acquisition*/ - uint32_t numTotMissingPackets[MAX_NUMBER_OF_WRITER_THREADS]; + uint32_t numTotMissingPackets; /** Number of Missing Packets in file */ uint32_t numTotMissingPacketsInFile[MAX_NUMBER_OF_WRITER_THREADS]; diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 96c81f465..62da115d3 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -128,7 +128,6 @@ void UDPStandardImplementation::initializeMembers(){ FILE_LOG(logDEBUG) << "Info: Initializing members"; //***detector parameters*** - frameSize = 0; bufferSize = 0; onePacketSize = 0; oneDataSize = 0; @@ -149,18 +148,18 @@ void UDPStandardImplementation::initializeMembers(){ strcpy(fileHeader[i],""); sfilefd[i] = NULL; } - maxPacketsPerFile = 0; + maxFramesPerFile = 0; fileCreateSuccess = false; //***acquisition indices parameters*** startAcquisitionIndex = 0; acqStarted = false; + startFrameIndex = 0; for(int i = 0; i < MAX_NUMBER_OF_LISTENING_THREADS; ++i){ - startFrameIndex[i] = 0; measurementStarted[i] = false; totalListeningFrameCount[i] = 0; } - + numTotMissingPackets = 0; for(int i=0; i 1 numberofJobsPerBuffer if(fifoSize % numberofJobsPerBuffer) @@ -338,10 +333,8 @@ int UDPStandardImplementation::setupFifoStructure(){ fifoFree[i]->pop(buffer[i]); //cprintf(BLUE,"FifoFree[%d]: value:%d, pop 0x%x\n",i,fifoFree[i]->getSemValue(),(void*)(buffer[i])); } -#ifdef DEBUG5 - cprintf(BLUE,"Info: %d fifostructure popped from fifofree %p\n", i, (void*)(buffer[i])); -#endif delete fifoFree[i]; + fifoFree[i] = NULL; } if(fifo[i]){ while(!fifo[i]->isEmpty()){ @@ -349,8 +342,12 @@ int UDPStandardImplementation::setupFifoStructure(){ //cprintf(CYAN,"Fifo[%d]: value:%d, pop 0x%x\n",i,fifo[i]->getSemValue(),(void*)(buffer[i])); } delete fifo[i]; + fifo[i] = NULL; + } + if(mem0[i]){ + free(mem0[i]); + mem0[i] = NULL; } - if(mem0[i]) free(mem0[i]); //creating fifoFree[i] = new CircularFifo(fifoSize); @@ -469,22 +466,20 @@ void UDPStandardImplementation::setShortFrameEnable(const int i){ shortFrameEnable = i; if(shortFrameEnable!=-1){ - frameSize = GOTTHARD_SHORT_BUFFER_SIZE; bufferSize = GOTTHARD_SHORT_BUFFER_SIZE; onePacketSize = GOTTHARD_SHORT_BUFFER_SIZE; oneDataSize = GOTTHARD_SHORT_DATABYTES; - maxPacketsPerFile = SHORT_MAX_FRAMES_PER_FILE * GOTTHARD_SHORT_PACKETS_PER_FRAME; + maxFramesPerFile = SHORT_MAX_FRAMES_PER_FILE; packetsPerFrame = GOTTHARD_SHORT_PACKETS_PER_FRAME; frameIndexMask = GOTTHARD_SHORT_FRAME_INDEX_MASK; frameIndexOffset = GOTTHARD_SHORT_FRAME_INDEX_OFFSET; packetIndexMask = GOTTHARD_SHORT_PACKET_INDEX_MASK; }else{ - frameSize = GOTTHARD_BUFFER_SIZE; bufferSize = GOTTHARD_BUFFER_SIZE; onePacketSize = GOTTHARD_ONE_PACKET_SIZE; oneDataSize = GOTTHARD_ONE_DATA_SIZE; - maxPacketsPerFile = MAX_FRAMES_PER_FILE * GOTTHARD_PACKETS_PER_FRAME; + maxFramesPerFile = MAX_FRAMES_PER_FILE; packetsPerFrame = GOTTHARD_PACKETS_PER_FRAME; frameIndexMask = GOTTHARD_FRAME_INDEX_MASK; frameIndexOffset = GOTTHARD_FRAME_INDEX_OFFSET; @@ -517,9 +512,8 @@ int UDPStandardImplementation::setAcquisitionPeriod(const uint64_t i){ FILE_LOG(logDEBUG) << __AT__ << " called"; acquisitionPeriod = i; - if((myDetectorType == GOTTHARD) && (myDetectorType == MOENCH)) - if(setupFifoStructure() == FAIL) - return FAIL; + if(setupFifoStructure() == FAIL) + return FAIL; FILE_LOG(logINFO) << "Acquisition Period: " << (double)acquisitionPeriod/(1E9) << "s"; @@ -531,9 +525,8 @@ int UDPStandardImplementation::setNumberOfFrames(const uint64_t i){ FILE_LOG(logDEBUG) << __AT__ << " called"; numberOfFrames = i; - if((myDetectorType == GOTTHARD) && (myDetectorType == MOENCH)) - if(setupFifoStructure() == FAIL) - return FAIL; + if(setupFifoStructure() == FAIL) + return FAIL; FILE_LOG(logINFO) << "Number of Frames:" << numberOfFrames; @@ -551,12 +544,11 @@ int UDPStandardImplementation::setDynamicRange(const uint32_t i){ if(myDetectorType == EIGER){ //set parameters depending on new dynamic range. - packetsPerFrame = (tengigaEnable ? EIGER_TEN_GIGA_CONSTANT : EIGER_ONE_GIGA_CONSTANT) - * dynamicRange * EIGER_MAX_PORTS; - frameSize = onePacketSize * packetsPerFrame; - maxPacketsPerFile = EIGER_MAX_FRAMES_PER_FILE * packetsPerFrame; + packetsPerFrame = (tengigaEnable ? EIGER_TEN_GIGA_CONSTANT : EIGER_ONE_GIGA_CONSTANT) * dynamicRange; + bufferSize = onePacketSize * packetsPerFrame; - updateFileHeader(); + for(int i=0; i 0)) @@ -1603,10 +1589,10 @@ void UDPStandardImplementation::startListening(){ //write packet count to buffer if(myDetectorType == EIGER) - (*((uint32_t*)(buffer[ithread]))) = 1; - //handling split frames and writing packet Count to buffer - else - (*((uint32_t*)(buffer[ithread]))) = processListeningBuffer(ithread, carryonBufferSize, tempBuffer); + (*((uint32_t*)(buffer[ithread]))) = rc/onePacketSize; + + if(dataCompressionEnable) + (*((uint32_t*)(buffer[ithread]))) = processListeningBuffer(ithread, carryonBufferSize, tempBuffer, rc); //push buffer to FIFO @@ -1645,24 +1631,17 @@ void UDPStandardImplementation::startListening(){ -int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int lSize, int cSize, char* temp){ +int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, char* temp){ FILE_LOG(logDEBUG) << __AT__ << " called"; - //listen to UDP packets - if(cSize) - memcpy(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS, temp, cSize); + //carry over from previous buffer + if(cSize) memcpy(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS, temp, cSize); - pthread_mutex_lock(&udpSocketMutex[ithread]); - int receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + cSize, lSize + cSize); + int receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + cSize, (bufferSize * numberofJobsPerBuffer) - cSize); //throw away packets that is not one packet size while(myDetectorType == EIGER && receivedSize != onePacketSize) { - //need to check status if socket is shut down - if(status == TRANSMITTING) - break; - //print - if(receivedSize != EIGER_HEADER_LENGTH){ + if(receivedSize != EIGER_HEADER_LENGTH) cprintf(RED,"Listening_Thread %d: Listened to a weird packet size %d\n",ithread, receivedSize); - } #ifdef DEBUG else cprintf(BLUE,"Listening_Thread %d: Listened to a header packet\n",ithread); @@ -1670,7 +1649,6 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int lSize, in //listen again receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS); } - pthread_mutex_unlock(&udpSocketMutex[ithread]); totalListeningFrameCount[ithread] += (receivedSize/onePacketSize); @@ -1696,8 +1674,6 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int lSize, in } } #endif - - #ifdef DEBUG cprintf(BLUE, "Listening_Thread %d : Received bytes: %d. Expected bytes: %d\n", ithread, receivedSize, bufferSize * numberofJobsPerBuffer-cSize); #endif @@ -1716,18 +1692,18 @@ void UDPStandardImplementation::startFrameIndices(int ithread){ jfrau_packet_header_t* header=0; switch(myDetectorType){ case EIGER: - startFrameIndex[ithread] = 0; //frame number always resets + startFrameIndex = 0; //frame number always resets break; case JUNGFRAU: header = (jfrau_packet_header_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS); - startFrameIndex[ithread] = (*( (uint32_t*) header->frameNumber))&0xffffff; + startFrameIndex = (*( (uint32_t*) header->frameNumber))&0xffffff; break; default: if(shortFrameEnable < 0){ - startFrameIndex[ithread] = (((((uint32_t)(*((uint32_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))))+1) + startFrameIndex = (((((uint32_t)(*((uint32_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))))+1) & (frameIndexMask)) >> frameIndexOffset); }else{ - startFrameIndex[ithread] = ((((uint32_t)(*((uint32_t*)(buffer[ithread]+HEADER_SIZE_NUM_TOT_PACKETS)))) + startFrameIndex = ((((uint32_t)(*((uint32_t*)(buffer[ithread]+HEADER_SIZE_NUM_TOT_PACKETS)))) & (frameIndexMask)) >> frameIndexOffset); } break; @@ -1736,14 +1712,14 @@ void UDPStandardImplementation::startFrameIndices(int ithread){ //start of entire acquisition if(!acqStarted){ pthread_mutex_lock(&progressMutex); - startAcquisitionIndex = startFrameIndex[ithread]; + startAcquisitionIndex = startFrameIndex; acqStarted = true; pthread_mutex_unlock(&progressMutex); cprintf(BLUE,"Listening_Thread %d: startAcquisitionIndex:%lld\n",ithread,(long long int)startAcquisitionIndex); } //set start of scan/real time measurement - cprintf(BLUE,"Listening_Thread %d: startFrameIndex: %lld\n", ithread,(long long int)startFrameIndex[ithread]); + cprintf(BLUE,"Listening_Thread %d: startFrameIndex: %lld\n", ithread,(long long int)startFrameIndex); measurementStarted[ithread] = true; } @@ -1863,13 +1839,13 @@ void UDPStandardImplementation::stopListening(int ithread, int numbytes){ -uint32_t UDPStandardImplementation::processListeningBuffer(int ithread, int cSize, char* temp){ +uint32_t UDPStandardImplementation::processListeningBuffer(int ithread, int &cSize, char* temp, int rc){ FILE_LOG(logDEBUG) << __AT__ << " called"; int lastPacketOffset; //the offset of the last packet uint32_t lastFrameHeader; //frame number of last packet in buffer uint64_t lastFrameHeader64; //frame number of last packet in buffer - uint32_t packetCount = (packetsPerFrame/numberofListeningThreads) * numberofJobsPerBuffer; //packets received + uint32_t packetCount = rc;//(packetsPerFrame/numberofListeningThreads) * numberofJobsPerBuffer; //packets received cSize = 0; //reset size jfrau_packet_header_t* header; @@ -2012,9 +1988,10 @@ void UDPStandardImplementation::processWritingBuffer(int ithread){ FILE_LOG(logDEBUG) << __AT__ << " called"; //variable definitions - char* wbuf[numberofListeningThreads]; //buffer popped from FIFO - sfilefd = NULL; //file pointer - uint64_t nf; //for compression, number of frames + char* wbuf; //buffer popped from FIFO + sfilefd[ithread] = NULL; //file pointer + uint64_t nf; //for compression, number of frames + int listenfifoIndex = ithread; /* outer loop - loops once for each acquisition */ @@ -2023,31 +2000,33 @@ void UDPStandardImplementation::processWritingBuffer(int ithread){ //--reset parameters before acquisition nf = 0; - guiData = latestData; //so that the first frame is always copied + guiData[ithread] = latestData[ithread]; //so that the first frame is always copied + if(dataCompressionEnable) + listenfifoIndex = 0; //compression has only one listening thread /* inner loop - loop for each buffer */ //until mask unset (udp sockets shut down by client) while((1 << ithread) & writerThreadsMask){ //pop - fifo[0]->pop(wbuf[0]); + fifo[listenfifoIndex]->pop(wbuf); #ifdef EVERYFIFODEBUG - if(fifo[0]->getSemValue()>(fifoSize-100)) - cprintf(CYAN,"Fifo[%d]: value:%d, pop 0x%x\n",0,fifo[0]->getSemValue(),(void*)(wbuf[0])); + if(fifo[listenfifoIndex]->getSemValue()>(fifoSize-100)) + cprintf(CYAN,"Fifo[%d]: value:%d, pop 0x%x\n",listenfifoIndex,fifo[listenfifoIndex]->getSemValue(),(void*)(wbuf)); #endif -#ifdef DEBUG5 - cprintf(GREEN,"Writing_Thread %d: Popped %p from FIFO %d\n", ithread, (void*)(wbuf[0]),0); -#endif - uint32_t numPackets = (uint32_t)(*((uint32_t*)wbuf[0])); #ifdef DEBUG4 - cprintf(GREEN,"Writing_Thread %d: Number of Packets: %d for FIFO %d\n", ithread, numPackets, 0); + cprintf(GREEN,"Writing_Thread %d: Popped %p from FIFO %d\n", ithread, (void*)(wbuf),listenfifoIndex); +#endif + uint32_t numPackets = (uint32_t)(*((uint32_t*)wbuf)); +#ifdef DEBUG4 + cprintf(GREEN,"Writing_Thread %d: Number of Packets: %d for FIFO %d\n", ithread, numPackets, listenfifoIndex); #endif //end of acquisition if(numPackets == dummyPacketValue){ -#ifdef DEBUG3 - cprintf(GREEN,"Writing_Thread %d: Dummy frame popped out of FIFO %d",ithread, 0); +#ifdef DEBUG4 + cprintf(GREEN,"Writing_Thread %d: Dummy frame popped out of FIFO %d",ithread, listenfifoIndex); #endif stopWriting(ithread,wbuf); continue; @@ -2055,9 +2034,11 @@ void UDPStandardImplementation::processWritingBuffer(int ithread){ - //process + //normal if(!dataCompressionEnable) handleWithoutDataCompression(ithread, wbuf, numPackets); + + //compression else{ #if defined(MYROOT1) && defined(ALLFILE_DEBUG) if(npackets > 0) @@ -2145,12 +2126,13 @@ void UDPStandardImplementation::processWritingBufferPacketByPacket(int ithread){ #endif } delete fifoTempFree[i]; + fifoTempFree[i] = NULL; } fifoTempFree[i] = new CircularFifo(MAX_NUM_PACKETS); } for(uint32_t i=0; ipacketNumber); @@ -2338,7 +2320,7 @@ void UDPStandardImplementation::processWritingBufferPacketByPacket(int ithread){ if(fullframe[0] && fullframe[1]){ currentFrameNumber = presentFrameNumber; numTotMissingPacketsInFile += numMissingPackets; - numTotMissingPackets += numMissingPackets; + numTotMissingPackets += numMissingPackets;/**requires a lock*/ /* cprintf(CYAN,"**framenum:%lld\n ",(long long int)currentFrameNumber); @@ -2379,7 +2361,7 @@ void UDPStandardImplementation::processWritingBufferPacketByPacket(int ithread){ //ensuring last packet got is not of some other future frame but of the current one eiger_packet_footer_t* wbuf_footer1 = (eiger_packet_footer_t*)(packetBuffer[i] + footerOffset + HEADER_SIZE_NUM_TOT_PACKETS); - uint64_t packfnum = (((uint32_t)(*( (uint64_t*) wbuf_footer1)))+(startFrameIndex[ithread] - 1)); + uint64_t packfnum = (((uint32_t)(*( (uint64_t*) wbuf_footer1)))+(startFrameIndex - 1)); //to reset to get new frame: not dummy and the last packet if((numPackets[i] != dummyPacketValue) && (currentPacketNumber[i] == LAST_PACKET_VALUE) && (packfnum == currentFrameNumber) ) @@ -2592,25 +2574,24 @@ bool UDPStandardImplementation::popAndCheckEndofAcquisition(int ithread, char* w -void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer[]){ +void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer){ FILE_LOG(logDEBUG) << __AT__ << " called"; FILE_LOG(logINFO) << "Writing "<< ithread << ": End of Acquisition"; //free fifo - for(int i=0; ipush(wbuffer[i])); + while(!fifoFree[ithread]->push(wbuffer)); #ifdef EVERYFIFODEBUG - if(fifoFree[i]->getSemValue()<100) - cprintf(GREEN,"FifoFree[%d]: value:%d, push 0x%x\n",i,fifoFree[i]->getSemValue(),(void*)(wbuffer[i])); + if(fifoFree[ithread]->getSemValue()<100) + cprintf(GREEN,"FifoFree[%d]: value:%d, push 0x%x\n",ithread,fifoFree[ithread]->getSemValue(),(void*)(wbuffer)); #endif #ifdef CFIFODEBUG - if(i==0) - cprintf(CYAN,"Writing_Thread %d: Freeing dummy-end buffer. Pushed into fifofree %p for listener %d\n", ithread,(void*)(wbuffer[i]),i); - else - cprintf(YELLOW,"Writing_Thread %d: Freeing dummy-end buffer. Pushed into fifofree %p for listener %d\n", ithread,(void*)(wbuffer[i]),i); + if(ithread==0) + cprintf(CYAN,"Writing_Thread %d: Freeing dummy-end buffer. Pushed into fifofree %p for listener %d\n", ithread,(void*)(wbuffer),ithread); + else + cprintf(YELLOW,"Writing_Thread %d: Freeing dummy-end buffer. Pushed into fifofree %p for listener %d\n", ithread,(void*)(wbuffer),ithread); #endif - } + //all threads need to close file, reset mask and exit loop closeFile(ithread); @@ -2644,7 +2625,7 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer[]){ //statistics FILE_LOG(logINFO) << "Status: Run Finished"; - FILE_LOG(logINFO) << "Last Frame Number Caught:" << lastFrameIndex; + FILE_LOG(logINFO) << "Last Frame Number Caught:" << lastFrameIndex[ithread]; if(totalPacketsCaught < ((uint64_t)numberOfFrames*packetsPerFrame)){ cprintf(RED, "Total Missing Packets padded: %d\n",numTotMissingPackets); cprintf(RED, "Total Packets Caught: %lld\n",(long long int)totalPacketsCaught); @@ -2663,7 +2644,7 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer[]){ -void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char* wbuffer[],uint32_t npackets){ +void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char* wbuffer,uint32_t npackets){ FILE_LOG(logDEBUG) << __AT__ << " called"; @@ -2682,7 +2663,7 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char* } //set indices acquisitionIndex = currentFrameNumber - startAcquisitionIndex; - frameIndex = currentFrameNumber - startFrameIndex[ithread]; + frameIndex = currentFrameNumber - startFrameIndex; } @@ -2774,7 +2755,7 @@ void UDPStandardImplementation::writeFileWithoutCompression(int ithread, char* w //set indices acquisitionIndex = currentFrameNumber - startAcquisitionIndex; - frameIndex = currentFrameNumber - startFrameIndex[ithread]; + frameIndex = currentFrameNumber - startFrameIndex; } #ifdef DEBUG3 cprintf(GREEN,"Writing_Thread: Current Frame Number:%d\n",currentFrameNumber); @@ -3065,7 +3046,7 @@ void UDPStandardImplementation::handleDataCompression(int ithread, char* wbuffer pthread_mutex_unlock(&progressMutex); //set indices acquisitionIndex = currentFrameNumber - startAcquisitionIndex; - frameIndex = currentFrameNumber - startFrameIndex[0]; + frameIndex = currentFrameNumber - startFrameIndex; //variable definitions