summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-05-20 20:58:54 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-05-20 20:58:54 +0200
commit9522c159dcca6acbb22c2f8ff04d76f4c6104c34 (patch)
tree7b05ce20b5cc6296af1b4662c62529f7a3d38c83
parent76302cd1f4441187e8481eeb2365669105081204 (diff)
downloaddabmod-9522c159dcca6acbb22c2f8ff04d76f4c6104c34.tar.gz
dabmod-9522c159dcca6acbb22c2f8ff04d76f4c6104c34.tar.bz2
dabmod-9522c159dcca6acbb22c2f8ff04d76f4c6104c34.zip
Add subdevice to UHD configuration
-rw-r--r--doc/example.ini11
-rw-r--r--src/DabMod.cpp1
-rw-r--r--src/OutputUHD.cpp5
-rw-r--r--src/OutputUHD.h4
4 files changed, 18 insertions, 3 deletions
diff --git a/doc/example.ini b/doc/example.ini
index 7f4e315..0f5dfe2 100644
--- a/doc/example.ini
+++ b/doc/example.ini
@@ -41,6 +41,11 @@ digital_gain=1.0
; Output sample rate
rate=2048000
+; The USRP1 does not have flexible clocking, you will need
+;rate=3200000
+; and
+;dac_clk_rate=128000000
+
[firfilter]
enabled=0
filtertapsfile=simple_taps.txt
@@ -77,9 +82,9 @@ txgain=2
; For the USRP1
;device=type=usrp1
-; you must change the rate in [modulator] ! The USRP1 does not have flexible
-; clocking
-;rate=3200000
+; the usrp1 can have two daughterboards, the subdevice parameter allows you
+; to choose which one to use
+;subdevice=A:0
; you must specify either frequency or channel
;frequency=234208000
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index 20c5ab6..d8614a7 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -441,6 +441,7 @@ int main(int argc, char* argv[])
else if (output_selected == "uhd") {
outputuhd_conf.device = pt.get("uhdoutput.device", "");
outputuhd_conf.usrpType = pt.get("uhdoutput.type", "");
+ outputuhd_conf.subDevice = pt.get("uhdoutput.subdevice", "");
outputuhd_conf.masterClockRate = pt.get<long>("uhdoutput.master_clock_rate", 0);
if (outputuhd_conf.device.find("master_clock_rate") != std::string::npos) {
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp
index b0600cd..b44cd3f 100644
--- a/src/OutputUHD.cpp
+++ b/src/OutputUHD.cpp
@@ -108,6 +108,11 @@ OutputUHD::OutputUHD(
myUsrp->set_clock_source(myConf.refclk_src);
myUsrp->set_time_source(myConf.pps_src);
+ if (myConf.subDevice != "") {
+ myUsrp->set_tx_subdev_spec(uhd::usrp::subdev_spec_t(myConf.subDevice),
+ uhd::usrp::multi_usrp::ALL_MBOARDS);
+ }
+
std::cerr << "UHD clock source is " <<
myUsrp->get_clock_source(0) << std::endl;
diff --git a/src/OutputUHD.h b/src/OutputUHD.h
index 990822e..69e5b20 100644
--- a/src/OutputUHD.h
+++ b/src/OutputUHD.h
@@ -153,6 +153,10 @@ class UHDWorker {
struct OutputUHDConfig {
std::string device;
std::string usrpType; // e.g. b100, b200, usrp2
+
+ // The USRP1 can accept two daughterboards
+ std::string subDevice; // e.g. A:0
+
long masterClockRate;
unsigned sampleRate;
double frequency;