You might need to make some tweaks to your system. Take a look at the
suggestions here:
https://kb.ettus.com/USRP_Host_Performance_Tuning_Tips_and_Tricks

Wade

On Mon, Jun 24, 2024 at 8:18 PM <cjohn...@serranosystems.com> wrote:

> Hi Wade,
>
> I am now receiving “U” instead of “L”. They don’t come out on the console
> that often, but it is “bad” if I see any.
> In addition, I did add a priority to the thread, you can see below (takes
> on a value between 0.0-100.0).
> I also tried setting the buffer to 10*1996.
> None of these efforts helped.
> Any suggestions on how I can get this to work without losing packets, or
> timing? FYI usrp->set_tx_rate(200e6).
> (Below is code, below that is the console output)
>
> // Main function to simulate packet transmission
> void transmit_packets_timespec(uhd::usrp::multi_usrp::sptr usrp, 
> uhd::tx_streamer::sptr tx_stream, std::atomic<bool> &gps_locked, double rate) 
> {
>     uhd::tx_metadata_t md;
>     md.start_of_burst = true;
>     md.end_of_burst = false;
>     md.has_time_spec = true;
>
>     // Attempt to set the thread priority
>     bool success = uhd::set_thread_priority_safe(0.90, true);
>     if (success) {
>         std::cout << "uhd::set_thread_priority_safe::Thread priority 
> successfully set." << std::endl;
>     } else {
>         std::cout << "uhd::set_thread_priority_safe::Failed to set thread 
> priority." << std::endl;
>     }
>
>     std::vector<std::complex<int16_t>> buffer(1996);
>
>     std::cout << "Start transmit_packets_timespec()" << std::endl;
>     std::cout << "Packet size: " << buffer.size() * 
> sizeof(std::complex<int16_t>) << " bytes" << std::endl;
>
>     // Get and print the maximum number of samples per packet
>     size_t max_num_samps = tx_stream->get_max_num_samps();
>     std::cout << "Max number of samples per packet: " << max_num_samps << 
> std::endl;
>
>     // Initialize timestamp
>     md.time_spec = uhd::time_spec_t(usrp->get_time_now().get_full_secs() + 
> 1.0); // Start 1 second in the future
>
>     while (true) {
>
>         size_t num_tx_samps = tx_stream->send(&buffer.front(), buffer.size(), 
> md);
>
>         if (num_tx_samps < buffer.size()) {
>             dropped_packets++;
>         } else {
>             transmitted_packets++;
>         }
>
>         //md.time_spec = md.time_spec + uhd::time_spec_t(buffer.size() / 
> rate);
>         md.has_time_spec = false;
>
>         md.start_of_burst = false;
>     }
>
>     // Mark end of burst
>     md.end_of_burst = true;
>     tx_stream->send("", 0, md);
> }
>
> *CONSOLE OUTPUT:*
>
> sudo ./tx_timed_samples_perf [INFO] [UHD] linux; GNU C++ version 9.4.0;
> Boost_107100; UHD_4.6.0.0-1-ga9f0b4c7 [INFO] [X300] X300 initialization
> sequence... [INFO] [X300] Maximum frame size: 8000 bytes. [INFO] [GPS]
> Found an internal GPSDO: LC_XO, Firmware Rev 0.929a [INFO] [X300] Radio 1x
> clock: 200 MHz Actual TX Rate: 200.000000 Msps Actual TX Freq: 1223.000003
> MHz Actual TX Gain: 20.000000 dB Actual TX Bandwidth: 200.000000 MHz
> [WARNING] [0/Radio#0] Attempting to set tick rate to 0. Skipping. Using
> transmit_packets_timespec() uhd::set_thread_priority_safe::Thread priority
> successfully set. Start transmit_packets_timespec() Packet size: 7984 bytes
> Max number of samples per packet: 1996
> UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
> _______________________________________________
> USRP-users mailing list -- usrp-users@lists.ettus.com
> To unsubscribe send an email to usrp-users-le...@lists.ettus.com
>
_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to