Fixed out of order talker samples#35
Open
akp7 wants to merge 3 commits into
Open
Conversation
Contributor
|
Could do with a rebase/squash to remove the semi-colon commit. |
There was a problem hiding this comment.
Pull request overview
This PR addresses out-of-order AVB talker samples and broadens support for “talker-only” / “no sinks / no listeners / no media outputs” build configurations by adding null-safe handling and conditional compilation across AVB, media clock, buffering, and example applications.
Changes:
- Update the 1722 talker transmit path to avoid overwriting queued packets and to flush pending TX buffers deterministically.
- Add conditional compilation and null checks to support configurations with
AVB_NUM_SINKS == 0,AVB_NUM_LISTENER_UNITS == 0, and/orAVB_NUM_MEDIA_OUTPUTS == 0. - Update 1722.1 descriptor/control logic and public API signatures to align with the new optional/conditional features.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib_tsn/src/media_clock/media_clock_support.c | Guard stream-derived clock recovery logic behind AVB_NUM_SINKS > 0. |
| lib_tsn/src/media_clock/media_clock_server.xc | Make buffer-control chanend array optional and add guards for output-only builds. |
| lib_tsn/src/avb/avb.xc | Avoid registering listeners / updating sinks when listener units are not present. |
| lib_tsn/src/audio_buffering/audio_buffering.xc | Make audio output pull interface optional and add runtime checks around output usage. |
| lib_tsn/src/audio_buffering/audio_buffering.h | Update audio_buffer_manager() signature to accept an optional output interface. |
| lib_tsn/src/1722/maap/avb_1722_maap.xc | Fix missing semicolon in debug print. |
| lib_tsn/src/1722/avb_1722_talker.xc | Prevent out-of-order samples by sending queued packets before overwriting and flushing one queued packet per call. |
| lib_tsn/src/1722_1/avb_1722_1_aecp.c | Adjust AEM descriptor generation/guards for sink-less builds and correct mapping offsets. |
| lib_tsn/src/1722_1/avb_1722_1_aecp_controls.xc | Fix start/stop streaming logic to use source state for stream outputs. |
| lib_tsn/api/avb.h | Gate stream-derived clock enum by sinks, tighten clock-type logging, and update server signature. |
| examples/AN00203_gige_avb_tdm_demo/src/main.xc | Add #if guards and null wiring for builds without outputs/listeners. |
| examples/AN00203_gige_avb_tdm_demo/src/aem_descriptors.h.in | Make descriptor counts conditional on sinks; adjust clock source descriptor list. |
| examples/AN00202_gige_avb_i2s_demo/src/main.xc | Add #if guards and null wiring for builds without outputs/listeners. |
| examples/AN00202_gige_avb_i2s_demo/src/aem_descriptors.h.in | Make descriptor counts conditional on sinks; correct stream output label counts; adjust clock source descriptor list. |
Comments suppressed due to low confidence (2)
examples/AN00202_gige_avb_i2s_demo/src/aem_descriptors.h.in:524
- The
#if (AVB_NUM_SINKS > 0)/#endifblock currently spans across the end ofdesc_clock_source_0and into the start ofdesc_clock_source_1, which will produce invalid C whenAVB_NUM_SINKS == 0(unterminated initializer / stray tokens). Restructure the preprocessor so each descriptor array is syntactically complete in both configurations.
#if (AVB_NUM_SINKS > 0)
"Input Stream", /* 4-67 object_name */
U16(AEM_NO_STRING), /* 68-69 localized_description */
U16(AEM_CLOCK_SOURCE_FLAGS_LOCAL_ID), /* 70-71 clock_source_flags */
U16(AEM_CLOCK_SOURCE_INPUT_STREAM), /* 72-73 clock_source_type */
examples/AN00203_gige_avb_tdm_demo/src/aem_descriptors.h.in:498
- The
#if (AVB_NUM_SINKS > 0)/#endifblock currently spans across the end ofdesc_clock_source_0and into the start ofdesc_clock_source_1, which will produce invalid C whenAVB_NUM_SINKS == 0(unterminated initializer / stray tokens). Restructure the preprocessor so each descriptor array is syntactically complete in both configurations.
#if (AVB_NUM_SINKS > 0)
"Input Stream", /* 4-67 object_name */
U16(AEM_NO_STRING), /* 68-69 localized_description */
U16(AEM_CLOCK_SOURCE_FLAGS_LOCAL_ID), /* 70-71 clock_source_flags */
U16(AEM_CLOCK_SOURCE_INPUT_STREAM), /* 72-73 clock_source_type */
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+119
to
+131
| buffer_handle_t h_out = null; | ||
| audio_output_fifo_t *unsafe output_sample_buf = null; | ||
| unsigned ctl_command; | ||
| unsigned sample_rate; | ||
|
|
||
| if( !isnull(audio_output_buf) && AVB_NUM_MEDIA_OUTPUTS ) | ||
| { | ||
| h_out = audio_output_buf.get_handle(); | ||
| output_sample_buf = (audio_output_fifo_t *unsafe)((struct output_finfo *)h_out)->p_buffer; | ||
| } | ||
| media_ctl_register(c_media_ctl, AVB_NUM_MEDIA_INPUTS, | ||
| output_sample_buf, AVB_NUM_MEDIA_OUTPUTS, 0); | ||
|
|
Comment on lines
66
to
+70
| U16(AEM_CLOCK_SOURCE_TYPE), | ||
| #if (AVB_NUM_SINKS > 0) | ||
| U16(2), | ||
| #else | ||
| U16(1), |
Comment on lines
66
to
+70
| U16(AEM_CLOCK_SOURCE_TYPE), | ||
| #if (AVB_NUM_SINKS > 0) | ||
| U16(2), | ||
| #else | ||
| U16(1), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed out of order samples discussed here https://www.xcore.com/viewtopic.php?p=30728