milan-avb: hook stream output to MSRP listener_observed + add max_transit_time_ns

This commit is contained in:
hackerman-kl 2026-04-26 14:57:24 +02:00 committed by Wim Taymans
parent a5fbeef6f8
commit 197bab7931
2 changed files with 28 additions and 4 deletions

View file

@ -219,6 +219,15 @@ struct aecp_aem_stream_output_state {
* MSRP_ACC_LAT_VALID flag. Range 0 .. 0x7FFFFFFF. */ * MSRP_ACC_LAT_VALID flag. Range 0 .. 0x7FFFFFFF. */
uint32_t presentation_time_offset_ns; uint32_t presentation_time_offset_ns;
/** IEEE 1722.1-2021 Section 7.4.39 max_transit_time, nanoseconds. The maximum
* time between an AVTP frame's transmission by this Talker and its
* consumption by any Listener. Read by stream_activate() to seed
* stream->mtt (the per-PDU presentation_time = txtime + mtt) and by
* GET_MAX_TRANSIT_TIME; updated by SET_MAX_TRANSIT_TIME. Default
* 2_000_000 (2 ms) kept in sync with presentation_time_offset_ns
* until the two opcodes are wired up to set them independently. */
uint64_t max_transit_time_ns;
bool stream_info_dirty; bool stream_info_dirty;
/* Milan Section 5.4.5 counter unsolicited rate-limit (see avb_interface_state). */ /* Milan Section 5.4.5 counter unsolicited rate-limit (see avb_interface_state). */

View file

@ -222,12 +222,27 @@ static void notify_listener(struct msrp *msrp, uint64_t now, struct attr *attr,
else if (notify == AVB_MRP_NOTIFY_LEAVE) else if (notify == AVB_MRP_NOTIFY_LEAVE)
stream_out->listener_observed = false; stream_out->listener_observed = false;
/* listener_observed flips flags_ex.REGISTERING in the if (prev != stream_out->listener_observed) {
* GET_STREAM_INFO answer (Milan Table 5.12). Hint AECP to /* listener_observed flips flags_ex.REGISTERING in the
* re-emit so controllers see the update. */ * GET_STREAM_INFO answer (Milan Table 5.12). Hint AECP
if (prev != stream_out->listener_observed) * to re-emit so controllers see the update. */
avb_aecp_aem_mark_stream_info_dirty(msrp->server, avb_aecp_aem_mark_stream_info_dirty(msrp->server,
AVB_AEM_DESC_STREAM_OUTPUT, s->index); AVB_AEM_DESC_STREAM_OUTPUT, s->index);
/* Milan Section 4.3.3.1: a foreign Listener registration is the
* "matching declaration" condition for starting AVTP TX.
* Activate the data plane on falsetrue; tear it down on
* truefalse. The internal source/!source guards make the
* calls idempotent against the listener_observed bit, so a
* spurious flip won't double-start. */
if (stream_out->listener_observed) {
if (s->source == NULL)
stream_activate(s, s->index, now);
} else {
if (s->source != NULL)
stream_deactivate(s, now);
}
}
} }
} }