Change in osmo-trx[master]: lms: Initial multi-arfcn support

2020-01-16 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/16878 )

Change subject: lms: Initial multi-arfcn support
..

lms: Initial multi-arfcn support

With current state multi-arfcn can be used (eg. I can place a call
between 2 phones using TRX1 and sustain for as long as wanted), but from
time to time (around every 20seconds), a burst of Tx packed dropped
events from LimeSuite appears.

LimeNet-micro coefficients have yet not been tested.

Related: OS#4362
Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 17 insertions(+), 7 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index 5a5fbe4..884cc28 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -69,17 +69,21 @@
double max_tx_gain;
/* Sample rate coef (without having TX/RX samples per symbol into 
account) */
double rate;
+   /* Sample rate coef (without having TX/RX samples per symbol into 
account), if multi-arfcn is enabled */
+   double rate_multiarfcn;
/* Coefficient multiplied by TX sample rate in order to shift Tx time */
double ts_offset_coef;
+   /* Coefficient multiplied by TX sample rate in order to shift Tx time, 
if multi-arfcn is enabled */
+   double ts_offset_coef_multiarfcn;
/* Device Name Prefix as presented by LimeSuite API LMS_GetDeviceInfo() 
*/
std::string name_prefix;
 };

 static const std::map dev_param_map {
-   { LMS_DEV_SDR_USB,   { true,  true,  73.0, GSMRATE, 8.9e-5, 
LMS_DEV_SDR_USB_PREFIX_NAME } },
-   { LMS_DEV_SDR_MINI,  { false, true,  66.0, GSMRATE, 8.9e-5, 
LMS_DEV_SDR_MINI_PREFIX_NAME } },
-   { LMS_DEV_NET_MICRO, { true,  false, 71.0, GSMRATE, 8.9e-5, 
LMS_DEV_NET_MICRO_PREFIX_NAME } },
-   { LMS_DEV_UNKNOWN,   { true,  true,  73.0, GSMRATE, 8.9e-5, "UNKNOWN" } 
},
+   { LMS_DEV_SDR_USB,   { true,  true,  73.0, GSMRATE, MCBTS_SPACING, 
8.9e-5, 7.9e-5, LMS_DEV_SDR_USB_PREFIX_NAME } },
+   { LMS_DEV_SDR_MINI,  { false, true,  66.0, GSMRATE, MCBTS_SPACING, 
8.9e-5, 8.2e-5, LMS_DEV_SDR_MINI_PREFIX_NAME } },
+   { LMS_DEV_NET_MICRO, { true,  false, 71.0, GSMRATE, MCBTS_SPACING, 
8.9e-5, 7.9e-5, LMS_DEV_NET_MICRO_PREFIX_NAME } },
+   { LMS_DEV_UNKNOWN,   { true,  true,  73.0, GSMRATE, MCBTS_SPACING, 
8.9e-5, 7.9e-5, "UNKNOWN" } },
 };

 static enum lms_dev_type parse_dev_type(lms_device_t *m_lms_dev)
@@ -281,7 +285,10 @@
goto out_close;
print_range("Sample Rate", _sr);

-   sr_host = dev_desc.rate * tx_sps;
+   if (iface == MULTI_ARFCN)
+   sr_host = dev_desc.rate_multiarfcn * tx_sps;
+   else
+   sr_host = dev_desc.rate * tx_sps;
LOGC(DDEV, INFO) << "Setting sample rate to " << sr_host << " " << 
tx_sps;
if (LMS_SetSampleRate(m_lms_dev, sr_host, 32) < 0)
goto out_close;
@@ -290,7 +297,10 @@
goto out_close;
LOGC(DDEV, INFO) << "Sample Rate: Host=" << sr_host << " RF=" << sr_rf;

-   ts_offset = static_cast(dev_desc.ts_offset_coef * sr_host);
+   if (iface == MULTI_ARFCN)
+   ts_offset = 
static_cast(dev_desc.ts_offset_coef_multiarfcn * sr_host);
+   else
+   ts_offset = static_cast(dev_desc.ts_offset_coef * 
sr_host);

/* configure antennas */
if (!set_antennas()) {
@@ -298,7 +308,7 @@
goto out_close;
}

-   return NORMAL;
+   return iface == MULTI_ARFCN ? MULTI_ARFCN : NORMAL;

 out_close:
LOGC(DDEV, FATAL) << "Error in LMS open, closing: " << 
LMS_GetLastErrorMessage();

--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16878
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
Gerrit-Change-Number: 16878
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-trx[master]: lms: Initial multi-arfcn support

2020-01-15 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/16878 )

Change subject: lms: Initial multi-arfcn support
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16878
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
Gerrit-Change-Number: 16878
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 15 Jan 2020 22:31:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-trx[master]: lms: Initial multi-arfcn support

2020-01-15 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/16878 )

Change subject: lms: Initial multi-arfcn support
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/c/osmo-trx/+/16878/2/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/c/osmo-trx/+/16878/2/Transceiver52M/device/lms/LMSDevice.cpp@83
PS2, Line 83: 8.9e-5, 8.2e-5
> I'm not sure what do you mean here.
Ah, nevermind. I failed to see the difference between 8.9e-5 and 8.2e-5.



--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16878
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
Gerrit-Change-Number: 16878
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 15 Jan 2020 16:24:04 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmo-trx[master]: lms: Initial multi-arfcn support

2020-01-15 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/16878 )

Change subject: lms: Initial multi-arfcn support
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16878
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
Gerrit-Change-Number: 16878
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 15 Jan 2020 14:58:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-trx[master]: lms: Initial multi-arfcn support

2020-01-15 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/16878 )

Change subject: lms: Initial multi-arfcn support
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/c/osmo-trx/+/16878/2/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/c/osmo-trx/+/16878/2/Transceiver52M/device/lms/LMSDevice.cpp@83
PS2, Line 83: 8.9e-5, 8.2e-5
> Is it really the same given that sampling frequency is different?
I'm not sure what do you mean here.



--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16878
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
Gerrit-Change-Number: 16878
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 15 Jan 2020 12:41:49 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmo-trx[master]: lms: Initial multi-arfcn support

2020-01-14 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/16878 )

Change subject: lms: Initial multi-arfcn support
..


Patch Set 2: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/c/osmo-trx/+/16878/2/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/c/osmo-trx/+/16878/2/Transceiver52M/device/lms/LMSDevice.cpp@83
PS2, Line 83: 8.9e-5, 8.2e-5
Is it really the same given that sampling frequency is different?



--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16878
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
Gerrit-Change-Number: 16878
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Wed, 15 Jan 2020 02:47:54 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-trx[master]: lms: Initial multi-arfcn support

2020-01-14 Thread pespin
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-trx/+/16878

to look at the new patch set (#2).

Change subject: lms: Initial multi-arfcn support
..

lms: Initial multi-arfcn support

With current state multi-arfcn can be used (eg. I can place a call
between 2 phones using TRX1 and sustain for as long as wanted), but from
time to time (around every 20seconds), a burst of Tx packed dropped
events from LimeSuite appears.

LimeNet-micro coefficients have yet not been tested.

Related: OS#4362
Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 17 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/78/16878/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16878
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
Gerrit-Change-Number: 16878
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-trx[master]: lms: Initial multi-arfcn support

2020-01-14 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/16878 )


Change subject: lms: Initial multi-arfcn support
..

lms: Initial multi-arfcn support

With current state multi-arfcn can be used (eg. I can place a call
between 2 phones using TRX1 and sustain for as long as wanted), but from
time to time (around every 20seconds), a burst of Tx packed dropped
events from LimeSuite appears.

LimeNet-micro coefficients have yet not been tested.

Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 17 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/78/16878/1

diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index d9cc371..7d67158 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -68,17 +68,21 @@
double max_tx_gain;
/* Sample rate coef (without having TX/RX samples per symbol into 
account) */
double rate;
+   /* Sample rate coef (without having TX/RX samples per symbol into 
account), if multi-arfcn is enabled */
+   double rate_multiarfcn;
/* Coefficient multiplied by TX sample rate in order to shift Tx time */
double ts_offset_coef;
+   /* Coefficient multiplied by TX sample rate in order to shift Tx time, 
if multi-arfcn is enabled */
+   double ts_offset_coef_multiarfcn;
/* Device Name Prefix as presented by LimeSuite API LMS_GetDeviceInfo() 
*/
std::string name_prefix;
 };

 static const std::map dev_param_map {
-   { LMS_DEV_SDR_USB,   { true,  true,  73.0, GSMRATE, 8.9e-5, 
LMS_DEV_SDR_USB_PREFIX_NAME } },
-   { LMS_DEV_SDR_MINI,  { false, true,  66.0, GSMRATE, 8.9e-5, 
LMS_DEV_SDR_MINI_PREFIX_NAME } },
-   { LMS_DEV_NET_MICRO, { true,  false, 71.0, GSMRATE, 8.9e-5, 
LMS_DEV_NET_MICRO_PREFIX_NAME } },
-   { LMS_DEV_UNKNOWN,   { true,  true,  73.0, GSMRATE, 8.9e-5, "UNKNOWN" } 
},
+   { LMS_DEV_SDR_USB,   { true,  true,  73.0, GSMRATE, MCBTS_SPACING, 
8.9e-5, 7.9e-5, LMS_DEV_SDR_USB_PREFIX_NAME } },
+   { LMS_DEV_SDR_MINI,  { false, true,  66.0, GSMRATE, MCBTS_SPACING, 
8.9e-5, 8.2e-5, LMS_DEV_SDR_MINI_PREFIX_NAME } },
+   { LMS_DEV_NET_MICRO, { true,  false, 71.0, GSMRATE, MCBTS_SPACING, 
8.9e-5, 7.9e-5, LMS_DEV_NET_MICRO_PREFIX_NAME } },
+   { LMS_DEV_UNKNOWN,   { true,  true,  73.0, GSMRATE, MCBTS_SPACING, 
8.9e-5, 7.9e-5, "UNKNOWN" } },
 };

 static enum lms_dev_type parse_dev_type(lms_device_t *m_lms_dev)
@@ -294,7 +298,10 @@
goto out_close;
print_range("Sample Rate", _sr);

-   sr_host = dev_desc.rate * tx_sps;
+   if (iface == MULTI_ARFCN)
+   sr_host = dev_desc.rate_multiarfcn * tx_sps;
+   else
+   sr_host = dev_desc.rate * tx_sps;
LOGC(DDEV, INFO) << "Setting sample rate to " << sr_host << " " << 
tx_sps;
if (LMS_SetSampleRate(m_lms_dev, sr_host, 32) < 0)
goto out_close;
@@ -303,7 +310,10 @@
goto out_close;
LOGC(DDEV, INFO) << "Sample Rate: Host=" << sr_host << " RF=" << sr_rf;

-   ts_offset = static_cast(dev_desc.ts_offset_coef * sr_host);
+   if (iface == MULTI_ARFCN)
+   ts_offset = 
static_cast(dev_desc.ts_offset_coef_multiarfcn * sr_host);
+   else
+   ts_offset = static_cast(dev_desc.ts_offset_coef * 
sr_host);

/* configure antennas */
if (!set_antennas()) {
@@ -311,7 +321,7 @@
goto out_close;
}

-   return NORMAL;
+   return iface == MULTI_ARFCN ? MULTI_ARFCN : NORMAL;

 out_close:
LOGC(DDEV, FATAL) << "Error in LMS open, closing: " << 
LMS_GetLastErrorMessage();

--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16878
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7e67d90a8126546ba376f816ec5d158d4712
Gerrit-Change-Number: 16878
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange