Problem using TVRX2 on multiple channels

Hello,

I’m using Ubuntu 11.10, UHD 003.004.000, the USRP N210, and the TVRX2
card.

I am trying to use both the receive channels at once but I am getting a
strange error.

Below is my code:

            self.Add(self.wxgui_fftsink2_0.win)
self.uhd_usrp_source_0 = uhd.usrp_source(
  device_addr="",
  stream_args=uhd.stream_args(
    cpu_format="fc32",
    channels=range(2),
  ),
)

self.uhd_usrp_source_0.set_samp_rate(samp_rate)
self.uhd_usrp_source_0.set_center_freq(509e6, 0)
self.uhd_usrp_source_0.set_gain(3, 0)
self.uhd_usrp_source_0.set_center_freq(593e6, 1)
self.uhd_usrp_source_0.set_gain(3, 1)

However, when I run code that has this, I get this error:

Traceback (most recent call last):
File “/home/shea/top_block.py”, line 97, in
tb = top_block()
File “/home/shea/top_block.py”, line 76, in init
self.uhd_usrp_source_0.set_center_freq(509000000, 1)
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/uhd/uhd_swig.py”,
line 1846, in set_center_freq
return _uhd_swig.uhd_usrp_source_sptr_set_center_freq(self, *args)
RuntimeError: vector::_M_range_check

It seems like it isnt letting me instantiate multiple channels. It
doesn’t
work in Gnuradio Companion either and I get the same error message.
Does
anyone have any ideas what could be going wrong?

I can give any more information you need.

Thanks!
SW

View this message in context:
http://old.nabble.com/Problem-using-TVRX2-on-multiple-channels-tp33392627p33392627.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Sat, Feb 25, 2012 at 3:16 PM, shea_watson [email protected]
wrote:

   self.Add(self.wxgui_fftsink2_0.win)
   self.uhd_usrp_source_0.set_gain(3, 0)
   self.uhd_usrp_source_0.set_center_freq(593e6, 1)
   self.uhd_usrp_source_0.set_gain(3, 1)

My best guess is that you need to call

self.uhd_usrp_source_0.set_subdev_spec(‘A:RXA’, 0)
self.uhd_usrp_source_0.set_subdev_spec(‘A:RXB’, 1)

before you call set_center_freq() or set_gain(). Otherwise, the
usrp.source has no idea which tuner to address.

Jason

Now i’m getting another error that i wasn’t getting before…

Exception in thread Thread-2:
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 552, in __bootstrap_inner
self.run()
File “./runDTVPos.py”, line 333, in run
tb = collect_double_tb(f0,filename0,f1,filename1,nsamples)
File
“/home/shea/Dropbox/SDP/Shea/DTVPos/Code/USRP_collection_double.py”,
line 38, in init
channels=range(2),
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/uhd/init.py”,
line 112, in constructor_interceptor
return old_constructor(*args)
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/uhd/uhd_swig.py”,
line 2826, in usrp_source
return _uhd_swig.usrp_source(*args)
RuntimeError: Operation not permitted

Am I not calling the constructor for the source right?

Jason A. wrote:

strange error.
)
self.uhd_usrp_source_0.set_subdev_spec(‘A:RXB’, 1)
Traceback (most recent call last):

View this message in context:
Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


View this message in context:
http://old.nabble.com/Problem-using-TVRX2-on-multiple-channels-tp33392627p33392962.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On 25/02/12 09:00 PM, shea_watson wrote:

channels=range(2),

This GRC flow-graph works just fine with two TVRX2 channels, albeit,
specifying a B100 platform.
(I’ve attached them).

This is with the latest UHD + Gnu Radio, fresh from GIT as of a couple
of days ago.

!

It was this line that I needed:

self.uhd_usrp_source_0.set_subdev_spec("A:RX1 A:RX2", 0)

Also, I had to update my UHD drivers. Must’ve been broken somewhere.

Thanks!
SW

mleech wrote:

File

Gnuradio Python Flow Graph

from gnuradio.wxgui import fftsink2

  baseband_freq=0,
  peak_hold=False,
  fft_size=1024,
    cpu_format="fc32",
##################################################
self.uhd_usrp_source_0.set_samp_rate(self.samp_rate)

Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


View this message in context:
http://old.nabble.com/Problem-using-TVRX2-on-multiple-channels-tp33392627p33393143.html
Sent from the GnuRadio mailing list archive at Nabble.com.