Hi Lefteris

thank you for bringing that up!

There has indeed been a bug in UHD caused by parallel access to rx/tx
methods by gnuradio.
Please find a patch attached that will fix the issue for the time being.
This code is not yet finalized but should solve your problem.

Cheers,
Julian


On Mon, Nov 17, 2014 at 2:47 PM, Ben Hilburn <b...@ettus.com> wrote:

> Hi Lefteris -
>
> We recently added that warning. We think we got it right, but it's
> possible something is wrong with the logic that makes it fire.
>
> Can you share your GRC flowgraph?
>
> Cheers,
> Ben
>
> On Mon, Nov 17, 2014 at 2:28 PM, Marcus D. Leech <mle...@ripnet.com>
> wrote:
>
>>  On 11/17/2014 05:15 PM, Lefteris Kampianakis wrote:
>>
>>  Hello,
>>
>>  FYI I am having problems even with a simpler configuration like this:
>>
>>  USRP_source_channel1 --> USRP_sink_channel1
>> USRP_source_channel2 --> USRP_sink_channel2
>>
>>
>>  Does anyone face the same issue? It is really frustrating because 1/3
>> executions are wasted and this causes problems with later design, that has
>> to have an execution rate of > 1Hz
>>
>> Thank you in advance
>>  Lefteris
>>
>>
>>
>>
>>
>>
>> On Fri, Nov 14, 2014 at 6:32 PM, Lefteris Kampianakis <
>> e.kampianakis...@ieee.org> wrote:
>>
>>>    Hello,
>>>
>>>  I have a B210 and I am trying to transmit and receive from all it's
>>> channels simultaneously. My setup is a macmini late 2012 with Ubuntu 12.04
>>> install. I compiled and installed gnuradio from source using the gnuradio
>>> build script. I have developed the attached very simple GRC script that
>>> looks like this
>>>
>>>  signal_source@1khz --> USRP_sink_channel1
>>> signal_source@2khz --> USRP_sink_channel2
>>>
>>>  USRP_source_channel1 --> WX_GUI_scope_channel1
>>> USRP_source_channel2 --> WX_GUI_scope_channel2
>>>
>>>  The problem I have is that I get the following message at random times
>>> and on average on 1/3 executions of the GRC script.
>>>
>>> linux; GNU C++ version 4.6.3; Boost_104800; UHD_003.008.000-18-g864f84b5
>>>
>>> Using Volk machine: avx_64_mmx_orc
>>> -- Operating over USB 3.
>>> -- Initialize CODEC control...
>>> -- Initialize Radio control...
>>> -- Performing register loopback test... pass
>>> -- Performing register loopback test... pass
>>> -- Performing CODEC loopback test... pass
>>> -- Performing CODEC loopback test... pass
>>> -- Asking for clock rate 32.000000 MHz
>>> -- Actually got clock rate 32.000000 MHz
>>> -- Performing timer loopback test... pass
>>> -- Performing timer loopback test... pass
>>> -- Asking for clock rate 28.000000 MHz
>>> -- Actually got clock rate 28.000000 MHz
>>> -- Performing timer loopback test... pass
>>> -- Performing timer loopback test... pass
>>> -- Tune Request: 915.000000 MHz
>>> --   The RF LO does not support the requested frequency:
>>> --     Requested LO Frequency: 915.000000 MHz
>>> --     RF LO Result: 914.999999 MHz
>>> --   Attempted to use the DSP to reach the requested frequency:
>>> --     Desired DSP Frequency: -0.000001 MHz
>>> --     DSP Result: -0.000001 MHz
>>> --   Successfully tuned to 915.000000 MHz
>>> --
>>> -- Tune Request: 915.000000 MHz
>>> --   The RF LO does not support the requested frequency:
>>> --     Requested LO Frequency: 915.000000 MHz
>>> --     RF LO Result: 914.999999 MHz
>>> --   Attempted to use the DSP to reach the requested frequency:
>>> --     Desired DSP Frequency: -0.000001 MHz
>>> --     DSP Result: -0.000001 MHz
>>> --   Successfully tuned to 915.000000 MHz
>>> --
>>> -- Asking for clock rate 28.000000 MHz
>>> -- Actually got clock rate 28.000000 MHz
>>> -- Performing timer loopback test... pass
>>> -- Performing timer loopback test... pass
>>> -- Tune Request: 915.000000 MHz
>>> --   The RF LO does not support the requested frequency:
>>> --     Requested LO Frequency: 915.000000 MHz
>>> --     RF LO Result: 914.999999 MHz
>>> --   Attempted to use the DSP to reach the requested frequency:
>>> --     Desired DSP Frequency: 0.000001 MHz
>>> --     DSP Result: 0.000001 MHz
>>> --   Successfully tuned to 915.000000 MHz
>>> --
>>> -- Tune Request: 915.000000 MHz
>>> --   The RF LO does not support the requested frequency:
>>> --     Requested LO Frequency: 915.000000 MHz
>>> --     RF LO Result: 914.999999 MHz
>>> --   Attempted to use the DSP to reach the requested frequency:
>>> --     Desired DSP Frequency: 0.000001 MHz
>>> --     DSP Result: 0.000001 MHz
>>> --   Successfully tuned to 915.000000 MHz
>>> --
>>> *thread[thread-per-block[2]: <block gr uhd usrp sink (24)>]:
>>> RuntimeError: b200: 2 RX 1 TX and 1 RX 2 TX configurations not possible*
>>>
>>>
>>>  It is obvious that I have all channels activated and that this message
>>> shouldn't be appearing in the first place, let alone, appearing in a
>>> non-deterministic manner.
>>>
>>>    Any ideas?
>>>
>>>  Thank you in advance
>>>  Lefteris
>>>
>>
>>
>>
>> --
>>   Eleftherios(Lefteris) Kampianakis
>> Electronics and Computer Engineer
>> PHD Candidate and Researcher at Sensing Computing Communications Group
>> (SGCC)
>> Department of Electrical Engineering
>> University of Washington
>> 3927 Adams Lane, NE, Mercer Court D805B, 98105
>> website: http://staff.washington.edu/ekampian/
>> <http://users.isc.tuc.gr/%7Eekabianakis/>
>> mail: e.kampianakis...@ieee.org
>>
>>
>> _______________________________________________
>> Discuss-gnuradio mailing 
>> listDiscuss-gnuradio@gnu.orghttps://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>>  We shall probably need a more-detailed description of what you're
>> doing.  Like the actual .grc files, etc.
>>
>> From your description, I think you're wanting to:
>>
>> bring up flow-graph, exchange a very small number of samples, and then
>> exit the flow-graph, and do this in a loop?
>>
>> That seems horribly inefficient, quit distinct from it perhaps uncovering
>> possible bugs in the latest UHD.
>>
>> But providing more information will help those who can help you.
>>
>>
>> --
>> Marcus Leech
>> Principal Investigator
>> Shirleys Bay Radio Astronomy Consortiumhttp://www.sbrac.org
>>
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>>
>
From b379fa42b5192cd7c619df8b6dbc3e59f7438735 Mon Sep 17 00:00:00 2001
From: Julian Arnold <julian.arn...@ettus.com>
Date: Mon, 17 Nov 2014 16:53:58 -0800
Subject: [PATCH] b200: serialized access to get_rx/tx_stream

---
 host/lib/usrp/b200/b200_impl.hpp    |  2 ++
 host/lib/usrp/b200/b200_io_impl.cpp | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp
index 613844f..8f03d81 100644
--- a/host/lib/usrp/b200/b200_impl.hpp
+++ b/host/lib/usrp/b200/b200_impl.hpp
@@ -117,6 +117,8 @@ private:
     boost::weak_ptr<uhd::rx_streamer> _rx_streamer;
     boost::weak_ptr<uhd::tx_streamer> _tx_streamer;
 
+    boost::mutex _transport_setup_mutex;
+
     //async ctrl + msgs
     uhd::msg_task::sptr _async_task;
     typedef uhd::transport::bounded_buffer<uhd::async_metadata_t> async_md_type;
diff --git a/host/lib/usrp/b200/b200_io_impl.cpp b/host/lib/usrp/b200/b200_io_impl.cpp
index 9f6d593..768b108 100644
--- a/host/lib/usrp/b200/b200_io_impl.cpp
+++ b/host/lib/usrp/b200/b200_io_impl.cpp
@@ -256,6 +256,12 @@ boost::optional<uhd::msg_task::msg_type_t> b200_impl::handle_async_task(
  **********************************************************************/
 rx_streamer::sptr b200_impl::get_rx_stream(const uhd::stream_args_t &args_)
 {
+    /*
+     * without this mutex gr-uhd might end up in undesired configurations
+     * because of parallel access to get_tx_stream and get_rx_stream
+     */
+    boost::mutex::scoped_lock lock(_transport_setup_mutex);
+
     stream_args_t args = args_;
 
     //setup defaults for unspecified values
@@ -361,6 +367,12 @@ void b200_impl::handle_overflow(const size_t radio_index)
  **********************************************************************/
 tx_streamer::sptr b200_impl::get_tx_stream(const uhd::stream_args_t &args_)
 {
+    /*
+     * without this mutex gr-uhd might end up in undesired configurations
+     * because of parallel access to get_tx_stream and get_rx_stream
+     */
+    boost::mutex::scoped_lock lock(_transport_setup_mutex);
+
     stream_args_t args = args_;
 
     //setup defaults for unspecified values
-- 
1.9.3

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to