summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandrew-elder <aelder@audioscience.com>2017-08-02 13:25:29 -0400
committerGitHub <noreply@github.com>2017-08-02 13:25:29 -0400
commit05322b28c099a9ebcff387f594b9d9a28710d75a (patch)
tree847bc4f44d966dbce694846ba7566c84f55d6266
parente03b43fd65b112ba6c59c2bb695253c18d76ac6c (diff)
parentf63c09fbf68961c5e164f232c7f3c56a7946abf5 (diff)
downloadOpen-AVB-05322b28c099a9ebcff387f594b9d9a28710d75a.tar.gz
Merge pull request #663 from AVnu/feature-avtp-pipeline-avdecc
Feature avtp pipeline avdecc
-rw-r--r--lib/avtp_pipeline/acmp/openavb_acmp_sm_listener.c19
-rw-r--r--lib/avtp_pipeline/adp/openavb_adp_sm_advertise_entity.c2
-rw-r--r--lib/avtp_pipeline/adp/openavb_adp_sm_advertise_interface.c2
-rw-r--r--lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c2
-rw-r--r--lib/avtp_pipeline/aem/openavb_descriptor_stream_io_pub.h1
-rw-r--r--lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_server.c3
-rw-r--r--lib/avtp_pipeline/endpoint/openavb_endpoint_server.c2
-rw-r--r--lib/avtp_pipeline/platform/Linux/openavb_time_osal_pub.h2
8 files changed, 25 insertions, 8 deletions
diff --git a/lib/avtp_pipeline/acmp/openavb_acmp_sm_listener.c b/lib/avtp_pipeline/acmp/openavb_acmp_sm_listener.c
index 53bc2fa4..c10ba2ef 100644
--- a/lib/avtp_pipeline/acmp/openavb_acmp_sm_listener.c
+++ b/lib/avtp_pipeline/acmp/openavb_acmp_sm_listener.c
@@ -890,7 +890,8 @@ void openavbAcmpSMListenerSet_doFastConnect(const openavb_tl_data_cfg_t *pListen
// Update the descriptor.
pDescriptor->fast_connect_status = OPENAVB_FAST_CONNECT_STATUS_IN_PROGRESS;
- memcpy(pDescriptor->fast_connect_talker_entity_id, talker_entity_id, 8);
+ memcpy(pDescriptor->fast_connect_talker_entity_id, talker_entity_id, sizeof(pDescriptor->fast_connect_talker_entity_id));
+ CLOCK_GETTIME(OPENAVB_CLOCK_REALTIME, &pDescriptor->fast_connect_start_time);
// Create a fake CONNECT_RX_COMMAND to kick off the fast connect process.
// The FAST_CONNECT flag is used to indicate internally that the controller didn't initiate this.
@@ -940,8 +941,19 @@ void openavbAcmpSMListenerSet_talkerTestFastConnect(
if (pDescriptor->stream &&
pDescriptor->fast_connect_status == OPENAVB_FAST_CONNECT_STATUS_TIMED_OUT &&
- memcmp(pDescriptor->fast_connect_talker_entity_id, entity_id, 8) == 0) {
+ memcmp(pDescriptor->fast_connect_talker_entity_id, entity_id, sizeof(pDescriptor->fast_connect_talker_entity_id)) == 0) {
+ //
// We found a Talker matching the one we have been looking for.
+ //
+
+ // See if it is time to connect yet.
+ struct timespec currenttime;
+ CLOCK_GETTIME(OPENAVB_CLOCK_REALTIME, &currenttime);
+ if (openavbTimeTimespecCmp(&currenttime, &pDescriptor->fast_connect_start_time) < 0) {
+ AVB_LOG_DEBUG("Not yet time to do a fast connect");
+ break;
+ }
+
// Get the rest of the details we need to connect to it.
U16 flags, talker_unique_id;
U8 talker_entity_id[8], controller_entity_id[8];
@@ -951,7 +963,8 @@ void openavbAcmpSMListenerSet_talkerTestFastConnect(
openavbAcmpSMListenerSet_doFastConnect(pDescriptor->stream, flags, talker_unique_id, talker_entity_id, controller_entity_id);
}
else {
- AVB_LOGF_ERROR("Unexpected fast connect info for talker_entity_id=" ENTITYID_FORMAT, ENTITYID_ARGS(entity_id));
+ AVB_LOGF_DEBUG("Fast connect info for talker_entity_id=" ENTITYID_FORMAT " no longer valid", ENTITYID_ARGS(entity_id));
+ memset(pDescriptor->fast_connect_talker_entity_id, 0, sizeof(pDescriptor->fast_connect_talker_entity_id));
}
break;
diff --git a/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_entity.c b/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_entity.c
index 7ba72355..6a1e5d44 100644
--- a/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_entity.c
+++ b/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_entity.c
@@ -201,7 +201,7 @@ void openavbAdpSMAdvertiseEntityStart()
bool errResult;
THREAD_CREATE(openavbAdpSmAdvertiseEntityThread, openavbAdpSmAdvertiseEntityThread, NULL, openavbAdpSMAdvertiseEntityThreadFn, NULL);
THREAD_CHECK_ERROR(openavbAdpSmAdvertiseEntityThread, "Thread / task creation failed", errResult);
- if (errResult); // Already reported
+ if (errResult); // Already reported
AVB_TRACE_EXIT(AVB_TRACE_ADP);
}
diff --git a/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_interface.c b/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_interface.c
index 495ab328..1bc1f101 100644
--- a/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_interface.c
+++ b/lib/avtp_pipeline/adp/openavb_adp_sm_advertise_interface.c
@@ -247,7 +247,7 @@ void openavbAdpSMAdvertiseInterfaceStart()
bool errResult;
THREAD_CREATE(openavbAdpSmAdvertiseInterfaceThread, openavbAdpSmAdvertiseInterfaceThread, NULL, openavbAdpSMAdvertiseInterfaceThreadFn, NULL);
THREAD_CHECK_ERROR(openavbAdpSmAdvertiseInterfaceThread, "Thread / task creation failed", errResult);
- if (errResult); // Already reported
+ if (errResult); // Already reported
AVB_TRACE_EXIT(AVB_TRACE_ADP);
}
diff --git a/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c b/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c
index 485f2783..3013642e 100644
--- a/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c
+++ b/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c
@@ -1049,7 +1049,7 @@ void openavbAecpSMEntityModelEntityStart()
bool errResult;
THREAD_CREATE(openavbAecpSMEntityModelEntityThread, openavbAecpSMEntityModelEntityThread, NULL, openavbAecpSMEntityModelEntityThreadFn, NULL);
THREAD_CHECK_ERROR(openavbAecpSMEntityModelEntityThread, "Thread / task creation failed", errResult);
- if (errResult); // Already reported
+ if (errResult); // Already reported
AVB_TRACE_EXIT(AVB_TRACE_AECP);
}
diff --git a/lib/avtp_pipeline/aem/openavb_descriptor_stream_io_pub.h b/lib/avtp_pipeline/aem/openavb_descriptor_stream_io_pub.h
index 799dc23e..5ab4ccb5 100644
--- a/lib/avtp_pipeline/aem/openavb_descriptor_stream_io_pub.h
+++ b/lib/avtp_pipeline/aem/openavb_descriptor_stream_io_pub.h
@@ -84,6 +84,7 @@ typedef struct {
// Current status of the fast connect support for the Listener.
openavb_fast_connect_status_t fast_connect_status;
U8 fast_connect_talker_entity_id[8];
+ struct timespec fast_connect_start_time;
// Also save a pointer to the supplied stream information.
const openavb_tl_data_cfg_t *stream;
diff --git a/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_server.c b/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_server.c
index 4959243e..e5315112 100644
--- a/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_server.c
+++ b/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_server.c
@@ -388,6 +388,9 @@ bool openavbAvdeccMsgSrvrHndlChangeNotificationFromClient(int avdeccMsgHandle, o
ENTITYID_ARGS(talker_entity_id),
ENTITYID_ARGS(controller_entity_id));
pDescriptor->fast_connect_status = OPENAVB_FAST_CONNECT_STATUS_TIMED_OUT;
+ memcpy(pDescriptor->fast_connect_talker_entity_id, talker_entity_id, sizeof(pDescriptor->fast_connect_talker_entity_id));
+ CLOCK_GETTIME(OPENAVB_CLOCK_REALTIME, &pDescriptor->fast_connect_start_time);
+ pDescriptor->fast_connect_start_time.tv_sec += 5; // Give the Talker some time to shutdown or stabilize
break;
}
}
diff --git a/lib/avtp_pipeline/endpoint/openavb_endpoint_server.c b/lib/avtp_pipeline/endpoint/openavb_endpoint_server.c
index 65f5c4cd..350dcff4 100644
--- a/lib/avtp_pipeline/endpoint/openavb_endpoint_server.c
+++ b/lib/avtp_pipeline/endpoint/openavb_endpoint_server.c
@@ -258,7 +258,7 @@ bool openavbEptSrvrRegisterStream(int h,
}
// If the Shaper is available, enable it.
- if (openavbShaperDaemonAvailable()) {
+ if (openavbShaperDaemonAvailable() && ps->txRate) {
ps->hndShaper = openavbShaperHandle(
ps->srClass,
MICROSECONDS_PER_SECOND / ps->txRate, /* Note that division rounds down, which is what we want. */
diff --git a/lib/avtp_pipeline/platform/Linux/openavb_time_osal_pub.h b/lib/avtp_pipeline/platform/Linux/openavb_time_osal_pub.h
index 5e4c4fc8..ba693da9 100644
--- a/lib/avtp_pipeline/platform/Linux/openavb_time_osal_pub.h
+++ b/lib/avtp_pipeline/platform/Linux/openavb_time_osal_pub.h
@@ -43,7 +43,7 @@ https://github.com/benhoyt/inih/commit/74d2ca064fb293bc60a77b0bd068075b293cf175.
#define TIMERFD_SETTIME(arg1, arg2, arg3, arg4) timerfd_settime(arg1, arg2, arg3, arg4)
#define TIMER_CLOSE(arg1) close(arg1)
-// In this Linux port all clock IDs preceeding OPENAVB_CLOCK_WALLTIME will be set to clock_gettime()
+// In this Linux port all clock IDs preceding OPENAVB_CLOCK_WALLTIME will be set to clock_gettime()
typedef enum {
OPENAVB_CLOCK_REALTIME,
OPENAVB_CLOCK_MONOTONIC,