For hardware which supports them, the buffer timestamps in readStream and writeStream are useful for a number of purposes:
- Synchronization of RX and TX signals
- Controlling the latency of TX signals
- Absolute timing of RX signals on hardware with a PPS input
- Detecting lost RX samples
How should we pass the timestamps between seeder and leecher? For RX, the shared buffer could contain the calculated timestamp of the latest sample. readStream would then use it to calculate the timestamp for the first sample in the returned buffer. Note that this might need locking in the state structure or an atomic way to update both the sample pointer and the latest timestamp at the same time.
For TX, what if we don't use a similar ring buffer but somehow pass the writeStream calls more directly together with a timestamp? It would still allow multiple leechers to transmit at different times. Simultaneous transmission from multiple leechers (with summation of signals) wouldn't work but doesn't work now either. Note that resampling might add some challenges for handling the timestamps.
How about hardware time functions? For example, on USRP, getHardwareTime("PPS") returns the timestamp of the sample during which the latest PPS pulse happened, so the value updates once a second. Should these calls also be passed to the seeder and return value back to the leecher?
For hardware which supports them, the buffer timestamps in readStream and writeStream are useful for a number of purposes:
How should we pass the timestamps between seeder and leecher? For RX, the shared buffer could contain the calculated timestamp of the latest sample. readStream would then use it to calculate the timestamp for the first sample in the returned buffer. Note that this might need locking in the state structure or an atomic way to update both the sample pointer and the latest timestamp at the same time.
For TX, what if we don't use a similar ring buffer but somehow pass the writeStream calls more directly together with a timestamp? It would still allow multiple leechers to transmit at different times. Simultaneous transmission from multiple leechers (with summation of signals) wouldn't work but doesn't work now either. Note that resampling might add some challenges for handling the timestamps.
How about hardware time functions? For example, on USRP, getHardwareTime("PPS") returns the timestamp of the sample during which the latest PPS pulse happened, so the value updates once a second. Should these calls also be passed to the seeder and return value back to the leecher?