# LMS\_SendStream without meta - fixed bug?

**URL:** <https://discourse.myriadrf.org/t/lms-sendstream-without-meta-fixed-bug/2970>\
**Category:** LimeSDR\
**Created:** [29 June 2018 12:32 UTC](https://discourse.myriadrf.org/t/lms-sendstream-without-meta-fixed-bug/2970 "2018-06-29T12:32:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavel](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@Pavel](https://discourse.myriadrf.org/u/Pavel)\
**Post date:** [29 June 2018 12:32 UTC](https://discourse.myriadrf.org/t/lms-sendstream-without-meta-fixed-bug/2970/1 "2018-06-29T12:32:13Z")

</div>

Hi,  
I have maybe a little strange question, but I’d like to understand this. Some time ago (month or two) I had a problem with LMS\_SendStream call. When I was calling it too quickly without meta (or with waitForTimestamp set to false) the samples seemed to be overwritten without being actually transmitted - e.g. following loop:  
while(…){  
n = read\_from\_file\_to\_buffer(buf);  
LMS\_SendStream(&tx\_stream, buf, n, NULL, 1000 );  
}

The speed of sending samples to LimeSDR-mini was limited only by the hw (cpu, usb, file i/o, etc.). LMS\_GetStreamStatus reported linkRate multiple times bigger than what was appropriate to the used sample rate.

I solved it by using waitForTimestamp and increasing the timestamp by what was returned by LMS\_SendStream.

But now I cannot replicate this behavior and the loop described above is working as I originally expected - the samples are transmitted correctly.

Was there a bug like this fixed? I cannot find any reference to anything like this. Or am I missing something else? I don`t have the original code any more, but I believe that the one I have is similar enough.

What is the correct behavior? I`d like to know how LMS\_SendStream is supposed to be used. Is it OK to call it without meta (or with waitForTimestamp set to false) without risk that samples will be lost (assuming other conditions, like e.g. USB speed, are good enough)?

Thank you for explanation.

Pavel

---

<div class="post-metadata">

**Author:** ![andrewback](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@andrewback](https://discourse.myriadrf.org/u/andrewback)\
**Post date:** [2 July 2018 13:18 UTC](https://discourse.myriadrf.org/t/lms-sendstream-without-meta-fixed-bug/2970/2 "2018-07-02T13:18:21Z")

</div>

@IgnasJ, could you advise, please.

---

<div class="post-metadata">

**Author:** ![IgnasJ](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@IgnasJ](https://discourse.myriadrf.org/u/IgnasJ)\
**Post date:** [3 July 2018 07:40 UTC](https://discourse.myriadrf.org/t/lms-sendstream-without-meta-fixed-bug/2970/3 "2018-07-03T07:40:45Z")

</div>

> [@Pavel](#):
>
> Was there a bug like this fixed? I cannot find any reference to anything like this. Or am I missing something else? I don`t have the original code any more, but I believe that the one I have is similar enough.

We were not aware of such bug. What board do you have (LimeSDR-USB or -Mini)? Recently, there has been some fixes in FPGA that dealt with issues when packet synchronization is disabled but none of the issues were similar to what you describe.

> [@Pavel](#):
>
> What is the correct behavior? I`d like to know how LMS\_SendStream is supposed to be used. Is it OK to call it without meta (or with waitForTimestamp set to false) without risk that samples will be lost (assuming other conditions, like e.g. USB speed, are good enough)?

NULL can be passed as metadata (it defaults to waitForTimestamp=false, flushPartialPacket=false, timestamp=0).  
When synchronization to timestamp is disabled (waitForTimestamp=false) Tx data rate should be limited by hardware sample rate.

---

<div class="post-metadata">

**Author:** ![Pavel](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@Pavel](https://discourse.myriadrf.org/u/Pavel)\
**Post date:** [3 July 2018 08:33 UTC](https://discourse.myriadrf.org/t/lms-sendstream-without-meta-fixed-bug/2970/4 "2018-07-03T08:33:03Z")

</div>

Thank you for the answer. I have LimeSDR-Mini. I suppose I am not the only one with this experience - this code [https://github.com/emvivre/limesdr\_toolbox/commit/d2f04dffff2bc751e813c2737ba05cabe54058fd#diff-f4faf650bc562c5fc7fc6d214567abd6R136](https://github.com/emvivre/limesdr_toolbox/commit/d2f04dffff2bc751e813c2737ba05cabe54058fd#diff-f4faf650bc562c5fc7fc6d214567abd6R136) seems to me, that the author was dealing with the same problem.

So if I understand it correctly, if I don`t want synchronization between RX and TX, I can pass NULL as metadata to LMS\_SendStream and it should work correctly. Right now it does, to there is actually now problem, I just wanted to understand. Maybe the fixes in FPGA solved this problem. Is there some simple way how test it?

Thank you

Pavel

---

<div class="post-metadata">

**Author:** ![IgnasJ](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@IgnasJ](https://discourse.myriadrf.org/u/IgnasJ)\
**Post date:** [3 July 2018 10:40 UTC](https://discourse.myriadrf.org/t/lms-sendstream-without-meta-fixed-bug/2970/5 "2018-07-03T10:40:12Z")

</div>

> [@Pavel](#):
>
> So if I understand it correctly, if I don`t want synchronization between RX and TX, I can pass NULL as metadata to LMS\_SendStream and it should work correctly.

Correct.

> [@Pavel](#):
>
> Maybe the fixes in FPGA solved this problem. Is there some simple way how test it?

You can try to revert to older GW ([v1.24](http://downloads.myriadrf.org/project/limesuite/18.04/LimeSDR-Mini_HW_1.1_r1.24.rpd)) and check if the problem comes back.
