USRP source gain problems?

I am trying to read samples from the USRP and the only samples I
receive back are integers between -2 and 2; not the -1500 to 1500 that
I get when running the samples.

As far as I can tell there is no difference between my set up and the
examples, I initialize the subdevice, set the gain choose the antenna,
and tune the receiver, but I only get the
very small integer values, whats wrong?

ur = usrp.source_c(0,rx_decim_rate)

rx_sd = (1,0) #manually choose the correct device

#Set up the USRP mux values
r_subdev = usrp.selected_subdev(ur, rx_sd)
m = usrp.determine_rx_mux_value(ur, rx_sd)
ur.set_mux(m)

r = r_subdev.gain_range()
r_subdev.set_gain((r[0] + r[1])/2)

r_subdev.select_rx_antenna( ‘RX2’)
r = ur.tune(r_subdev._which, r_subdev, 24e8)

On Mon, Jul 21, 2008 at 05:59:23PM -0500, Jason U. wrote:

r_subdev.select_rx_antenna( ‘RX2’)
r = ur.tune(r_subdev._which, r_subdev, 24e8)

I don’t know if this is a problem, but you’re not checking for errors
after any of the calls.

This should be:

r = ur.tune(0, r_subdev, 24e8)

Eric

On Mon, Jul 21, 2008 at 6:42 PM, Jason U. [email protected] wrote:

tune(0,r_subdev,24e8) produced no changes in the output.

Also I am checking, I just cut it out to keep the post short :wink:

Thanks for your help,

Jason

I checked again and, of course, the one value I wasn’t checking
failed, set_gain return an empty value consistently.

Jason

On Mon, Jul 21, 2008 at 07:31:24PM -0500, Jason U. wrote:

tune(0,r_subdev,24e8) produced no changes in the output.

Also I am checking, I just cut it out to keep the post short :wink:

Thanks for your help,

Jason

I checked again and, of course, the one value I wasn’t checking
failed, set_gain return an empty value consistently.

It could be that we’re not returning that value correctly.
There’s an open ticket on that one.

If you run usrp_fft.py or usrp_oscope.py do you see the signal you
expect?

Eric

It could be that we’re not returning that value correctly.
There’s an open ticket on that one.

Actually, yes. I noticed that it returns None in all of the other
working examples as well so I just assumed it wasn’t the problem and
went back to work.

Oddly enough I was able to solve the problem by making my
initialization code an inherited class from top_block (as is done in
some of the examples) rather than a function that returns a created
top_block (which always worked before).

Thanks again,

Jason