usrp-users@lists.ettus.com

Discussion and technical support related to USRP, UHD, RFNoC

View all threads

x300 Timeout Error

BJ
Bilskie, Jessica - 0664 - MITLL
Thu, Jul 26, 2018 1:10 PM

Hello,

I am working with the x300 and am trying to receive on both RX2 channels and transmit on both TX/RX channels in real-time using UHD API . I am creating a stream for each channel, set the mode to continuous, issue the stream command, and then later issue receives (recv) and transmits (send) for the channel I wish to do this on. I have this run continuously so that any signal processing can be done in real-time on the received data and then transmitted properly.

//create a transmit streamer 1
usrp->set_tx_antenna("TX/RX"); //valid antennas are TX/RX and RX2
usrp->set_tx_subdev_spec(uhd::usrp::subdev_spec_t("A:0"));
uhd::stream_args_t stream_args1("fc32"); //complex floats;

            //create streamer for transmit 2, receive 1
            ...

            //create a receive streamer 2
            usrp->set_rx_antenna("RX2"); //valid antennas are TX/RX and RX2
            usrp->set_rx_subdev_spec(uhd::usrp::subdev_spec_t("B:0"));
             uhd::stream_args_t stream_args4("fc32"); //complex floats

            // start data transfer
            uhd::tx_streamer::sptr tx_stream1 = usrp->get_tx_stream(stream_args1);
            uhd::tx_streamer::sptr tx_stream2 = usrp->get_tx_stream(stream_args2);
            uhd::rx_streamer::sptr rx_stream1 = usrp->get_rx_stream(stream_args3);
            uhd::rx_streamer::sptr rx_stream2 = usrp->get_rx_stream(stream_args4);
            uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
            usrp->issue_stream_cmd(stream_cmd);
            printf("usrp data transfer started\n");

secs_since = difftime(time(0), start);
while (secs_since < end_time)
{
// fill transmit buffer with samples from receive buffer
rx_stream1->recv(&buf_usrp3.front(), buf_usrp3.size(), mdr1);
rx_stream2->recv(&buf_usrp4.front(), buf_usrp4.size(), mdr2);

                            // handle error codes from mdr1 and mdr2
                            ...

                            // signal processing on buf_usrp3 and buf_usrp4 to get buf_usrp1 and buf_usrp2
                            ...

// send the entire contents of the buffer
tx_stream1->send(&buf_usrp1.front(), buf_usrp1.size(), md);
tx_stream2->send(&buf_usrp2.front(), buf_usrp2.size(), md);

                            secs_since = difftime(time(0), start);
            }

            printf("%i \n", n);

            // stop data transfer
            usrp->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
            printf("usrp data transfer complete\n");

I keep getting a timeout error in the metadata on receive after a short period of time (it appears to be about 5 microseconds. When I run this code for one channel tx and one channel rx for the b200, it doesn't timeout. Has anyone else experienced this or know what needs to be done differently for the x300? I thought maybe it was similar to the issue (http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2015-March/012900.html) back in 2015, but it doesn't seem to be exactly the same issue as my code encounters the error much earlier.

Thanks in advance,
Jessica

Hello, I am working with the x300 and am trying to receive on both RX2 channels and transmit on both TX/RX channels in real-time using UHD API . I am creating a stream for each channel, set the mode to continuous, issue the stream command, and then later issue receives (recv) and transmits (send) for the channel I wish to do this on. I have this run continuously so that any signal processing can be done in real-time on the received data and then transmitted properly. //create a transmit streamer 1 usrp->set_tx_antenna("TX/RX"); //valid antennas are TX/RX and RX2 usrp->set_tx_subdev_spec(uhd::usrp::subdev_spec_t("A:0")); uhd::stream_args_t stream_args1("fc32"); //complex floats; //create streamer for transmit 2, receive 1 ... //create a receive streamer 2 usrp->set_rx_antenna("RX2"); //valid antennas are TX/RX and RX2 usrp->set_rx_subdev_spec(uhd::usrp::subdev_spec_t("B:0")); uhd::stream_args_t stream_args4("fc32"); //complex floats // start data transfer uhd::tx_streamer::sptr tx_stream1 = usrp->get_tx_stream(stream_args1); uhd::tx_streamer::sptr tx_stream2 = usrp->get_tx_stream(stream_args2); uhd::rx_streamer::sptr rx_stream1 = usrp->get_rx_stream(stream_args3); uhd::rx_streamer::sptr rx_stream2 = usrp->get_rx_stream(stream_args4); uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS); usrp->issue_stream_cmd(stream_cmd); printf("usrp data transfer started\n"); secs_since = difftime(time(0), start); while (secs_since < end_time) { // fill transmit buffer with samples from receive buffer rx_stream1->recv(&buf_usrp3.front(), buf_usrp3.size(), mdr1); rx_stream2->recv(&buf_usrp4.front(), buf_usrp4.size(), mdr2); // handle error codes from mdr1 and mdr2 ... // signal processing on buf_usrp3 and buf_usrp4 to get buf_usrp1 and buf_usrp2 ... // send the entire contents of the buffer tx_stream1->send(&buf_usrp1.front(), buf_usrp1.size(), md); tx_stream2->send(&buf_usrp2.front(), buf_usrp2.size(), md); secs_since = difftime(time(0), start); } printf("%i \n", n); // stop data transfer usrp->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS); printf("usrp data transfer complete\n"); I keep getting a timeout error in the metadata on receive after a short period of time (it appears to be about 5 microseconds. When I run this code for one channel tx and one channel rx for the b200, it doesn't timeout. Has anyone else experienced this or know what needs to be done differently for the x300? I thought maybe it was similar to the issue (http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2015-March/012900.html) back in 2015, but it doesn't seem to be exactly the same issue as my code encounters the error much earlier. Thanks in advance, Jessica