srsran / srsRAN_4G

Open source SDR 4G software suite from Software Radio Systems (SRS) https://docs.srsran.com/projects/4g
https://www.srsran.com
GNU Affero General Public License v3.0
3.42k stars 1.13k forks source link

failures in benchmark_radio for bladeRF 2.0 micro #1248

Open nitinvjain opened 9 months ago

nitinvjain commented 9 months ago

Issue Description

Refer to https://github.com/srsran/srsRAN_4G/issues/1247 I have been suspecting Radio interface as issue since I see very flaky and intermittent attach with bladeRF 2.0 micro XA4 with srsenb and srsue.

I thought of benchmarking and ran benchmark_radio program present in srsRAN_4G/build/lib/src/radio/test

First I did it for baldeRF 2.0 micro XA4. I see 2 number of overflows.

With same host machine, I just swapped bladerf with Ettus usrp B210 board and I don't see any overflows. Does it mean that bladeRF 2.0 micro is having some issue interfacing with srsRAN_4G? Please share your own experiences or insights.

With Nuand bladeRF 2.0 micro XA4: njain@njain-VivoBook-ASUS-Laptop-X505ZA-X505ZA:~/srsRAN_4G/build/lib/src/radio/test$ ./benchmark_radio -a soapy -s 11520000 Active RF plugins: libsrsran_rf_uhd.so libsrsran_rf_soapy.so libsrsran_rf_blade.so Inactive RF plugins: Instantiating objects and allocating memory... Initialising instances... Opening 1 channels in RF device= with args=soapy Supported RF device list: UHD soapy bladeRF file Trying to open RF device 'UHD' [INFO] [UHD] linux; GNU C++ version 11.4.0; Boost_107400; DPDK_20.5; UHD_4.4.0.HEAD-0-g5fac246b [INFO] [LOGGING] Fastpath logging disabled at runtime. Opening USRP channels=1, args: soapy= [INFO] [UHD RF] RF UHD Generic instance constructed /home/njain/srsRAN_4G/lib/src/phy/rf/rf_uhd_imp.cc:932: uhd_init failed, freeing... [ERROR] [UHD RF] LookupError: KeyError: No devices found for -----> Device Address: soapy:

Unable to open RF device 'UHD' Trying to open RF device 'soapy' Soapy has found device #0: backend=libusb, device=0x02:0x04, driver=bladerf, instance=0, label=BladeRF #0 [1646d82f..622b2595], serial=1646d82fb50c411199db297e622b2595, Selecting Soapy device: 0 [INFO] bladerf_open_with_devinfo() [INFO] bladerf_get_serial() = 1646d82fb50c411199db297e622b2595 [INFO] setSampleRate(Rx, 0, 4.000000 MHz), actual = 4.000000 MHz [INFO] setSampleRate(Tx, 0, 4.000000 MHz), actual = 4.000000 MHz Setting up Rx stream with 1 channel(s) Setting up Tx stream with 1 channel(s) [INFO] setSampleRate(Rx, 0, 1.920000 MHz), actual = 1.920000 MHz [INFO] setSampleRate(Tx, 0, 1.920000 MHz), actual = 1.920000 MHz Available device sensors:

Warning: TX gain was not set. Using open-loop power control (not working properly)

[INFO] setSampleRate(Rx, 0, 11.520000 MHz), actual = 11.520000 MHz Start capturing 10 sub-frames of 11520 samples (approx. 0s) ... 00Finished streaming with 1 gaps, 0 late timestamps, 2 overflows, 0 underflow... Tearing down... [INFO] bladerf_close() Failed!

with UHD USRP Ettus B210:

./benchmark_radio -a uhd -s 11520000 Active RF plugins: libsrsran_rf_uhd.so libsrsran_rf_soapy.so libsrsran_rf_blade.so Inactive RF plugins: Instantiating objects and allocating memory... Initialising instances... Opening 1 channels in RF device= with args=uhd Supported RF device list: UHD soapy bladeRF file Trying to open RF device 'UHD' [INFO] [UHD] linux; GNU C++ version 11.4.0; Boost_107400; DPDK_20.5; UHD_4.4.0.HEAD-0-g5fac246b [INFO] [LOGGING] Fastpath logging disabled at runtime. Opening USRP channels=1, args: uhd=,type=b200,master_clock_rate=23.04e6 [INFO] [UHD RF] RF UHD Generic instance constructed [INFO] [B200] Detected Device: B210 [INFO] [B200] Operating over USB 2. [INFO] [B200] Initialize CODEC control... [INFO] [B200] Initialize Radio control... [INFO] [B200] Performing register loopback test... [INFO] [B200] Register loopback test passed [INFO] [B200] Performing register loopback test... [INFO] [B200] Register loopback test passed [INFO] [B200] Asking for clock rate 23.040000 MHz... [INFO] [B200] Actually got clock rate 23.040000 MHz. RF device 'UHD' successfully opened

Warning: TX gain was not set. Using open-loop power control (not working properly)

Start capturing 10 sub-frames of 11520 samples (approx. 0s) ... Finished streaming with 0 gaps, 0 late timestamps, 0 overflows, 0 underflow... Tearing down... Ok!

[Describe the issue in detail]

Setup Details

[Specify details of the test setup. This would help us reproduce the problem reliably] e.g. Network configuration, Operation System, Hardware, RF front-end, library and driver versions Other Configs: bladeRF related:bladeRF 2.0 micro XA4bladeRF> version bladeRF-cli version: 1.8.0-git-unknown libbladeRF version: 2.4.1-git-unknown Firmware version: 2.4.0-git-a3d5c55f FPGA version: 0.14.0 (configured by USB host) Ubuntu versions: Distributor ID: UbuntuDescription: Ubuntu 22.04.3 LTSRelease: 22.04Codename: jammy srsRAN_4G: git logcommit https://github.com/srsran/srsRAN_4G/commit/fa56836b14dc6ad7ce0c3484a1944ebe2cdbe63b (HEAD -> master, tag: release_23_04_1, origin/master, origin/HEAD)Merge: https://github.com/srsran/srsRAN_4G/commit/921f17484e0714f167d48cfe33b0a94ae569c533 737c5ae71Author: Codebot <codebot at softwareradiosystems.com>Date: Mon Jun 19 15:03:18 2023 +0200 Merge branch 'next' into agpl_next

Machine : AMD Ryzen 5

Expected Behavior

No Overflows and status shown is OK

Actual Behaviour

00Finished streaming with 1 gaps, 0 late timestamps, 2 overflows, 0 underflow...

Steps to reproduce the problem

Go to folder /home/njain/srsRAN_4G/build/lib/src/radio/test and run benchmark_radio -s 11520000

Additional Information

nitinvjain commented 9 months ago

https://github.com/Nuand/bladeRF/issues/778

Hi Robert (@robertghilduta ) and all, I am trying to setup srsRAN_4G ( 23.04 for srsRAN_4G) and am able to setup pretty easily with Ettus B210 using srsenb and srsue and attach does happen consistently. But same is not the case with bladeRF 2.0 micro xA4.

Below is the setup for bladerf. bladeRF-cli version: 1.8.0-git-unknown libbladeRF version: 2.4.1-git-unknown

Firmware version: 2.4.0-git-a3d5c55f FPGA version: 0.14.0 (configured by USB host)

When I try to run sudo ./lib/src/radio/test/benchmark_radio -d bladerf -s 1.92e6 -f 801.3e6 -t 10 -x -y or

sudo ./lib/src/radio/test/benchmark_radio -d bladerf -s 11.52e6 -f 801.3e6 -t 10 -x -y

Overall , It fails anyway but many times, it gets stuck to following too: [ERROR @ host/libraries/libbladeRF/src/streaming/sync.c:336] wait_for_buffer: Timed out waiting for buf_ready after 400 ms

Please do provide any solution. I even tried modifying lib/src/phy/rf/rf_soapy_imp.c to set below define constant

define STOP_STREAM_BEFORE_RATE_CHANGE 1 from

define STOP_STREAM_BEFORE_RATE_CHANGE 0

But that also does not make any difference.

Please do share any workarounds or fixes for same.