Re: [Discuss-gnuradio] Accessing the ADI registers on B200mini

2018-03-27 Thread Firdavs Pulat
Hi Marcus,

I tried to use the set_agc_mode the same way, but I get an error during the
build process that says: 'class uhd::usrp::multi_usrp' has no member named
'set_agc_mode.' This API is in the ad9361_ctrl, but it seems to be looking
for it in multi_usrp. How would I include the ad9361_ctrl?

Also, is there a way to read what all the AD registers are set to so I know
the default values? When I use the getter functions (e.g.,
self.uhd_usrp_source_0.get_gain()) in the python code, it doesn't seem to
do anything.

Thank you


On Wed, Mar 21, 2018 at 1:26 PM, Marcus D. Leech <mle...@ripnet.com> wrote:

> On 03/21/2018 02:24 PM, Firdavs Pulat wrote:
>
> Hi Marcus,
>
> Thank you for your help and patience!
>
> Following your suggestion, I think I was able to turn the AGC on. Now, I'm
> wondering what mode it's running at (e.g., slow, fast, etc). Looking at the
> multi_usrp class, I don't see any API's to set the mode. But in the
> ad9361_ctrl class, I see an API called set_agc_mode. Can I use that API the
> same way I'm using set_rx_agc? I tried the following
> command: uhd_usrp_probe --string /mboards/0/dboards/A/rx_
> frontends/A/gain/agc/mode/value, and it returned 'slow', so I assume the
> default mode of AGC is slow?
>
> I know you said AGC isn't used by most applications, but the reason why
> I'm asking all of this is because our application was using the AD9361 chip
> and we were enabling AGC then, so I'm trying to do the same here with Ettus
> B200 since the RFIC is the same.
>
> Thanks!
>
> You should be able to use set_agc_mode() in the same way.
>
>
>
>
> On Tue, Mar 20, 2018 at 3:11 PM, Marcus D. Leech <mle...@ripnet.com>
> wrote:
>
>> On 03/20/2018 03:27 PM, Firdavs Pulat wrote:
>>
>> Hi Marcus,
>>
>> Could you please elaborate on the "extend the Gnu Radio multi_usrp" part?
>> Maybe you could point me to some examples one how to set these (I assume
>> others must have played around with them since it's so essential), or
>> documentation on how that's done? I'm just not sure where/how in the
>> usrp_source impl source code I would set them. I have been looking online,
>> but haven't found anything of use yet.
>>
>> Thank you!
>>
>> In the Gnu Radio source code, in gr_uhd/usrp_source_impl.cc
>>
>> If you look at any of the setter functions for various device parameters,
>> you'd pattern your call to set_rx_agc() after one of those.  The
>> lowest-impact
>>   way to do it would be to "hijack" the existing gain-setting function,
>> and have it look for "magic" gain value that then turns on hardware AGC
>>   via the set_rx_agc() function.
>>
>> In reality, very few applications use the hardware AGC in the chip, which
>> is one of the reasons that it hasn't yet been "mapped" into the GR
>>   API wrapper.
>>
>>
>>
>>
>> On Thu, Mar 8, 2018 at 10:58 AM, Marcus D. Leech <mle...@ripnet.com>
>> wrote:
>>
>>> On 03/08/2018 10:43 AM, Firdavs Pulat wrote:
>>>
>>>> Hi all,
>>>>
>>>> Are there APIs as part of gnuradio that give access to the low level
>>>> ADI registers (to both probe, and set)? For instance, I'm trying to see if
>>>> the AGC is currently turned on on B200mini, and if it's, what kind of mode
>>>> it is on (e.g., slow or fast). Looking at it the USRP manual online, I see
>>>> functions like set_agc, set_agc_mode, etc. I just don't have any idea
>>>> how/where to actually use/set these. Could anyone please help me out?
>>>>
>>>> Thanks!
>>>>
>>>>
>>>> No need to tinker with ADI registers.
>>>
>>> The multi_usrp API provides access to a set_rx_agc function:
>>>
>>> https://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__us
>>> rp.html#abdab1f6c3775a9071b15c9805f866486
>>>
>>> However, you'd have to extend the Gnu Radio multi_usrp "wrapper" (in
>>> gr-uhd in the main Gnu Radio codebase) to provide access to set_rx_agc().
>>>
>>> Note that in many cases, hardware AGC doesn't really work the way you'd
>>> like it to, since its "world view" may be very very different than the view
>>>   of your particular application.
>>>
>>>
>>>
>>>
>>> ___
>>> Discuss-gnuradio mailing list
>>> Discuss-gnuradio@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>>
>>
>>
>>
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Accessing the ADI registers on B200mini

2018-03-21 Thread Firdavs Pulat
Hi Marcus,

Thank you for your help and patience!

Following your suggestion, I think I was able to turn the AGC on. Now, I'm
wondering what mode it's running at (e.g., slow, fast, etc). Looking at the
multi_usrp class, I don't see any API's to set the mode. But in the
ad9361_ctrl class, I see an API called set_agc_mode. Can I use that API the
same way I'm using set_rx_agc? I tried the following
command: uhd_usrp_probe --string
/mboards/0/dboards/A/rx_frontends/A/gain/agc/mode/value, and it returned
'slow', so I assume the default mode of AGC is slow?

I know you said AGC isn't used by most applications, but the reason why I'm
asking all of this is because our application was using the AD9361 chip and
we were enabling AGC then, so I'm trying to do the same here with Ettus
B200 since the RFIC is the same.

Thanks!


On Tue, Mar 20, 2018 at 3:11 PM, Marcus D. Leech <mle...@ripnet.com> wrote:

> On 03/20/2018 03:27 PM, Firdavs Pulat wrote:
>
> Hi Marcus,
>
> Could you please elaborate on the "extend the Gnu Radio multi_usrp" part?
> Maybe you could point me to some examples one how to set these (I assume
> others must have played around with them since it's so essential), or
> documentation on how that's done? I'm just not sure where/how in the
> usrp_source impl source code I would set them. I have been looking online,
> but haven't found anything of use yet.
>
> Thank you!
>
> In the Gnu Radio source code, in gr_uhd/usrp_source_impl.cc
>
> If you look at any of the setter functions for various device parameters,
> you'd pattern your call to set_rx_agc() after one of those.  The
> lowest-impact
>   way to do it would be to "hijack" the existing gain-setting function,
> and have it look for "magic" gain value that then turns on hardware AGC
>   via the set_rx_agc() function.
>
> In reality, very few applications use the hardware AGC in the chip, which
> is one of the reasons that it hasn't yet been "mapped" into the GR
>   API wrapper.
>
>
>
>
> On Thu, Mar 8, 2018 at 10:58 AM, Marcus D. Leech <mle...@ripnet.com>
> wrote:
>
>> On 03/08/2018 10:43 AM, Firdavs Pulat wrote:
>>
>>> Hi all,
>>>
>>> Are there APIs as part of gnuradio that give access to the low level ADI
>>> registers (to both probe, and set)? For instance, I'm trying to see if the
>>> AGC is currently turned on on B200mini, and if it's, what kind of mode it
>>> is on (e.g., slow or fast). Looking at it the USRP manual online, I see
>>> functions like set_agc, set_agc_mode, etc. I just don't have any idea
>>> how/where to actually use/set these. Could anyone please help me out?
>>>
>>> Thanks!
>>>
>>>
>>> No need to tinker with ADI registers.
>>
>> The multi_usrp API provides access to a set_rx_agc function:
>>
>> https://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__us
>> rp.html#abdab1f6c3775a9071b15c9805f866486
>>
>> However, you'd have to extend the Gnu Radio multi_usrp "wrapper" (in
>> gr-uhd in the main Gnu Radio codebase) to provide access to set_rx_agc().
>>
>> Note that in many cases, hardware AGC doesn't really work the way you'd
>> like it to, since its "world view" may be very very different than the view
>>   of your particular application.
>>
>>
>>
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Accessing the ADI registers on B200mini

2018-03-20 Thread Firdavs Pulat
Hi Marcus,

Could you please elaborate on the "extend the Gnu Radio multi_usrp" part?
Maybe you could point me to some examples one how to set these (I assume
others must have played around with them since it's so essential), or
documentation on how that's done? I'm just not sure where/how in the
usrp_source impl source code I would set them. I have been looking online,
but haven't found anything of use yet.

Thank you!


On Thu, Mar 8, 2018 at 10:58 AM, Marcus D. Leech <mle...@ripnet.com> wrote:

> On 03/08/2018 10:43 AM, Firdavs Pulat wrote:
>
>> Hi all,
>>
>> Are there APIs as part of gnuradio that give access to the low level ADI
>> registers (to both probe, and set)? For instance, I'm trying to see if the
>> AGC is currently turned on on B200mini, and if it's, what kind of mode it
>> is on (e.g., slow or fast). Looking at it the USRP manual online, I see
>> functions like set_agc, set_agc_mode, etc. I just don't have any idea
>> how/where to actually use/set these. Could anyone please help me out?
>>
>> Thanks!
>>
>>
>> No need to tinker with ADI registers.
>
> The multi_usrp API provides access to a set_rx_agc function:
>
> https://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__
> usrp.html#abdab1f6c3775a9071b15c9805f866486
>
> However, you'd have to extend the Gnu Radio multi_usrp "wrapper" (in
> gr-uhd in the main Gnu Radio codebase) to provide access to set_rx_agc().
>
> Note that in many cases, hardware AGC doesn't really work the way you'd
> like it to, since its "world view" may be very very different than the view
>   of your particular application.
>
>
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Accessing the ADI registers on B200mini

2018-03-08 Thread Firdavs Pulat
Hi all,

Are there APIs as part of gnuradio that give access to the low level ADI
registers (to both probe, and set)? For instance, I'm trying to see if the
AGC is currently turned on on B200mini, and if it's, what kind of mode it
is on (e.g., slow or fast). Looking at it the USRP manual online, I see
functions like set_agc, set_agc_mode, etc. I just don't have any idea
how/where to actually use/set these. Could anyone please help me out?

Thanks!
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] UDP Sink sending bursty packets

2018-03-04 Thread Firdavs Pulat
The data rate I'm dealing with is ~30 Mbytes/s. Receiver should be able to
keep up with the required data rates (but barely), but it wasn't designed
to work with Ethernet packets, so it's having a hard time due to the bursty
nature of the incoming UDP packets. On top of that, it's got limited rx
buffer.

I was really hoping I could handle this in GnuRadio, but it sounds like I
need to figure out a different way. Thanks for the suggestions!


On Sun, Mar 4, 2018 at 6:50 PM, Michael Piscopo <mike.pisc...@gmail.com>
wrote:

> I think if you want to smooth it out, you'll need to add the packets to a
> custom queue and use your own transmit thread rather than trying to do it
> all in the work function.  That way you can send consistent-sized packets
> and adjust the per-packet timing if you need to.
>
>
>
> On Sun, Mar 4, 2018 at 7:23 PM, Firdavs Pulat <firda...@gmail.com> wrote:
>
>> Setting it on the UDP itself didn't change the behavior either. Do you
>> (or anyone else) have any other ideas?
>>
>> Thank you
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>  Virus-free.
>> www.avast.com
>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>> <#m_-8113279904684015709_m_-4079682633075123343_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> On Sun, Mar 4, 2018 at 5:16 PM, Jeff Long <willco...@gmail.com> wrote:
>>
>>> I think you'd want to set that on the UDP sink itself.
>>>
>>> On 03/04/2018 01:30 PM, Firdavs Pulat wrote:
>>>
>>>> Thanks for the suggestion, Jeff. Unfortunately, that didn't seem to
>>>> help. I still see bursty packet transmission.
>>>>
>>>> Btw, currently I have: USRP source --> Low-Pass Filter -->
>>>> ComplexToInterleavedShort --> Endian Swap --> UDP Sink. I added the
>>>> set_max_noutput_items line at the output of the Endian Swap block since
>>>> that would be the input to UDP. Is that the only place where I would have
>>>> to make that change, or on all the blocks?
>>>>
>>>> Thanks!
>>>>
>>>>
>>>> <https://www.avast.com/sig-email?utm_medium=email_source
>>>> =link_campaign=sig-email_content=webmail_term=icon>
>>>>  Virus-free. www.avast.com <https://www.avast.com/sig-ema
>>>> il?utm_medium=email_source=link_campaign=sig-email
>>>> tm_content=webmail_term=link>
>>>>
>>>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>>
>>>>
>>>> On Sun, Mar 4, 2018 at 6:44 AM, Jeff Long <willco...@gmail.com >>> willco...@gmail.com>> wrote:
>>>>
>>>> Try yourblock.set_max_noutput_items(1024/itemsize)
>>>>
>>>>
>>>> On 03/03/2018 09:57 PM, Firdavs Pulat wrote:
>>>>
>>>> Hello everyone,
>>>>
>>>> I have a B200mini device I'm communicating over USB to a pc
>>>> which is running the gnuradio software. The gnuradio does some
>>>> processing (e.g., low-pass filtering, data type conversion,
>>>> etc), and finally gets to the UDP sink block where packets are
>>>> generated and sent through Ethernet to an external device. The
>>>> issue I'm having is that, in the UDP block,
>>>> noutput_items*d_itemsize size is alot larger than the UDP
>>>> payload size (1024 bytes). So, UDP gets 4-6K worth of bytes and
>>>> bursts it all out really fast (I can see this behavior in
>>>> Wireshark), then waits to buffer up another 4-6K bytes, and
>>>> sends it all out really fast. This process then continues. Is
>>>> there a way to smooth this out so that it's not bursting bunch
>>>> of packets all at once? Otherwise the external device isn't able
>>>> to keep up and it's leading to tons of dropped packets.
>>>>
>>>> I tried setting the max output buffer in python but I get this
>>>> warning when I run: gr::log :WARN: flat_flowgraph - Block
>>>> (endian_swap_impl0) max output buffer set to 2048 instead of
>>>> requested 512.
>>>>
>>>> Any ideas on what I can do to change this behaviour?
>>>>
>>>> Thanks!
>>>>
>>>>
>>>>
>>>> ___

Re: [Discuss-gnuradio] UDP Sink sending bursty packets

2018-03-04 Thread Firdavs Pulat
Setting it on the UDP itself didn't change the behavior either. Do you (or
anyone else) have any other ideas?

Thank you

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sun, Mar 4, 2018 at 5:16 PM, Jeff Long <willco...@gmail.com> wrote:

> I think you'd want to set that on the UDP sink itself.
>
> On 03/04/2018 01:30 PM, Firdavs Pulat wrote:
>
>> Thanks for the suggestion, Jeff. Unfortunately, that didn't seem to help.
>> I still see bursty packet transmission.
>>
>> Btw, currently I have: USRP source --> Low-Pass Filter -->
>> ComplexToInterleavedShort --> Endian Swap --> UDP Sink. I added the
>> set_max_noutput_items line at the output of the Endian Swap block since
>> that would be the input to UDP. Is that the only place where I would have
>> to make that change, or on all the blocks?
>>
>> Thanks!
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email_source
>> =link_campaign=sig-email_content=webmail_term=icon>
>>  Virus-free. www.avast.com <https://www.avast.com/sig-ema
>> il?utm_medium=email_source=link_campaign=sig-email&
>> utm_content=webmail_term=link>
>>
>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>>
>> On Sun, Mar 4, 2018 at 6:44 AM, Jeff Long <willco...@gmail.com > willco...@gmail.com>> wrote:
>>
>> Try yourblock.set_max_noutput_items(1024/itemsize)
>>
>>
>> On 03/03/2018 09:57 PM, Firdavs Pulat wrote:
>>
>> Hello everyone,
>>
>> I have a B200mini device I'm communicating over USB to a pc
>> which is running the gnuradio software. The gnuradio does some
>> processing (e.g., low-pass filtering, data type conversion,
>> etc), and finally gets to the UDP sink block where packets are
>> generated and sent through Ethernet to an external device. The
>> issue I'm having is that, in the UDP block,
>> noutput_items*d_itemsize size is alot larger than the UDP
>> payload size (1024 bytes). So, UDP gets 4-6K worth of bytes and
>> bursts it all out really fast (I can see this behavior in
>> Wireshark), then waits to buffer up another 4-6K bytes, and
>> sends it all out really fast. This process then continues. Is
>> there a way to smooth this out so that it's not bursting bunch
>> of packets all at once? Otherwise the external device isn't able
>> to keep up and it's leading to tons of dropped packets.
>>
>> I tried setting the max output buffer in python but I get this
>> warning when I run: gr::log :WARN: flat_flowgraph - Block
>> (endian_swap_impl0) max output buffer set to 2048 instead of
>> requested 512.
>>
>> Any ideas on what I can do to change this behaviour?
>>
>> Thanks!
>>
>>
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org <mailto:Discuss-gnuradio@gnu.org>
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>> <https://lists.gnu.org/mailman/listinfo/discuss-gnuradio>
>>
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org <mailto:Discuss-gnuradio@gnu.org>
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>> <https://lists.gnu.org/mailman/listinfo/discuss-gnuradio>
>>
>>
>>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] UDP Sink sending bursty packets

2018-03-04 Thread Firdavs Pulat
Thanks for the suggestion, Jeff. Unfortunately, that didn't seem to help. I
still see bursty packet transmission.

Btw, currently I have: USRP source --> Low-Pass Filter -->
ComplexToInterleavedShort --> Endian Swap --> UDP Sink. I added the
set_max_noutput_items line at the output of the Endian Swap block since
that would be the input to UDP. Is that the only place where I would have
to make that change, or on all the blocks?

Thanks!


<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sun, Mar 4, 2018 at 6:44 AM, Jeff Long <willco...@gmail.com> wrote:

> Try yourblock.set_max_noutput_items(1024/itemsize)
>
>
> On 03/03/2018 09:57 PM, Firdavs Pulat wrote:
>
>> Hello everyone,
>>
>> I have a B200mini device I'm communicating over USB to a pc which is
>> running the gnuradio software. The gnuradio does some processing (e.g.,
>> low-pass filtering, data type conversion, etc), and finally gets to the UDP
>> sink block where packets are generated and sent through Ethernet to an
>> external device. The issue I'm having is that, in the UDP block,
>> noutput_items*d_itemsize size is alot larger than the UDP payload size
>> (1024 bytes). So, UDP gets 4-6K worth of bytes and bursts it all out really
>> fast (I can see this behavior in Wireshark), then waits to buffer up
>> another 4-6K bytes, and sends it all out really fast. This process then
>> continues. Is there a way to smooth this out so that it's not bursting
>> bunch of packets all at once? Otherwise the external device isn't able to
>> keep up and it's leading to tons of dropped packets.
>>
>> I tried setting the max output buffer in python but I get this warning
>> when I run: gr::log :WARN: flat_flowgraph - Block (endian_swap_impl0) max
>> output buffer set to 2048 instead of requested 512.
>>
>> Any ideas on what I can do to change this behaviour?
>>
>> Thanks!
>>
>>
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] UDP Sink sending bursty packets

2018-03-03 Thread Firdavs Pulat
Hello everyone,

I have a B200mini device I'm communicating over USB to a pc which is
running the gnuradio software. The gnuradio does some processing (e.g.,
low-pass filtering, data type conversion, etc), and finally gets to the UDP
sink block where packets are generated and sent through Ethernet to an
external device. The issue I'm having is that, in the UDP block,
noutput_items*d_itemsize size is alot larger than the UDP payload size
(1024 bytes). So, UDP gets 4-6K worth of bytes and bursts it all out really
fast (I can see this behavior in Wireshark), then waits to buffer up
another 4-6K bytes, and sends it all out really fast. This process then
continues. Is there a way to smooth this out so that it's not bursting
bunch of packets all at once? Otherwise the external device isn't able to
keep up and it's leading to tons of dropped packets.

I tried setting the max output buffer in python but I get this warning when
I run: gr::log :WARN: flat_flowgraph - Block (endian_swap_impl0) max output
buffer set to 2048 instead of requested 512.

Any ideas on what I can do to change this behaviour?

Thanks!
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio