Change in osmo-trx[master]: lms: Make ts_offset and smpl rate coefs device-specific
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/16877 ) Change subject: lms: Make ts_offset and smpl rate coefs device-specific .. lms: Make ts_offset and smpl rate coefs device-specific Right now the values are the same for all devices, but they will differ in forthcoming commits once multi-arfcn support is added. Change-Id: I262d3a71848fc3070473e29e42820848e7591d02 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 12 insertions(+), 8 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 1ef7728..5a5fbe4 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -67,15 +67,19 @@ bool clock_src_int_usable; /* Device specific maximum tx levels selected by phasenoise measurements, in dB */ double max_tx_gain; + /* Sample rate coef (without having TX/RX samples per symbol into account) */ + double rate; + /* Coefficient multiplied by TX sample rate in order to shift Tx time */ + double ts_offset_coef; /* 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, LMS_DEV_SDR_USB_PREFIX_NAME } }, - { LMS_DEV_SDR_MINI, { false, true, 66.0, LMS_DEV_SDR_MINI_PREFIX_NAME } }, - { LMS_DEV_NET_MICRO, { true, false, 71.0, LMS_DEV_NET_MICRO_PREFIX_NAME } }, - { LMS_DEV_UNKNOWN, { true, true, 73.0, "UNKNOWN" } }, + { 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" } }, }; static enum lms_dev_type parse_dev_type(lms_device_t *m_lms_dev) @@ -277,16 +281,16 @@ goto out_close; print_range("Sample Rate", _sr); - LOGC(DDEV, INFO) << "Setting sample rate to " << GSMRATE*tx_sps << " " << tx_sps; - if (LMS_SetSampleRate(m_lms_dev, GSMRATE*tx_sps, 32) < 0) + 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; if (LMS_GetSampleRate(m_lms_dev, LMS_CH_RX, 0, _host, _rf)) goto out_close; LOGC(DDEV, INFO) << "Sample Rate: Host=" << sr_host << " RF=" << sr_rf; - /* FIXME: make this device/model dependent, like UHDDevice:dev_param_map! */ - ts_offset = static_cast(8.9e-5 * GSMRATE * tx_sps); /* time * sample_rate */ + ts_offset = static_cast(dev_desc.ts_offset_coef * sr_host); /* configure antennas */ if (!set_antennas()) { -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I262d3a71848fc3070473e29e42820848e7591d02 Gerrit-Change-Number: 16877 Gerrit-PatchSet: 2 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: Make ts_offset and smpl rate coefs device-specific
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/16877 ) Change subject: lms: Make ts_offset and smpl rate coefs device-specific .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I262d3a71848fc3070473e29e42820848e7591d02 Gerrit-Change-Number: 16877 Gerrit-PatchSet: 2 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:33 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in osmo-trx[master]: lms: Make ts_offset and smpl rate coefs device-specific
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/16877 ) Change subject: lms: Make ts_offset and smpl rate coefs device-specific .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I262d3a71848fc3070473e29e42820848e7591d02 Gerrit-Change-Number: 16877 Gerrit-PatchSet: 2 Gerrit-Owner: pespin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-Comment-Date: Wed, 15 Jan 2020 14:57:18 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in osmo-trx[master]: lms: Make ts_offset and smpl rate coefs device-specific
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/16877 ) Change subject: lms: Make ts_offset and smpl rate coefs device-specific .. Patch Set 1: (1 comment) https://gerrit.osmocom.org/c/osmo-trx/+/16877/1/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/c/osmo-trx/+/16877/1/Transceiver52M/device/lms/LMSDevice.cpp@297 PS1, Line 297: host > host? Yes, that's how LimeSuite calls this sample rate (the one used on the stream between workstation and Lime device). I'm reusing the variable which was already being used later on in LMS_GetSampleRate to show they contain the same information. -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I262d3a71848fc3070473e29e42820848e7591d02 Gerrit-Change-Number: 16877 Gerrit-PatchSet: 1 Gerrit-Owner: pespin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-Comment-Date: Wed, 15 Jan 2020 12:35:01 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria Gerrit-MessageType: comment
Change in osmo-trx[master]: lms: Make ts_offset and smpl rate coefs device-specific
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/16877 ) Change subject: lms: Make ts_offset and smpl rate coefs device-specific .. Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/c/osmo-trx/+/16877/1/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/c/osmo-trx/+/16877/1/Transceiver52M/device/lms/LMSDevice.cpp@297 PS1, Line 297: host host? -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I262d3a71848fc3070473e29e42820848e7591d02 Gerrit-Change-Number: 16877 Gerrit-PatchSet: 1 Gerrit-Owner: pespin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Comment-Date: Wed, 15 Jan 2020 02:39:07 + Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in osmo-trx[master]: lms: Make ts_offset and smpl rate coefs device-specific
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/16877 ) Change subject: lms: Make ts_offset and smpl rate coefs device-specific .. lms: Make ts_offset and smpl rate coefs device-specific Right now the values are the same for all devices, but they will differ in forthcoming commits once multi-arfcn support is added. Change-Id: I262d3a71848fc3070473e29e42820848e7591d02 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/77/16877/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 2e164ed..d9cc371 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -66,15 +66,19 @@ bool clock_src_int_usable; /* Device specific maximum tx levels selected by phasenoise measurements, in dB */ double max_tx_gain; + /* Sample rate coef (without having TX/RX samples per symbol into account) */ + double rate; + /* Coefficient multiplied by TX sample rate in order to shift Tx time */ + double ts_offset_coef; /* 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, LMS_DEV_SDR_USB_PREFIX_NAME } }, - { LMS_DEV_SDR_MINI, { false, true, 66.0, LMS_DEV_SDR_MINI_PREFIX_NAME } }, - { LMS_DEV_NET_MICRO, { true, false, 71.0, LMS_DEV_NET_MICRO_PREFIX_NAME } }, - { LMS_DEV_UNKNOWN, { true, true, 73.0, "UNKNOWN" } }, + { 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" } }, }; static enum lms_dev_type parse_dev_type(lms_device_t *m_lms_dev) @@ -290,16 +294,16 @@ goto out_close; print_range("Sample Rate", _sr); - LOGC(DDEV, INFO) << "Setting sample rate to " << GSMRATE*tx_sps << " " << tx_sps; - if (LMS_SetSampleRate(m_lms_dev, GSMRATE*tx_sps, 32) < 0) + 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; if (LMS_GetSampleRate(m_lms_dev, LMS_CH_RX, 0, _host, _rf)) goto out_close; LOGC(DDEV, INFO) << "Sample Rate: Host=" << sr_host << " RF=" << sr_rf; - /* FIXME: make this device/model dependent, like UHDDevice:dev_param_map! */ - ts_offset = static_cast(8.9e-5 * GSMRATE * tx_sps); /* time * sample_rate */ + ts_offset = static_cast(dev_desc.ts_offset_coef * sr_host); /* configure antennas */ if (!set_antennas()) { -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I262d3a71848fc3070473e29e42820848e7591d02 Gerrit-Change-Number: 16877 Gerrit-PatchSet: 1 Gerrit-Owner: pespin Gerrit-MessageType: newchange