luxonis / XLink

A cross-platform library for communicating with devices over various physical links.
Apache License 2.0
12 stars 18 forks source link

XLinkOpenStream StreamId desynchronization #6

Closed themarpe closed 3 years ago

themarpe commented 3 years ago

XLinkOpenStream has an issue where if both host and device try to open streams, streamId can get "desynchronized`. Example: XLinkOpenStream1

The above diagram shows how host tries to open stream A and device stream B, but the results are that both streams now point to same IDs, which results in all data transfers being delivered to wrong locations.

Possible solution is to replace the creation of "unique" stream ID on remote with creating one locally for local conversion between ID<->name while replace using stream name as an unique ID.

Events would then be sent with name instead of ID, but this doesn't diverge too much from current architecture, as stream name has a fixed place in event header already.