summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrant Thomsen <brant.thomsen@harman.com>2017-12-06 15:59:10 -0700
committerBrant Thomsen <brant.thomsen@harman.com>2017-12-06 15:59:10 -0700
commit5486b92890334c3a80bcd2af84866add9a94a04a (patch)
tree1e0c88d3c10a9b2858445972e2f39fc36b3090af
parent115e0255312a3688de2be49d2368bba5c62c9061 (diff)
parentbfd90fbbcf189650e0b15edd8a5511bf271bbf6e (diff)
downloadOpen-AVB-5486b92890334c3a80bcd2af84866add9a94a04a.tar.gz
Merge branch 'open-avb-next' of https://github.com/AVnu/Open-AVB into feature-avtp-pipeline-experimental
-rw-r--r--.gitmodules2
-rw-r--r--.travis.yml11
-rw-r--r--CMakeLists.txt37
-rw-r--r--README.rst7
-rw-r--r--appveyor.yml24
-rw-r--r--daemons/gptp/CMakeLists.txt12
-rw-r--r--daemons/gptp/common/gptp_cfg.cpp2
-rw-r--r--daemons/gptp/common/ptptypes.hpp1
-rw-r--r--daemons/gptp/linux/src/linux_hal_common.cpp5
-rw-r--r--daemons/gptp/linux/src/linux_hal_common.hpp2
-rw-r--r--daemons/gptp/linux/src/linux_hal_generic.cpp21
-rw-r--r--daemons/gptp/linux/src/linux_hal_generic_adj.cpp6
-rw-r--r--daemons/maap/linux/src/maap_log_linux.c17
-rw-r--r--daemons/maap/windows/src/maap_main.c29
-rw-r--r--daemons/mrpd/mvrp.c3
-rw-r--r--daemons/shaper/src/shaper_log_linux.c16
-rw-r--r--examples/mrp_client/mrpdhelper.c4
-rw-r--r--lib/avtp_pipeline/README.md27
-rw-r--r--lib/avtp_pipeline/avtp_avdecc.mk9
-rw-r--r--lib/avtp_pipeline/avtp_pipeline.mk7
-rw-r--r--lib/avtp_pipeline/platform/Linux/openavb_tasks.h10
-rwxr-xr-xrun_daemons.sh34
-rwxr-xr-xstop_daemons.sh7
m---------thirdparty/cpputest0
24 files changed, 224 insertions, 69 deletions
diff --git a/.gitmodules b/.gitmodules
index 3254bb8a..6494de60 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
[submodule "thirdparty/cpputest"]
path = thirdparty/cpputest
- url = ../../cpputest/cpputest.git
+ url = ../../AVnu/cpputest.git
[submodule "avdecc-lib"]
path = avdecc-lib
url = ../../AVnu/avdecc-lib
diff --git a/.travis.yml b/.travis.yml
index 8eb91588..ecc2b9d6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,12 +21,19 @@ before_install:
- sudo update-alternatives --set c++ /usr/bin/g++
compiler:
- gcc
-env: BUILD_KERNEL=4.4.0-75-generic
+env:
+ - BUILD_KERNEL=4.4.0-75-generic
install:
- sudo apt-get update -qq
- - sudo apt-get install -y libpcap-dev libpci-dev libsndfile1-dev libjack-dev linux-headers-4.4.0-75-generic cmake
+ - sudo apt-get install -y libpcap-dev libpci-dev libsndfile1-dev libjack-dev linux-headers-4.4.0-75-generic
- sudo apt-get install -y libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libasound2-dev
- sudo cp /usr/src/linux-headers-4.4.0-75/include/uapi/linux/ethtool.h /usr/include/linux
- sudo cp /usr/src/linux-headers-4.4.0-75/include/uapi/linux/ptp_clock.h /usr/include/linux
+ - CMAKE_URL="https://cmake.org/files/v3.9/cmake-3.9.4-Linux-x86_64.tar.gz"
+ - mkdir -p ${TRAVIS_BUILD_DIR}/deps/cmake
+ - travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${TRAVIS_BUILD_DIR}/deps/cmake
+ - export PATH=${TRAVIS_BUILD_DIR}/deps/cmake/bin:${PATH}
+
+
script: ./travis.sh
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 555d9db3..eccb62eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,8 +2,43 @@ cmake_minimum_required (VERSION 2.8)
project (open-avb)
enable_testing()
-set(C++11 ON CACHE BOOL "Compile with C++11 support" FORCE)
+include(CheckCXXCompilerFlag)
+CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+if(COMPILER_SUPPORTS_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+elseif(COMPILER_SUPPORTS_CXX0X)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+else()
+ message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+endif()
+
add_subdirectory("thirdparty/cpputest")
add_subdirectory("daemons/common/tests")
add_subdirectory("daemons/mrpd")
add_subdirectory("daemons/maap")
+add_subdirectory("daemons/gptp")
+
+message("
+-------------------------------------------------------
+OpenAvnu Build information
+
+Current compiler options:
+ CC: ${CMAKE_C_COMPILER}
+ CXX: ${CMAKE_CXX_COMPILER}
+ OpenAvnu CFLAGS: ${CMAKE_C_FLAGS}
+ OpenAvnu CXXFLAGS: ${CMAKE_CXX_FLAGS}
+ OpenAvnu LDFLAGS: ${CMAKE_LD_FLAGS}
+
+Features configured in OpenAvnu root CMakeFile.txt:
+ Memory Leak Detection: ${MEMORY_LEAK_DETECTION}
+ Compiling Extensions: ${EXTENSIONS}
+ Support Long Long: ${LONGLONG}
+ Use OpenAvnu flags: ${CMAKE_FLAGS}
+
+ Using Standard C library: ${STD_C}
+ Using Standard C++ library: ${STD_CPP}
+ Using C++11 library: ${C++11}
+
+-------------------------------------------------------
+")
diff --git a/README.rst b/README.rst
index e9635b1b..b8fecdf1 100644
--- a/README.rst
+++ b/README.rst
@@ -120,3 +120,10 @@ XMOS is a semiconductor company providing a reference design for AVB/TSN
endpoints in pro audio and automotive. XMOS endpoint source code is open source
and available on Github - https://github.com/xcore/sw_avb
+Apple Vendor PTP Profile
+------------------------
+Support for the Apple Vendor PTP Profile can be found on this fork of the OpenAvnu code within the branch ArtAndLogic-aPTP-changes.
+
++ https://github.com/rroussel/OpenAvnu/tree/ArtAndLogic-aPTP-changes
+
+These changes allow interaction with Apple proprietary PTP clocks. This implementation has been tested with the Apple AirPlay SDK on a Raspberry Pi 3 running within a group of devices playing the same music stream.
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 00000000..be1355c1
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,24 @@
+version: '1.0.{build}'
+
+clone_folder: c:\oavb
+clone_depth: 20
+
+environment:
+ # Config for mrp Windows build
+ WPCAP_DIR: c:\oavb\WpdPack
+
+install:
+ - git submodule update --init --recursive
+ # download WinPcap developer module and unzip it
+ - ps: Start-FileDownload 'https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip'
+ - ps: 7z x WpdPack_4_1_2.zip
+
+before_build:
+ # cmake
+ - choco upgrade cmake
+ - set path=C:\Program Files\CMake\bin;%path%
+
+build_script:
+ - cd c:\oavb
+ - cmake CMakeLists.txt -G "Visual Studio 12 2013"
+ - cmake --build . --config Release
diff --git a/daemons/gptp/CMakeLists.txt b/daemons/gptp/CMakeLists.txt
index 4935e665..fb7d19b3 100644
--- a/daemons/gptp/CMakeLists.txt
+++ b/daemons/gptp/CMakeLists.txt
@@ -6,8 +6,16 @@ file(GLOB GPTP_COMMON "./common/*.cpp" "./common/*.c")
if(UNIX)
include_directories( include "./linux/src" )
- file(GLOB GPTP_OS "./linux/src/*.cpp")
- target_link_libraries(gptp pthread)
+ file(GLOB GPTP_OS
+ "./linux/src/daemon_cl.cpp"
+ "./linux/src/linux_ipc.cpp"
+ "./linux/src/platform.cpp"
+ "./linux/src/linux_hal_persist_file.cpp"
+ "./linux/src/linux_hal_generic.cpp"
+ "./linux/src/linux_hal_generic_adj.cpp"
+ "./linux/src/linux_hal_common.cpp")
+ add_executable (gptp ${GPTP_COMMON} ${GPTP_OS})
+ target_link_libraries(gptp pthread rt)
elseif(WIN32)
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
link_directories($ENV{WPCAP_DIR}/Lib/x64)
diff --git a/daemons/gptp/common/gptp_cfg.cpp b/daemons/gptp/common/gptp_cfg.cpp
index fae8e6c0..8b9db0dc 100644
--- a/daemons/gptp/common/gptp_cfg.cpp
+++ b/daemons/gptp/common/gptp_cfg.cpp
@@ -253,7 +253,7 @@ void GptpIniParser::print_phy_delay( void )
tx = i->second.get_tx_delay();
rx = i->second.get_rx_delay();
- snprintf( phy_delay_desc, PHY_DELAY_DESC_LEN+1,
+ PLAT_snprintf( phy_delay_desc, PHY_DELAY_DESC_LEN+1,
"TX: %hu | RX: %hu", tx, rx );
speed_name = findNameBySpeed( speed );
diff --git a/daemons/gptp/common/ptptypes.hpp b/daemons/gptp/common/ptptypes.hpp
index 03cd57be..f73c8f92 100644
--- a/daemons/gptp/common/ptptypes.hpp
+++ b/daemons/gptp/common/ptptypes.hpp
@@ -43,6 +43,7 @@ typedef double FrequencyRatio; /*!< Frequency Ratio */
typedef long double FrequencyRatio; /*!< Frequency Ratio */
#endif
+#define ETHER_HDR_LEN (14)
#define ETHER_ADDR_OCTETS 6 /*!< Number of octets in a link layer address*/
#define IP_ADDR_OCTETS 4 /*!< Number of octets in a ip address*/
#define PTP_ETHERTYPE 0x88F7 /*!< PTP ethertype */
diff --git a/daemons/gptp/linux/src/linux_hal_common.cpp b/daemons/gptp/linux/src/linux_hal_common.cpp
index cd880ba9..3be16c86 100644
--- a/daemons/gptp/linux/src/linux_hal_common.cpp
+++ b/daemons/gptp/linux/src/linux_hal_common.cpp
@@ -704,9 +704,10 @@ bool LinuxLock::initialize( OSLockType type ) {
lock_c = pthread_mutex_init(&_private->mutex,&_private->mta);
if(lock_c != 0) {
GPTP_LOG_ERROR("Mutex initialization failed - %s",strerror(errno));
- return oslock_fail;
+ return false;
}
- return oslock_ok;
+
+ return true;
}
LinuxLock::~LinuxLock() {
diff --git a/daemons/gptp/linux/src/linux_hal_common.hpp b/daemons/gptp/linux/src/linux_hal_common.hpp
index 28332f01..9eb3ddc9 100644
--- a/daemons/gptp/linux/src/linux_hal_common.hpp
+++ b/daemons/gptp/linux/src/linux_hal_common.hpp
@@ -306,7 +306,7 @@ public:
OSLock * createLock( OSLockType type ) const
{
LinuxLock *lock = new LinuxLock();
- if (lock->initialize(type) != oslock_ok) {
+ if (!lock->initialize(type)) {
delete lock;
lock = NULL;
}
diff --git a/daemons/gptp/linux/src/linux_hal_generic.cpp b/daemons/gptp/linux/src/linux_hal_generic.cpp
index 5364fa6a..9eeba46f 100644
--- a/daemons/gptp/linux/src/linux_hal_generic.cpp
+++ b/daemons/gptp/linux/src/linux_hal_generic.cpp
@@ -30,9 +30,10 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
-
#include <linux_hal_generic.hpp>
#include <linux_hal_generic_tsprivate.hpp>
+#include <platform.hpp>
+#include <avbts_message.hpp>
#include <sys/select.h>
#include <sys/socket.h>
#include <netpacket/packet.h>
@@ -285,6 +286,10 @@ int LinuxTimestamperGeneric::HWTimestamper_txtimestamp
struct cmsghdr *cmsg;
struct sockaddr_ll remote;
struct iovec sgentry;
+ PTPMessageId reflectedMessageId;
+ uint8_t reflected_bytes[ETHER_HDR_LEN + PTP_COMMON_HDR_LENGTH];
+ uint8_t *gptpCommonHeader;
+ uint16_t sequenceId;
struct {
struct cmsghdr cm;
char control[256];
@@ -296,8 +301,10 @@ int LinuxTimestamperGeneric::HWTimestamper_txtimestamp
msg.msg_iov = &sgentry;
msg.msg_iovlen = 1;
- sgentry.iov_base = NULL;
- sgentry.iov_len = 0;
+ sgentry.iov_base = reflected_bytes;
+ sgentry.iov_len = sizeof(reflected_bytes);
+
+ gptpCommonHeader = reflected_bytes + ETHER_HDR_LEN;
memset( &remote, 0, sizeof(remote));
msg.msg_name = (caddr_t) &remote;
@@ -316,6 +323,14 @@ int LinuxTimestamperGeneric::HWTimestamper_txtimestamp
goto done;
}
}
+ sequenceId = PLAT_ntohs(*((uint16_t*)(PTP_COMMON_HDR_SEQUENCE_ID(gptpCommonHeader))));
+ reflectedMessageId.setSequenceId(sequenceId);
+ reflectedMessageId.setMessageType((MessageType)(*PTP_COMMON_HDR_TRANSSPEC_MSGTYPE(gptpCommonHeader) & 0xF));
+ if (messageId != reflectedMessageId) {
+ GPTP_LOG_WARNING("Timestamp discarded due to wrong message id");
+ ret = GPTP_EC_EAGAIN;
+ goto done;
+ }
// Retrieve the timestamp
cmsg = CMSG_FIRSTHDR(&msg);
diff --git a/daemons/gptp/linux/src/linux_hal_generic_adj.cpp b/daemons/gptp/linux/src/linux_hal_generic_adj.cpp
index f722ac4a..7f1d59c8 100644
--- a/daemons/gptp/linux/src/linux_hal_generic_adj.cpp
+++ b/daemons/gptp/linux/src/linux_hal_generic_adj.cpp
@@ -31,10 +31,8 @@
******************************************************************************/
-#include <linux/timex.h>
- // avoid indirect inclusion of time.h since this will clash with linux/timex.h
-#define _TIME_H 1
-#define _STRUCT_TIMEVAL 1
+#include <sys/timex.h>
+#define ADJ_SETOFFSET 0x0100 // Missing from older header files
#include <linux_hal_generic.hpp>
#include <syscall.h>
#include <math.h>
diff --git a/daemons/maap/linux/src/maap_log_linux.c b/daemons/maap/linux/src/maap_log_linux.c
index 2d6f02b3..35dcfcbc 100644
--- a/daemons/maap/linux/src/maap_log_linux.c
+++ b/daemons/maap/linux/src/maap_log_linux.c
@@ -27,6 +27,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdarg.h>
#include <string.h>
#include <inttypes.h>
+#include <limits.h>
#include "platform.h"
#include "maap_log_queue.h"
@@ -74,7 +75,14 @@ extern void *loggingThreadFn(void *pv);
THREAD_TYPE(loggingThread);
THREAD_DEFINITON(loggingThread);
-#define THREAD_STACK_SIZE 65536
+#if !defined(PTHREAD_STACK_MIN)
+#error "PTHREAD_STACK_MIN variable not defined"
+#elif (PTHREAD_STACK_MIN > 65536)
+#define THREAD_STACK_SIZE PTHREAD_STACK_MIN
+#else
+#define THREAD_STACK_SIZE 65536
+#endif
+
#define loggingThread_THREAD_STK_SIZE THREAD_STACK_SIZE
static MUTEX_HANDLE_ALT(gLogMutex);
@@ -211,13 +219,16 @@ void maapLogInit(void)
loggingThreadRunning = TRUE;
THREAD_CREATE(loggingThread, loggingThread, NULL, loggingThreadFn, NULL);
THREAD_CHECK_ERROR(loggingThread, "Thread / task creation failed", errResult);
- if (errResult); // Already reported
+ if (errResult) {
+ loggingThreadRunning = FALSE;
+ MAAP_LOG_ERROR("Could not log data: loggingThread create failure");
+ }
}
}
void maapLogExit()
{
- if (MAAP_LOG_FROM_THREAD) {
+ if (MAAP_LOG_FROM_THREAD && loggingThreadRunning ) {
loggingThreadRunning = FALSE;
THREAD_JOIN(loggingThread, NULL);
}
diff --git a/daemons/maap/windows/src/maap_main.c b/daemons/maap/windows/src/maap_main.c
index 6c817d71..dce75312 100644
--- a/daemons/maap/windows/src/maap_main.c
+++ b/daemons/maap/windows/src/maap_main.c
@@ -1,3 +1,32 @@
+/*************************************************************************************
+Copyright (c) 2016-2017, Harman International Industries, Incorporated
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS LISTED "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS LISTED BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*************************************************************************************/
+
/*
* TODO: This code still needs to be added!
*/
+
+int main(int argc, char *argv[])
+{
+}
diff --git a/daemons/mrpd/mvrp.c b/daemons/mrpd/mvrp.c
index b36e3ace..fa14ac37 100644
--- a/daemons/mrpd/mvrp.c
+++ b/daemons/mrpd/mvrp.c
@@ -331,7 +331,8 @@ int mvrp_event(int event, struct mvrp_attribute *rattrib)
}
attrib = mvrp_conditional_reclaim(attrib);
#if LOG_MVRP
- mvrp_print_debug_info(event, attrib);
+ if (attrib != NULL)
+ mvrp_print_debug_info(event, attrib);
#endif
break;
default:
diff --git a/daemons/shaper/src/shaper_log_linux.c b/daemons/shaper/src/shaper_log_linux.c
index d68a79a2..38017c38 100644
--- a/daemons/shaper/src/shaper_log_linux.c
+++ b/daemons/shaper/src/shaper_log_linux.c
@@ -27,6 +27,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdarg.h>
#include <string.h>
#include <inttypes.h>
+#include <limits.h>
#include "platform.h"
#include "shaper_log_queue.h"
@@ -74,7 +75,13 @@ extern void *loggingThreadFn(void *pv);
THREAD_TYPE(loggingThread);
THREAD_DEFINITON(loggingThread);
-#define THREAD_STACK_SIZE 65536
+#if !defined(PTHREAD_STACK_MIN)
+#error "PTHREAD_STACK_MIN variable not defined"
+#elif (PTHREAD_STACK_MIN > 65536)
+#define THREAD_STACK_SIZE PTHREAD_STACK_MIN
+#else
+#define THREAD_STACK_SIZE 65536
+#endif
#define loggingThread_THREAD_STK_SIZE THREAD_STACK_SIZE
static MUTEX_HANDLE_ALT(gLogMutex);
@@ -217,13 +224,16 @@ void shaperLogInit(void)
loggingThreadRunning = TRUE;
THREAD_CREATE(loggingThread, loggingThread, NULL, loggingThreadFn, NULL);
THREAD_CHECK_ERROR(loggingThread, "Thread / task creation failed", errResult);
- if (errResult) {} // Already reported
+ if (errResult) {
+ loggingThreadRunning = FALSE;
+ SHAPER_LOG_ERROR("Could not log data: loggingThread create failure");
+ }
}
}
void shaperLogExit()
{
- if (SHAPER_LOG_FROM_THREAD) {
+ if (SHAPER_LOG_FROM_THREAD && loggingThreadRunning) {
loggingThreadRunning = FALSE;
THREAD_JOIN(loggingThread, NULL);
}
diff --git a/examples/mrp_client/mrpdhelper.c b/examples/mrp_client/mrpdhelper.c
index ddd5a958..a4026903 100644
--- a/examples/mrp_client/mrpdhelper.c
+++ b/examples/mrp_client/mrpdhelper.c
@@ -301,8 +301,8 @@ static int parse_mmrp(char *sz, size_t len, struct mrpdhelper_notify *n)
if (parse_state(&sz[5], n) < 0)
return -1;
- n->attrib = mrpdhelper_attribtype_mvrp;
- if (sscanf(&sz[8], "M=%" SCNx64, &n->u.m.mac) != 1)
+ n->attrib = mrpdhelper_attribtype_mmrp;
+ if (sscanf(&sz[4], "M=%" SCNx64, &n->u.m.mac) != 1)
return -1;
return parse_registrar(sz, n, NULL);
}
diff --git a/lib/avtp_pipeline/README.md b/lib/avtp_pipeline/README.md
index 23e6e525..cbf89a1a 100644
--- a/lib/avtp_pipeline/README.md
+++ b/lib/avtp_pipeline/README.md
@@ -6,8 +6,7 @@
- gPTP
- MAAP
- MSRP
- - igb direct for packet TX.
- - igb credit based shaper
+ - credit based shaper
- build system
- Credit-based shaper algorithm is not used for individual streams.
- Testing of various mappings and benchmarking has been performed. Look at the end of this file for benchmark results.
@@ -25,15 +24,17 @@
- $ sudo apt-get install linux-headers-generic
- linux-headers (same version as the kernel you're building for)
-- Install dependencies for AVTP pipeline
+- Additional install dependencies for AVTP pipeline
- $ sudo apt-get install libglib2.0-dev
+ - $ sudo apt-get install libasound2-dev
+
+- Additional install dependencies for AVTP pipeline if GStreamer support is enabled
- $ sudo apt-get install libgstreamer0.10-dev
- $ sudo apt-get install libgstreamer-plugins-base0.10-dev
- - $ sudo apt-get install libasound2-dev
### Building everything
- Building from the repo root
-- $ ARCH=I210 make all
+- $ make all
### Building just AVTP pipeline
- $ make avtp_pipeline
@@ -51,7 +52,8 @@ Make sure to call `make avtp_pipeline_clean` before.
### Building just AVTP AVDECC support
- $ make avtp_avdecc
-Binaries will be installed in lib/avtp_pipeline/build_avdecc/bin.
+Binaries will be installed in lib/avtp_pipeline/build/bin.
+Build files will be in the lib/avtp_pipeline/build_avdecc directory, to avoid interfering with the AVTP Pipeline build files.
The openavb_avdecc binary needs to be run in addition to the AVTP pipeline binary (openavb_harness or openavb_host) for AVDECC to be supported.
@@ -61,13 +63,10 @@ The openavb_avdecc binary needs to be run in addition to the AVTP pipeline binar
## Running OpenAvnu daemons
- Helper scripts in the repo root.
- `$ sudo ./run_igb.sh eth1`
- - Load the igb driver. Supply the interface name (ethx) as parameter.
-- `$ sudo ./run_gptp.sh eth1`
- - Start gptp daemon. Supply the interface name (ethx) as parameter.
-- `$ sudo ./run_srp.sh eth1`
- - Start msrp daemon. Supply the interface name (ethx) as parameter.
-- `$ sudo ./run_maap.sh eth1`
- - Start maap daemon. Supply the interface name (ethx) as parameter.
+ - Load the igb driver. Supply the interface name (ethx) as parameter. Only needed if using IGB support for the Intel i210 adapter.
+- `$ sudo ./run_daemons.sh eth1`
+ - Start gptp, msrp, maap, and shaper daemons. Supply the interface name (ethx) as parameter.
+ - Daemons can also be started individually using the run_gptp.sh, run_srp.sh, run_maap.sh, and run_shaper.sh scripts.
## Running OpenAvnu simple talker example
- `$ sudo ./run_simple_talker.sh eth1`
@@ -84,7 +83,7 @@ The openavb_avdecc binary needs to be run in addition to the AVTP pipeline binar
## Benchmark results
-All test done on DELL Optiplex 755 with Intel Core 2 Duo CPU E8400 @ 3.00GHz
+All test done on DELL Optiplex 755 with Intel Core 2 Duo CPU E8400 @ 3.00GHz
| Type | Comment | Class | Streams | CPU Talker | CPU Listener |
|:-------:| -------------|:-----:| -------:| ----------:| ------------:|
diff --git a/lib/avtp_pipeline/avtp_avdecc.mk b/lib/avtp_pipeline/avtp_avdecc.mk
index 9a140c03..1331daf0 100644
--- a/lib/avtp_pipeline/avtp_avdecc.mk
+++ b/lib/avtp_pipeline/avtp_avdecc.mk
@@ -1,10 +1,12 @@
AVB_FEATURE_AVDECC ?= 1
-PLATFORM_TOOLCHAIN ?= x86_i210_linux
+PLATFORM_TOOLCHAIN ?= generic
.PHONY: all clean
all: build_avdecc/Makefile
$(MAKE) -s -C build_avdecc install
+ mkdir -p build/bin
+ cp build_avdecc/bin/* build/bin/.
doc: build_avdecc/Makefile
$(MAKE) -s -C build_avdecc doc
@@ -17,7 +19,8 @@ clean:
build_avdecc/Makefile:
mkdir -p build_avdecc && \
cd build_avdecc && \
- cmake -DCMAKE_TOOLCHAIN_FILE=../platform/Linux/$(PLATFORM_TOOLCHAIN).cmake \
+ cmake -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_TOOLCHAIN_FILE=../platform/Linux/$(PLATFORM_TOOLCHAIN).cmake \
-DAVB_FEATURE_AVDECC=$(AVB_FEATURE_AVDECC) \
- ..
+ ..
diff --git a/lib/avtp_pipeline/avtp_pipeline.mk b/lib/avtp_pipeline/avtp_pipeline.mk
index a3ed80e8..e08ac9b9 100644
--- a/lib/avtp_pipeline/avtp_pipeline.mk
+++ b/lib/avtp_pipeline/avtp_pipeline.mk
@@ -1,7 +1,7 @@
AVB_FEATURE_ENDPOINT ?= 1
IGB_LAUNCHTIME_ENABLED ?= 0
-AVB_FEATURE_GSTREAMER ?= 1
-PLATFORM_TOOLCHAIN ?= x86_i210_linux
+AVB_FEATURE_GSTREAMER ?= 0
+PLATFORM_TOOLCHAIN ?= generic
.PHONY: all clean
@@ -19,7 +19,8 @@ clean:
build/Makefile:
mkdir -p build && \
cd build && \
- cmake -DCMAKE_TOOLCHAIN_FILE=../platform/Linux/$(PLATFORM_TOOLCHAIN).cmake \
+ cmake -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_TOOLCHAIN_FILE=../platform/Linux/$(PLATFORM_TOOLCHAIN).cmake \
-DAVB_FEATURE_ENDPOINT=$(AVB_FEATURE_ENDPOINT) \
-DIGB_LAUNCHTIME_ENABLED=$(IGB_LAUNCHTIME_ENABLED) \
-DAVB_FEATURE_GSTREAMER=$(AVB_FEATURE_GSTREAMER) \
diff --git a/lib/avtp_pipeline/platform/Linux/openavb_tasks.h b/lib/avtp_pipeline/platform/Linux/openavb_tasks.h
index 01969f09..387fd985 100644
--- a/lib/avtp_pipeline/platform/Linux/openavb_tasks.h
+++ b/lib/avtp_pipeline/platform/Linux/openavb_tasks.h
@@ -32,7 +32,15 @@ https://github.com/benhoyt/inih/commit/74d2ca064fb293bc60a77b0bd068075b293cf175.
#ifndef _EAVBTASKS_H
#define _EAVBTASKS_H
-#define THREAD_STACK_SIZE 65536
+#include <limits.h>
+
+#if !defined(PTHREAD_STACK_MIN)
+#error "PTHREAD_STACK_MIN variable not defined"
+#elif (PTHREAD_STACK_MIN > 65536)
+#define THREAD_STACK_SIZE PTHREAD_STACK_MIN
+#else
+#define THREAD_STACK_SIZE 65536
+#endif
///////////////////////////
// Platform code Tasks values
diff --git a/run_daemons.sh b/run_daemons.sh
index 30da552d..c8ed4996 100755
--- a/run_daemons.sh
+++ b/run_daemons.sh
@@ -1,33 +1,29 @@
#!/bin/bash
# Start all daemons
-nic=$1
-
if [ "$1" == "-h" ]; then
echo "Usage: $0 <network interface>"
echo " eg: $0 eth1"
+ echo ""
+ echo "If you are using IGB, call \"sudo ./run_igb.sh\" before running this script."
+ echo ""
exit
fi
if [ "$1" == "" ]; then
- nic="eth1" #edit as required
- echo "Network interface not specified, assuming: $nic"
+ echo "Please enter network interface name as parameter. For example:"
+ echo "sudo $0 eth1"
+ echo ""
+ echo "If you are using IGB, call \"sudo ./run_igb.sh\" before running this script."
+ echo ""
+ exit -1
fi
+nic=$1
echo "Starting daemons on "$nic
-#use false for silence
-if true; then
- sudo rmmod igb
- sudo insmod kmod/igb/igb_avb.ko
- sudo groupadd ptp
-else
- sudo rmmod igb > /dev/null 2>&1
- sudo insmod kmod/igb/igb_avb.ko > /dev/null 2>&1
- sudo groupadd ptp > /dev/null 2>&1
-fi
-
-sudo daemons/gptp/linux/build/obj/daemon_cl $nic &
-sudo daemons/mrpd/mrpd -mvs -i $nic &
-sudo daemons/maap/linux/maap_daemon -i $nic &
-
+groupadd ptp > /dev/null 2>&1
+daemons/gptp/linux/build/obj/daemon_cl $nic &
+daemons/mrpd/mrpd -mvs -i $nic &
+daemons/maap/linux/build/maap_daemon -i $nic -d /dev/null
+daemons/shaper/shaper_daemon -d &
diff --git a/stop_daemons.sh b/stop_daemons.sh
index 82598852..a1ae8bb0 100755
--- a/stop_daemons.sh
+++ b/stop_daemons.sh
@@ -1,9 +1,10 @@
#!/bin/bash
# Stop all daemons
-sudo killall maap_daemon
-sudo killall mrpd
-sudo killall daemon_cl
+killall shaper_daemon
+killall maap_daemon
+killall mrpd
+killall daemon_cl
# possibly add rmmod igb_avb here
diff --git a/thirdparty/cpputest b/thirdparty/cpputest
-Subproject 69d1b24fa92fc8c3cf5542bf44293c3e05cfbf0
+Subproject 1d95a3905413d99fddb5bcbd30be35a16dbf911