# Question about ZeroMQ Sub source

**URL:** <https://www.ruby-forum.com/t/question-about-zeromq-sub-source/231790>\
**Category:** GNU Radio\
**Created:** [August 30, 2014, 7:13pm UTC](https://www.ruby-forum.com/t/question-about-zeromq-sub-source/231790 "2014-08-30T19:13:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 30, 2014, 7:13pm UTC](https://www.ruby-forum.com/t/question-about-zeromq-sub-source/231790/1 "2014-08-30T19:13:44Z")

</div>

I’ve got a question relating to the zmq sub source.  
I’ve got a flowgraph that has rtlsdr -\> pub sink

In another graph, I decode FM radio using WBFM receive.  
I noticed that it sounds horrible and choppy (sped up).  
I looked in the code of the sub source, and saw this

```
        // Copy to output buffer and return
        if (msg.size() >= d_itemsize*noutput_items)
        {
            memcpy(out, (void *) msg.data(), 

```

d\_itemsize\*noutput\_items);  
return noutput\_items;  
} else  
{  
memcpy(out, (void \*) msg.data(), msg.size());  
return msg.size() / (d\_itemsize);  
}

Does this mean that if the message size is greater then the number of  
items  
requested by scheduler \* item size (e.g. complex = 8), the rest of the  
message is simply dropped?

This is probably the reason for the choppy audio. How can a situation  
like  
this be avoided?

---

<div class="post-metadata">

**Author:** ![Vanush\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ce7236/32.png) [@Vanush\_V](https://www.ruby-forum.com/u/Vanush_V)\
**Post date:** [August 30, 2014, 7:38pm UTC](https://www.ruby-forum.com/t/question-about-zeromq-sub-source/231790/2 "2014-08-30T19:38:44Z")

</div>

Setting max number of output items in both graphs seems to help this.

---

<div class="post-metadata">

**Author:** ![Vanush\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ce7236/32.png) [@Vanush\_V](https://www.ruby-forum.com/u/Vanush_V)\
**Post date:** [August 30, 2014, 7:57pm UTC](https://www.ruby-forum.com/t/question-about-zeromq-sub-source/231790/3 "2014-08-30T19:57:35Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![Vanush\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ce7236/32.png) [@Vanush\_V](https://www.ruby-forum.com/u/Vanush_V)\
**Post date:** [August 31, 2014, 1:19pm UTC](https://www.ruby-forum.com/t/question-about-zeromq-sub-source/231790/4 "2014-08-31T13:19:43Z")

</div>

I tried it but it’s still very choppy.

I’m not 100% on the scheduler, but if the downstream graph requests 4096  
items, and the zmq message size is 8192 items, wouldn’t this result in  
choppy audio?

Regards,  
Vanush

On Sun, Aug 31, 2014 at 3:56 AM, Johnathan C.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
