| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | == Multi-channel Uhd STreamer == |
| 103 | |
| 104 | === Description === |
| 105 | A high-level application to stream real-time samples from multiple IP addressable USRP devices. |
| 106 | |
| 107 | === How it works (without going into the source-code :-D === |
| 108 | Application is split into two run-time objects: |
| 109 | 1) hardware interface application - talks to radio and manages sample streaming\\ |
| 110 | 2) signal handler application - a customized application to process streams samples. |
| 111 | |
| 112 | The hardware interface application controls and initializes the USRP devices with configuration parameters, enables a remote-commander for run-time query and limited parameter updates and configures a circular queue of shared memory buffers (similar to IPC) for continuous real-time sample streaming to/from the device. At the moment this can run in one mode: receive OR transmit streaming. This object uses an XML file containing a list of devices with configuration parameters to set up all the devices. Once all the devices are configured, this starts a continuous receive / transmit streaming thread for the signal handler application. |
| 113 | |
| 114 | The second object attaches to the already created shared memory buffer and allows customized processing of the streaming samples in the receive direction or construction of samples in the transmit direction. |
| 115 | |
| 116 | === Source code & compilation === |
| 117 | Download the source code from here. |
| 118 | |
| 119 | Install the required libraries using the package manager and then use ''make'' to generate the executable. |
| 120 | {{{ |
| 121 | > apt-get update |
| 122 | > apt-get install libboost-all-dev libpugixml-dev libpugixml1 liblog4cxx10 liblog4cxx10-dev |
| 123 | |
| 124 | > make |
| 125 | }}} |
| 126 | |
| 127 | Upon successful compilation the following apps will be generated: |
| 128 | 1) ''rf_hw_intf'' - the hardware interface application \\ |
| 129 | 2) ''sigproc_avg_bw_pwr'' - example signal handler application for processing received samples \\ |
| 130 | 3) ''sigtran'' - example transmit side signal handler application for transmitting |
| 131 | \\ |
| 132 | |
| 133 | |
| 134 | == Hardware interface application == |
| 135 | |
| 136 | The ''rf_hw_intf'' must be specified with an an xml file for device configuration and direction for sample processing. |
| 137 | For a list of arguments use ''--help'': |
| 138 | {{{ |
| 139 | linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.001.000-0-unknown |
| 140 | |
| 141 | Multi-channel Uhd STreamer v000.001.000 |
| 142 | Allowed options: |
| 143 | --help help message |
| 144 | --conf arg specify xml device configuration file and path |
| 145 | "devices.xml,/devices/active" |
| 146 | --print-conf print device conf |
| 147 | --rx-only enable receive direction only |
| 148 | --tx-only enable transmit direction only |
| 149 | --cmd-port arg (=5180) command server port |
| 150 | }}} |
| 151 | |
| 152 | |
| 153 | |
| 154 | === XML file === |
| 155 | The XML file template is described below. A description of the xml nodes and attributes are in the table. |
| 156 | {{{ |
| 157 | <devices> |
| 158 | <_grp_rx_ sync="now" rx_freq="1900e6" rx_rate="5e6" rx_gain="10"> |
| 159 | <device type="n210" ip="192.168.101.102"> |
| 160 | <ch rx_bw="25e6" rx_ant="RX2" |
| 161 | tx_gain="20" tx_bw="25e6" tx_ant="TX/RX" /> |
| 162 | </device> |
| 163 | |
| 164 | <device type="x310" ip="10.10.23.2"> |
| 165 | <ch rx_bw="25e6" rx_ant="RX2" |
| 166 | tx_gain="20" tx_bw="25e6" tx_ant="TX/RX" /> |
| 167 | </device> |
| 168 | </_grp_rx_> |
| 169 | <devices> |
| 170 | |
| 171 | }}} |
| 172 | |
| 173 | |
| 174 | ||'''Group (parent) nodes / attributes''' || Description || |
| 175 | || _grp_rx || specify a group name for a cluster of devices || |
| 176 | || sync || clock/time source options \\ now - use internal clock,\\ pps - use external clock and external time source || |
| 177 | |
| 178 | ||'''Device (child) nodes / attributes''' || Description || |
| 179 | || device || specifies a unique radio || |
| 180 | || type || device category \\ b200 - this USB based devices. ie. no IP address \\ n210 - IP addressable, must specify sttribute: ip \\ x310 - IP addressable, must specify sttribute: ip || |
| 181 | || ip || address of device || |
| 182 | |
| 183 | ||'''Group / channel attributes, \\ channel attribute takes precedence ''' || Description || |
| 184 | || ch || specifies a unique radio within device || |
| 185 | || rx_freq || receiver carrier frequency || |
| 186 | || rx_gain || receiver gain || |
| 187 | || rx_rate || receiver rate || |
| 188 | || rx_bw || receiver bandwidth || |
| 189 | || rx_ant || receiver antenna options: \\ TX/RX \\ RX2 || |
| 190 | || tx_freq || transmit carrier frequency || |
| 191 | || tx_gain || transmit gain || |
| 192 | || tx_rate || transmit rate || |
| 193 | || tx_bw || transmit bandwidth || |
| 194 | || tx_ant || transmit antenna options: \\ TX/RX || |
| 195 | |
| 196 | |
| 197 | === Command server === |
| 198 | The command server can be used to communicate with the application and issue a limited set of control and query commands. This a way to remotely control the device settings during runtime. |
| 199 | ||''' RC commands ''' || Description || |
| 200 | || rxfreq all || get rx carrier frequency for all channels || |
| 201 | || rxgain all || get rx gain for all channels || |
| 202 | || rxrate all || get rx rate for all channels || |
| 203 | || rxfreq all <freq> || set rx carrier frequency for all channels || |
| 204 | || rxgain all <gain> || set rx gain for all channels || |
| 205 | || ---- || set rx rate is not supported during runtime || |
| 206 | |
| 207 | || txfreq all || get tx carrier frequency for all channels || |
| 208 | || txgain all || get tx gain for all channels || |
| 209 | || txrate all || get tx rate for all channels || |
| 210 | || txfreq all <freq> || set tx carrier frequency for all channels || |
| 211 | || txgain all <gain> || set tx gain for all channels || |
| 212 | || ---- || set tx rate is not supported during runtime || |
| 213 | |
| 214 | |
| 215 | === Usage Example=== |
| 216 | To stream samples in the receive direction from the device group in /devices/mimo_rx with a command server listening on port 5111. |
| 217 | {{{ |
| 218 | node21-1> ./rf_hw_intf --conf "mimo1.xml,/devices/mimo_rx" --rx-only --cmd-port 5111 |
| 219 | }}} |
| 220 | |
| 221 | Stream samples in the transmit direction: |
| 222 | {{{ |
| 223 | node1-1> ./rf_hw_intf --conf "devices.xml,/devices/grid_tx" --tx-only --cmd-port 5112 |
| 224 | }}} |
| 225 | |
| 226 | Use the python script to run commands via the hardware interface's command port: |
| 227 | {{{ |
| 228 | console> python rc.py node21-1 5111 "rxfreq all" |
| 229 | console> python rc.py node21-1 5111 "rxfreq all 2800e6" |
| 230 | }}} |
| 231 | |
| 232 | == Signal handler applications == |
| 233 | The signal handler application attaches the shared memory buffer allocated by the hardware interface app. |
| 234 | Both receive and transmit direction have separate shared memory buffers. The signal handler applications are meant to be run for several iterations without stopping the hardware interface. |
| 235 | |
| 236 | An example of a receive direction signal handler is provided. Running is app will attach to the receive side shared memory buffer and perform some processing on the received samples. This app (or some variation of it with a different signal handler) can be run for several iterations without stopping the hardware interface application. |
| 237 | {{{ |
| 238 | node21-1> ./sigproc_avg_bw_pwr --time 15 |
| 239 | }}} |
| 240 | |
| 241 | |
| 242 | Likewise a signal handler for the transmit direction is provided as an example. This attaches to the transmit direction shared memory buffer and populates with predefined samples passed in as an argument. |
| 243 | {{{ |
| 244 | node1-1> samps="octave -qf awgn256.m" |
| 245 | node1-1> ./sigtran --sig "`$samps`" --intv 500 |
| 246 | }}} |
| 247 | |
| 248 | == Tutorials == |
| 249 | * Multi Channel Sample Processing & Visualization |