c++ - Gnuradio,OOT: correcting send() for tagged stream block? -


i need making gnuradio oot module. trying extending 1 code.

i trying make 2 tx 1rx tagged stream block (oot). 1tx 1rx, working fine. trying extend it. problem is, not being able configure send() function. code, 1 transmitter transmits, other not work. subdev specification , frequency , other parameters allocated correctly. checked.

if try make test, not show problem. checked every port of usrp x310, working fine.

here's code. putting short part deals send , receive buffer.

void usrp_echotimer_cc_impl::send() { // data usrp num_tx_samps = d_tx_stream->send(d_in_send1, total_num_samps, d_metadata_tx, total_num_samps/(float)d_samp_rate+d_timeout_tx); num_tx_samps = d_tx_stream->send(d_in_send0, total_num_samps, d_metadata_tx, total_num_samps/(float)d_samp_rate+d_timeout_tx); }  int usrp_echotimer_cc_impl::work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { gr_complex *in0 = (gr_complex *) input_items[0]; gr_complex *in1 = (gr_complex *) input_items[1]; gr_complex *out = (gr_complex *) output_items[0]; // set output items on packet length noutput_items = ninput_items[0]=ninput_items[1];  // resize output buffer if(d_out_buffer.size()!=noutput_items) d_out_buffer.resize(noutput_items);  // send thread d_in_send0 = in0; d_in_send1 = in1; d_noutput_items_send = noutput_items; d_thread_send = gr::thread::thread(boost::bind(&usrp_echotimer_cc_impl::send, this));  // receive thread d_out_recv = &d_out_buffer[0]; d_noutput_items_recv = noutput_items; d_thread_recv = gr::thread::thread(boost::bind(&usrp_echotimer_cc_impl::receive, this)); 

my system config x310, daughterboard sbx-120 , using uhd-3.9. checked subdev specification, gain , frequency assignment. fine.

for completeness: has been asked yesterday on gnu radio mailing list; sanjoy has gotten 2 responses:

martin braun wrote:

sorry, sanjoy,

we'll need more information before can give better feedback. it's not clear you're trying achieve, , failing.

perhaps helps getting started: http://gnuradio.org/redmine/projects/gnuradio/wiki/reportingerrors

cheers, martin

and answer bit longish, it's available here. in excerpts:

hi sanjoy,

i trying make 2 tx 1rx tagged stream block(oot). 1tx 1rx, working fine. trying extend it. problem is, not being able configure send() function.

is there particular reason you're creating own block? there feature missing on usrp sink , source come gr-uhd?

...

your send() function looks bit strange; you're doing transmitting 2 things on single channel after each other. also, should doing (from programming style point of view) pass buffers want send references or something, not save them class properties , call send(). send 2 buffers 2 different channels, need use vector containing 2 buffers -- have @ rx_multi_samples; of course recv()s rather sends(), semantics same.

...

noutput_items given let work how may produce, that's why it's parameter.

...

there's no reason gnu radio couldn't call work function again while usrp_echotimer_cc_impl::send() hasn't started transmit samples. then, d_send variables overwritten.

...

since single x310 inherently coherent , has same time, can use usrp sink , source, use set_start_time(...) on both same time spec, , have flow graph consume , produce samples in different threads, coherently.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -