Replies: 9 comments 12 replies
-
Sequence number increment: Solution 1 In this solution, the host will just naively increment the sequence number once per SDU interval using a timer. This is a very simple solution and requires little to no thought. The side effect of this, is that if the application attempts to send 2 SDUs in a single SDU interval on a single stream, they will get the same package sequence number (unless we choose to reject the send request), and when sent to the controller won't be sent on air. Since the controller cannot reject it, it is best if the host rejects it if the application sends two SDUs in a single SDU interval on a single stream. The application will not be able to enqueue multiple packets in the controller at the same time |
Beta Was this translation helpful? Give feedback.
-
Sequence number increment: Solution 2 In this solution, the host will increment the sequence number once per SDU interval using a timer, but also once per send request from the application. The application will be able to enqueue multiple packets in the controller (with different sequence numbers). The implementation will be slightly more complex than #43317 (comment) since we need to figure out when to increment the sequence from the timer and when we need to increment it from application requesting a send. |
Beta Was this translation helpful? Give feedback.
-
Sequence number increment: Solution 3 In this solution we simply offload the sequence number to the application. Add another field in the This solution is however also the most flexible, as it will allow an application to schedule ISO SDUs in the future (e.g. sending a SDU with a sequence number 10 above the current sequence number will schedule it 10 * SDU interval in the future. The application will however require that the TS of the last sent message is also known to the application. |
Beta Was this translation helpful? Give feedback.
-
TX Sync Solution 1 To sync the timestamp and sequence number, the In this solution, the application is responsible for calling a function that sends this command to the controller, and then the resulting event can then be used for the host or application (depending on the Sequence number solution) to correct any out-of-sync sequence numbers. It is thus up to to the application to derive when it makes sense to call this, and how often. |
Beta Was this translation helpful? Give feedback.
-
TX Sync Solution 2 To sync the timestamp and sequence number, the In this solution, the host will send this command to the controller periodically. This can either by configured by a KConfig in e.g. MS (e.g. send every 10000ms/10s), or relative to the SDU interval, e.g. send it every 100 SDU intervals. This solution can work together with #43317 (comment), i.e. having the host call this periodically, as well as allowing the application to call it manually. |
Beta Was this translation helpful? Give feedback.
-
For a correct supply of audio data from host to controller, the host must anyway send (at least on average) exactly one SDU per SDU interval. So "naively incrementing" should be fine. That will fulfill the spec requirement of incrementing once per SDU interval. So, I think the question is not so much about the numbering as it is about knowing when to send SDUs, i.e. keeping track of how many SDU intervals have elapsed and when send SDUs to the controller. For a "live" system, that should be given by the flow of data from the A/D converter (which must exist somewhere). For stored data (less common?) a timer is required, I believe. |
Beta Was this translation helpful? Give feedback.
-
Sequence number increment: Solution 4 In this solution the host will continuously send ISO packets to the controller, and use the command complete to increment the sequence number, rather than using a timer, when a specific ISO channel is considered "idle". This should ensure correctness for the sequence number, assuming that we can enqueue enough packets to never miss an interval. The side effects of this is that the controller will continuously send SDUs instead of empty PDUs, causing the remote host to receive empty SDUs continuously (which arguably is the intention of the ISO feature). A negative side effect is that the host will need to reserve at least 1 but more like 1-2 ISO TX buffers to implement this feature. |
Beta Was this translation helpful? Give feedback.
-
It seems that the conclusion (based on numerous discussions) is that TX Sync Solution 1 together with Sequence number increment: Solution 3 is the solution. In this case, we basically offload everything to the application, and add the packet sequence number to the So basically we are going to change int bt_iso_chan_send(struct bt_iso_chan *chan, struct net_buf *buf); to int bt_iso_chan_send(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t sn, uint32_t ts); For Audio data (sent via @Casper-Bonde-Bose Does this seem good to you? |
Beta Was this translation helpful? Give feedback.
-
Closed as issue has been fixed |
Beta Was this translation helpful? Give feedback.
-
The current implementation (as of SHA 0e8f556) is that the sequence number is just naively incremented per SDU send from the application/host to the controller for the specific ISO stream.
The core spec (Version 5.3, Vol 6, Part G, Section 2 ISOAL Features) mandates that the sequence number is incremented once per SDU interval, which is current not the case.
So we need to increment the SDU interval via a timer in the host, started when the ISO channel is connected. This applies for both unicast and broadcast. This change is pretty trivial, and won't require much discussion (if any).
Furthermore, to keep the timer in sync with the timer in the controller, as well as the sequence number, we need to use the
LE Read ISO TX Sync
HCI command. This will need to be called periodically either by the application, or by the host.There is no way for the controller to indicate to the host that the timestamps/sequences numbers are out of sync.
Below will be a few discussion points in comments, with different ways of implementing this sync between the host and the controller.
Beta Was this translation helpful? Give feedback.
All reactions