Uhd::tune_result_t vs. usrp2::tune_result

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,

I’m currently trying to adapt the

gnuradio-core/src/python/gnuradio/blks2impl/generic_usrp.py

to work with the gr-uhd modules to (re)enable the use of UHD with the
gnuradio-examples/python/digital stuff.

I’m a bit confused with the return value of the set_center_freq of the
uhd_single_usrp_source.

What I tried was to map the values of the uhd::tune_result_t into a
usrp_tune_result. Does this make any sense to you guys? :wink:

Another question that arose while looking at the code concerns the
change in the way we set the sample rate:

Why do we have in the new UHD source:

set_samp_rate (double rate)

versus:

set_decim (int decimation_factor)

in the old USRP source?

Thanks for your time again & happy hacking

  • -Moritz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM7mLVAAoJEOjnDXL6I0uZpHMP/28s/A98djBGYaeanGp54MXY
khFV6Ltx0vsCNv6Uf4oJTsBdxhcqPX3x3YYbXCf5k7MXyQXxj23OrHVMtl2niVbc
kbh2V710OTQEIC940ARrumPVTVDJ+A8vN76XGGGowZtJjMGaPYb20vyKkhqN5FWC
k6+xhi/DUBCWIWWE/fyefP0zl3VhSIbV4L5zjWtoX/A1NTeTKZsq+UcsKz6ZVDCl
UmZPBvav2PAIYpo99zvB3qZcxCPaGata09ZKsV03OeiUKG9yI1yUCXgj5tzhRNs2
dJFIAJAhkvI4rzV/GCYHI2WUuql758iCCPTbE4DLYBzyST/Eg5h1jveQetObIGpy
PGMRGKv4jXg3BUQN6gxrI7SN2ZGSs8i+oxJdmu7pr1Zwnc3DxAVX9HgupfjARray
MbO9RqbFKPoaWSwIJj6/SpNvVb/0b9zHPrN2UQWW31LfL4NS/3Ku5iTf3Fm5lx8l
7qLg+vJ4K35FO0iV/WIrOu+SHLPE8jiqlaaOgMC2pFfpqueLIMf5EXn0usiDgLjl
IrvdxBzvMfPI4H+4UiNoMq3OD9v0jBFvaIGcFqPmVlqKr93N/GNT/sRYgxxOIXpw
+4nzu5sRB2uFJa+4ABUs6RrJ8QvSzzkZW72rXk0hYNygn8IuUX8YkQMgifEQ19KZ
WLgxSrO5FnWPUkYL+X7i
=EbAB
-----END PGP SIGNATURE-----

to work with the gr-uhd modules to (re)enable the use of UHD with the
gnuradio-examples/python/digital stuff.

awesome

I’m a bit confused with the return value of the set_center_freq of the
uhd_single_usrp_source.

What I tried was to map the values of the uhd::tune_result_t into a
usrp_tune_result. Does this make any sense to you guys? :wink:

Its not quite a 1:1 mapping. I dont believe that any of the examples
that use generic USRP even bother to look at the tune result. I would
ignore this.

Another question that arose while looking at the code concerns the
change in the way we set the sample rate:

In UHD, you set the sample rate. However for usrp2 and usrp1 gnuradio
drivers, you set the decimation and interpolation and the sample rate is
implied to be codec_rate/decim.

I see two options:

  1. change the options for the generic usrp to take a sample rate and
    internally (in generic_usrp.py) translate this into a
    decimation/interpolation number for non UHD case.

or 2) add a new option that specifies the codec rate that can be used to
calculate the sample rate from decim/interp for the UHD case.

-josh

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/25/2010 05:44 PM, Josh B. wrote:

In UHD, you set the sample rate. However for usrp2 and usrp1 gnuradio
drivers, you set the decimation and interpolation and the sample rate is
implied to be codec_rate/decim.

Ok, I got it working now for some of the demos (benchmark_tx/rx),
however it’s far from looking nice enough for a merge :wink:

While looking at the code I was wondering whether
we still have to support the ‘legacy’ interface on next.

If not, I’ll attempt to throw out the old stuff from the digital
examples and just use the uhd sources/sinks for the examples;UHD should,
if compiled with support for USRP1, automatically select the right
sources/sinks as far as I know(?) at least that’s what it does in my
tests.

Now if I connect say two USRP2s and one USRP1, is there any way to
influence the order in which they’ll be selected? For the USRP2s the
‘addr=…’ parameter seems to work, but how would I do the same to
select one USRP2 and one USRP1?

And now for something completely different :wink:

While playing with the USRP1 it occured to me, that I had to manually
copy the std.ihx from $PREFIX/share/usrp/rev4/std.ihx to
$PREFIX/share/uhd/images/usrp1_fw.ihx in order to get UHD to find the
USRP1.

Looking at line 64 and following in host/lib/usrp/usrp1/usrp1_impl.cpp
in UHD, if I got it right, we search for a file called ‘usrp1_fw.ihx’.

Did I miss some under the hood magic or is this file ‘missing’ in the
images package?

Again thanks and happy hacking,

Moritz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM78maAAoJEOjnDXL6I0uZB2AP/2p2+nu0YAl4EiySXNGpjUc8
bwXgz4wwheoeFlTmNrI3c6I2swePyFaeXq8nSRGiKy5N0LbQmlhfsKnCB3Nyq59q
d+9y6gq4v6XCazjXNrz3uK1/tI9tbZU3oKPRxy1kMCfBZzNM5369U906sa42uHEw
RCC3IzEr69V8asxHM31BYapdivt2r1lrH1oY7MQxkbA09NKerlW3ln8ltIYnoxj1
OMPeR3Ed0ve6Fz72TRaB0EgewVxXwujmpnyRTlZDEx0RaNSc4iBZICE4kPRxnn4L
HJ0B2hsURUXZhGPOZMSlD39Q0iY/bGC/wJje+ZVRyHy7j+Q00GiL9bzWTWZwPKVE
SKiQbs0Ni6zu1Z4Q9F5JPs6uz7hBu+PbqC2CkOramu1+9r6u+O7EitaKrcj+tUs5
9+1Hoh5xi15hel2/mtkmN+/rG/E2X0IiLGu9goib4BAvVtslZXUB+gpvskq43Jl4
96kmCH4Sha4dzGM6IExfpbMrv2Grd4Kw+r6e7q75r/Orr1+JWG6Y65tY9xCm0qq0
TSyRS+JwL1dTgzT8ml8ZrOsPpTrTdK8o2r7fxEGTr+7JCq2z4WH1j9mP6miEYLRI
q0KrAfh8+zb0CDNc4TIpsWXGNbCd3O9V6uICy1IXK4XYgNLNLH91xZlRtk5JaQYM
OvQbHIpQ8/oQPijWul9V
=F+ws
-----END PGP SIGNATURE-----