Skip to content

Commit

Permalink
Merge pull request #882 from robertoostenveld/reorganize-buffer
Browse files Browse the repository at this point in the history
Reorganize buffer source code
  • Loading branch information
robertoostenveld committed Nov 20, 2018
2 parents d854d06 + ddb1f87 commit 3f33ed8
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
6 changes: 0 additions & 6 deletions realtime/src/acquisition/audio/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ processing can be performed by clients that connect to the FieldTrip buffer. To
acquire the audio data, the PortAudio library [1] is used.

## TODO:
- Compilation is broken. Perhaps it is designed for an outdated PortAudio
library.
- Remove config file and replace with getopt.


# Usage

You need to call this tool with a number that selects your sound card and
Expand Down Expand Up @@ -38,9 +35,6 @@ Audio2ft can be compiled with `make`. Building on Windows is supported through
the MinGW compiler. For windows a pre-compiled DLL is available.
you might need to compile the buffer library first.

*NOTE THAT COMPILATION SEEMS TO BE BROKEN*. On Ubuntu Linux with PortAudio 1.9
lots of symbols are undefined.


# References

Expand Down
2 changes: 1 addition & 1 deletion realtime/src/buffer/cpp/OnlineDataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ class OnlineDataManager : public StringRequestHandler {
FtBufferResponse resp; /**< Receives responses from the buffer server */
FtEventList eventList; /**< Used for writing events to the buffer server, is flushed after each handleBlock() */
FtSampleBlock *sampleBlock; /**< Used for writing data to the buffer server */
socketserver_server_t *ftServer; /**< Handles the server sockets and background threads in case an own server is spawned */
ft_buffer_server_t *ftServer; /**< Handles the server sockets and background threads in case an own server is spawned */

SignalConfiguration signalConf; /**< Maintains the channel selection for streaming and saving, as well as a few other parameters */

Expand Down
2 changes: 1 addition & 1 deletion realtime/src/buffer/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ includes = $(wildcard *.h)
##############################################################################
all: libbuffer.a

libbuffer.a: tcpserver.o socketserver.o rdaserver.o tcpsocket.o tcprequest.o clientrequest.o dmarequest.o cleanup.o timestamp.o util.o interface.o printstruct.o swapbytes.o extern.o endianutil.o clock_gettime.o gettimeofday.o fsync.o usleep.o
libbuffer.a: cleanup.o clientrequest.o compat_clock_gettime.o compat_fsync.o compat_gettimeofday.o compat_usleep.o dmarequest.o endianutil.o extern.o interface.o printstruct.o rdaserver.o socketserver.o swapbytes.o tcprequest.o tcpserver.o tcpsocket.o timestamp.o util.o
ar rv $@ $^

libclient.a: tcprequest.o util.o
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion realtime/src/buffer/src/tcprequest.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
#include <stdlib.h>
#include "buffer.h"

#define MERGE_THRESHOLD 4096 /* TODO: optimize this value? Maybe look at MTU size */
#define MERGE_THRESHOLD 1460

/*
The default MTU is 1500 for most network interfaces. Adding 26 bytes for the Ethernet header
results in a frame size of 1526. For TCP there is also a Maximum Segment Size (MSS),
which is 1460 after subtracting 20 bytes for the IPv4 and TCP header.
*/

/*******************************************************************************
* communicate with the buffer through TCP
Expand Down

0 comments on commit 3f33ed8

Please sign in to comment.