From 727d26e75f19bebf986af52e472656e0c813e384 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 14 Jun 2018 14:46:29 +0200 Subject: [PATCH] init Soapy with LTE rates before creating streams --- lib/src/phy/rf/rf_soapy_imp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/phy/rf/rf_soapy_imp.c b/lib/src/phy/rf/rf_soapy_imp.c index 5f2c082e8..ba0043ac5 100644 --- a/lib/src/phy/rf/rf_soapy_imp.c +++ b/lib/src/phy/rf/rf_soapy_imp.c @@ -230,6 +230,11 @@ int rf_soapy_open_multi(char *args, void **h, uint32_t nof_rx_antennas) handler->tx_stream_active = false; handler->rx_stream_active = false; handler->devname = devname; + + // init rx/tx rate to lowest LTE rate + rf_soapy_set_rx_srate(handler, 1.92e6); + rf_soapy_set_tx_srate(handler, 1.92e6); + if(SoapySDRDevice_getNumChannels(handler->device,SOAPY_SDR_RX) > 0){ printf("Setting up RX stream\n"); if(SoapySDRDevice_setupStream(handler->device, &(handler->rxStream), SOAPY_SDR_RX, SOAPY_SDR_CF32, NULL, 0, NULL) != 0) { @@ -308,9 +313,6 @@ int rf_soapy_open_multi(char *args, void **h, uint32_t nof_rx_antennas) ant = SoapySDRDevice_getAntenna(handler->device, SOAPY_SDR_TX, 0); printf("Tx antenna set to %s\n", ant); - // init Rx rate to lowest LTE rate - rf_soapy_set_rx_srate(handler, 1.92e6); - // set default tx gain and leave some time to calibrate tx rf_soapy_set_tx_gain(handler, 35); usleep(10000);