GithubHelp home page GithubHelp logo

libxtrx's Introduction

libxtrx

High level XTRX API

libxtrx's People

Contributors

chemeris avatar dankamongmen avatar earwin avatar ghostop14 avatar hewittc avatar kluchnikov avatar lynxis avatar satunnainen avatar sergforce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libxtrx's Issues

Error in example: /libxtrx/examples/xtrx_fft

We have a XTRX with PCIe Front end.
We got an error when running the xtrx_fft example: ERROR: Wire RX pkt size is 65536, should be rounded to 128 bit and less 32768
Here is the output:
hp@hp:~/images/sources/build/libxtrx/examples/xtrx_fft$ sudo ./mainwindow
[sudo] password for hp:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
10:59:09.281316 INFO: Probing 'libxtrxll_pcie.so.0' low-level library
10:59:09.281823 INFO: Probing 'libxtrxll_libusb3380.so.0' low-level library
10:59:09.289444 ERROR: USB3380: Unable to open USB3380!
10:59:09.289554 ERROR: Unable to allocate USB3380 context: error: -6
10:59:09.289602 INFO: XTRX PCI_9: XTRX Rev4 (04000013)
10:59:09.289611 INFO: XTRX PCI_9: Device /dev/xtrx0 was opened
CPU Features: SSE2+ SSE4.1+ AVX+ FMA+
10:59:09.289651 INFO: LMS PMIC: DCDC out set to V18=1880mV V33=3100mV V14=1480mV V12=1340mV
10:59:09.289662 INFO: FPGA V_IO set to 1800mV
10:59:09.292355 WARNING: NLMS7 PCI_9: LMS VER:7 REV:1 MASK:1 (3841)
10:59:09.292397 INFO: Starting XTRX debug thread
10:59:09.332980 INFO: xtrx_set_samplerate: set RefClk to 26000000 based on 26060223 measurement
10:59:09.333024 WARNING: NLMS7 PCI_9: CGEN: VCO/2=1184000000 k/2=37 int=91 frac=80659
10:59:09.333567 WARNING: NLMS7 PCI_9: CGEN: binary result: 157
10:59:09.333935 WARNING: NLMS7 PCI_9: CGEN: Retuned [158:164] -> 161
10:59:09.334146 INFO: FPGA V_IO set to 1800mV
10:59:09.334152 INFO: xtrx_set_samplerate: rxrate=4,000MHz txrate=0,000MHz actual_master=32,000MHz rxdecim=2(h_1) txinterp=1(h_1) RX_ADC=8,000MHz TX_DAC=4,000MHz hintr=0 hdecim=0 delay=0 NRXFWD=0 LML1HID=3 LML2HID=1 RX_div=0 TX_div=0 RX_TSP_div=1 TX_TSP_div=1 FclkRX=0,000 (PHS=0) RXx2=0
10:59:09.334171 INFO: DC START
10:59:09.334224 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334241 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334259 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334278 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334303 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334319 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334340 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334362 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334379 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334396 WARNING: NLMS7 PCI_9: 5c1=0000
10:59:09.334446 WARNING: NLMS7 PCI_9: TX[0]=0000
10:59:09.334498 WARNING: NLMS7 PCI_9: TX[1]=0000
10:59:09.334550 WARNING: NLMS7 PCI_9: TX[2]=0000
10:59:09.334608 WARNING: NLMS7 PCI_9: TX[3]=0000
10:59:09.334673 WARNING: NLMS7 PCI_9: RX[0]=0000
10:59:09.334724 WARNING: NLMS7 PCI_9: RX[1]=0000
10:59:09.334785 WARNING: NLMS7 PCI_9: RX[2]=0000
10:59:09.334836 WARNING: NLMS7 PCI_9: RX[3]=0000
10:59:09.334860 INFO: FE_FREQ: rx=1 type=0 freq=100000000,000000 ch=3
10:59:09.334980 WARNING: NLMS7 PCI_9: SXR: initial VCO=3200000000 DIVH=5 VCOs:0110
10:59:09.334983 WARNING: NLMS7 PCI_9: SXX: VCO1 N=123 frac=80659
10:59:09.335317 WARNING: NLMS7 PCI_9: SXX: binary result: 255
10:59:09.335355 WARNING: NLMS7 PCI_9: SXR: VCO1 [0;0] -> 0
10:59:09.335357 WARNING: NLMS7 PCI_9: SXX: VCO2 N=123 frac=80659
10:59:09.335632 WARNING: NLMS7 PCI_9: SXX: binary result: 1
10:59:09.335655 WARNING: NLMS7 PCI_9: SXX: VCO1 N=123 frac=80659
10:59:09.335829 WARNING: NLMS7 PCI_9: SXX: binary result: 255
10:59:09.335851 WARNING: NLMS7 PCI_9: SXR: VCO1 [0;0] -> 0
10:59:09.335852 WARNING: NLMS7 PCI_9: SXX: VCO2 N=123 frac=80659
10:59:09.336026 WARNING: NLMS7 PCI_9: SXX: binary result: 1
10:59:09.336071 WARNING: NLMS7 PCI_9: 0x0124[18, 00]
10:59:09.336144 WARNING: NLMS7 PCI_9: TIA: CCOMP=15 CFB=3350 RCOMP=0
10:59:09.336220 INFO: Set gain 15,0 to 0 on 1 channel
10:59:09.336224 WARNING: NLMS7 PCI_9: RFE: set_lna(15 -> 15) => 6
10:59:09.336303 INFO: AFE: TX=[0;0] RX=[1;0]
10:59:09.336359 WARNING: NLMS7 PCI_9: 0x0124[1c, 00]
10:59:09.336474 INFO: RBB: Restore BW[0]=500000
10:59:09.336477 WARNING: NLMS7 PCI_9: TIA: CCOMP=15 CFB=3350 RCOMP=0
10:59:09.336554 ERROR: Wire RX pkt size is 65536, should be rounded to 128 bit and less 32768
10:59:09.336571 WARNING: NLMS7 PCI_9: 0x0124[18, 00]
10:59:09.337909 INFO: XTRX PCI_9: Device closing

osomcom source/sink blocks gnuradio delayed buffers, skipping....

When compiling libxtrx and grosmocom from source, (using DragonOS pre-compiled GNU_radio)
running the osmocom sink block w/ XTRX gives lots of errors like so:

14:19:56.946493 ERROR: [XTRX] PCI:/dev/xtrx0: TX DMA Current skip due to TO buffers: 12682, prev: 12681 TS:137833808 STPS:137836832
14:19:57.308728 ERROR: [XTRX] PCI:/dev/xtrx0: TX DMA Current delayed buffers: 12695, prev: 12682 TS:137981696
14:19:57.318501 ERROR: [XTRX] PCI:/dev/xtrx0: TX DMA Current skip due to TO buffers: 12695, prev: 12695 TS:137993453 STPS:137998080
14:19:57.405521 INFO: [BPCI] PCI:/dev/xtrx0: RX DMA SKIP MIMO (BLK:0 TS:0); TX DMA STOP MIMO @0.0
14:19:57.405697 INFO: [LSM7] PCI:/dev/xtrx0: 0x0124[02, 10]
14:19:57.405805 INFO: [BPCI] PCI:/dev/xtrx0: RX DMA SKIP MIMO (BLK:0 TS:0); TX DMA STOP MIMO @0.0

Any help would be appreciated.

There are also some gotchas as far as what device args to use what the antenna names are, and what the clocks settings do: Not sure if i have the right stuff here.

image
image

static const std::map<std::string, xtrx_antenna_t> s_ant_map = boost::assign::map_list_of
("AUTO", XTRX_TX_AUTO)
("B1", XTRX_TX_H)
("B2", XTRX_TX_W)
("TXH", XTRX_TX_H)
("TXW", XTRX_TX_W)
;
static const std::map<xtrx_antenna_t, std::string> s_ant_map_r = boost::assign::map_list_of
(XTRX_TX_H, "TXH")
(XTRX_TX_W, "TXW")
(XTRX_TX_AUTO, "AUTO")
;

Package 'libxtrxdsp' and 'libxtrxll' not found

I have compiled (cmake . && make && sudo make install) libxtrxll and libxtrxdsp - and when I try to do the same wit libxtrx I get:

-- Checking for module 'libxtrxdsp'
--   Package 'libxtrxdsp', required by 'virtual:world', not found
-- libxtrxdsp not found.
-- Checking for module 'libxtrxll'
--   Package 'libxtrxll', required by 'virtual:world', not found
-- libxtrxll not found.

I can't even test my XTRX ;-( - generally would be a good idea to have a WIKI.. whatever how to install & test xtrx... Hardware without this software is unusable...

make error:xtrx_fe_octorx0.c:88:30: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?

cmake ..
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Building for x86_64
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'libxtrxdsp'
--   Found libxtrxdsp, version 
-- Found libxtrxdsp: /usr/local/include, /usr/local/lib/libxtrxdsp.so
-- Checking for module 'libxtrxll'
--   Found libxtrxll, version 
-- Found libxtrxll: /usr/local/include, /usr/local/lib/libxtrxll.so
-- Checking for module 'LIBLMS7COMPACT'
--   No package 'LIBLMS7COMPACT' found
-- Found liblms7mcompact: /usr/local/include, /usr/local/lib/liblms7compact.so
-- Found QCustomPlot: /usr/include  
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
/home/init3/SDR/xtrx/libxtrx/cmake/home/init3/SDR/xtrx/libxtrx/examples/xtrx_fft
-- Build type not specified: defaulting to release.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/init3/SDR/xtrx/libxtrx/build


make -j8
Scanning dependencies of target test_xtrx_soapy
Scanning dependencies of target xtrx
[  4%] Building C object CMakeFiles/xtrx.dir/xtrx_fe.c.o
[  9%] Building C object CMakeFiles/xtrx.dir/xtrx_fe_octorx0.c.o
[ 13%] Building C object soapy/CMakeFiles/test_xtrx_soapy.dir/test_xtrx_soapy.c.o
[ 18%] Building C object CMakeFiles/xtrx.dir/xtrx.c.o
[ 22%] Building C object CMakeFiles/xtrx.dir/xtrx_fe_nlms7.c.o
[ 27%] Building C object CMakeFiles/xtrx.dir/xtrx_debug.c.o
[ 31%] Building C object CMakeFiles/xtrx.dir/xtrx_fe_octocal0.c.o
[ 36%] Building C object CMakeFiles/xtrx.dir/octo/adf4355.c.o
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c: In function ‘adf4355_spi’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:88:30: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
  res = xtrxll_set_param(dev, XTRXLL_PARAM_EXT_SPI, MAKE_OCTO_SPI(REG_TMP_L, out));
                              ^~~~~~~~~~~~~~~~~~~~
                              XTRXLL_PARAM_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:88:30: note: each undeclared identifier is reported only once for each function it appears in
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c: In function ‘trf37_spi’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:144:30: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
  res = xtrxll_set_param(dev, XTRXLL_PARAM_EXT_SPI, MAKE_OCTO_SPI(REG_TMP_L, out));
                              ^~~~~~~~~~~~~~~~~~~~
                              XTRXLL_PARAM_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c: In function ‘octo_read_spi’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:159:34: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
  int res = xtrxll_set_param(dev, XTRXLL_PARAM_EXT_SPI, MAKE_OCTO_SPI(regno, 0));
                                  ^~~~~~~~~~~~~~~~~~~~
                                  XTRXLL_PARAM_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:165:32: error: ‘XTRXLL_EXT_SPI_RB’ undeclared (first use in this function); did you mean ‘XTRXLL_EXT_CLK’?
  return xtrxll_get_sensor(dev, XTRXLL_EXT_SPI_RB, (int*)out);
                                ^~~~~~~~~~~~~~~~~
                                XTRXLL_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c: In function ‘i2c_cmdwr’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:183:30: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
  res = xtrxll_set_param(dev, XTRXLL_PARAM_EXT_SPI,
                              ^~~~~~~~~~~~~~~~~~~~
                              XTRXLL_PARAM_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c: In function ‘lms7octo_init’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:438:33: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
   res = xtrxll_set_param(lldev, XTRXLL_PARAM_EXT_SPI,
                                 ^~~~~~~~~~~~~~~~~~~~
                                 XTRXLL_PARAM_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c: In function ‘lms7octo_deinit’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:501:39: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
   res = xtrxll_set_param(dev->master, XTRXLL_PARAM_EXT_SPI,
                                       ^~~~~~~~~~~~~~~~~~~~
                                       XTRXLL_PARAM_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c: In function ‘octo_switch_fe’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:530:48: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
    r = (r) ? r : xtrxll_set_param(dev->master, XTRXLL_PARAM_EXT_SPI,
                                                ^~~~~~~~~~~~~~~~~~~~
                                                XTRXLL_PARAM_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c: In function ‘lms7octo_dd_set_modes’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:666:35: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
     xtrxll_set_param(dev->master, XTRXLL_PARAM_EXT_SPI,
                                   ^~~~~~~~~~~~~~~~~~~~
                                   XTRXLL_PARAM_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c: In function ‘octo_read_spi’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octorx0.c:166:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/home/init3/SDR/xtrx/libxtrx/xtrx_debug.c: In function ‘_xtrx_thread’:
/home/init3/SDR/xtrx/libxtrx/xtrx_debug.c:223:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(data_socket, reply, replen);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMakeFiles/xtrx.dir/build.make:158: recipe for target 'CMakeFiles/xtrx.dir/xtrx_fe_octorx0.c.o' failed
make[2]: *** [CMakeFiles/xtrx.dir/xtrx_fe_octorx0.c.o] Error 1
make[2]: *** 正在等待未完成的任务....
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octocal0.c: In function ‘adf4355_spi’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octocal0.c:88:30: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
  res = xtrxll_set_param(dev, XTRXLL_PARAM_EXT_SPI, out);
                              ^~~~~~~~~~~~~~~~~~~~
                              XTRXLL_PARAM_EXT_CLK
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octocal0.c:88:30: note: each undeclared identifier is reported only once for each function it appears in
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octocal0.c: In function ‘lms7octocal_tune_fe’:
/home/init3/SDR/xtrx/libxtrx/xtrx_fe_octocal0.c:380:38: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_EXT_CLK’?
  res = xtrxll_set_param(dev->master, XTRXLL_PARAM_EXT_SPI, 0x0081200B);
                                      ^~~~~~~~~~~~~~~~~~~~
                                      XTRXLL_PARAM_EXT_CLK
CMakeFiles/xtrx.dir/build.make:182: recipe for target 'CMakeFiles/xtrx.dir/xtrx_fe_octocal0.c.o' failed
make[2]: *** [CMakeFiles/xtrx.dir/xtrx_fe_octocal0.c.o] Error 1
[ 40%] Linking C executable test_xtrx_soapy
[ 40%] Built target test_xtrx_soapy
/home/init3/SDR/xtrx/libxtrx/xtrx.c: In function ‘_xtrx_gtime_ctrl’:
/home/init3/SDR/xtrx/libxtrx/xtrx.c:2193:49: error: ‘XTRXLL_PARAM_CURPPS_SETTIME’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_ISOPPS_SETTIME’?
          (fwen) ? XTRXLL_PARAM_ISOPPS_SETTIME : XTRXLL_PARAM_CURPPS_SETTIME,
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                 XTRXLL_PARAM_ISOPPS_SETTIME
/home/init3/SDR/xtrx/libxtrx/xtrx.c:2193:49: note: each undeclared identifier is reported only once for each function it appears in
/home/init3/SDR/xtrx/libxtrx/xtrx.c: In function ‘_xtrx_gtime_op’:
/home/init3/SDR/xtrx/libxtrx/xtrx.c:2267:38: error: ‘XTRXLL_PARAM_CURPPS_SETTIME’ undeclared (first use in this function); did you mean ‘XTRXLL_PARAM_ISOPPS_SETTIME’?
   res = xtrxll_set_param(dev->lldev, XTRXLL_PARAM_CURPPS_SETTIME, in.sec);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                      XTRXLL_PARAM_ISOPPS_SETTIME
CMakeFiles/xtrx.dir/build.make:62: recipe for target 'CMakeFiles/xtrx.dir/xtrx.c.o' failed
make[2]: *** [CMakeFiles/xtrx.dir/xtrx.c.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/xtrx.dir/all' failed
make[1]: *** [CMakeFiles/xtrx.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

System info:
Ubuntu 18.04

Fix for Soapy (timing issue for SetupStream)

Hi,
On my PC with test_xtrx_soapy I encountered a weird bug preventing exactly once every two time test_xtrx_soapy to run, more precisely it was freezing when reading the stream. I manage to circumvent it (so that's rather a hack than a fix actually) by adding usleep(20000) after SoapySDRDevice_setupStream but before SoapySDRDevice_activateStream.

As the issue is time-based, it may be linked with the PC speed so, for info, my PC is a Ryzen 2700 running Ubuntu 18.04

Failed to build libxtrx - ‘XTRXLL_PARAM_EXT_SPI’ undeclared

I got errors when tried to build libxtrx:

home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c: In function ‘adf4355_spi’:
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:88:30: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function)
res = xtrxll_set_param(dev, XTRXLL_PARAM_EXT_SPI, MAKE_OCTO_SPI(REG_TMP_L, out));
^
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:88:30: note: each undeclared identifier is reported only once for each function it appears in
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c: In function ‘trf37_spi’:
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:144:30: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function)
res = xtrxll_set_param(dev, XTRXLL_PARAM_EXT_SPI, MAKE_OCTO_SPI(REG_TMP_L, out));
^
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c: In function ‘octo_read_spi’:
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:159:34: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function)
int res = xtrxll_set_param(dev, XTRXLL_PARAM_EXT_SPI, MAKE_OCTO_SPI(regno, 0));
^
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:165:32: error: ‘XTRXLL_EXT_SPI_RB’ undeclared (first use in this function)
return xtrxll_get_sensor(dev, XTRXLL_EXT_SPI_RB, (int*)out);
^
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c: In function ‘i2c_cmdwr’:
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:183:30: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function)
res = xtrxll_set_param(dev, XTRXLL_PARAM_EXT_SPI,
^
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c: In function ‘lms7octo_init’:
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:438:33: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function)
res = xtrxll_set_param(lldev, XTRXLL_PARAM_EXT_SPI,
^
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c: In function ‘lms7octo_deinit’:
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:501:39: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function)
res = xtrxll_set_param(dev->master, XTRXLL_PARAM_EXT_SPI,
^
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c: In function ‘octo_switch_fe’:
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:530:48: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function)
r = (r) ? r : xtrxll_set_param(dev->master, XTRXLL_PARAM_EXT_SPI,
^
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:537:17: warning: implicit declaration of function ‘lms7_rbb_set_ext’ [-Wimplicit-function-declaration]
r = (r) ? r : lms7_rbb_set_ext(&dev->lms->lms_state);
^
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c: In function ‘lms7octo_dd_set_modes’:
/home/nvidia/xtrx/images/sources/libxtrx/xtrx_fe_octorx0.c:666:35: error: ‘XTRXLL_PARAM_EXT_SPI’ undeclared (first use in this function)
xtrxll_set_param(dev->master, XTRXLL_PARAM_EXT_SPI,

closeStream() function is empty and device doesn't close properly when using Soapy

Hey all, the XTRX Soapy wrapper has A LOT of issues and missing functionality. The issues become even more apparent when using SoapyRemote.

For some reason currently, when closeStream() is called through SoapyRemote, nothing happens and the XTRX never closes. Using fuser, you can see that the XTRX device is in fact still open. This means that anytime you interact with the XTRX, you need to restart the SoapyRemote server to be able to use it again.

Upon further inspection, closeStream() doesn't even do anything. It's literally empty.

Tuning to 950Mhz fails

Trying to tune my USB3 device to 950MHz fails.

From SoapySDR:

22:22:48.266405 INFO:   [LMSF] USB3_4/2/3: FE_FREQ rx=1 type=0 freq=950000000.000000 ch=3
22:22:48.267300 INFO:   [LSM7] USB3_4/2/3: SXR: initial VCO=1900000000 DIVH=1 VCOs:0001
22:22:48.267316 INFO:   [LSM7] USB3_4/2/3: SXX: VCO3 N=36 frac=564617
22:22:48.269502 INFO:   [LSM7] USB3_4/2/3: SXX: binary result: 1
22:22:48.270949 INFO:   [LSM7] USB3_4/2/3: SXX: VCO3 N=36 frac=564617
22:22:48.273121 INFO:   [LSM7] USB3_4/2/3: SXX: binary result: 1
22:22:48.274426 INFO:   [LSM7] USB3_4/2/3: SXX: VCO3 N=36 frac=564617
22:22:48.276661 INFO:   [LSM7] USB3_4/2/3: SXX: binary result: 1
22:22:48.278062 INFO:   [LSM7] USB3_4/2/3: SXX: VCO3 N=36 frac=564617
22:22:48.280247 INFO:   [LSM7] USB3_4/2/3: SXX: binary result: 1
22:22:48.281547 INFO:   [LSM7] USB3_4/2/3: SXX: VCO3 N=36 frac=564617
22:22:48.283744 INFO:   [LSM7] USB3_4/2/3: SXX: binary result: 1
22:22:48.285050 INFO:   [LSM7] USB3_4/2/3: SXX: VCO3 N=36 frac=564617
22:22:48.287241 INFO:   [LSM7] USB3_4/2/3: SXX: binary result: 1
22:22:48.288549 INFO:   [LSM7] USB3_4/2/3: SXX: VCO3 N=36 frac=564617
22:22:48.290745 INFO:   [LSM7] USB3_4/2/3: SXX: binary result: 1
22:22:48.292191 INFO:   [LSM7] USB3_4/2/3: SXX: VCO3 N=36 frac=564617
22:22:48.294367 INFO:   [LSM7] USB3_4/2/3: SXX: binary result: 1
22:22:48.295836 INFO:   [LSM7] USB3_4/2/3: SXR: Unable to tune to VCO=1900000000
terminate called after throwing an instance of 'std::runtime_error'
  what():  SoapyXTRX::setFrequency(RF) unable to tune!
Aborted (core dumped)

Using test_xtrx gives the following:

jessie@jessie-ThinkPad-T530:~/xtrx/libxtrx/build$ ./test_xtrx -t -f 950e6 
22:25:59.470635 WARN:   [PCIE] XTRX PCIe driver isn't loaded
22:25:59.634796 WARN:   [3380] IO thread: Unable to set realtime priority: error 1
CPU Features: SSE2+ SSE4.1+ AVX+ FMA-
Master: 32.000 MHz; RX rate: 4.000 MHz; TX rate: 0.000 MHz
Failed xtrx_tune: -2

Is there something else I need to do in order to tune to 950MHz? Or is this a hardware limitation of the Fractional VCO?

Issue in test_xtrx_soapy.c during compilation on Ubuntu 18.4.6

Compilation fails on Ubuntu 18.4.6 following the steps provided in the README.

The error is

/home/will/Documents/build/images/sources/libxtrx/soapy/test_xtrx_soapy.c:70:16: error: too few arguments to function ‘SoapySDRDevice_setupStream’
     rxStream = SoapySDRDevice_setupStream(sdr, SOAPY_SDR_RX, SOAPY_SDR_CF32, NULL, 0, NULL);

https://github.com/xtrx-sdr/libxtrx/blob/acb0b1cf7ab92744034767a04c1d4b4c281b840f/soapy/test_xtrx_soapy.c#L70

It looks like at some point the setupStream() call changed and now includes a stream as its second argument.

test_xtrx_soapy fails to build due to setup stream function change

The Soapy setupstream function now passes back rxStream as the return value rather than taking it as a parameter.

The setup stream should now look something like this:

SoapySDRStream *rxStream;
rxStream = SoapySDRDevice_setupStream(sdr, SOAPY_SDR_RX, SOAPY_SDR_CF32, NULL, 0, NULL);
if ( rxStream == 0)

rather than this:
SoapySDRStream *rxStream;
if (SoapySDRDevice_setupStream(sdr, &rxStream, SOAPY_SDR_RX, SOAPY_SDR_CF32, NULL, 0, NULL) != 0)
{

Library documentation

Please provide documentation for library functions,structures and enums, because it's hard to guess, whats going on without any documenation.

XTRX (tx) flips the signal

XTRX flips the signal in the frequency domain during TX.

The easiest way to check this is to open sdrangel and do an ssb transmission. Then you will need to use USB to listen to LSB or visa versa.

I also see this in my own app that uses soapy directly, there i have to mix my signal (using a zadoff chu sequence as a preamble) with a complex mixer, and use the difference product for it to be received correctly.

(This was tested by receiving with a LimeSDR, it might be that that flips the signal, but i think that is unlikely since that driver has been out for a few years).

Feature request: example transmitter

I have been testing the XTRX SDR with a simple transceiver script. So far, I have managed to receive data after setting appropriate flags. However, the transmitter appears to output not RF signal. I have tried several flags (and your example script) but without success. It would be very helpful to share a simple transmitter script with minimal options. For example, transmit a square pulse using a single TX antenna at sub-gigahertz frequency. This could be used as a starting point for implementing a more complex transceiver. My plan is to use the XTRX SDR for cellular BS/UE. Me and my team need to make decision on whether we use XTRX or some other SDR for our product.

match args ignored in enumerate devices

If the match args specify any unique keys like serial or device addresses, they should not yield results when those values do not match the ones in the discovery for loop. This is necessary to select a specific device either by manually specifying an identifying key/value like serial or using the exact results from the enumeration

There also seems to be a bug where the serial number is empty

Cannot reopen device after activating stream using Soapy interface

While using the Soapy interface to access an XTRX using the PCIe adapter, I get an error while trying to reopen the device after closing it. This only occurs if I call activateStream() on a stream created from the device. If I do not call activateStream(), it works properly. I have not tested to see if the same problem occurs while using the USB3 adapter.

I am using the latest version of libxtrx with this patch applied to fix setup stream. libxtrxll is the latest and xtrx_linux_pcie_drv is at ab29a2b.

Below is a program exhibiting the behavior I'm observing:

#include "SoapySDR/Device.hpp"
#include "SoapySDR/Formats.hpp"

#include <cassert>
#include <iostream>

void openClose(bool activateStream) {
    int retval;
    static constexpr int Channel = 0;

    SoapySDR::KwargsList devs = SoapySDR::Device::enumerate();
    SoapySDR::Kwargs args = devs[0];
    SoapySDR::Device* sdr = SoapySDR::Device::make(args);
    assert(sdr);

    sdr->setSampleRate(SOAPY_SDR_RX, Channel, 0);
    sdr->setFrequency(SOAPY_SDR_RX, Channel, 30e6);
    sdr->setGain(SOAPY_SDR_RX, Channel, 0);

    SoapySDR::Stream* stream = sdr->setupStream(SOAPY_SDR_RX, SOAPY_SDR_CS16, std::vector<size_t>{Channel});
    assert(stream);

    if (activateStream) {
        retval = sdr->activateStream(stream);
        assert(retval == 0);

        retval = sdr->deactivateStream(stream);
        assert(retval == 0);
    }

    sdr->closeStream(stream);
    SoapySDR::Device::unmake(sdr);
}

int main() {
    std::cout << "===Running test 1===\n";
    openClose(false);
    std::cout << "===Running test 2===\n";
    openClose(false);
    std::cout << "===Running test 3===\n";
    openClose(true);
    std::cout << "===Running test 4===\n";
    openClose(true);
}

Output:

===Running test 1===
10:21:37.659682 DEBUG:  xtrxllpciev0_discovery:263 [PCIE] pcie: Found `pcie:///dev/xtrx0`
10:21:37.672593 DEBUG:  xtrxllpciev0_discovery:263 [PCIE] pcie: Found `pcie:///dev/xtrx0`
[INFO] Make connection: 'pcie:///dev/xtrx0'
10:21:37.677002 INFO:   [XTRX] xtrx_open(): dev[0]='pcie:///dev/xtrx0'
...SNIP...
10:21:37.693861 INFO:   [PCIE] PCI:/dev/xtrx0: Device `pcie:///dev/xtrx0` has been opened successfully
...SNIP...
[INFO] Created: `pcie:///dev/xtrx0`
...SNIP...
10:21:37.956242 INFO:   [PCIE] PCI:/dev/xtrx0: Device is closing
===Running test 2===
[INFO] Make connection: 'pcie:///dev/xtrx0'
10:21:37.977839 INFO:   [XTRX] xtrx_open(): dev[0]='pcie:///dev/xtrx0'
...SNIP...
[INFO] Created: `pcie:///dev/xtrx0`
...SNIP...
10:21:38.254507 INFO:   [PCIE] PCI:/dev/xtrx0: Device is closing
===Running test 3===
[INFO] Make connection: 'pcie:///dev/xtrx0'
10:21:38.276247 INFO:   [XTRX] xtrx_open(): dev[0]='pcie:///dev/xtrx0'
...SNIP...
[INFO] Created: `pcie:///dev/xtrx0`
...SNIP...
10:21:38.564715 INFO:   [XTRX] PCI:/dev/xtrx0: RX initialized to 65536 bytes packet size
10:21:38.564718 INFO:   [BPCI] PCI:/dev/xtrx0: RX DMA 16 bit SISO (BLK:16384 TS:32768); TX DMA SKIP MIMO @0.0
10:21:38.564738 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @32768 on 0 data: 0 stat:20
[INFO] SoapyXTRX::activateStream(RX) 0 Samples per packet; res = 0
10:21:38.564745 INFO:   [BPCI] PCI:/dev/xtrx0: RX DMA STOP MIMO (BLK:0 TS:0); TX DMA SKIP MIMO @0.0
10:21:38.564782 INFO:   [LSM7] PCI:/dev/xtrx0: 0x0124[18, 00]
10:21:38.564995 INFO:   [BPCI] PCI:/dev/xtrx0: RX DMA STOP MIMO (BLK:0 TS:0); TX DMA SKIP MIMO @0.0
10:21:38.565096 INFO:   [CTRL] PCI:/dev/xtrx0: RFIC_GPIO 0x000300
10:21:38.566169 INFO:   [PCIE] PCI:/dev/xtrx0: Device is closing
===Running test 4===
[INFO] Make connection: 'pcie:///dev/xtrx0'
10:21:38.584735 INFO:   [XTRX] xtrx_open(): dev[0]='pcie:///dev/xtrx0'
10:21:38.584749 ERROR:  [PCIE] Can't open device `/dev/xtrx0`: Device or resource busy
10:21:38.584756 ERROR:  [USB3] Can't parse device string!
terminate called after throwing an instance of 'std::runtime_error'
  what():  XTRXHandle::XTRXHandle(pcie:///dev/xtrx0) - unable to open the device: error: No such device
Aborted (core dumped)

If I put a pause in between Tests 1 and 2, fuser reports the device is not in use (no output), as expected. If I put a pause between Tests 3 and 4, fuser reports the device is still in use, which it should not be:

$ fuser --verbose /dev/xtrx0
                     USER        PID  ACCESS COMMAND
/dev/xtrx0:          username   18987 ....m a.out

Trouble opening devices using xtrx_open

I'm not able to open a specific device using osmocom in GNU Radio or Soapy in python using dev=pcie:///dev/xtrx0 (or pcie:///dev/xtrx1). In GNU Radio it fails after xtrx_open_list with no error output. In Soapy it simply defaults to xtrx0 every time. If I leave dev empty everything works fine, transmit, receive, tuning, etc. Additionally, xtrx_fft example works fine with either device, which is odd.

My goal here is to get two xtrx devices receiving together (4 channel mimo).

EDIT: I've manually compiled all source repos since the images repo isn't properly tracking the latest commits. However, Soapy is still defaulting to xtrx0. Here is what I'm using for initialization in python:
args = dict(dev="/dev/xtrx1", loglevel="2")
print args
sdr = SoapySDR.Device(args)

and the corresponding output:
{'loglevel': '2', 'dev': '/dev/xtrx1'}
10:48:09.368261 DEBUG: xtrxllpciev0_discovery:264 [PCIE] pcie: Found 'pcie:///dev/xtrx0'
10:48:09.368292 DEBUG: xtrxllpciev0_discovery:264 [PCIE] pcie: Found 'pcie:///dev/xtrx1'
[INFO] Make connection: 'pcie:///dev/xtrx0'
CPU Features: SSE2+ SSE4.1+ AVX- FMA-
[INFO] Created: 'pcie:///dev/xtrx0'

If I manually set const std::string& dev = "/dev/xtrx1"; in SoapyXTRX.cpp I correctly initialize the second device.
[INFO] Created: '/dev/xtrx1'

Anyone running gnuradio or gr-osmocom/Soapy app (gqrx, pothos)?

Hi
Has anyonye manage to make the xtrx work correctly with any usual app like gnuradio, pothos, gqrx, etc, actually any Soapy or gr-osmocom app ?

I have been using many brands of SDR but I must say the XTRX is the first one miserably failing whatever I do - using prebuilt binaries (which show several issues) or compiling them - and I'm not even speaking of hardware failure that I had with the 1st card board (replaced since). The must I managed was to get working soapy app but the spectrum I get are all flat. On the very same computers (running Linux Mint or Ubuntu 18.04), USRP, LimeSdr and BladeRF are just running fine.

And the total lack of support by the XTRX team at Fairwaves is simply astounding, whether on github, by email or by telegram.

If anybody was nice to give working instructions, I would appreciate so much, as on paper the card looks promising (and I keep hoping the XTRX is not a hoax).

Help on visualising Rx data!

Hi,
Can anyone help me out with this. How can I visualize Rx data stream in real time. I want to view both Rx FFT and raw IQ data. What third party software is supported with XTRX library to do this or not sure if XTRX has its own like LimeSuite? I am using my own custom code written in C++ and want to visualize the data. I am not using Soapy Library. There is no relevant forum for XTRX, so I am asking here. Thanks.

Feature request: support of LMS FIR filter

There does not seem to be a high level function to deal with the LMS7002M FIR filters like the LMS_SetGFIRLPF of LimeSuite.

For a device of the XTRX class this should be a must to make it available and I hope to see it in future versions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.