move command line sample offset and 3/4 sampling option at top level, as it is common option for 4G,5G xNB and UE
This commit is contained in:
@@ -138,7 +138,7 @@ static int trx_brf_write(openair0_device *device,
|
||||
brf_state_t *brf = (brf_state_t*)device->priv;
|
||||
/* BRF has only 1 rx/tx chaine : is it correct? */
|
||||
int16_t *samples = (int16_t*)buff[0];
|
||||
|
||||
timestamp -= device->openair0_cfg->command_line_sample_advance - device->openair0_cfg->tx_sample_advance;
|
||||
//memset(&brf->meta_tx, 0, sizeof(brf->meta_tx));
|
||||
// When BLADERF_META_FLAG_TX_NOW is used the timestamp is not used, so one can't schedule a tx
|
||||
if (brf->meta_tx.flags == 0 )
|
||||
|
||||
@@ -96,7 +96,7 @@ int load_lib(openair0_device *device,
|
||||
loader_shlibfunc_t shlib_fdesc[1];
|
||||
int ret=0;
|
||||
char *deflibname=OAI_RF_LIBNAME;
|
||||
|
||||
openair0_cfg->command_line_sample_advance = get_softmodem_params()->command_line_sample_advance;
|
||||
openair0_cfg->recplay_mode = read_recplayconfig(&(openair0_cfg->recplay_conf),&(device->recplay_state));
|
||||
|
||||
if (openair0_cfg->recplay_mode == RECPLAY_RECORDMODE) {
|
||||
|
||||
@@ -215,6 +215,7 @@ typedef struct openair0_config {
|
||||
int mmapped_dma;
|
||||
//! offset in samples between TX and RX paths
|
||||
int tx_sample_advance;
|
||||
int command_line_sample_advance;
|
||||
//! samples per packet on the fronthaul interface
|
||||
int samples_per_packet;
|
||||
//! number of RX channels (=RX antennas)
|
||||
|
||||
@@ -137,7 +137,7 @@ trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buf
|
||||
using namespace std::chrono;
|
||||
|
||||
int flag = 0;
|
||||
|
||||
timestamp -= device->openair0_cfg->command_line_sample_advance - device->openair0_cfg->tx_sample_advance;
|
||||
iris_state_t *s = (iris_state_t *) device->priv;
|
||||
int nsamps2; // aligned to upper 32 or 16 byte boundary
|
||||
nsamps2 = (nsamps+7)>>3;
|
||||
@@ -164,8 +164,7 @@ trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buf
|
||||
flag |= SOAPY_SDR_END_BURST;
|
||||
}
|
||||
|
||||
|
||||
long long timeNs = SoapySDR::ticksToTimeNs(timestamp, s->sample_rate / SAMPLE_RATE_DOWN);
|
||||
long long timeNs = SoapySDR::ticksToTimeNs(timestamp - device.command_line_sample_advance, s->sample_rate / SAMPLE_RATE_DOWN);
|
||||
uint32_t *samps[2]; //= (uint32_t **)buff;
|
||||
int r;
|
||||
int m = s->tx_num_channels;
|
||||
|
||||
@@ -73,15 +73,13 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
|
||||
\returns 0 on success
|
||||
*/
|
||||
int trx_lms_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int antenna_id, int flags) {
|
||||
timestamp -= device->openair0_cfg->command_line_sample_advance - device->openair0_cfg->tx_sample_advance;
|
||||
lms_stream_meta_t meta;
|
||||
meta.waitForTimestamp = true;
|
||||
meta.flushPartialPacket = false;
|
||||
meta.timestamp = timestamp;
|
||||
|
||||
|
||||
lms_stream_meta_t meta;
|
||||
meta.waitForTimestamp = true;
|
||||
meta.flushPartialPacket = false;
|
||||
meta.timestamp = timestamp;
|
||||
|
||||
|
||||
return LMS_SendStream(&tx_stream,(const void*)buff[0],nsamps,&meta,30);
|
||||
return LMS_SendStream(&tx_stream, (const void *)buff[0], nsamps, &meta, 30);
|
||||
}
|
||||
|
||||
/*! \brief Receive samples from hardware.
|
||||
|
||||
@@ -428,6 +428,7 @@ static int trx_usrp_write(openair0_device *device,
|
||||
int flags) {
|
||||
int ret=0;
|
||||
usrp_state_t *s = (usrp_state_t *)device->priv;
|
||||
timestamp -= device->openair0_cfg->command_line_sample_advance - device->openair0_cfg->tx_sample_advance;
|
||||
int nsamps2; // aligned to upper 32 or 16 byte boundary
|
||||
|
||||
radio_tx_burst_flag_t flags_burst = (radio_tx_burst_flag_t) (flags & 0xf);
|
||||
|
||||
@@ -755,6 +755,7 @@ static int rfsimulator_write_internal(rfsimulator_state_t *t, openair0_timestamp
|
||||
}
|
||||
|
||||
static int rfsimulator_write(openair0_device *device, openair0_timestamp timestamp, void **samplesVoid, int nsamps, int nbAnt, int flags) {
|
||||
timestamp -= device->openair0_cfg->command_line_sample_advance;
|
||||
return rfsimulator_write_internal(device->priv, timestamp, samplesVoid, nsamps, nbAnt, flags, false); // false = with lock
|
||||
// return rfsimulator_write_internal(device->priv, timestamp, samplesVoid, nsamps, nbAnt, flags, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user