usrp-users@lists.ettus.com

Discussion and technical support related to USRP, UHD, RFNoC

View all threads

B210 with two 8 bit streams, output is all 0's

HJ
Heiko Jones
Mon, Jul 25, 2016 4:21 PM

I am trying to get a B210 to give me two 8 bit streams at the same time.
All I get is hard zeros, yet with the exact same hardware setup and signal,
but using 16 bits, I get data. I can verify the correct green leds come on,
so it is not the subdev spec or number of channels, I dont think. I have
tried all sorts of stuff, including loading the latest (as of friday) code
from git. Another thing to note, the 8 bit works fine if you just want one
stream!!  Anybody else tried this???

I am including the simple python code, which is just a modified output file
from gnuradio_companion. It sends the two streams to seperate tcp sockets,
so I can archive the streams on a machine with a fast raid setup. Note the
sc8 in uhd.stream_args() and the gr.sizeof_char*2 in grc_blks2.tcp_sink(),
if you change those to sc16 and sizeof_short, it will work...

Heiko

#!/usr/bin/env python2
##################################################

GNU Radio Python Flow Graph

Title: Top Block

Generated: Mon Jul 18 09:39:08 2016

##################################################

from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import uhd
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from grc_gnuradio import blks2 as grc_blks2
from optparse import OptionParser
import time

class top_block(gr.top_block):

def __init__(self):
    gr.top_block.__init__(self, "Top Block")

    ##################################################
    # Variables
    ##################################################
    self.samp_rate = samp_rate = 2500000
    self.freq_tune1 = freq_tune1 = 1.0e9
    self.freq_tune0 = freq_tune0 = 1.2e9

    ##################################################
    # Blocks
    ##################################################
    self.uhd_usrp_source_0 = uhd.usrp_source(
     ",".join(("serial=F61164,type=b200", "")),
     uhd.stream_args(
     cpu_format="sc8",
     otw_format="sc8",
     args="peak=0.03125",
     channels=range(2),
     ),
    )
    self.uhd_usrp_source_0.set_clock_source("external", 0)
    self.uhd_usrp_source_0.set_subdev_spec("A:A A:B", 0)
    self.uhd_usrp_source_0.set_antenna("RX2", 0)
    self.uhd_usrp_source_0.set_antenna("RX2", 1)
    print "Set sample rate to:", samp_rate
    self.uhd_usrp_source_0.set_samp_rate(samp_rate)
    print "Set freq 0 to:", freq_tune0
    self.uhd_usrp_source_0.set_center_freq(freq_tune0, 0)
    self.uhd_usrp_source_0.set_gain(0.5, 0)
    print "Set freq 1 to:", freq_tune1
    self.uhd_usrp_source_0.set_center_freq(freq_tune1, 1)
    self.uhd_usrp_source_0.set_gain(0.5, 1)
    print "Connect to 8224..."
    self.blks2_tcp_sink_0_1 = grc_blks2.tcp_sink(
     itemsize=gr.sizeof_char*2,
     addr="127.0.0.1",
     port=8224,
     server=True,
    )
    print "Connect to 8223..."
    self.blks2_tcp_sink_0_0 = grc_blks2.tcp_sink(
     itemsize=gr.sizeof_char*2,
     addr="127.0.0.1",
     port=8223,
     server=True,
    )
    print "Done setup..."

    ##################################################
    # Connections
    ##################################################
    self.connect((self.uhd_usrp_source_0, 0), (self.blks2_tcp_sink_0_0,

0))

    self.connect((self.uhd_usrp_source_0, 1), (self.blks2_tcp_sink_0_1,

0))

def get_samp_rate(self):
    return self.samp_rate

def set_samp_rate(self, samp_rate):
    self.samp_rate = samp_rate
    self.uhd_usrp_source_0.set_samp_rate(self.samp_rate)

def get_freq_tune1(self):
    return self.freq_tune1

def set_freq_tune1(self, freq_tune1):
    self.freq_tune1 = freq_tune1
    self.uhd_usrp_source_0.set_center_freq(self.freq_tune1, 1)

def get_freq_tune0(self):
    return self.freq_tune0

def set_freq_tune0(self, freq_tune0):
    self.freq_tune0 = freq_tune0
    self.uhd_usrp_source_0.set_center_freq(self.freq_tune0, 0)

if name == 'main':
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
(options, args) = parser.parse_args()
if gr.enable_realtime_scheduling() != gr.RT_OK:
print "Error: failed to enable realtime scheduling."
tb = top_block()
tb.start()
try:
raw_input('Press Enter to quit: ')
except EOFError:
pass
tb.stop()
tb.wait()

I am trying to get a B210 to give me two 8 bit streams at the same time. All I get is hard zeros, yet with the exact same hardware setup and signal, but using 16 bits, I get data. I can verify the correct green leds come on, so it is not the subdev spec or number of channels, I dont think. I have tried all sorts of stuff, including loading the latest (as of friday) code from git. Another thing to note, the 8 bit works fine if you just want one stream!! Anybody else tried this??? I am including the simple python code, which is just a modified output file from gnuradio_companion. It sends the two streams to seperate tcp sockets, so I can archive the streams on a machine with a fast raid setup. Note the sc8 in uhd.stream_args() and the gr.sizeof_char*2 in grc_blks2.tcp_sink(), if you change those to sc16 and sizeof_short, it will work... Heiko #!/usr/bin/env python2 ################################################## # GNU Radio Python Flow Graph # Title: Top Block # Generated: Mon Jul 18 09:39:08 2016 ################################################## from gnuradio import eng_notation from gnuradio import gr from gnuradio import uhd from gnuradio.eng_option import eng_option from gnuradio.filter import firdes from grc_gnuradio import blks2 as grc_blks2 from optparse import OptionParser import time class top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self, "Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 2500000 self.freq_tune1 = freq_tune1 = 1.0e9 self.freq_tune0 = freq_tune0 = 1.2e9 ################################################## # Blocks ################################################## self.uhd_usrp_source_0 = uhd.usrp_source( ",".join(("serial=F61164,type=b200", "")), uhd.stream_args( cpu_format="sc8", otw_format="sc8", args="peak=0.03125", channels=range(2), ), ) self.uhd_usrp_source_0.set_clock_source("external", 0) self.uhd_usrp_source_0.set_subdev_spec("A:A A:B", 0) self.uhd_usrp_source_0.set_antenna("RX2", 0) self.uhd_usrp_source_0.set_antenna("RX2", 1) print "Set sample rate to:", samp_rate self.uhd_usrp_source_0.set_samp_rate(samp_rate) print "Set freq 0 to:", freq_tune0 self.uhd_usrp_source_0.set_center_freq(freq_tune0, 0) self.uhd_usrp_source_0.set_gain(0.5, 0) print "Set freq 1 to:", freq_tune1 self.uhd_usrp_source_0.set_center_freq(freq_tune1, 1) self.uhd_usrp_source_0.set_gain(0.5, 1) print "Connect to 8224..." self.blks2_tcp_sink_0_1 = grc_blks2.tcp_sink( itemsize=gr.sizeof_char*2, addr="127.0.0.1", port=8224, server=True, ) print "Connect to 8223..." self.blks2_tcp_sink_0_0 = grc_blks2.tcp_sink( itemsize=gr.sizeof_char*2, addr="127.0.0.1", port=8223, server=True, ) print "Done setup..." ################################################## # Connections ################################################## self.connect((self.uhd_usrp_source_0, 0), (self.blks2_tcp_sink_0_0, 0)) self.connect((self.uhd_usrp_source_0, 1), (self.blks2_tcp_sink_0_1, 0)) def get_samp_rate(self): return self.samp_rate def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate self.uhd_usrp_source_0.set_samp_rate(self.samp_rate) def get_freq_tune1(self): return self.freq_tune1 def set_freq_tune1(self, freq_tune1): self.freq_tune1 = freq_tune1 self.uhd_usrp_source_0.set_center_freq(self.freq_tune1, 1) def get_freq_tune0(self): return self.freq_tune0 def set_freq_tune0(self, freq_tune0): self.freq_tune0 = freq_tune0 self.uhd_usrp_source_0.set_center_freq(self.freq_tune0, 0) if __name__ == '__main__': parser = OptionParser(option_class=eng_option, usage="%prog: [options]") (options, args) = parser.parse_args() if gr.enable_realtime_scheduling() != gr.RT_OK: print "Error: failed to enable realtime scheduling." tb = top_block() tb.start() try: raw_input('Press Enter to quit: ') except EOFError: pass tb.stop() tb.wait()
MM
Marcus Müller
Mon, Jul 25, 2016 4:43 PM

Hello Heiko,

could you share the full console output of a run of that flow graph?
(I'd separately ask, but that contains the UHD version, anyway)

You said it works when using sc16; does that mean otw=sc16,cpu=sc16, or
otw=sc8,cpu=sc16 ? Generally, I'm a bit confused about the "peak"
setting – this might really be the issue here; if you remove peak=0....,
does the situation change?

As a GNU Radio note: the blocks in blks2 are terribly organized, old
python blocks; I don't know how long they are still going to be around.
I'd personally recommend using ZMQ (e.g. ZMQ REP sink on this machine,
and ZMQ REQ source on your storage machine, or any self-written ZMQ
request socket program) instead, or the UDP sinks (UDP is totally
sufficient, if your network is reliable – USRPs with network interfaces
also use UDP, and under normal, non-overflow circumstances, no packets
are lost).

Best regards,

Marcus

On 25.07.2016 18:21, Heiko Jones via USRP-users wrote:

I am trying to get a B210 to give me two 8 bit streams at the same
time. All I get is hard zeros, yet with the exact same hardware setup
and signal, but using 16 bits, I get data. I can verify the correct
green leds come on, so it is not the subdev spec or number of
channels, I dont think. I have tried all sorts of stuff, including
loading the latest (as of friday) code from git. Another thing to
note, the 8 bit works fine if you just want one stream!!  Anybody else
tried this???

I am including the simple python code, which is just a modified output
file from gnuradio_companion. It sends the two streams to seperate tcp
sockets, so I can archive the streams on a machine with a fast raid
setup. Note the sc8 in uhd.stream_args() and the gr.sizeof_char*2
in grc_blks2.tcp_sink(), if you change those to sc16 and sizeof_short,
it will work...

Heiko

#!/usr/bin/env python2
##################################################

GNU Radio Python Flow Graph

Title: Top Block

Generated: Mon Jul 18 09:39:08 2016

##################################################

from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import uhd
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from grc_gnuradio import blks2 as grc_blks2
from optparse import OptionParser
import time

class top_block(gr.top_block):

 def __init__(self):
     gr.top_block.__init__(self, "Top Block")

     ##################################################
     # Variables
     ##################################################
     self.samp_rate = samp_rate = 2500000
     self.freq_tune1 = freq_tune1 = 1.0e9
     self.freq_tune0 = freq_tune0 = 1.2e9

     ##################################################
     # Blocks
     ##################################################
     self.uhd_usrp_source_0 = uhd.usrp_source(
     ",".join(("serial=F61164,type=b200", "")),
     uhd.stream_args(
     cpu_format="sc8",
     otw_format="sc8",
     args="peak=0.03125",
     channels=range(2),
     ),
     )
     self.uhd_usrp_source_0.set_clock_source("external", 0)
     self.uhd_usrp_source_0.set_subdev_spec("A:A A:B", 0)
     self.uhd_usrp_source_0.set_antenna("RX2", 0)
     self.uhd_usrp_source_0.set_antenna("RX2", 1)
     print "Set sample rate to:", samp_rate
     self.uhd_usrp_source_0.set_samp_rate(samp_rate)
     print "Set freq 0 to:", freq_tune0
     self.uhd_usrp_source_0.set_center_freq(freq_tune0, 0)
     self.uhd_usrp_source_0.set_gain(0.5, 0)
     print "Set freq 1 to:", freq_tune1
     self.uhd_usrp_source_0.set_center_freq(freq_tune1, 1)
     self.uhd_usrp_source_0.set_gain(0.5, 1)
     print "Connect to 8224..."
     self.blks2_tcp_sink_0_1 = grc_blks2.tcp_sink(
     itemsize=gr.sizeof_char*2,
     addr="127.0.0.1",
     port=8224,
     server=True,
     )
     print "Connect to 8223..."
     self.blks2_tcp_sink_0_0 = grc_blks2.tcp_sink(
     itemsize=gr.sizeof_char*2,
     addr="127.0.0.1",
     port=8223,
     server=True,
     )
     print "Done setup..."

     ##################################################
     # Connections
     ##################################################
     self.connect((self.uhd_usrp_source_0, 0),

(self.blks2_tcp_sink_0_0, 0))

     self.connect((self.uhd_usrp_source_0, 1),

(self.blks2_tcp_sink_0_1, 0))

 def get_samp_rate(self):
     return self.samp_rate

 def set_samp_rate(self, samp_rate):
     self.samp_rate = samp_rate
     self.uhd_usrp_source_0.set_samp_rate(self.samp_rate)

 def get_freq_tune1(self):
     return self.freq_tune1

 def set_freq_tune1(self, freq_tune1):
     self.freq_tune1 = freq_tune1
     self.uhd_usrp_source_0.set_center_freq(self.freq_tune1, 1)

 def get_freq_tune0(self):
     return self.freq_tune0

 def set_freq_tune0(self, freq_tune0):
     self.freq_tune0 = freq_tune0
     self.uhd_usrp_source_0.set_center_freq(self.freq_tune0, 0)

if name == 'main':
parser = OptionParser(option_class=eng_option, usage="%prog:
[options]")
(options, args) = parser.parse_args()
if gr.enable_realtime_scheduling() != gr.RT_OK:
print "Error: failed to enable realtime scheduling."
tb = top_block()
tb.start()
try:
raw_input('Press Enter to quit: ')
except EOFError:
pass
tb.stop()
tb.wait()


USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Hello Heiko, could you share the full console output of a run of that flow graph? (I'd separately ask, but that contains the UHD version, anyway) You said it works when using sc16; does that mean otw=sc16,cpu=sc16, or otw=sc8,cpu=sc16 ? Generally, I'm a bit confused about the "peak" setting – this might really be the issue here; if you remove peak=0...., does the situation change? As a GNU Radio note: the blocks in blks2 are terribly organized, old python blocks; I don't know how long they are still going to be around. I'd personally recommend using ZMQ (e.g. ZMQ REP sink on this machine, and ZMQ REQ source on your storage machine, or any self-written ZMQ request socket program) instead, or the UDP sinks (UDP is totally sufficient, if your network is reliable – USRPs with network interfaces also use UDP, and under normal, non-overflow circumstances, no packets are lost). Best regards, Marcus On 25.07.2016 18:21, Heiko Jones via USRP-users wrote: > I am trying to get a B210 to give me two 8 bit streams at the same > time. All I get is hard zeros, yet with the exact same hardware setup > and signal, but using 16 bits, I get data. I can verify the correct > green leds come on, so it is not the subdev spec or number of > channels, I dont think. I have tried all sorts of stuff, including > loading the latest (as of friday) code from git. Another thing to > note, the 8 bit works fine if you just want one stream!! Anybody else > tried this??? > > I am including the simple python code, which is just a modified output > file from gnuradio_companion. It sends the two streams to seperate tcp > sockets, so I can archive the streams on a machine with a fast raid > setup. Note the sc8 in uhd.stream_args() and the gr.sizeof_char*2 > in grc_blks2.tcp_sink(), if you change those to sc16 and sizeof_short, > it will work... > > Heiko > > #!/usr/bin/env python2 > ################################################## > # GNU Radio Python Flow Graph > # Title: Top Block > # Generated: Mon Jul 18 09:39:08 2016 > ################################################## > > from gnuradio import eng_notation > from gnuradio import gr > from gnuradio import uhd > from gnuradio.eng_option import eng_option > from gnuradio.filter import firdes > from grc_gnuradio import blks2 as grc_blks2 > from optparse import OptionParser > import time > > class top_block(gr.top_block): > > def __init__(self): > gr.top_block.__init__(self, "Top Block") > > ################################################## > # Variables > ################################################## > self.samp_rate = samp_rate = 2500000 > self.freq_tune1 = freq_tune1 = 1.0e9 > self.freq_tune0 = freq_tune0 = 1.2e9 > > ################################################## > # Blocks > ################################################## > self.uhd_usrp_source_0 = uhd.usrp_source( > ",".join(("serial=F61164,type=b200", "")), > uhd.stream_args( > cpu_format="sc8", > otw_format="sc8", > args="peak=0.03125", > channels=range(2), > ), > ) > self.uhd_usrp_source_0.set_clock_source("external", 0) > self.uhd_usrp_source_0.set_subdev_spec("A:A A:B", 0) > self.uhd_usrp_source_0.set_antenna("RX2", 0) > self.uhd_usrp_source_0.set_antenna("RX2", 1) > print "Set sample rate to:", samp_rate > self.uhd_usrp_source_0.set_samp_rate(samp_rate) > print "Set freq 0 to:", freq_tune0 > self.uhd_usrp_source_0.set_center_freq(freq_tune0, 0) > self.uhd_usrp_source_0.set_gain(0.5, 0) > print "Set freq 1 to:", freq_tune1 > self.uhd_usrp_source_0.set_center_freq(freq_tune1, 1) > self.uhd_usrp_source_0.set_gain(0.5, 1) > print "Connect to 8224..." > self.blks2_tcp_sink_0_1 = grc_blks2.tcp_sink( > itemsize=gr.sizeof_char*2, > addr="127.0.0.1", > port=8224, > server=True, > ) > print "Connect to 8223..." > self.blks2_tcp_sink_0_0 = grc_blks2.tcp_sink( > itemsize=gr.sizeof_char*2, > addr="127.0.0.1", > port=8223, > server=True, > ) > print "Done setup..." > > ################################################## > # Connections > ################################################## > self.connect((self.uhd_usrp_source_0, 0), > (self.blks2_tcp_sink_0_0, 0)) > > self.connect((self.uhd_usrp_source_0, 1), > (self.blks2_tcp_sink_0_1, 0)) > > > > def get_samp_rate(self): > return self.samp_rate > > def set_samp_rate(self, samp_rate): > self.samp_rate = samp_rate > self.uhd_usrp_source_0.set_samp_rate(self.samp_rate) > > def get_freq_tune1(self): > return self.freq_tune1 > > def set_freq_tune1(self, freq_tune1): > self.freq_tune1 = freq_tune1 > self.uhd_usrp_source_0.set_center_freq(self.freq_tune1, 1) > > def get_freq_tune0(self): > return self.freq_tune0 > > def set_freq_tune0(self, freq_tune0): > self.freq_tune0 = freq_tune0 > self.uhd_usrp_source_0.set_center_freq(self.freq_tune0, 0) > > > if __name__ == '__main__': > parser = OptionParser(option_class=eng_option, usage="%prog: > [options]") > (options, args) = parser.parse_args() > if gr.enable_realtime_scheduling() != gr.RT_OK: > print "Error: failed to enable realtime scheduling." > tb = top_block() > tb.start() > try: > raw_input('Press Enter to quit: ') > except EOFError: > pass > tb.stop() > tb.wait() > > > _______________________________________________ > USRP-users mailing list > USRP-users@lists.ettus.com > http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
M
mleech@ripnet.com
Mon, Jul 25, 2016 4:55 PM

Play with the "peak=" parameter, also your gains are set to 0.5 (0.0 to
1.0) are these normalized gains or absolute?

On 2016-07-25 12:43, Marcus Müller via USRP-users wrote:

Hello Heiko,

could you share the full console output of a run of that flow graph? (I'd separately ask, but that contains the UHD version, anyway)

You said it works when using sc16; does that mean otw=sc16,cpu=sc16, or otw=sc8,cpu=sc16 ? Generally, I'm a bit confused about the "peak" setting - this might really be the issue here; if you remove peak=0...., does the situation change?

As a GNU Radio note: the blocks in blks2 are terribly organized, old python blocks; I don't know how long they are still going to be around. I'd personally recommend using ZMQ (e.g. ZMQ REP sink on this machine, and ZMQ REQ source on your storage machine, or any self-written ZMQ request socket program) instead, or the UDP sinks (UDP is totally sufficient, if your network is reliable - USRPs with network interfaces also use UDP, and under normal, non-overflow circumstances, no packets are lost).

Best regards,

Marcus

On 25.07.2016 18:21, Heiko Jones via USRP-users wrote:

I am trying to get a B210 to give me two 8 bit streams at the same time. All I get is hard zeros, yet with the exact same hardware setup and signal, but using 16 bits, I get data. I can verify the correct green leds come on, so it is not the subdev spec or number of channels, I dont think. I have tried all sorts of stuff, including loading the latest (as of friday) code from git. Another thing to note, the 8 bit works fine if you just want one stream!!  Anybody else tried this???

I am including the simple python code, which is just a modified output file from gnuradio_companion. It sends the two streams to seperate tcp sockets, so I can archive the streams on a machine with a fast raid setup. Note the sc8 in uhd.stream_args() and the gr.sizeof_char*2 in grc_blks2.tcp_sink(), if you change those to sc16 and sizeof_short, it will work...

Heiko

#!/usr/bin/env python2
##################################################

GNU Radio Python Flow Graph

Title: Top Block

Generated: Mon Jul 18 09:39:08 2016

##################################################

from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import uhd
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from grc_gnuradio import blks2 as grc_blks2
from optparse import OptionParser
import time

class top_block(gr.top_block):

def init(self):
gr.top_block.init(self, "Top Block")

##################################################

Variables

##################################################
self.samp_rate = samp_rate = 2500000
self.freq_tune1 = freq_tune1 = 1.0e9
self.freq_tune0 = freq_tune0 = 1.2e9

##################################################

Blocks

##################################################
self.uhd_usrp_source_0 = uhd.usrp_source(
",".join(("serial=F61164,type=b200", "")),
uhd.stream_args(
cpu_format="sc8",
otw_format="sc8",
args="peak=0.03125",
channels=range(2),
),
)
self.uhd_usrp_source_0.set_clock_source("external", 0)
self.uhd_usrp_source_0.set_subdev_spec("A:A A:B", 0)
self.uhd_usrp_source_0.set_antenna("RX2", 0)
self.uhd_usrp_source_0.set_antenna("RX2", 1)
print "Set sample rate to:", samp_rate
self.uhd_usrp_source_0.set_samp_rate(samp_rate)
print "Set freq 0 to:", freq_tune0
self.uhd_usrp_source_0.set_center_freq(freq_tune0, 0)
self.uhd_usrp_source_0.set_gain(0.5, 0)
print "Set freq 1 to:", freq_tune1
self.uhd_usrp_source_0.set_center_freq(freq_tune1, 1)
self.uhd_usrp_source_0.set_gain(0.5, 1)
print "Connect to 8224..."
self.blks2_tcp_sink_0_1 = grc_blks2.tcp_sink(
itemsize=gr.sizeof_char2,
addr="127.0.0.1",
port=8224,
server=True,
)
print "Connect to 8223..."
self.blks2_tcp_sink_0_0 = grc_blks2.tcp_sink(
itemsize=gr.sizeof_char
2,
addr="127.0.0.1",
port=8223,
server=True,
)
print "Done setup..."

##################################################

Connections

##################################################
self.connect((self.uhd_usrp_source_0, 0), (self.blks2_tcp_sink_0_0, 0))

self.connect((self.uhd_usrp_source_0, 1), (self.blks2_tcp_sink_0_1, 0))

def get_samp_rate(self):
return self.samp_rate

def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.uhd_usrp_source_0.set_samp_rate(self.samp_rate)

def get_freq_tune1(self):
return self.freq_tune1

def set_freq_tune1(self, freq_tune1):
self.freq_tune1 = freq_tune1
self.uhd_usrp_source_0.set_center_freq(self.freq_tune1, 1)

def get_freq_tune0(self):
return self.freq_tune0

def set_freq_tune0(self, freq_tune0):
self.freq_tune0 = freq_tune0
self.uhd_usrp_source_0.set_center_freq(self.freq_tune0, 0)

if name == 'main':
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
(options, args) = parser.parse_args()
if gr.enable_realtime_scheduling() != gr.RT_OK:
print "Error: failed to enable realtime scheduling."
tb = top_block()
tb.start()
try:
raw_input('Press Enter to quit: ')
except EOFError:
pass
tb.stop()
tb.wait()


USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Play with the "peak=" parameter, also your gains are set to 0.5 (0.0 to 1.0) are these normalized gains or absolute? On 2016-07-25 12:43, Marcus Müller via USRP-users wrote: > Hello Heiko, > > could you share the full console output of a run of that flow graph? (I'd separately ask, but that contains the UHD version, anyway) > > You said it works when using sc16; does that mean otw=sc16,cpu=sc16, or otw=sc8,cpu=sc16 ? Generally, I'm a bit confused about the "peak" setting - this might really be the issue here; if you remove peak=0...., does the situation change? > > As a GNU Radio note: the blocks in blks2 are terribly organized, old python blocks; I don't know how long they are still going to be around. I'd personally recommend using ZMQ (e.g. ZMQ REP sink on this machine, and ZMQ REQ source on your storage machine, or any self-written ZMQ request socket program) instead, or the UDP sinks (UDP is totally sufficient, if your network is reliable - USRPs with network interfaces also use UDP, and under normal, non-overflow circumstances, no packets are lost). > > Best regards, > > Marcus > > On 25.07.2016 18:21, Heiko Jones via USRP-users wrote: > >> I am trying to get a B210 to give me two 8 bit streams at the same time. All I get is hard zeros, yet with the exact same hardware setup and signal, but using 16 bits, I get data. I can verify the correct green leds come on, so it is not the subdev spec or number of channels, I dont think. I have tried all sorts of stuff, including loading the latest (as of friday) code from git. Another thing to note, the 8 bit works fine if you just want one stream!! Anybody else tried this??? >> >> I am including the simple python code, which is just a modified output file from gnuradio_companion. It sends the two streams to seperate tcp sockets, so I can archive the streams on a machine with a fast raid setup. Note the sc8 in uhd.stream_args() and the gr.sizeof_char*2 in grc_blks2.tcp_sink(), if you change those to sc16 and sizeof_short, it will work... >> >> Heiko >> >> #!/usr/bin/env python2 >> ################################################## >> # GNU Radio Python Flow Graph >> # Title: Top Block >> # Generated: Mon Jul 18 09:39:08 2016 >> ################################################## >> >> from gnuradio import eng_notation >> from gnuradio import gr >> from gnuradio import uhd >> from gnuradio.eng_option import eng_option >> from gnuradio.filter import firdes >> from grc_gnuradio import blks2 as grc_blks2 >> from optparse import OptionParser >> import time >> >> class top_block(gr.top_block): >> >> def __init__(self): >> gr.top_block.__init__(self, "Top Block") >> >> ################################################## >> # Variables >> ################################################## >> self.samp_rate = samp_rate = 2500000 >> self.freq_tune1 = freq_tune1 = 1.0e9 >> self.freq_tune0 = freq_tune0 = 1.2e9 >> >> ################################################## >> # Blocks >> ################################################## >> self.uhd_usrp_source_0 = uhd.usrp_source( >> ",".join(("serial=F61164,type=b200", "")), >> uhd.stream_args( >> cpu_format="sc8", >> otw_format="sc8", >> args="peak=0.03125", >> channels=range(2), >> ), >> ) >> self.uhd_usrp_source_0.set_clock_source("external", 0) >> self.uhd_usrp_source_0.set_subdev_spec("A:A A:B", 0) >> self.uhd_usrp_source_0.set_antenna("RX2", 0) >> self.uhd_usrp_source_0.set_antenna("RX2", 1) >> print "Set sample rate to:", samp_rate >> self.uhd_usrp_source_0.set_samp_rate(samp_rate) >> print "Set freq 0 to:", freq_tune0 >> self.uhd_usrp_source_0.set_center_freq(freq_tune0, 0) >> self.uhd_usrp_source_0.set_gain(0.5, 0) >> print "Set freq 1 to:", freq_tune1 >> self.uhd_usrp_source_0.set_center_freq(freq_tune1, 1) >> self.uhd_usrp_source_0.set_gain(0.5, 1) >> print "Connect to 8224..." >> self.blks2_tcp_sink_0_1 = grc_blks2.tcp_sink( >> itemsize=gr.sizeof_char*2, >> addr="127.0.0.1", >> port=8224, >> server=True, >> ) >> print "Connect to 8223..." >> self.blks2_tcp_sink_0_0 = grc_blks2.tcp_sink( >> itemsize=gr.sizeof_char*2, >> addr="127.0.0.1", >> port=8223, >> server=True, >> ) >> print "Done setup..." >> >> ################################################## >> # Connections >> ################################################## >> self.connect((self.uhd_usrp_source_0, 0), (self.blks2_tcp_sink_0_0, 0)) >> >> self.connect((self.uhd_usrp_source_0, 1), (self.blks2_tcp_sink_0_1, 0)) >> >> def get_samp_rate(self): >> return self.samp_rate >> >> def set_samp_rate(self, samp_rate): >> self.samp_rate = samp_rate >> self.uhd_usrp_source_0.set_samp_rate(self.samp_rate) >> >> def get_freq_tune1(self): >> return self.freq_tune1 >> >> def set_freq_tune1(self, freq_tune1): >> self.freq_tune1 = freq_tune1 >> self.uhd_usrp_source_0.set_center_freq(self.freq_tune1, 1) >> >> def get_freq_tune0(self): >> return self.freq_tune0 >> >> def set_freq_tune0(self, freq_tune0): >> self.freq_tune0 = freq_tune0 >> self.uhd_usrp_source_0.set_center_freq(self.freq_tune0, 0) >> >> if __name__ == '__main__': >> parser = OptionParser(option_class=eng_option, usage="%prog: [options]") >> (options, args) = parser.parse_args() >> if gr.enable_realtime_scheduling() != gr.RT_OK: >> print "Error: failed to enable realtime scheduling." >> tb = top_block() >> tb.start() >> try: >> raw_input('Press Enter to quit: ') >> except EOFError: >> pass >> tb.stop() >> tb.wait() >> >> _______________________________________________ >> USRP-users mailing list >> USRP-users@lists.ettus.com >> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com > > _______________________________________________ > USRP-users mailing list > USRP-users@lists.ettus.com > http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com