<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Kamal,<br>
    <br>
    ah, ok!<br>
    My suspicion stays that at the time you call recv() you haven't
    effectively made the device stream samples, and somehow don't do
    that -- thus, recv() waits for longer than the timeout, and you get
    this error message.<br>
    Thus, a few comments on your reply:<br>
    <blockquote type="cite">
      <div><font size="2"><span style="font-weight:normal"><br>
          </span></font></div>
      <font size="2"><span style="font-weight:normal">1.) We have n't
          set any value in the constructor of time_spec_t for steam_cmd.
          it is un-disturbed.<br>
        </span></font></blockquote>
    <font size="2">hm. ok, so this then means that you really don't
      issue your stream_cmd long enough before the first call to recv();
      you can try increasing recv()'s timeout value only for the first
      call!</font><br>
    <blockquote type="cite"><font size="2"><span
          style="font-weight:normal"><br>
        </span></font><font size="2"><span style="font-weight:normal">2.)

          I am using a Highend system for executing the code ( Lenovo
          Y510P ), So system resources should n't be any problem. No, We
          are unable to receive any samples, What we get is a <br>
          <br>
        </span></font><font size="2"><span style="font-weight:normal">       
          <i>Timeout while streaming</i><br>
          <br>
        </span></font>
      <div><font size="2"><span style="font-weight:normal"><br>
          </span></font></div>
    </blockquote>
    <font size="2">Again, this is not about system performance,
      probably, but about some logical error in your application -- you
      call recv() before there is something to receive!</font><br>
    <blockquote type="cite">
      <div><font size="2"><span style="font-weight:normal"><br>
          </span></font></div>
      <div><font size="2"><span style="font-weight:normal">3.) yeah, the
            timeout might not be sufficient. If it is so, why would it
            take so much time, to push samples to PC...?? does timeout
            really varies from experiment to experiment..??<br>
          </span></font></div>
    </blockquote>
    <font size="2">3s is not a network/USB latency you'll ever see.
      Something is broken with your application logic.</font><br>
    <blockquote type="cite">
      <div><font size="2"><span style="font-weight:normal"><br>
          </span></font></div>
      <div style="margin-left:40px"><font size="2"><span
            style="font-weight:normal">This is the stream_cmd_t we are
            using for our test,<br>
            <br>
            <span style="font-family:monospace,monospace"><i>uhd::stream_cmd_t
                stream_cmd((num_requested_samples == 0)?<br>
                 ....</i></span><br>
            <br>
          </span></font></div>
      <font size="2"><span style="font-weight:normal">and --nsamps to
          nothing, So it should start with continuous mode. NO room for 
          TIME_SPECT_T() issue :) :) .</span></font></blockquote>
    <big><font size="2"><big>So <i>when</i> do you <i>issue</i></big></font></big>
    that command? (By the way, you <b>do</b> touch the timespec in the
    stream_cmd, but it doesn't matter, with stream_now, and a
    time_spec_t(0)).<br>
    <br>
    Regarding the rest of your approaches: this looks like you're
    guessing; it's happened to me many times, and it seldom brings you
    to the right solution, so<br>
    <blockquote type="cite">1.) Is the <i>const buffer reference</i>,
      semantics used for first argument passed to recv() command is
      causing problem from storing samples from board..??</blockquote>
    No.<br>
    <blockquote type="cite">2.) Since we got into multi threading,
      should we need to really take care about <span
        style="font-family:monospace,monospace">uhd::set_thread_priority(
        priority_value, real_time)</span> in each thread function..??</blockquote>
    Not really. <br>
    <blockquote type="cite">3.) we are using new c++11 standards for
      creating and managing threads. Is this causing problem..?? <br>
    </blockquote>
    Not probable.<br>
    <blockquote type="cite">
      <div><br>
      </div>
      <div>4.) passing parameter values to DataAcquisitionThread, is
        causing problem..??<br>
      </div>
    </blockquote>
    I don't know your application, but if you didn't make a mistake, why
    should it?<br>
    <br>
    Best regards,<br>
    Marcus<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 04/30/2015 08:34 AM, kamal kumar
      jeldi via USRP-users wrote:<br>
    </div>
    <blockquote
cite="mid:CACDZarWdiidByj61RCgf4c-kJeUM3w1JXcoF81jus7HMy1-2VA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>
                            <div>Hi Marcus, <br>
                            </div>
                            <br>
                          </div>
                          Once again thanks for your kind/patient reply,
                          Since the reply is huge, it took me time to
                          reply to each suggestion you answered.<br>
                          <br>
                          <br>
                        </div>
                        I am not using any other third party library (
                        like threading building blocks, tbb) for
                        concurrent queue. with some knowledge from books
                        and online sources we have coded our own, here
                        is the implementation ( if it might helps for
                        other trying the same threading problem ) code
                        pasted in pastebin.<br>
                        <br>
                      </div>
                    </div>
                    pastebin link : <i><a moz-do-not-send="true"
                        href="http://pastebin.com/H0yqkfgB">http://pastebin.com/H0yqkfgB</a></i><br>
                    <br>
                  </div>
                  In the above code, I have removed all template classes
                  and hard coded it for type 'double'. It worked
                  perfectly in normal compilation: <i>g++ -std=c++11
                    source.cpp -o exec -lpthread<br>
                  </i><br>
                </div>
                So, from the above code and mail body with sub: <font
                  size="2"><span style="font-weight:normal">"setting
                    thread priority during multi threading", you might
                    have understood that, the problem is from UHD (
                    ERROR_CODE_TIMEOUT) itself. <br>
                    <br>
                    <br>
                  </span></font></div>
              <div><font size="2"><span style="font-weight:normal">Are
                    you suggesting me to test by altering the time_out
                    parameter in recv() ?, To exactly find out where the
                    Timeout While streaming is coming..??<br>
                  </span></font></div>
              <div><font size="2"><span style="font-weight:normal"><br>
                  </span></font></div>
              <font size="2"><span style="font-weight:normal">1.) We
                  have n't set any value in the constructor of
                  time_spec_t for steam_cmd. it is un-disturbed.<br>
                  <br>
                </span></font></div>
            <font size="2"><span style="font-weight:normal">2.) I am
                using a Highend system for executing the code ( Lenovo
                Y510P ), So system resources should n't be any problem.
                No, We are unable to receive any samples, What we get is
                a <br>
                <br>
              </span></font></div>
          <font size="2"><span style="font-weight:normal">        <i>Timeout
                while streaming</i><br>
              <br>
            </span></font></div>
        <div><font size="2"><span style="font-weight:normal">We have
              tried by placing small stubs before and after recv()
              command,<br>
              <br>
            </span></font></div>
        <div><font size="2"><span style="font-weight:normal">3.) yeah,
              the timeout might not be sufficient. If it is so, why
              would it take so much time, to push samples to PC...??
              does timeout really varies from experiment to
              experiment..??<br>
              <br>
            </span></font></div>
        <div style="margin-left:40px"><font size="2"><span
              style="font-weight:normal">This is the stream_cmd_t we are
              using for our test,<br>
              <br>
              <span style="font-family:monospace,monospace"><i>uhd::stream_cmd_t
                  stream_cmd((num_requested_samples == 0)?<br>
                         
                  uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS:<br>
                         
                  uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE<br>
                      );<br>
                      stream_cmd.num_samps = num_requested_samples;<br>
                      stream_cmd.stream_now = true;<br>
                      stream_cmd.time_spec = uhd::time_spec_t(); </i></span><br>
              <br>
              <br>
            </span></font></div>
        <div>
          <div style="margin-left:40px"><font size="2"><span
                style="font-weight:normal">and --nsamps to nothing, So
                it should start with continuous mode. NO room for 
                TIME_SPECT_T() issue :) :) .</span></font><br>
            <br>
          </div>
          <br>
        </div>
        <div>Thank you for this great tip regarding memory management
          while allocating memory space with new ( The best part of your
          reply) . Yeah, will work on deleting the allocated memory
          locations dynamically.<br>
          <br>
        </div>
        <div>We people have got some queries regarding the problem, We
          came up with some conclusions why this problem occurred,<br>
          <br>
        </div>
        <div>1.) Is the <i>const buffer reference</i>, semantics used
          for first argument passed to recv() command is causing problem
          from storing samples from board..?? if it is so, what would
          you suggest me, for storing different memory locations address
          in the queue..??<br>
          <br>
        </div>
        <div>2.) Since we got into multi threading, should we need to
          really take care about <span
            style="font-family:monospace,monospace">uhd::set_thread_priority(
            priority_value, real_time)</span> in each thread
          function..??( this is why we thought of throwing a mail with
          different subject), if it is so, what is the necessary care
          should I need to take for multi threading.<br>
          <br>
        </div>
        <div>3.) we are using new c++11 standards for creating and
          managing threads. Is this causing problem..?? <br>
          <br>
        </div>
        <div>4.) passing parameter values to DataAcquisitionThread, is
          causing problem..??<br>
        </div>
        <div><br>
        </div>
        <div>Now you might be knowing that we are not working with any
          third party threading libraries, Please help us in that way.<br>
          <br>
        </div>
        <div>Thanks in advance,<br>
          <br>
        </div>
        <div>Hoping for a solution,<br>
        </div>
        <div>Kamal Kumar Jeldi<br>
        </div>
        <div>
          <div style="margin-left:40px"><br>
          </div>
          <div style="margin-left:40px"><font size="2"><span
                style="font-weight:normal"></span></font></div>
          <font size="2"><span style="font-weight:normal"><br>
              <br>
              <br>
            </span></font></div>
        <font size="2"><span style="font-weight:normal"></span></font>
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>
                            <div><a moz-do-not-send="true" name="13764"></a></div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
USRP-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:USRP-users@lists.ettus.com">USRP-users@lists.ettus.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>