# UHD's recv\_frame\_size for E100

**URL:** <https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219>\
**Category:** GNU Radio\
**Created:** [April 26, 2011, 2:29am UTC](https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219 "2011-04-26T02:29:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [April 26, 2011, 2:29am UTC](https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219/1 "2011-04-26T02:29:44Z")

</div>

Unlike USRP1 over USB, it seems specifying the recv\_frame\_size on “args”  
doesn’t have any effect on E100. I see get\_max\_recv\_samps\_per\_packet()  
always returning 506 and I see fragmented segements from recv() calls.  
Is it  
unadjustable for E100 or am I doing something wrong here?

Thanks,

Michael

---

<div class="post-metadata">

**Author:** ![Michael\_Dev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@Michael\_Dev](https://www.ruby-forum.com/u/Michael_Dev)\
**Post date:** [April 26, 2011, 3:02am UTC](https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219/2 "2011-04-26T03:02:24Z")

</div>

On 04/25/2011 08:28 PM, Michael Dev wrote:

> Unlike USRP1 over USB, it seems specifying the recv\_frame\_size on “args”  
> doesn’t have any effect on E100. I see get\_max\_recv\_samps\_per\_packet()  
> always returning 506 and I see fragmented segements from recv() calls. Is it  
> unadjustable for E100 or am I doing something wrong here?

Due to the design of the fpga interface, the largest transfer between  
the fpga and gpp is 2048 bytes. Beyond this, Josh will need to comment  
🙂

Philip

---

<div class="post-metadata">

**Author:** ![Michael\_Dev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@Michael\_Dev](https://www.ruby-forum.com/u/Michael_Dev)\
**Post date:** [April 26, 2011, 3:09am UTC](https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219/3 "2011-04-26T03:09:11Z")

</div>

On 04/25/2011 06:01 PM, Philip B. wrote:

> On 04/25/2011 08:28 PM, Michael Dev wrote:
> 
> > Unlike USRP1 over USB, it seems specifying the recv\_frame\_size on “args”  
> > doesn’t have any effect on E100. I see get\_max\_recv\_samps\_per\_packet()  
> > always returning 506 and I see fragmented segements from recv() calls.  
> > Is it  
> > unadjustable for E100 or am I doing something wrong here?
> 
> Due to the design of the fpga interface, the largest transfer between  
> the fpga and gpp is 2048 bytes. Beyond this, Josh will need to comment 🙂

I didnt put in the hooks to change the frame size. It should be possible  
without too much fuss. Right now, the frame size defaults to the maximum  
size of the kernel ring buffer frames, or optimized for bandwidth. This  
hook would allow you to make the frames smaller (optimized for latency).  
Is that what you are looking for?

-Josh

---

<div class="post-metadata">

**Author:** ![Michael\_Dev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@Michael\_Dev](https://www.ruby-forum.com/u/Michael_Dev)\
**Post date:** [April 26, 2011, 9:07pm UTC](https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219/4 "2011-04-26T21:07:57Z")

</div>

On 04/25/2011 06:34 PM, Michael Dev wrote:

> Yes, improved latency with smaller frame size is what I’m looking for. 506  
> samples of buffering is pretty big for me. Also, being able to adjust the  
> frame size to a nice size for my app would mean I don’t have to have some  
> additional buffering code (and the code to ‘manufacture’ rx timestamps for  
> fragments that don’t come with timestamps) between the recv() call and  
> feeding the result to my app.

Can you try this branch:  
[http://code.ettus.com/redmine/ettus/projects/uhd/repository/show?rev=usrp\_e100\_frame\_sizes](http://code.ettus.com/redmine/ettus/projects/uhd/repository/show?rev=usrp_e100_frame_sizes)

-Josh

---

<div class="post-metadata">

**Author:** ![Michael\_Dev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@Michael\_Dev](https://www.ruby-forum.com/u/Michael_Dev)\
**Post date:** [April 27, 2011, 1:01am UTC](https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219/5 "2011-04-27T01:01:22Z")

</div>

It seg faults on me.  
Opening USRP-E on /dev/usrp\_e0  
USRP-E100 clock control: 6  
r\_counter: 1  
a\_counter: 0  
b\_counter: 12  
prescaler: 8  
vco\_divider: 2  
chan\_divider: 15  
vco\_rate: 1920.000000MHz  
chan\_rate: 960.000000MHz  
out\_rate: 64.000000MHz  
[New LWP 847]  
Program received signal SIGSEGV, Segmentation fault.  
[Switching to LWP 847]  
0x401ff524 in usrp\_e100\_impl::io\_impl::recv\_pirate\_loop (this=0x92e20,  
spawn\_barrier=, clock\_ctrl=…)  
at /home/root/uhd-new/uhd/host/lib/usrp/usrp\_e100/io\_impl.cpp:116  
116 managed\_recv\_buffer::sptr buff = this-\>data\_xport-\>get\_recv\_buff();

---

<div class="post-metadata">

**Author:** ![Michael\_Dev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@Michael\_Dev](https://www.ruby-forum.com/u/Michael_Dev)\
**Post date:** [April 27, 2011, 2:08am UTC](https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219/6 "2011-04-27T02:08:31Z")

</div>

> Program received signal SIGSEGV, Segmentation fault.  
> [Switching to LWP 847]  
> 0x401ff524 in usrp\_e100\_impl::io\_impl::recv\_pirate\_loop (this=0x92e20,  
> spawn\_barrier=, clock\_ctrl=…)  
> at /home/root/uhd-new/uhd/host/lib/usrp/usrp\_e100/io\_impl.cpp:116  
> 116 managed\_recv\_buffer::sptr buff = this-\>data\_xport-\>get\_recv\_buff();

Whoops, missed a & and stored the wrong reference to the shared pointer.  
Can you try this branch w/ fix (I ran it myself this time):  
[http://code.ettus.com/redmine/ettus/projects/uhd/repository/show?rev=usrp\_e100\_frame\_sizes2](http://code.ettus.com/redmine/ettus/projects/uhd/repository/show?rev=usrp_e100_frame_sizes2)

---

<div class="post-metadata">

**Author:** ![Michael\_Dev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@Michael\_Dev](https://www.ruby-forum.com/u/Michael_Dev)\
**Post date:** [April 26, 2011, 3:38am UTC](https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219/7 "2011-04-26T03:38:14Z")

</div>

Yes, improved latency with smaller frame size is what I’m looking for.  
506  
samples of buffering is pretty big for me. Also, being able to adjust  
the  
frame size to a nice size for my app would mean I don’t have to have  
some  
additional buffering code (and the code to ‘manufacture’ rx timestamps  
for  
fragments that don’t come with timestamps) between the recv() call and  
feeding the result to my app.

Michael

---

<div class="post-metadata">

**Author:** ![Michael\_Dev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@Michael\_Dev](https://www.ruby-forum.com/u/Michael_Dev)\
**Post date:** [April 27, 2011, 5:58am UTC](https://www.ruby-forum.com/t/uhds-recv-frame-size-for-e100/206219/8 "2011-04-27T05:58:58Z")

</div>

I was able to control the frame size with this build. That’s a good  
start.  
But my app is not able to demodulate the received signal like it used  
to. It  
works fine if I switch back to the regular libuhd. I double checked  
everything and I don’t think it’s due to my code.  
Another thing is that application of the “recv\_frame\_size” value is a  
bit  
off compared to the USB version. For example, with USB, when I specify  
1536,  
each packet will get me 1536/4 = 384 samples. For usrp-e with this  
build, I  
have to specify a number somewhat higher than 1536 to fit 384 samples.  
It  
may be due to the header size consideration? It would be good to have a  
more  
consistent application of this parameter if possible. Definitely not a  
biggie though. 🙂  
Michael
