Attention is currently required from: dexter, fixeria.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41229?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: pySim-shell: set callback function to print formatted warnings
......................................................................
pySim-shell: set callback function to print formatted warnings
In many sub modules we still use print() to occassionally print status
messages or warnings. This technically does not hurt, but it is an unclean
solution which we should replace with something more mature.
The python provided warnings module provides a warn() function that can
be used to send warnings to higher layers. The higher layers can receive
the warnings via a callback and then decide what to do with it. In our
application we will format and print the warnings using the cmd2 provided
functions (or print in case the cmd2 object does not exist yet.)
Let's also add a custom warning class "Info", which we can use to print
informative messages
To illustrate how the approach can be used in sub-modules, this also
replaces the print() calls in runtimpe.py with warn() calls.
Related: OS#6864
Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
---
M pySim-shell.py
M pySim/runtime.py
A pySim/warnings.py
M tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok
4 files changed, 56 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/41229/3
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41229?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
Gerrit-Change-Number: 41229
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: fixeria.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41229?usp=email )
Change subject: pySim-shell: set callback function to print formatted warnings
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
> Honestly, this looks overengineered to me. […]
I think that using the standard logging is an equal solution for the same problem. I will try it out to see which solution is better.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41229?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
Gerrit-Change-Number: 41229
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 20 Oct 2025 08:43:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41229?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: pySim-shell: set callback function to print formatted warnings
......................................................................
pySim-shell: set callback function to print formatted warnings
In many sub modules we still use print() to occassionally print status
messages or warnings. This technically does not hurt, but it is an unclean
solution which we should replace with something more mature.
The python provided warnings module provides a warn() function that can
be used to send warnings to higher layers. The higher layers can receive
the warnings via a callback and then decide what to do with it. In our
application we will format and print the warnings using the cmd2 provided
functions (or print in case the cmd2 object does not exist yet.)
Let's also add a custom warning class "Info", which we can use to print
informative messages
To illustrate how the approach can be used in sub-modules, this also
replaces the print() calls in runtimpe.py with warn() calls.
Related: OS#6864
Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
---
M pySim-shell.py
M pySim/runtime.py
A pySim/warnings.py
M tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok
4 files changed, 56 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/41229/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41229?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
Gerrit-Change-Number: 41229
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: dexter.
fixeria has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41229?usp=email )
Change subject: pySim-shell: set callback function to print formatted warnings
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Honestly, this looks overengineered to me. Especially the `Info` class, which is a `Warning` but not really a warning. Why not using the standard logging module, which does have all the necessary facilities (logging categories, logging targets, etc.)? You can then define a logging target that prints messages using `cmd2`.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41229?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
Gerrit-Change-Number: 41229
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 19 Oct 2025 13:41:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: laforge, tempest, tnt, ttsou.
Hoernchen has posted comments on this change by tempest. ( https://gerrit.osmocom.org/c/osmo-trx/+/41231?usp=email )
Change subject: trx: Fix tx/rx-sps 4 for USRP1 devices
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Patchset:
PS1:
I don't have one of the arcane usrp1 devices nor the time to test it, but I suspected that it broke the arcane ancient stuff at some point. lgtm if it works for you.
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/41231?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I3b08c23a3e7d4a226cd23b9fe42558f596a63257
Gerrit-Change-Number: 41231
Gerrit-PatchSet: 1
Gerrit-Owner: tempest <jackleea1b(a)gmail.com>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-Reviewer: ttsou <tom(a)tsou.cc>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: tempest <jackleea1b(a)gmail.com>
Gerrit-Attention: tnt <tnt(a)246tNt.com>
Gerrit-Attention: ttsou <tom(a)tsou.cc>
Gerrit-Comment-Date: Sun, 19 Oct 2025 13:09:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
tempest has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/41231?usp=email )
Change subject: trx: Fix tx/rx-sps 4 for USRP1 devices
......................................................................
trx: Fix tx/rx-sps 4 for USRP1 devices
The existing code sets the pingOffset variable to -7231(269 - 7500) with tx-sps = 4. The (apparent) correct value for pingOffset for tx/rx-sps 4 is 272.
While I'm not completely sure how this patch works to fix the increased sps value, my theory is that(as seen in the block comment on lines 72-77) OpenBTS, where this code is adapted from, only supported a split sps setup(tx-sps=4, rx_sps=1 for sps=4), which created a differing decimation rate between Tx and Rx on the board. In this case, apparently you needed to account for an advance in the timestamp for a correct output.
However, in the case tx_sps == rx_sps, the decimation/sample rates will be the same, and(I guess) this advance doesn't need to be accounted for. I also had to change a line in the initialization of the Rx end of the USRP device to allow it to have a correct decimation rate when the sps values are 4.
Also commented out the line that would create different pingOffset values for split sps values, since osmo-trx won't allow nonequal values for tx-sps and rx-sps. I left it visible in the file for reference however.
Tested & working on the URAN-1, a USRP1 clone designed for GSM.
Change-Id: I3b08c23a3e7d4a226cd23b9fe42558f596a63257
---
M Transceiver52M/device/usrp1/USRPDevice.cpp
1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/31/41231/1
diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp b/Transceiver52M/device/usrp1/USRPDevice.cpp
index 63a9bcc..21cbd7e 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.cpp
+++ b/Transceiver52M/device/usrp1/USRPDevice.cpp
@@ -75,18 +75,19 @@
* split sample rate Tx/Rx - 4/1 sps we need to need to
* compensate for advance rather than delay.
*/
- if (tx_sps == 1)
- pingOffset = 272;
- else if (tx_sps == 4)
- pingOffset = 269 - 7500;
- else
- pingOffset = 0;
+ pingOffset = 272;
+
+ /* Split SPS (4/1) unsupported on USRP1
+ * if(tx_sps == 4 && rx_sps == 1)
+ * pingOffset = 269 - 7500;
+ */
#ifdef SWLOOPBACK
samplePeriod = 1.0e6/actualSampleRate;
loopbackBufferSize = 0;
gettimeofday(&lastReadTime,NULL);
firstRead = false;
+ pingOffset = 0;
#endif
}
@@ -101,7 +102,7 @@
m_uRx.reset();
try {
m_uRx = usrp_standard_rx_sptr(usrp_standard_rx::make(
- 0, decimRate * tx_sps, 1, -1,
+ 0, decimRate, 1, -1,
usrp_standard_rx::FPGA_MODE_NORMAL,
1024, 16 * 8, rbf));
m_uRx->set_fpga_master_clock_freq(masterClockRate);
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/41231?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I3b08c23a3e7d4a226cd23b9fe42558f596a63257
Gerrit-Change-Number: 41231
Gerrit-PatchSet: 1
Gerrit-Owner: tempest <jackleea1b(a)gmail.com>
tempest has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/41230?usp=email )
Change subject: Fix tx/rx-sps 4 for USRP1 devices
......................................................................
Fix tx/rx-sps 4 for USRP1 devices
In Transceiver52M/device/usrp1/USRPDevice.cpp, the existing code sets the pingOffset variable to -7231(269 - 7500) with tx-sps = 4. The (apparent) correct value for pingOffset for tx/rx-sps 4 is 272.
While I'm not completely sure how this patch works to fix the increased sps value, my theory is that(as seen in the block comment on lines 72-77) OpenBTS, where this code is adapted from, only supported a split sps setup(tx-sps=4, rx_sps=1 for sps=4), which created a differing decimation rate between Tx and Rx on the board. In this case, apparently you needed to account for an advance in the timestamp for a correct output.
However, in the case tx_sps == rx_sps, the decimation/sample rates will be the same, and(I guess) this advance doesn't need to be accounted for. I also had to change a line in the initialization of the Rx end of the USRP device to allow it to have a correct decimation rate when the sps values are 4.
Furthermore, I commented out the line that would create different pingOffset values for split sps values, since osmo-trx won't allow nonequal values for tx-sps and rx-sps. I left it visible in the file for reference however.
Tested and working(with EDGE!) on the URAN-1, a clone of the USRP1 designed for GSM applications.
Change-Id: Ie5263b6fd00c2bf18bd1132355aeebd9b4d9ffda
---
M Transceiver52M/device/usrp1/USRPDevice.cpp
1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/30/41230/1
diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp b/Transceiver52M/device/usrp1/USRPDevice.cpp
index 63a9bcc..fcd60c4 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.cpp
+++ b/Transceiver52M/device/usrp1/USRPDevice.cpp
@@ -75,18 +75,19 @@
* split sample rate Tx/Rx - 4/1 sps we need to need to
* compensate for advance rather than delay.
*/
- if (tx_sps == 1)
- pingOffset = 272;
- else if (tx_sps == 4)
- pingOffset = 269 - 7500;
- else
- pingOffset = 0;
+ pingOffset = 272;
+
+/* Split SPS (4/1) unsupported on USRP1
+ if(tx_sps == 4 && rx_sps == 1)
+ pingOffset = 269 - 7500;
+*/
#ifdef SWLOOPBACK
samplePeriod = 1.0e6/actualSampleRate;
loopbackBufferSize = 0;
gettimeofday(&lastReadTime,NULL);
firstRead = false;
+ pingOffset = 0;
#endif
}
@@ -101,7 +102,7 @@
m_uRx.reset();
try {
m_uRx = usrp_standard_rx_sptr(usrp_standard_rx::make(
- 0, decimRate * tx_sps, 1, -1,
+ 0, decimRate, 1, -1,
usrp_standard_rx::FPGA_MODE_NORMAL,
1024, 16 * 8, rbf));
m_uRx->set_fpga_master_clock_freq(masterClockRate);
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/41230?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Ie5263b6fd00c2bf18bd1132355aeebd9b4d9ffda
Gerrit-Change-Number: 41230
Gerrit-PatchSet: 1
Gerrit-Owner: tempest <jackleea1b(a)gmail.com>
Attention is currently required from: laforge.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41228?usp=email )
Change subject: runtime: check record/file size before write
......................................................................
Patch Set 2:
(1 comment)
File pySim/runtime.py:
https://gerrit.osmocom.org/c/pysim/+/41228/comment/a6a1c1b5_0c3e4a90?usp=em… :
PS1, Line 551:
> I don't think printing is the best option. […]
I also think that just printing is not the ideal solution here. Unfortunately we do not have a reference to the app object. Also I think we have a general problem here. I have looked around. Python indeed has Warning classes which work similar to exceptions but do not disturb the program flow. I will put a patch before this one.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41228?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I7fa717d803ae79398d2c5daf92a7336be660c5ad
Gerrit-Change-Number: 41228
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Fri, 17 Oct 2025 16:08:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>