Skip to content
Snippets Groups Projects
Commit a8181894 authored by Raymond Knopp's avatar Raymond Knopp
Browse files

changed the rxgain values for USRP (seemed to have changed with new UHD driver 3.8.0)

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6408 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 03b2d7dd
Branches
Tags
No related merge requests found
...@@ -1858,7 +1858,7 @@ static void *UE_thread_synch(void *arg) { ...@@ -1858,7 +1858,7 @@ static void *UE_thread_synch(void *arg) {
for (i=0; i<openair0_cfg[card].rx_num_channels; i++) { for (i=0; i<openair0_cfg[card].rx_num_channels; i++) {
openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i]+openair_daq_vars.freq_offset; openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i]+openair_daq_vars.freq_offset;
openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i]+openair_daq_vars.freq_offset; openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i]+openair_daq_vars.freq_offset;
openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB-73; // 65 calibrated for USRP B210 @ 2.6 GHz openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB-82; // 65 calibrated for USRP B210 @ 2.6 GHz
#ifdef USRP #ifdef USRP
#ifndef USRP_DEBUG #ifndef USRP_DEBUG
openair0_set_frequencies(&openair0,&openair0_cfg[0]); openair0_set_frequencies(&openair0,&openair0_cfg[0]);
...@@ -1977,32 +1977,32 @@ static void *UE_thread_rx(void *arg) { ...@@ -1977,32 +1977,32 @@ static void *UE_thread_rx(void *arg) {
PHY_VARS_UE *UE = (PHY_VARS_UE*)arg; PHY_VARS_UE *UE = (PHY_VARS_UE*)arg;
int i; int i;
/*
#ifdef LOWLATENCY #ifdef LOWLATENCY
struct sched_attr attr; struct sched_attr attr;
unsigned int flags = 0; unsigned int flags = 0;
#endif #endif
*/
UE->instance_cnt_rx=-1; UE->instance_cnt_rx=-1;
/*
#ifdef LOWLATENCY #ifdef LOWLATENCY
attr.size = sizeof(attr); attr.size = sizeof(attr);
attr.sched_flags = 0; attr.sched_flags = 0;
attr.sched_nice = 0; attr.sched_nice = 0;
attr.sched_priority = 0; attr.sched_priority = 0;
/* This creates a 1ms reservation every 10ms period*/ // This creates a 1ms reservation every 10ms period
attr.sched_policy = SCHED_DEADLINE; attr.sched_policy = SCHED_DEADLINE;
attr.sched_runtime = 1 * 1000000; // each tx thread requires 1ms to finish its job attr.sched_runtime = 1 * 800000; // each tx thread requires 1ms to finish its job
attr.sched_deadline =1 * 1000000; // each tx thread will finish within 1ms attr.sched_deadline =1 * 1000000; // each tx thread will finish within 1ms
attr.sched_period = 1 * 10000000; // each tx thread has a period of 10ms from the starting point attr.sched_period = 1 * 1000000; // each tx thread has a period of 10ms from the starting point
if (sched_setattr(0, &attr, flags) < 0 ){ if (sched_setattr(0, &attr, flags) < 0 ){
perror("[SCHED] eNB tx thread: sched_setattr failed\n"); perror("[SCHED] eNB tx thread: sched_setattr failed\n");
exit(-1); exit(-1);
} }
#endif #endif
*/
mlockall(MCL_CURRENT | MCL_FUTURE); mlockall(MCL_CURRENT | MCL_FUTURE);
#ifndef EXMIMO #ifndef EXMIMO
...@@ -2101,12 +2101,13 @@ static void *UE_thread(void *arg) { ...@@ -2101,12 +2101,13 @@ static void *UE_thread(void *arg) {
unsigned int rxs; unsigned int rxs;
void *rxp[2],*txp[2]; void *rxp[2],*txp[2];
/*
#ifdef LOWLATENCY #ifdef LOWLATENCY
struct sched_attr attr; struct sched_attr attr;
unsigned int flags = 0; unsigned int flags = 0;
unsigned long mask = 1; /* processor 0 */ unsigned long mask = 1; // processor 0
#endif #endif
*/
printf("waiting for sync (UE_thread)\n"); printf("waiting for sync (UE_thread)\n");
#ifdef RTAI #ifdef RTAI
...@@ -2121,22 +2122,23 @@ static void *UE_thread(void *arg) { ...@@ -2121,22 +2122,23 @@ static void *UE_thread(void *arg) {
#endif #endif
printf("starting UE thread\n"); printf("starting UE thread\n");
/*
#ifdef LOWLATENCY #ifdef LOWLATENCY
attr.size = sizeof(attr); attr.size = sizeof(attr);
attr.sched_flags = 0; attr.sched_flags = 0;
attr.sched_nice = 0; attr.sched_nice = 0;
attr.sched_priority = 0; attr.sched_priority = 0;
/* This creates a .5 ms reservation */ // This creates a .5 ms reservation
attr.sched_policy = SCHED_DEADLINE; attr.sched_policy = SCHED_DEADLINE;
attr.sched_runtime = 0.5 * 1000000; attr.sched_runtime = 0.5 * 1000000;
attr.sched_deadline = 0.5 * 1000000; attr.sched_deadline = 0.5 * 1000000;
attr.sched_period = 1 * 1000000; attr.sched_period = 1 * 1000000;
/* pin the UE main thread to CPU0*/ // pin the UE main thread to CPU0
/* if (pthread_setaffinity_np(pthread_self(), sizeof(mask),&mask) <0) { // if (pthread_setaffinity_np(pthread_self(), sizeof(mask),&mask) <0) {
perror("[MAIN_ENB_THREAD] pthread_setaffinity_np failed\n"); // perror("[MAIN_ENB_THREAD] pthread_setaffinity_np failed\n");
}*/ // }
if (sched_setattr(0, &attr, flags) < 0 ){ if (sched_setattr(0, &attr, flags) < 0 ){
perror("[SCHED] main eNB thread: sched_setattr failed\n"); perror("[SCHED] main eNB thread: sched_setattr failed\n");
...@@ -2146,6 +2148,7 @@ static void *UE_thread(void *arg) { ...@@ -2146,6 +2148,7 @@ static void *UE_thread(void *arg) {
gettid(),sched_getcpu()); gettid(),sched_getcpu());
} }
#endif #endif
*/
mlockall(MCL_CURRENT | MCL_FUTURE); mlockall(MCL_CURRENT | MCL_FUTURE);
T0 = rt_get_time_ns(); T0 = rt_get_time_ns();
...@@ -3411,7 +3414,7 @@ int main(int argc, char **argv) { ...@@ -3411,7 +3414,7 @@ int main(int argc, char **argv) {
openair0_cfg[card].tx_gain[i] = tx_gain[0][i]; openair0_cfg[card].tx_gain[i] = tx_gain[0][i];
openair0_cfg[card].rx_gain[i] = ((UE_flag==0) ? PHY_vars_eNB_g[0][0]->rx_total_gain_eNB_dB : openair0_cfg[card].rx_gain[i] = ((UE_flag==0) ? PHY_vars_eNB_g[0][0]->rx_total_gain_eNB_dB :
PHY_vars_UE_g[0][0]->rx_total_gain_dB) - 73.0; // calibrated for USRP B210 @ 2.6 GHz PHY_vars_UE_g[0][0]->rx_total_gain_dB) - 82.0; // calibrated for USRP B210 @ 2.6 GHz
openair0_cfg[card].tx_freq[i] = (UE_flag==0) ? downlink_frequency[0][i] : downlink_frequency[0][i]+uplink_frequency_offset[0][i]; openair0_cfg[card].tx_freq[i] = (UE_flag==0) ? downlink_frequency[0][i] : downlink_frequency[0][i]+uplink_frequency_offset[0][i];
openair0_cfg[card].rx_freq[i] = (UE_flag==0) ? downlink_frequency[0][i] + uplink_frequency_offset[0][i] : downlink_frequency[0][i]; openair0_cfg[card].rx_freq[i] = (UE_flag==0) ? downlink_frequency[0][i] + uplink_frequency_offset[0][i] : downlink_frequency[0][i];
printf("Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n", printf("Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment