Compare commits

...

6 Commits

Author SHA1 Message Date
Jack Lee
33445944de 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 the original OpenBTS TRX  only supported
a split sps setup(tx-sps=4, rx_sps=1 for sps=4), which created
differing decimation rates 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.

With tx_sps == rx_sps, the decimation/sample rates will be the same,
and(I guess) this advance doesn't need to be accounted for.

Also changed a line in the initialization of the Rx end of the USRP
device to use the correct decimation rate when tx/rx-sps == 4.

Since osmo-trx won't allow nonequal values for tx-sps and rx-sps, I
commented out the logic that selected pingOffset based on 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
2025-10-22 14:24:52 -06:00
Pau Espin Pedrol
1d4117faf4 lms: Use define LMS_LOG_CRITICAL instead of value
The define is available since v20.01.0 [1]

[1] https://github.com/myriadrf/LimeSuite/pull/275

Change-Id: Ie5bb99a76580c5780a24f190682700c5e69b3d85
2025-07-17 11:18:46 +02:00
Pau Espin Pedrol
a0e1b20939 Drop use of deprecated vty is_config_node() cb
This callback was drepecated and is not ever called since
libosmocore.git 70ce871532ab21955e0955d7e230eae65438f047 (release 1.3.0).

See also libosmocore.git d31de237582f6fe3315d61bb9a488d4cda92654e.

Change-Id: I1bbaa455c018ba9c0943ac3cf1ae5511ebb4b723
2025-03-04 18:05:35 +01:00
Oliver Smith
0d155a130f Bump version: 1.7.0.2-8a71 → 1.7.1
Change-Id: Iad491e6608206f21e5ed8a95d2985fa53db4dd20
2025-02-12 12:43:25 +01:00
Neels Hofmeyr
8a71a7dd5d comma_delimited_to_vector() optimization CID#465430
(I am not sure about this, just doing as coverity says.)

Change-Id: I30e57c6a9df39552bc4f8c18d27bc421f5c60f49
2025-01-16 18:29:43 +01:00
Oliver Smith
3642b5956c contrib/jenkins: remove broken chroot + qemu code
The mirror where it would download images from is not online anymore,
and it looks like this whole block has not been executed in years (we
always test the arm builds on native arm machines nowadays, and run all
builds in docker).

Replace the whole block with a simple check that ensures when arm flags
are used, that the build is actually running on an arm machine.

Change-Id: I2e204e4a0a7dfcf32f011ed6fb403b564f8155a7
2024-09-12 09:59:09 +02:00
6 changed files with 33 additions and 75 deletions

View File

@@ -28,7 +28,7 @@ std::vector<std::string> comma_delimited_to_vector(const char* opt)
{
std::string substr;
getline(ss, substr, ',');
result.push_back(substr);
result.push_back(std::move(substr));
}
return result;
}

View File

@@ -781,17 +781,6 @@ DEFUN(show_trx, show_trx_cmd,
return CMD_SUCCESS;
}
static int trx_vty_is_config_node(struct vty *vty, int node)
{
switch (node) {
case TRX_NODE:
case CHAN_NODE:
return 1;
default:
return 0;
}
}
static int trx_vty_go_parent(struct vty *vty)
{
switch (vty->node) {
@@ -829,7 +818,6 @@ struct vty_app_info g_vty_info = {
.version = PACKAGE_VERSION,
.copyright = trx_copyright,
.go_parent_cb = trx_vty_go_parent,
.is_config_node = trx_vty_is_config_node,
};
struct trx_ctx *vty_trx_ctx_alloc(void *talloc_ctx)

View File

@@ -150,7 +150,7 @@ static void lms_log_callback(int lvl, const char *msg)
{
/* map lime specific log levels */
static const int lvl_map[5] = {
[0] = LOGL_FATAL,
[LMS_LOG_CRITICAL] = LOGL_FATAL,
[LMS_LOG_ERROR] = LOGL_ERROR,
[LMS_LOG_WARNING] = LOGL_NOTICE,
[LMS_LOG_INFO] = LOGL_INFO,

View File

@@ -75,18 +75,19 @@ USRPDevice::USRPDevice(InterfaceType iface, const struct trx_cfg *cfg) : RadioDe
* 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 @@ int USRPDevice::open()
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);

View File

@@ -9,60 +9,19 @@
#
set -ex
substr() { [ -z "${2##*$1*}" ]; }
#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot
mychroot_nocwd() {
# LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container
# PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH.
# PROOT_NO_SECCOMP is required due to proot bug #106
LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@"
}
mychroot() {
mychroot_nocwd -w / "$@"
}
if [ -z "${INSIDE_CHROOT}" ]; then
# Only use ARM chroot if host is not ARM and the target is ARM:
if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then
OSMOTRX_DIR="$PWD" # we assume we are called as contrib/jenkins.sh
ROOTFS_PREFIX="${ROOTFS_PREFIX:-$HOME}"
ROOTFS="${ROOTFS_PREFIX}/qemu-img"
mkdir -p "${ROOTFS_PREFIX}"
# Prepare chroot:
if [ ! -d "$ROOTFS" ]; then
mkdir -p "$ROOTFS"
if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then
fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/
# Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it:
sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script"
mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/
else
YESTERDAY=$(python -c 'import datetime ; print((datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%Y%m%d"))')
wget -nc -q "https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/${YESTERDAY}_22:42/rootfs.tar.xz"
tar -xf rootfs.tar.xz -C "$ROOTFS/" || true
echo "nameserver 8.8.8.8" > "$ROOTFS/etc/resolv.conf"
fi
mychroot -b /dev apt-get update
mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev git libtalloc-dev libgnutls28-dev stow
fi
# Run jenkins.sh inside the chroot:
INSIDE_CHROOT=1 mychroot_nocwd \
-w /osmo-trx \
-b "$OSMOTRX_DIR:/osmo-trx" \
-b "$(which osmo-clean-workspace.sh):/usr/bin/osmo-clean-workspace.sh" \
-b "$(which osmo-build-dep.sh):/usr/bin/osmo-build-dep.sh" \
-b "$(which osmo-deps.sh):/usr/bin/osmo-deps.sh" \
./contrib/jenkins.sh
exit 0
fi
fi
set -ex
case "$INSTR" in
"--with-neon"*)
case "$(arch)" in
arm*)
;;
*)
set +x
echo "ERROR: trying to build with INSTR=$INSTR but not running on a 32-bit arm machine! (arch=$(arch))"
exit 1
;;
esac
;;
esac
if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"

10
debian/changelog vendored
View File

@@ -1,3 +1,13 @@
osmo-trx (1.7.1) unstable; urgency=medium
[ Oliver Smith ]
* contrib/jenkins: remove broken chroot + qemu code
[ Neels Hofmeyr ]
* comma_delimited_to_vector() optimization CID#465430
-- Oliver Smith <osmith@sysmocom.de> Wed, 12 Feb 2025 12:43:24 +0100
osmo-trx (1.7.0) unstable; urgency=medium
[ Eric ]