diff --git a/srsue/src/phy/phy_nr_sa.cc b/srsue/src/phy/phy_nr_sa.cc index c1e686b1c..efd480aa5 100644 --- a/srsue/src/phy/phy_nr_sa.cc +++ b/srsue/src/phy/phy_nr_sa.cc @@ -103,6 +103,10 @@ void phy_nr_sa::init_background() } workers.init(args, sync, stack); + // Set fix Tx and Rx sampling rates + radio->set_tx_srate(args.srate_hz); + radio->set_rx_srate(args.srate_hz); + is_configured = true; } @@ -258,4 +262,4 @@ bool phy_nr_sa::set_config(const srsran::phy_cfg_nr_t& cfg) return true; } -} // namespace srsue \ No newline at end of file +} // namespace srsue diff --git a/srsue/src/phy/sync_sa.cc b/srsue/src/phy/sync_sa.cc index a73c02dfc..4f38b4f11 100644 --- a/srsue/src/phy/sync_sa.cc +++ b/srsue/src/phy/sync_sa.cc @@ -281,7 +281,9 @@ void sync_sa::run_state_cell_camping() rf_buffer.set_nof_samples(slot_sz); rf_buffer.set(0, nr_worker->get_buffer(0, 0)); if (not slot_synchronizer.run_camping(rf_buffer, last_rx_time)) { - logger.error("SYNC: detected out-of-sync... unhandled outcome..."); + logger.error("SYNC: detected out-of-sync... skipping slot ..."); + nr_worker->release(); + return; } srsran::phy_common_interface::worker_context_t context; diff --git a/srsue/src/ue.cc b/srsue/src/ue.cc index 3b3dcb62f..ec7726fa7 100644 --- a/srsue/src/ue.cc +++ b/srsue/src/ue.cc @@ -82,6 +82,7 @@ int ue::init(const all_args_t& args_) phy_args_nr.worker_cpu_mask = args.phy.worker_cpu_mask; phy_args_nr.log = args.phy.log; phy_args_nr.store_pdsch_ko = args.phy.nr_store_pdsch_ko; + phy_args_nr.srate_hz = args.rf.srate_hz; // init layers if (args.phy.nof_lte_carriers == 0) { @@ -269,6 +270,12 @@ int ue::parse_args(const all_args_t& args_) // Consider Carrier Aggregation support if more than one args.stack.rrc.support_ca = (args.phy.nof_lte_carriers > 1); + // Make sure fix sampling rate is set for SA mode + if (args.phy.nof_lte_carriers == 0 and not std::isnormal(args.rf.srate_hz)) { + srsran::console("Error. NR Standalone PHY requires a fix RF sampling rate.\n"); + return SRSRAN_ERROR; + } + return SRSRAN_SUCCESS; }