Dear All, I was experimenting with GNURadio to see if multiple transmitter threads can exist in the same program. The following are my transmitter class definitions (both are set to the same transmission parameters):
class my_trans(gr.top_block): def __init__(self, mod_class, options): gr.top_block.__init__(self) # Get the modulation's bits_per_symbol args = mod_class.extract_kwargs_from_options(options) symbol_rate = options.bitrate / mod_class(**args).bits_per_symbol() self.sink = uhd_transmitter(options.args, symbol_rate, options.samples_per_symbol, options.tx_freq, options.tx_gain, options.spec, options.antenna, options.verbose) self.txpath = transmit_path(mod_class, options) self.connect(self.txpath, self.sink) class my_ret_trans(gr.top_block): def __init__(self, mod_class, options): gr.top_block.__init__(self) # Get the modulation's bits_per_symbol args = mod_class.extract_kwargs_from_options(options) symbol_rate = options.bitrate / mod_class(**args).bits_per_symbol() self.sink = uhd_transmitter(options.args, symbol_rate, options.samples_per_symbol, options.tx_freq, options.tx_gain, options.spec, options.antenna, options.verbose) self.txpath = transmit_path(mod_class, options) self.connect(self.txpath, self.sink) However, the problem arises when I try to transmit using one of the transmitters: tb = my_trans(mods[options.modulation],options) rtb = my_ret_trans(mods[options.modulation],options) payload = struct.pack('!H', pktno & 0xffff) + struct.pack('!I',int('0x'+str[0:6],0))+struct.pack('!I',int('0x'+str[6:],0)) + data send_pkt(payload, dev_mac.replace(':','')) send_pkt_rtb(payload, dev_mac.replace(':','')) sys.stderr.write("\nSent pktno=%4d\n" % (pktno)) Where the send functions are defined as: def send_pkt(payload='', dev_mac = 'ffffffffffff', eof=False): return tb.txpath.send_pkt(payload, dev_mac, eof) def send_pkt_rtb(payload='', dev_mac = 'ffffffffffff', eof=False): return rtb.txpath.send_pkt(payload, dev_mac, eof) The program prints the following exception: Sent pktno= 0 UFloating point exception I have observed the same exception whenever rtb is called from any context (including the receiver thread's callback function - not shown here). Does it mean we are constrained to use at max one transmitter thread per process? What prevents us from having multiple transmit chains, and why is the exception a floating point exception? Thanks and regards, Dhrubo -- Dhrubojyoti Roy 1655, North 4th Street, Apt-D Columbus, OH-43201 Contact no.: +1-740-417-5890
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio