Hello,

over three years ago I submitted this patch and it probably wasn't noticed so I send it again. The patch still applies without conflict to the current version of gr-osmosdr.

Am 19.10.17 um 22:06 schrieb Michael Loeffler:
Hello,

the attached patch allows to set the clock_source on uhd devices in
programs like gqrx.

Bye


>From 502ec2d36034f5a12e138667ce652ae83c014f16 Mon Sep 17 00:00:00 2001
From: Michael Loeffler <[email protected]>
Date: Thu, 12 Oct 2017 00:31:17 +0200
Subject: [PATCH] uhd: add clock_source= parameter

Allow to set the clock_source on uhd devices in programs like gqrx.
Typical values for clock_source= are "internal", "external" or "gpsdo"
depending on the hardware.
---
 lib/uhd/uhd_sink_c.cc   | 4 ++++
 lib/uhd/uhd_source_c.cc | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/lib/uhd/uhd_sink_c.cc b/lib/uhd/uhd_sink_c.cc
index a154556..e225d41 100644
--- a/lib/uhd/uhd_sink_c.cc
+++ b/lib/uhd/uhd_sink_c.cc
@@ -80,6 +80,7 @@ uhd_sink_c::uhd_sink_c(const std::string &args) :
          "nchan" == entry.first ||
          "subdev" == entry.first ||
          "lo_offset" == entry.first ||
+         "clock_source" == entry.first ||
          "uhd" == entry.first )
       continue;
 
@@ -109,6 +110,9 @@ uhd_sink_c::uhd_sink_c(const std::string &args) :
   if (dict.count("subdev"))
     _snk->set_subdev_spec( dict["subdev"] );
 
+  if (dict.count("clock_source"))
+    _snk->set_clock_source( dict["clock_source"] );
+
   std::cerr << "-- Using subdev spec '" << _snk->get_subdev_spec() << "'."
             << std::endl;
 
diff --git a/lib/uhd/uhd_source_c.cc b/lib/uhd/uhd_source_c.cc
index fc13017..fc4b768 100644
--- a/lib/uhd/uhd_source_c.cc
+++ b/lib/uhd/uhd_source_c.cc
@@ -81,6 +81,7 @@ uhd_source_c::uhd_source_c(const std::string &args) :
          "nchan" == entry.first ||
          "subdev" == entry.first ||
          "lo_offset" == entry.first ||
+         "clock_source" == entry.first ||
          "uhd" == entry.first )
       continue;
 
@@ -110,6 +111,9 @@ uhd_source_c::uhd_source_c(const std::string &args) :
   if (dict.count("subdev"))
     _src->set_subdev_spec( dict["subdev"] );
 
+  if (dict.count("clock_source"))
+    _src->set_clock_source( dict["clock_source"] );
+
   std::cerr << "-- Using subdev spec '" << _src->get_subdev_spec() << "'."
             << std::endl;
 
-- 
2.14.2


Reply via email to