discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Issue with multiple transmitter threads in same p


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] Issue with multiple transmitter threads in same program
Date: Sun, 3 Jun 2012 10:59:48 -0400

On Fri, Jun 1, 2012 at 7:14 PM, Dhrubojyoti Roy
<address@hidden> wrote:
> 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

Dhrubo,
It looks like you are never running the start() method on your
flowgraphs, which might be the problem.

Conceptually, you should be able to have multiple transmitters. If you
are trying to use the same UHD device and sending packets from two
different UHD sink blocks, that _might_ be a problem, but I don't
think so.

Tom



reply via email to

[Prev in Thread] Current Thread [Next in Thread]