Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-15 Thread Jason W Zheng via USRP-users
@robin, I reset the usrp clock to zero right before creating my threads, I also 
tried your suggestion of starting transmit much later, but once transmits 
start, I get underflows, so same problem. It doesn't look like transmitting 
later helps.

@marcus, i've tried running on UHD 3.10.2, but I get the same problem.



From: Jason W Zheng
Sent: Tuesday, August 15, 2017 9:54:45 AM
To: Marcus D. Leech; ROBIN TORTORA
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310


@robin, I reset the usrp clock to zero right before creating my threads, I also 
tried your suggestion of starting transmit much later, but once transmits 
start, I get underflows, so same problem. It doesn't look like transmitting 
later helps.


@marcus, i've tried running on UHD 3.10.2, but I get the same problem.




From: USRP-users  on behalf of Marcus D. 
Leech via USRP-users 
Sent: Tuesday, August 15, 2017 5:07:01 AM
To: usrp-users@lists.ettus.com
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310

On 08/14/2017 08:27 PM, Jason W Zheng via USRP-users wrote:

I don't think the problem is in the metadata, unless I'm really doing it wrong. 
I've tried the suggestion you put out earlier, modeling my code after the 
example txrx_loopback_to_file. The first packet has a startofburst = true and 
subsequent packets have the start_of_burst value and the has_time_spec value 
set to false after the first transmission.

COuld you try reverting to UHD 3.10.2 and see if that changes things?   Just 
got this hint from engineering.



// set up TX streams and threads
std::thread tx_threads[NUM_CHANNELS];
uhd::tx_streamer::sptr tx_streams[NUM_CHANNELS];
uhd::tx_metadata_t md;
md.start_of_burst = true;
md.end_of_burst = false;
md.has_time_spec = true;
md.time_spec = uhd::time_spec_t(0.1);

for (int i = 0; i < NUM_CHANNELS; i++){
stream_args.channels = std::vector(1,i);
tx_streams[i] = usrp->get_tx_stream(stream_args);
//start the thread
std::cout << "Starting tx thread " << i << std::endl;
tx_threads[i] = std::thread(txTask,tx_buffs[i],tx_streams[i],md);
}

///
the thread function




void txTask(Complex *buff, uhd::tx_streamer::sptr tx_stream, uhd::tx_metadata_t 
md){

size_t num_acc_samps = 0;
struct timespec start_time;
clock_gettime(CLOCK_MONOTONIC, _time);

while(!stop_signal_called){
size_t samples_sent = tx_stream->send(buff,BUFF_SIZE,md);
num_acc_samps += samples_sent;

md.start_of_burst = false;//after first transmission set to false
md.has_time_spec = false;  //after first transmission set to false
}

struct timespec end_time;
clock_gettime(CLOCK_MONOTONIC, _time);
double runtime = (end_time.tv_sec  - start_time.tv_sec)  +
 (end_time.tv_nsec - start_time.tv_nsec ) / 10.0;
std::cout << std::endl << "Sent " << num_acc_samps
  << " samples in " << runtime << "s"
  << " Throughput = " << num_acc_samps / 1e6 /runtime << " Msps"
  << std::endl;

//send a mini EOB packet
md.end_of_burst = true;
tx_stream -> send("",0,md);

printf("End transmit \n");
}


Even with the metadata fix I still get underflows when transmitting and 
receiving on the same channel, no matter what the rate. If you have an X310, I 
wonder if you could compile and run my code and see if you get the same result?


Thanks,

Jason



From: The Tilla 
Sent: Monday, August 14, 2017 4:47:31 PM
To: Jason W Zheng; mle...@ripnet.com
Cc: usrp-users@lists.ettus.com
Subject: RE: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310

I think some of the issue here as well is the tx_metadata.

For continuous streaming, the first packet ONLY should have startofburst = true…

Further packets after the first one should have startofburst = false, cuz they 
really are not start of burst, they are continuations of the initial burst.

Furthermore, for continuous streaming as soon as possible, you should not 
provide a timespec.

If you continually provide a timespec to each packet, it will continually try 
to send them at time = 0.1, which is not what you want…

If you want to start your tx at a specific time, then similar to startofburst, 
you should only provide a timespec with the first packet, all subsequent 
packets should not include a timespec.

Does that make sense?

It can be a bit confusing at first, but after writing a few apps, you will be 

Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-15 Thread Marcus D. Leech via USRP-users

On 08/14/2017 08:27 PM, Jason W Zheng via USRP-users wrote:


I don't think the problem is in the metadata, unless I'm really doing 
it wrong. I've tried the suggestion you put out earlier, modeling my 
code after the example txrx_loopback_to_file. The first packet has a 
startofburst = true and subsequent packets have the start_of_burst 
value and the has_time_spec value set to false after the first 
transmission.


COuld you try reverting to UHD 3.10.2 and see if that changes things?   
Just got this hint from engineering.




// set up TX streams and threads
std::thread tx_threads[NUM_CHANNELS];
uhd::tx_streamer::sptr tx_streams[NUM_CHANNELS];
uhd::tx_metadata_t md;
md.start_of_burst = true;
md.end_of_burst = false;
md.has_time_spec = true;
md.time_spec = uhd::time_spec_t(0.1);

for (int i = 0; i < NUM_CHANNELS; i++){
stream_args.channels = std::vector(1,i);
tx_streams[i] = usrp->get_tx_stream(stream_args);
//start the thread
std::cout << "Starting tx thread " << i << std::endl;
tx_threads[i] = std::thread(txTask,tx_buffs[i],tx_streams[i],md);
}

///
the thread function




void txTask(Complex *buff, uhd::tx_streamer::sptr tx_stream, 
uhd::tx_metadata_t md){


size_t num_acc_samps = 0;
struct timespec start_time;
clock_gettime(CLOCK_MONOTONIC, _time);

while(!stop_signal_called){
size_t samples_sent = tx_stream->send(buff,BUFF_SIZE,md);
num_acc_samps += samples_sent;

md.start_of_burst = false;//after first transmission set 
to false

md.has_time_spec = false;  //after first transmission set to false
}

struct timespec end_time;
clock_gettime(CLOCK_MONOTONIC, _time);
double runtime = (end_time.tv_sec  - start_time.tv_sec)  +
 (end_time.tv_nsec - start_time.tv_nsec ) / 
10.0;

std::cout << std::endl << "Sent " << num_acc_samps
  << " samples in " << runtime << "s"
  << " Throughput = " << num_acc_samps / 1e6 /runtime << " 
Msps"

  << std::endl;

//send a mini EOB packet
md.end_of_burst = true;
tx_stream -> send("",0,md);

printf("End transmit \n");
}

Even with the metadata fix I still get underflows when transmitting 
and receiving on the same channel, no matter what the rate. If you 
have an X310, I wonder if you could compile and run my code and see if 
you get the same result?



Thanks,

Jason



*From:* The Tilla 
*Sent:* Monday, August 14, 2017 4:47:31 PM
*To:* Jason W Zheng; mle...@ripnet.com
*Cc:* usrp-users@lists.ettus.com
*Subject:* RE: [USRP-users] Buffer underrun issue with simultaneous 
transmit and receive on the X310


I think some of the issue here as well is the tx_metadata.

For continuous streaming, the first packet ONLY should have 
startofburst = true…


Further packets after the first one should have startofburst = false, 
cuz they really are not start of burst, they are continuations of the 
initial burst.


Furthermore, for continuous streaming as soon as possible, you should 
not provide a timespec.


If you continually provide a timespec to each packet, it will 
continually try to send them at time = 0.1, which is not what you want…


If you want to start your tx at a specific time, then similar to 
startofburst, you should only provide a timespec with the first 
packet, all subsequent packets should not include a timespec.


Does that make sense?

It can be a bit confusing at first, but after writing a few apps, you 
will be an expert 


*From:* Jason W Zheng [mailto:jason.w.zh...@aero.org]
*Sent:* Monday, August 14, 2017 4:41 PM
*To:* ROBIN TORTORA ; mle...@ripnet.com
*Cc:* usrp-users@lists.ettus.com
*Subject:* Re: [USRP-users] Buffer underrun issue with simultaneous 
transmit and receive on the X310


Hi Robin, Marcus

It makes no sense to me, then why changing transmit to be on its own 
channel (daughtercard) would cause the program to work.


// set up TX streams and threads

std::thread tx_threads[NUM_CHANNELS];

uhd::tx_streamer::sptr tx_streams[NUM_CHANNELS];

uhd::tx_metadata_t md;

md.start_of_burst = true;

md.end_of_burst = false;

md.has_time_spec = true;

md.time_spec = uhd::time_spec_t(0.1);

for (int i = 0; i < NUM_CHANNELS; i++){

stream_args.channels = std::vector(1,i); //changing this from 
i to 1 causes it to work for unknown reasons


tx_streams[i] = usrp->get_tx_stream(stream_args);

//start the thread

std::cout << "Starting tx thread " << i << std::endl;

tx_threads[i] = std::thread(txTask,tx_buffs[i],tx_streams[i],md);

}

The relevant line is commented in the above code snippet. When I 
change the channels arguments for the tx stream_args to be on 

Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread Jason W Zheng via USRP-users
I don't think the problem is in the metadata, unless I'm really doing it wrong. 
I've tried the suggestion you put out earlier, modeling my code after the 
example txrx_loopback_to_file. The first packet has a startofburst = true and 
subsequent packets have the start_of_burst value and the has_time_spec value 
set to false after the first transmission.


// set up TX streams and threads
std::thread tx_threads[NUM_CHANNELS];
uhd::tx_streamer::sptr tx_streams[NUM_CHANNELS];
uhd::tx_metadata_t md;
md.start_of_burst = true;
md.end_of_burst = false;
md.has_time_spec = true;
md.time_spec = uhd::time_spec_t(0.1);

for (int i = 0; i < NUM_CHANNELS; i++){
stream_args.channels = std::vector(1,i);
tx_streams[i] = usrp->get_tx_stream(stream_args);
//start the thread
std::cout << "Starting tx thread " << i << std::endl;
tx_threads[i] = std::thread(txTask,tx_buffs[i],tx_streams[i],md);
}

///
the thread function




void txTask(Complex *buff, uhd::tx_streamer::sptr tx_stream, uhd::tx_metadata_t 
md){

size_t num_acc_samps = 0;
struct timespec start_time;
clock_gettime(CLOCK_MONOTONIC, _time);

while(!stop_signal_called){
size_t samples_sent = tx_stream->send(buff,BUFF_SIZE,md);
num_acc_samps += samples_sent;

md.start_of_burst = false;//after first transmission set to false
md.has_time_spec = false;  //after first transmission set to false
}

struct timespec end_time;
clock_gettime(CLOCK_MONOTONIC, _time);
double runtime = (end_time.tv_sec  - start_time.tv_sec)  +
 (end_time.tv_nsec - start_time.tv_nsec ) / 10.0;
std::cout << std::endl << "Sent " << num_acc_samps
  << " samples in " << runtime << "s"
  << " Throughput = " << num_acc_samps / 1e6 /runtime << " Msps"
  << std::endl;

//send a mini EOB packet
md.end_of_burst = true;
tx_stream -> send("",0,md);

printf("End transmit \n");
}


Even with the metadata fix I still get underflows when transmitting and 
receiving on the same channel, no matter what the rate. If you have an X310, I 
wonder if you could compile and run my code and see if you get the same result?


Thanks,

Jason



From: The Tilla 
Sent: Monday, August 14, 2017 4:47:31 PM
To: Jason W Zheng; mle...@ripnet.com
Cc: usrp-users@lists.ettus.com
Subject: RE: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310

I think some of the issue here as well is the tx_metadata.

For continuous streaming, the first packet ONLY should have startofburst = true…

Further packets after the first one should have startofburst = false, cuz they 
really are not start of burst, they are continuations of the initial burst.

Furthermore, for continuous streaming as soon as possible, you should not 
provide a timespec.

If you continually provide a timespec to each packet, it will continually try 
to send them at time = 0.1, which is not what you want…

If you want to start your tx at a specific time, then similar to startofburst, 
you should only provide a timespec with the first packet, all subsequent 
packets should not include a timespec.

Does that make sense?

It can be a bit confusing at first, but after writing a few apps, you will be 
an expert 


From: Jason W Zheng [mailto:jason.w.zh...@aero.org]
Sent: Monday, August 14, 2017 4:41 PM
To: ROBIN TORTORA ; mle...@ripnet.com
Cc: usrp-users@lists.ettus.com
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310


Hi Robin, Marcus



It makes no sense to me, then why changing transmit to be on its own channel 
(daughtercard) would cause the program to work.


// set up TX streams and threads
std::thread tx_threads[NUM_CHANNELS];
uhd::tx_streamer::sptr tx_streams[NUM_CHANNELS];
uhd::tx_metadata_t md;
md.start_of_burst = true;
md.end_of_burst = false;
md.has_time_spec = true;
md.time_spec = uhd::time_spec_t(0.1);

for (int i = 0; i < NUM_CHANNELS; i++){
stream_args.channels = std::vector(1,i); //changing this from i 
to 1 causes it to work for unknown reasons
tx_streams[i] = usrp->get_tx_stream(stream_args);
//start the thread
std::cout << "Starting tx thread " << i << std::endl;
tx_threads[i] = std::thread(txTask,tx_buffs[i],tx_streams[i],md);
}


The relevant line is commented in the above code snippet. When I change the 
channels arguments for the tx stream_args to be on it's own channel 
(daughterboard) separate from the receive, the underflows go away.





@Marcus, in the code I posted, there is no coordination between the transmit 
and the receive threads. This is for example 

Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread The Tilla via USRP-users
I think some of the issue here as well is the tx_metadata.

 

For continuous streaming, the first packet ONLY should have startofburst = true…

 

Further packets after the first one should have startofburst = false, cuz they 
really are not start of burst, they are continuations of the initial burst.

 

Furthermore, for continuous streaming as soon as possible, you should not 
provide a timespec.

 

If you continually provide a timespec to each packet, it will continually try 
to send them at time = 0.1, which is not what you want…

 

If you want to start your tx at a specific time, then similar to startofburst, 
you should only provide a timespec with the first packet, all subsequent 
packets should not include a timespec.

 

Does that make sense?

 

It can be a bit confusing at first, but after writing a few apps, you will be 
an expert 

 

 

From: Jason W Zheng [mailto:jason.w.zh...@aero.org] 
Sent: Monday, August 14, 2017 4:41 PM
To: ROBIN TORTORA ; mle...@ripnet.com
Cc: usrp-users@lists.ettus.com
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310

 

Hi Robin, Marcus

 

It makes no sense to me, then why changing transmit to be on its own channel 
(daughtercard) would cause the program to work. 

 

// set up TX streams and threads

std::thread tx_threads[NUM_CHANNELS];

uhd::tx_streamer::sptr tx_streams[NUM_CHANNELS];

uhd::tx_metadata_t md;

md.start_of_burst = true;

md.end_of_burst = false;

md.has_time_spec = true;

md.time_spec = uhd::time_spec_t(0.1); 

 

for (int i = 0; i < NUM_CHANNELS; i++){

stream_args.channels = std::vector(1,i); //changing this from i 
to 1 causes it to work for unknown reasons

tx_streams[i] = usrp->get_tx_stream(stream_args);

//start the thread

std::cout << "Starting tx thread " << i << std::endl;

tx_threads[i] = std::thread(txTask,tx_buffs[i],tx_streams[i],md);

}

 

The relevant line is commented in the above code snippet. When I change the 
channels arguments for the tx stream_args to be on it's own channel 
(daughterboard) separate from the receive, the underflows go away. 

 

 

@Marcus, in the code I posted, there is no coordination between the transmit 
and the receive threads. This is for example purposes. The transmit and receive 
buffers are independent. The transmit thread buffer is prefilled with 0's and 
is constantly transmitting 0's. 

 

  _  

From: ROBIN TORTORA  >
Sent: Monday, August 14, 2017 1:06:20 PM
To: Jason W Zheng via USRP-users; Jason W Zheng
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310 

 

Willing to bet significant money your tx thread is being put on the physical 
processor that does not have your NIC card attached to it...

 

Then, all data must go over QPI between processors.

 

NUMA is not good for this.

 

You can experiment with affinity to make sure things are all on the same 
physical processor as your NIC...

 

We no longer buy multi-processor boxes for issues like this, NUMA is bad...

 

On August 14, 2017 at 2:32 PM Jason W Zheng via USRP-users 
 > wrote:

 

I'm running on a server with 2 Intel Xeon E5-2650 v4, CPU is listed here:

https://ark.intel.com/products/91767/Intel-Xeon-Processor-E5-2650-v4-30M-Cache-2_20-GHz

 

The network card I'm using is the recommended Intel X520-DA2

 

I also have over 500 gigs of ram, so that is not an issue

 

I don't think my cpu or network card are the issue as when I change my code to 
receive and transmit on separate channels, it works without any underflows. 

 

 

  _  

From: USRP-users  > on behalf of Jason W Zheng via 
USRP-users  >
Sent: Monday, August 14, 2017 11:27:24 AM
To: ROBIN TORTORA
Cc: usrp-users@lists.ettus.com  
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310 

 

How should I set the tx metadata? My application will essentially stream 
continuously. 

 

Thanks,

Jason


  _  


From: ROBIN TORTORA  >
Sent: Monday, August 14, 2017 11:17:07 AM
To: Jason W Zheng via USRP-users; Jason W Zheng
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310 

 

I dont see you setting the tx metadata object members to any values, so you are 
essentially going to tx with default metadata IF there is a constructor that 
initializes all the members to a consistent value...

On August 14, 2017 at 1:56 PM Jason W Zheng via USRP-users 
 > wrote:

 

Since I haven't gotten a 

Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread Edwin Li via USRP-users
Hi Jason,

I have the same under-run problem with my project. I use x310 as well. I
don't have a solution. I'll appreciate it if anyone can figure out what is
causing this.

Regards,
Edwin




Jason W Zheng via USRP-users 于2017年8月14日周一
下午2:42写道:

> Hi Robin, Marcus
>
>
> It makes no sense to me, then why changing transmit to be on its own
> channel (daughtercard) would cause the program to work.
>
>
> // set up TX streams and threads
> std::thread tx_threads[NUM_CHANNELS];
> uhd::tx_streamer::sptr tx_streams[NUM_CHANNELS];
> uhd::tx_metadata_t md;
> md.start_of_burst = true;
> md.end_of_burst = false;
> md.has_time_spec = true;
> md.time_spec = uhd::time_spec_t(0.1);
>
> for (int i = 0; i < NUM_CHANNELS; i++){
> stream_args.channels = std::vector(1,i); //changing this
> from i to 1 causes it to work for unknown reasons
> tx_streams[i] = usrp->get_tx_stream(stream_args);
> //start the thread
> std::cout << "Starting tx thread " << i << std::endl;
> tx_threads[i] = std::thread(txTask,tx_buffs[i],tx_streams[i],md);
> }
>
> The relevant line is commented in the above code snippet. When I change
> the channels arguments for the tx stream_args to be on it's own channel
> (daughterboard) separate from the receive, the underflows go away.
>
>
>
> @Marcus, in the code I posted, there is no coordination between the
> transmit and the receive threads. This is for example purposes. The
> transmit and receive buffers are independent. The transmit thread buffer is
> prefilled with 0's and is constantly transmitting 0's.
>
>
> --
> *From:* ROBIN TORTORA 
> *Sent:* Monday, August 14, 2017 1:06:20 PM
>
> *To:* Jason W Zheng via USRP-users; Jason W Zheng
> *Subject:* Re: [USRP-users] Buffer underrun issue with simultaneous
> transmit and receive on the X310
>
> Willing to bet significant money your tx thread is being put on the
> physical processor that does not have your NIC card attached to it...
>
>
> Then, all data must go over QPI between processors.
>
>
> NUMA is not good for this.
>
>
> You can experiment with affinity to make sure things are all on the same
> physical processor as your NIC...
>
>
> We no longer buy multi-processor boxes for issues like this, NUMA is bad...
>
>
> On August 14, 2017 at 2:32 PM Jason W Zheng via USRP-users <
> usrp-users@lists.ettus.com> wrote:
>
>
> I'm running on a server with 2 Intel Xeon E5-2650 v4, CPU is listed here:
>
> https://ark.intel.com/products/91767/Intel-Xeon-Processor-E5-2650-v4-30M-Cache-2_20-GHz
>
> The network card I'm using is the recommended Intel X520-DA2
>
> I also have over 500 gigs of ram, so that is not an issue
>
> I don't think my cpu or network card are the issue as when I change my
> code to receive and transmit on separate channels, it works without any
> underflows.
>
>
> --
> *From:* USRP-users  on behalf of
> Jason W Zheng via USRP-users 
> *Sent:* Monday, August 14, 2017 11:27:24 AM
> *To:* ROBIN TORTORA
> *Cc:* usrp-users@lists.ettus.com
> *Subject:* Re: [USRP-users] Buffer underrun issue with simultaneous
> transmit and receive on the X310
>
>
> How should I set the tx metadata? My application will essentially stream
> continuously.
>
>
> Thanks,
>
> Jason
> --
> *From:* ROBIN TORTORA 
> *Sent:* Monday, August 14, 2017 11:17:07 AM
> *To:* Jason W Zheng via USRP-users; Jason W Zheng
> *Subject:* Re: [USRP-users] Buffer underrun issue with simultaneous
> transmit and receive on the X310
>
>
> I dont see you setting the tx metadata object members to any values, so
> you are essentially going to tx with default metadata IF there is a
> constructor that initializes all the members to a consistent value...
>
> On August 14, 2017 at 1:56 PM Jason W Zheng via USRP-users <
> usrp-users@lists.ettus.com> wrote:
>
>
> Since I haven't gotten a response in a week, I thought some source code
> might help. I've removed any buffer dependencies leaving just the receive
> thread and transmit thread. The receive thread is constant receiving to a
> buffer, while the transmit thread is constantly transmitting 0s from
> another buffer.
>
> On the x310, when I receive and transmit from the same channel (same
> daughterboard), I get underflows (U's on the console), no matter what the
> rate. When I put receive and transmit on separate channels, the U's go
> away.
>
> How do I fix my source code so I can receive and transmit from the same
> channel without underflows?
>
> Thanks,
> Jason
>
>
> --
> *From:* USRP-users  on behalf of
> Jason W Zheng via USRP-users 
> *Sent:* Monday, August 7, 2017 1:05:05 PM
> *To:* usrp-users@lists.ettus.com
> *Subject:* [USRP-users] Buffer underrun issue with 

Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread ROBIN TORTORA via USRP-users
Willing to bet significant money your tx thread is being put on the physical 
processor that does not have your NIC card attached to it...


Then, all data must go over QPI between processors.


NUMA is not good for this.


You can experiment with affinity to make sure things are all on the same 
physical processor as your NIC...


We no longer buy multi-processor boxes for issues like this, NUMA is bad...


> On August 14, 2017 at 2:32 PM Jason W Zheng via USRP-users 
>  wrote:
> 
> 
>  
> 
> I'm running on a server with 2 Intel Xeon E5-2650 v4, CPU is listed here:
> 
> https://ark.intel.com/products/91767/Intel-Xeon-Processor-E5-2650-v4-30M-Cache-2_20-GHz
>  
> https://ark.intel.com/products/91767/Intel-Xeon-Processor-E5-2650-v4-30M-Cache-2_20-GHz
> 
> The network card I'm using is the recommended Intel X520-DA2
> 
> I also have over 500 gigs of ram, so that is not an issue
> 
> I don't think my cpu or network card are the issue as when I change my 
> code to receive and transmit on separate channels, it works without any 
> underflows. 
> 
> 
>  
> 
> 
> -
> From: USRP-users  on behalf of Jason 
> W Zheng via USRP-users 
> Sent: Monday, August 14, 2017 11:27:24 AM
> To: ROBIN TORTORA
> Cc: usrp-users@lists.ettus.com
> Subject: Re: [USRP-users] Buffer underrun issue with simultaneous 
> transmit and receive on the X310
>  
> 
> How should I set the tx metadata? My application will essentially stream 
> continuously. 
> 
> 
> Thanks,
> 
> Jason
> 
> 
> -
> From: ROBIN TORTORA 
> Sent: Monday, August 14, 2017 11:17:07 AM
> To: Jason W Zheng via USRP-users; Jason W Zheng
> Subject: Re: [USRP-users] Buffer underrun issue with simultaneous 
> transmit and receive on the X310
>  
> 
> I dont see you setting the tx metadata object members to any values, so 
> you are essentially going to tx with default metadata IF there is a 
> constructor that initializes all the members to a consistent value...
> 
> > > On August 14, 2017 at 1:56 PM Jason W Zheng via USRP-users 
>  wrote:
> > 
> > 
> >  
> > 
> > Since I haven't gotten a response in a week, I thought some source 
> > code might help. I've removed any buffer dependencies leaving just the 
> > receive thread and transmit thread. The receive thread is constant 
> > receiving to a buffer, while the transmit thread is constantly transmitting 
> > 0s from another buffer. 
> > 
> > On the x310, when I receive and transmit from the same channel 
> > (same daughterboard), I get underflows (U's on the console), no matter what 
> > the rate. When I put receive and transmit on separate channels, the U's go 
> > away. 
> > 
> > How do I fix my source code so I can receive and transmit from the 
> > same channel without underflows? 
> > 
> > Thanks,
> > Jason
> > 
> >  
> > 
> > 
> > -
> > From: USRP-users  on behalf of 
> > Jason W Zheng via USRP-users 
> > Sent: Monday, August 7, 2017 1:05:05 PM
> > To: usrp-users@lists.ettus.com
> > Subject: [USRP-users] Buffer underrun issue with simultaneous 
> > transmit and receive on the X310
> >  
> > 
> >  
> > 
> > Hi,
> > 
> > 
> > I'm building an application where I receive data from the x310, 
> > process the data, then transmit it out. I have 3 separate threads running, 
> > one for each task. The receive task is constantly receiving data from the 
> > x310 at 200MS/s and putting it into a buffer. The process task takes data 
> > from the receive buffer, processes it, and puts it into a transmit buffer. 
> > The transmit task is constantly transmitting data from the transmit buffer 
> > at 12.5 MS/s. 
> > 
> > 
> > I get constant underruns (U's on the console) when I try to receive 
> > and transmit from the same channel on the x310. However, when I transmit 
> > and receive on separate channels, underruns no longer occur. I would like 
> > to figure out a solution to this problem as I want to processes two 200MS/s 
> > streams on 1 x310. 
> > 
> > 
> > This problem occurs no matter the sample rates. I've tried lowering 
> > the receive rate to 50MS/s (while transmitting 4x the data to balance 
> > things out) and there are still constant underruns though at a lower rate.  
> > I know processing time is not the issue as I've profiled the time it takes 
> > to process, and I have even removed the processing task from the 
> > application altogether (receive data to a buffer and do nothing with the 
> > data; constantly transmit 0's from the transmit 

Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread Marcus D. Leech via USRP-users

On 08/14/2017 02:48 PM, Jason W Zheng wrote:


Hi Marcus, Robin,


I've set the tx_metadata, yet the issue still occurs. There are 
constant streams of underruns when receiving and transmitting on the 
same channel.



I've attached the code

One thing I notice, and forgive me if I'm just missing it, is that 
there's no coordination of the buffer between TX and RX threads--that 
is, the TX thread
  has no way of knowing when there's a buffer "ready" to be 
transmitted.  Again, I may have just missed it.






*From:* USRP-users  on behalf of 
Marcus D. Leech via USRP-users 

*Sent:* Monday, August 14, 2017 11:32:21 AM
*To:* usrp-users@lists.ettus.com
*Subject:* Re: [USRP-users] Buffer underrun issue with simultaneous 
transmit and receive on the X310

On 08/14/2017 02:27 PM, Jason W Zheng via USRP-users wrote:


How should I set the tx metadata? My application will essentially 
stream continuously.



Thanks,

Jason

From the tx_samples_from_file  example code (which you should probably 
study)


   uhd::tx_metadata_t md;
md.start_of_burst = false;
md.end_of_burst = false;




*From:* ROBIN TORTORA 
*Sent:* Monday, August 14, 2017 11:17:07 AM
*To:* Jason W Zheng via USRP-users; Jason W Zheng
*Subject:* Re: [USRP-users] Buffer underrun issue with simultaneous 
transmit and receive on the X310


I dont see you setting the tx metadata object members to any values, 
so you are essentially going to tx with default metadata IF there is 
a constructor that initializes all the members to a consistent value...


On August 14, 2017 at 1:56 PM Jason W Zheng via USRP-users 
 wrote:



Since I haven't gotten a response in a week, I thought some source 
code might help. I've removed any buffer dependencies leaving just 
the receive thread and transmit thread. The receive thread is 
constant receiving to a buffer, while the transmit thread is 
constantly transmitting 0s from another buffer.


On the x310, when I receive and transmit from the same channel (same 
daughterboard), I get underflows (U's on the console), no matter 
what the rate. When I put receive and transmit on separate channels, 
the U's go away.


How do I fix my source code so I can receive and transmit from the 
same channel without underflows?


Thanks,
Jason



*From:* USRP-users  on behalf of 
Jason W Zheng via USRP-users 

*Sent:* Monday, August 7, 2017 1:05:05 PM
*To:* usrp-users@lists.ettus.com
*Subject:* [USRP-users] Buffer underrun issue with simultaneous 
transmit and receive on the X310



Hi,


I'm building an application where I receive data from the x310, 
process the data, then transmit it out. I have 3 separate threads 
running, one for each task. The receive task is constantly receiving 
data from the x310 at 200MS/s and putting it into a buffer. The 
process task takes data from the receive buffer, processes it, and 
puts it into a transmit buffer. The transmit task is constantly 
transmitting data from the transmit buffer at 12.5 MS/s.



I get constant underruns (U's on the console) when I try to receive 
and transmit from the same channel on the x310. However, when I 
transmit and receive on separate channels, underruns no longer 
occur. I would like to figure out a solution to this problem as I 
want to processes two 200MS/s streams on 1 x310.



This problem occurs no matter the sample rates. I've tried lowering 
the receive rate to 50MS/s (while transmitting 4x the data to 
balance things out) and there are still constant underruns though at 
a lower rate.  I know processing time is not the issue as I've 
profiled the time it takes to process, and I have even removed the 
processing task from the application altogether (receive data to a 
buffer and do nothing with the data; constantly transmit 0's from 
the transmit buffer) and the underruns still occur.



I'm running on UHD 3.11.0, and the x310 is is configured with basic 
TX/RX daughterboards and flashed with the XG image for use over two 
10 gig ethernet links.



Thanks,

Jason






___
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




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


Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread Jason W Zheng via USRP-users
I'm running on a server with 2 Intel Xeon E5-2650 v4, CPU is listed here:
https://ark.intel.com/products/91767/Intel-Xeon-Processor-E5-2650-v4-30M-Cache-2_20-GHz

The network card I'm using is the recommended Intel X520-DA2

I also have over 500 gigs of ram, so that is not an issue

I don't think my cpu or network card are the issue as when I change my code to 
receive and transmit on separate channels, it works without any underflows.



From: USRP-users  on behalf of Jason W 
Zheng via USRP-users 
Sent: Monday, August 14, 2017 11:27:24 AM
To: ROBIN TORTORA
Cc: usrp-users@lists.ettus.com
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310


How should I set the tx metadata? My application will essentially stream 
continuously.


Thanks,

Jason


From: ROBIN TORTORA 
Sent: Monday, August 14, 2017 11:17:07 AM
To: Jason W Zheng via USRP-users; Jason W Zheng
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310


I dont see you setting the tx metadata object members to any values, so you are 
essentially going to tx with default metadata IF there is a constructor that 
initializes all the members to a consistent value...

On August 14, 2017 at 1:56 PM Jason W Zheng via USRP-users 
 wrote:




Since I haven't gotten a response in a week, I thought some source code might 
help. I've removed any buffer dependencies leaving just the receive thread and 
transmit thread. The receive thread is constant receiving to a buffer, while 
the transmit thread is constantly transmitting 0s from another buffer.

On the x310, when I receive and transmit from the same channel (same 
daughterboard), I get underflows (U's on the console), no matter what the rate. 
When I put receive and transmit on separate channels, the U's go away.

How do I fix my source code so I can receive and transmit from the same channel 
without underflows?

Thanks,
Jason




From: USRP-users  on behalf of Jason W 
Zheng via USRP-users 
Sent: Monday, August 7, 2017 1:05:05 PM
To: usrp-users@lists.ettus.com
Subject: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310




Hi,


I'm building an application where I receive data from the x310, process the 
data, then transmit it out. I have 3 separate threads running, one for each 
task. The receive task is constantly receiving data from the x310 at 200MS/s 
and putting it into a buffer. The process task takes data from the receive 
buffer, processes it, and puts it into a transmit buffer. The transmit task is 
constantly transmitting data from the transmit buffer at 12.5 MS/s.


I get constant underruns (U's on the console) when I try to receive and 
transmit from the same channel on the x310. However, when I transmit and 
receive on separate channels, underruns no longer occur. I would like to figure 
out a solution to this problem as I want to processes two 200MS/s streams on 1 
x310.


This problem occurs no matter the sample rates. I've tried lowering the receive 
rate to 50MS/s (while transmitting 4x the data to balance things out) and there 
are still constant underruns though at a lower rate.  I know processing time is 
not the issue as I've profiled the time it takes to process, and I have even 
removed the processing task from the application altogether (receive data to a 
buffer and do nothing with the data; constantly transmit 0's from the transmit 
buffer) and the underruns still occur.


I'm running on UHD 3.11.0, and the x310 is is configured with basic TX/RX 
daughterboards and flashed with the XG image for use over two 10 gig ethernet 
links.


Thanks,

Jason






___
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


Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread Jason W Zheng via USRP-users
How should I set the tx metadata? My application will essentially stream 
continuously.


Thanks,

Jason


From: ROBIN TORTORA 
Sent: Monday, August 14, 2017 11:17:07 AM
To: Jason W Zheng via USRP-users; Jason W Zheng
Subject: Re: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310


I dont see you setting the tx metadata object members to any values, so you are 
essentially going to tx with default metadata IF there is a constructor that 
initializes all the members to a consistent value...

On August 14, 2017 at 1:56 PM Jason W Zheng via USRP-users 
 wrote:




Since I haven't gotten a response in a week, I thought some source code might 
help. I've removed any buffer dependencies leaving just the receive thread and 
transmit thread. The receive thread is constant receiving to a buffer, while 
the transmit thread is constantly transmitting 0s from another buffer.

On the x310, when I receive and transmit from the same channel (same 
daughterboard), I get underflows (U's on the console), no matter what the rate. 
When I put receive and transmit on separate channels, the U's go away.

How do I fix my source code so I can receive and transmit from the same channel 
without underflows?

Thanks,
Jason




From: USRP-users  on behalf of Jason W 
Zheng via USRP-users 
Sent: Monday, August 7, 2017 1:05:05 PM
To: usrp-users@lists.ettus.com
Subject: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310




Hi,


I'm building an application where I receive data from the x310, process the 
data, then transmit it out. I have 3 separate threads running, one for each 
task. The receive task is constantly receiving data from the x310 at 200MS/s 
and putting it into a buffer. The process task takes data from the receive 
buffer, processes it, and puts it into a transmit buffer. The transmit task is 
constantly transmitting data from the transmit buffer at 12.5 MS/s.


I get constant underruns (U's on the console) when I try to receive and 
transmit from the same channel on the x310. However, when I transmit and 
receive on separate channels, underruns no longer occur. I would like to figure 
out a solution to this problem as I want to processes two 200MS/s streams on 1 
x310.


This problem occurs no matter the sample rates. I've tried lowering the receive 
rate to 50MS/s (while transmitting 4x the data to balance things out) and there 
are still constant underruns though at a lower rate.  I know processing time is 
not the issue as I've profiled the time it takes to process, and I have even 
removed the processing task from the application altogether (receive data to a 
buffer and do nothing with the data; constantly transmit 0's from the transmit 
buffer) and the underruns still occur.


I'm running on UHD 3.11.0, and the x310 is is configured with basic TX/RX 
daughterboards and flashed with the XG image for use over two 10 gig ethernet 
links.


Thanks,

Jason






___
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


Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread ROBIN TORTORA via USRP-users
I dont see you setting the tx metadata object members to any values, so you are 
essentially going to tx with default metadata IF there is a constructor that 
initializes all the members to a consistent value...

> On August 14, 2017 at 1:56 PM Jason W Zheng via USRP-users 
>  wrote:
> 
> 
>  
> 
> Since I haven't gotten a response in a week, I thought some source code 
> might help. I've removed any buffer dependencies leaving just the receive 
> thread and transmit thread. The receive thread is constant receiving to a 
> buffer, while the transmit thread is constantly transmitting 0s from another 
> buffer. 
> 
> On the x310, when I receive and transmit from the same channel (same 
> daughterboard), I get underflows (U's on the console), no matter what the 
> rate. When I put receive and transmit on separate channels, the U's go away. 
> 
> How do I fix my source code so I can receive and transmit from the same 
> channel without underflows? 
> 
> Thanks,
> Jason
> 
>  
> 
> 
> -
> From: USRP-users  on behalf of Jason 
> W Zheng via USRP-users 
> Sent: Monday, August 7, 2017 1:05:05 PM
> To: usrp-users@lists.ettus.com
> Subject: [USRP-users] Buffer underrun issue with simultaneous transmit 
> and receive on the X310
>  
> 
>  
> 
> Hi,
> 
> 
> I'm building an application where I receive data from the x310, process 
> the data, then transmit it out. I have 3 separate threads running, one for 
> each task. The receive task is constantly receiving data from the x310 at 
> 200MS/s and putting it into a buffer. The process task takes data from the 
> receive buffer, processes it, and puts it into a transmit buffer. The 
> transmit task is constantly transmitting data from the transmit buffer at 
> 12.5 MS/s. 
> 
> 
> I get constant underruns (U's on the console) when I try to receive and 
> transmit from the same channel on the x310. However, when I transmit and 
> receive on separate channels, underruns no longer occur. I would like to 
> figure out a solution to this problem as I want to processes two 200MS/s 
> streams on 1 x310. 
> 
> 
> This problem occurs no matter the sample rates. I've tried lowering the 
> receive rate to 50MS/s (while transmitting 4x the data to balance things out) 
> and there are still constant underruns though at a lower rate.  I know 
> processing time is not the issue as I've profiled the time it takes to 
> process, and I have even removed the processing task from the application 
> altogether (receive data to a buffer and do nothing with the data; constantly 
> transmit 0's from the transmit buffer) and the underruns still occur. 
> 
> 
> I'm running on UHD 3.11.0, and the x310 is is configured with basic TX/RX 
> daughterboards and flashed with the XG image for use over two 10 gig ethernet 
> links. 
> 
> 
> Thanks,
> 
> Jason
> 
> 
>  
> 


 

> ___
> 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


Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread Marcus D. Leech via USRP-users
What are the specs on your computer?   What type of 10GiG interface card
are you using? 

On 2017-08-14 13:56, Jason W Zheng via USRP-users wrote:

> Since I haven't gotten a response in a week, I thought some source code might 
> help. I've removed any buffer dependencies leaving just the receive thread 
> and transmit thread. The receive thread is constant receiving to a buffer, 
> while the transmit thread is constantly transmitting 0s from another buffer.  
> 
> On the x310, when I receive and transmit from the same channel (same 
> daughterboard), I get underflows (U's on the console), no matter what the 
> rate. When I put receive and transmit on separate channels, the U's go away.  
> 
> How do I fix my source code so I can receive and transmit from the same 
> channel without underflows?  
> 
> Thanks, 
> Jason 
> 
> -
> 
> FROM: USRP-users  on behalf of Jason W 
> Zheng via USRP-users 
> SENT: Monday, August 7, 2017 1:05:05 PM
> TO: usrp-users@lists.ettus.com
> SUBJECT: [USRP-users] Buffer underrun issue with simultaneous transmit and 
> receive on the X310 
> 
> Hi, 
> 
> I'm building an application where I receive data from the x310, process the 
> data, then transmit it out. I have 3 separate threads running, one for each 
> task. The receive task is constantly receiving data from the x310 at 200MS/s 
> and putting it into a buffer. The process task takes data from the receive 
> buffer, processes it, and puts it into a transmit buffer. The transmit task 
> is constantly transmitting data from the transmit buffer at 12.5 MS/s.  
> 
> I get constant underruns (U's on the console) when I try to receive and 
> transmit from the same channel on the x310. However, when I transmit and 
> receive on separate channels, underruns no longer occur. I would like to 
> figure out a solution to this problem as I want to processes two 200MS/s 
> streams on 1 x310.  
> 
> This problem occurs no matter the sample rates. I've tried lowering the 
> receive rate to 50MS/s (while transmitting 4x the data to balance things out) 
> and there are still constant underruns though at a lower rate.  I know 
> processing time is not the issue as I've profiled the time it takes to 
> process, and I have even removed the processing task from the application 
> altogether (receive data to a buffer and do nothing with the data; constantly 
> transmit 0's from the transmit buffer) and the underruns still occur.  
> 
> I'm running on UHD 3.11.0, and the x310 is is configured with basic TX/RX 
> daughterboards and flashed with the XG image for use over two 10 gig ethernet 
> links.  
> 
> Thanks, 
> 
> Jason 
> 
> ___
> 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


Re: [USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-14 Thread Jason W Zheng via USRP-users
Since I haven't gotten a response in a week, I thought some source code might 
help. I've removed any buffer dependencies leaving just the receive thread and 
transmit thread. The receive thread is constant receiving to a buffer, while 
the transmit thread is constantly transmitting 0s from another buffer.

On the x310, when I receive and transmit from the same channel (same 
daughterboard), I get underflows (U's on the console), no matter what the rate. 
When I put receive and transmit on separate channels, the U's go away.

How do I fix my source code so I can receive and transmit from the same channel 
without underflows?

Thanks,
Jason


From: USRP-users  on behalf of Jason W 
Zheng via USRP-users 
Sent: Monday, August 7, 2017 1:05:05 PM
To: usrp-users@lists.ettus.com
Subject: [USRP-users] Buffer underrun issue with simultaneous transmit and 
receive on the X310


Hi,


I'm building an application where I receive data from the x310, process the 
data, then transmit it out. I have 3 separate threads running, one for each 
task. The receive task is constantly receiving data from the x310 at 200MS/s 
and putting it into a buffer. The process task takes data from the receive 
buffer, processes it, and puts it into a transmit buffer. The transmit task is 
constantly transmitting data from the transmit buffer at 12.5 MS/s.


I get constant underruns (U's on the console) when I try to receive and 
transmit from the same channel on the x310. However, when I transmit and 
receive on separate channels, underruns no longer occur. I would like to figure 
out a solution to this problem as I want to processes two 200MS/s streams on 1 
x310.


This problem occurs no matter the sample rates. I've tried lowering the receive 
rate to 50MS/s (while transmitting 4x the data to balance things out) and there 
are still constant underruns though at a lower rate.  I know processing time is 
not the issue as I've profiled the time it takes to process, and I have even 
removed the processing task from the application altogether (receive data to a 
buffer and do nothing with the data; constantly transmit 0's from the transmit 
buffer) and the underruns still occur.


I'm running on UHD 3.11.0, and the x310 is is configured with basic TX/RX 
daughterboards and flashed with the XG image for use over two 10 gig ethernet 
links.


Thanks,

Jason

// // CUDA runtime
// #include 

// // helper functions and utilities to work with CUDA
// #include 
// #include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
//#include 
#include 

#include 
#include 
#include 
#include 

typedef std::complex Complex;

// Constants and signal variables
static bool stop_signal_called = false;
const int NUM_CHANNELS = 1;
const int BUFF_SIZE = 64000;

//function prototypes here
void recvTask(Complex *buff, uhd::rx_streamer::sptr rx_stream);
void txTask(Complex *buff, uhd::tx_streamer::sptr tx_stream);
void sig_int_handler(int){
std::cout << "Interrupt Signal Received" << std::endl;
stop_signal_called = true;
}

int UHD_SAFE_MAIN(int argc, char *argv[]) {

uhd::set_thread_priority_safe();

//type=x300,addr=192.168.30.2,second_addr=192.168.40.2
std::cout << std::endl;
std::cout << boost::format("Creating the usrp device") << std::endl;
uhd::usrp::multi_usrp::sptr usrp = 
uhd::usrp::multi_usrp::make(std::string("type=x300,addr=192.168.30.2,second_addr=192.168.40.2"));
std::cout << std::endl;

//set stream args
uhd::stream_args_t stream_args("sc16"); 

double samp_rate_tx = 100e6;
double samp_rate_rx = 100e6;
uhd::tune_request_t tune_request(0);

//Lock mboard clocks
usrp->set_clock_source(std::string("internal"));

//set rx parameters
usrp->set_rx_rate(samp_rate_rx);
usrp->set_rx_freq(tune_request);
usrp->set_rx_gain(0);

//set tx parameters
usrp->set_tx_rate(samp_rate_tx);
usrp->set_tx_freq(tune_request);
usrp->set_tx_gain(0);

std::signal(SIGINT, _int_handler);
std::cout << "Press Ctrl + C to stop streaming..." << std::endl;

//create buffers, 2 per channel (1 for tx, 1 for rx)
// transmitting complex shorts -> typedef as Complex
Complex *rx_buffs[NUM_CHANNELS];
Complex *tx_buffs[NUM_CHANNELS];

for (int i = 0; i < NUM_CHANNELS; i++){
rx_buffs[i] = new Complex[BUFF_SIZE];
tx_buffs[i] = new Complex[BUFF_SIZE];
// only transmitting 0's 
std::fill(tx_buffs[i], tx_buffs[i]+BUFF_SIZE, 0);
}

//
START RECEIVE AND TRANSMIT THREADS
//

printf("setting up threading\n");

usrp -> set_time_now(uhd::time_spec_t(0.0));

// set up RX streams and threads
std::thread 

[USRP-users] Buffer underrun issue with simultaneous transmit and receive on the X310

2017-08-07 Thread Jason W Zheng via USRP-users
Hi,


I'm building an application where I receive data from the x310, process the 
data, then transmit it out. I have 3 separate threads running, one for each 
task. The receive task is constantly receiving data from the x310 at 200MS/s 
and putting it into a buffer. The process task takes data from the receive 
buffer, processes it, and puts it into a transmit buffer. The transmit task is 
constantly transmitting data from the transmit buffer at 12.5 MS/s.


I get constant underruns (U's on the console) when I try to receive and 
transmit from the same channel on the x310. However, when I transmit and 
receive on separate channels, underruns no longer occur. I would like to figure 
out a solution to this problem as I want to processes two 200MS/s streams on 1 
x310.


This problem occurs no matter the sample rates. I've tried lowering the receive 
rate to 50MS/s (while transmitting 4x the data to balance things out) and there 
are still constant underruns though at a lower rate.  I know processing time is 
not the issue as I've profiled the time it takes to process, and I have even 
removed the processing task from the application altogether (receive data to a 
buffer and do nothing with the data; constantly transmit 0's from the transmit 
buffer) and the underruns still occur.


I'm running on UHD 3.11.0, and the x310 is is configured with basic TX/RX 
daughterboards and flashed with the XG image for use over two 10 gig ethernet 
links.


Thanks,

Jason

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