Send USRP-users mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of USRP-users digest..."


Today's Topics:

   1. Boost not found by cmake gui (Windows XP) (Isaac Gerg)
   2. Re: Boost not found by cmake gui (Windows XP) (Isaac Gerg)
   3. UHD setup bugs under windows (Colin Stanners)
   4. Re: UHD setup bugs under windows (Josh Blum)
   5. Using windows DLL (debug symbols on) gives error (Isaac Gerg)
   6. Re: Using windows DLL (debug symbols on) gives error (Josh Blum)
   7. Re: time outs during Tx (Josh Blum)
   8. Redirecting UHD messages (Mike Roddewig)
   9. Re: USRP N210 Matlab and Simulink demo error (Huan Len)
  10. Using TVRX2 for MIMO reception (Farrukh Aziz)
  11. Re: Using TVRX2 for MIMO reception (Marcus D. Leech)
  12. Re: time outs during Tx (Sanat Gulvadi)
  13. Re: time outs during Tx (Josh Blum)
  14. Two usrp receive to file at the same time by using
      multi-thread (Eddie Sun)
  15. Re: time outs during Tx (Sanat Gulvadi)
  16. Access Violation When Running UHD on Windows XP 32-bit with
      VS 9 - 2008 (Bastien Auneau)
  17. Re: Two usrp receive to file at the same time by using
      multi-thread (Marcus D. Leech)
  18. Re: time outs during Tx (Marc Epard)
  19. Re: Access Violation When Running UHD on Windows XP 32-bit
      with VS 9 - 2008 ([email protected])
  20. Questions about OFDM Implementation with GNU-Radio (Amr Youssef)
  21. Re: time outs during Tx (Sanat Gulvadi)


----------------------------------------------------------------------

Message: 1
Date: Wed, 18 Apr 2012 13:21:59 -0400
From: Isaac Gerg <[email protected]>
To: [email protected]
Subject: [USRP-users] Boost not found by cmake gui (Windows XP)
Message-ID:
        <CADnN3yVaBbEzktuXB-qxod9n50S9CYb524zPUnru+=egmpu...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi All,

Trying to compile UHD from scratch on Windows XP 32bit.  Run I run CMAKE
configure, from the cmake-gui, it keeps telling me it cannot find Boost.  I
have hacked around the CMakeLists.txt file a good bit today and am out of
options.  I have tried hard-coding in the path using the SET command and
also adjusted the CMake paths...

SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
"D:/Downloads/boost_1_49_0/boost_1_49_0/boost")
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
"D:/Downloads/boost_1_49_0/boost_1_49_0/stage/lib")
FIND_PACKAGE(Boost)

....and still have no luck.

Any advice?

Thanks in advance,
Isaac
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120418/81b25e45/attachment-0001.html>

------------------------------

Message: 2
Date: Wed, 18 Apr 2012 16:20:55 -0400
From: Isaac Gerg <[email protected]>
To: [email protected]
Subject: Re: [USRP-users] Boost not found by cmake gui (Windows XP)
Message-ID:
        <CADnN3yX=9XYMYmXjQcm4SfXyEC=c8f7p8urbg0wsm+aczso...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

After more digging around, I find this post about how to get debug output
from CMAKE.

http://stackoverflow.com/questions/3808775/cmake-doesnt-find-boost
set(Boost_DEBUG 1)

I saw that BOOST_ROOT was not being set.  I added it to
my environment variables and this fixed this issue.

Isaac

On Wed, Apr 18, 2012 at 1:21 PM, Isaac Gerg <[email protected]> wrote:

> Hi All,
>
> Trying to compile UHD from scratch on Windows XP 32bit.  Run I run CMAKE
> configure, from the cmake-gui, it keeps telling me it cannot find Boost.  I
> have hacked around the CMakeLists.txt file a good bit today and am out of
> options.  I have tried hard-coding in the path using the SET command and
> also adjusted the CMake paths...
>
> SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
> "D:/Downloads/boost_1_49_0/boost_1_49_0/boost")
> SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
> "D:/Downloads/boost_1_49_0/boost_1_49_0/stage/lib")
> FIND_PACKAGE(Boost)
>
> ....and still have no luck.
>
> Any advice?
>
> Thanks in advance,
> Isaac
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120418/9afcf21c/attachment-0001.html>

------------------------------

Message: 3
Date: Wed, 18 Apr 2012 16:03:18 -0500
From: Colin Stanners <[email protected]>
To: [email protected]
Subject: [USRP-users] UHD setup bugs under windows
Message-ID:
        <CAPoOROyCoz2pNx9RfjYNH6tiba98jXtctQRK_u+2yN=ifqs...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I'm attempting to setup a USRP N210v4 under Win7 starter. Some bugs,
using latest UHD and Python:

1) NetBurner doesn't like having multiple network interfaces, or
multiple IP addresses on
one interface. I get the following result unless I disable all NICs
except the one the USRP
is on and set it to just one IP address:

C:\windows\system32>C:\python32\python.exe "C:\Program Files\UHD\share\uhd\utils
\usrp_n2xx_net_burner_gui.py
Traceback (most recent call last):
  File "C:\Program Files\UHD\share\uhd\utils\usrp_n2xx_net_burner_gui.py", line
231, in <module>
    USRPN2XXNetBurnerApp(root, addr=options.addr, fw=options.fw, fpga=options.fp
ga).pack()
  File "C:\Program Files\UHD\share\uhd\utils\usrp_n2xx_net_burner_gui.py", line
158, in __init__
    self._net_dev_entry = DeviceEntryWidget(self, text=addr)
  File "C:\Program Files\UHD\share\uhd\utils\usrp_n2xx_net_burner_gui.py", line
100, in __init__
    self._reload_cb()
  File "C:\Program Files\UHD\share\uhd\utils\usrp_n2xx_net_burner_gui.py", line
113, in _reload_cb
    for hint in usrp_n2xx_net_burner.enumerate_devices():
  File "C:\Program Files\UHD\share\uhd\utils\usrp_n2xx_net_burner.py", line 211,
 in enumerate_devices
    for bcast_addr in get_interfaces():
  File "C:\Program Files\UHD\share\uhd\utils\usrp_n2xx_net_burner.py", line 199,
 in win_get_interfaces
    ipAddr = adNode.ipAddress.decode()
AttributeError: 'LP_IP_ADDR_STRING' object has no attribute 'ipAddress'


2) strange error about an object's properties when trying to upgrade firmware:
C:\windows\system32>C:\python32\python.exe "C:\Program Files\UHD\share\uhd\utils
\usrp_n2xx_net_burner.py" --addr=192.168.10.2 --fw="C:\Program Files\UHD\share\u
hd\images\usrp_n210_fw.bin"
USRP-N2XX found.
Traceback (most recent call last):
  File "C:\Program Files\UHD\share\uhd\utils\usrp_n2xx_net_burner.py", line 522,
 in <module>
    else: burner.burn_fw(fw=options.fw, fpga=options.fpga, reset=options.reset,
safe=options.overwrite_safe, check_rev=not options.dont_check_rev)
  File "C:\Program Files\UHD\share\uhd\utils\usrp_n2xx_net_burner.py", line 285,
 in burn_fw
    if n2xx_revs.has_key(hw_rev): print("Hardware type: %s" %
n2xx_revs[hw_rev][0])
AttributeError: 'dict' object has no attribute 'has_key'

Thanks.



------------------------------

Message: 4
Date: Wed, 18 Apr 2012 15:14:52 -0700
From: Josh Blum <[email protected]>
To: [email protected]
Subject: Re: [USRP-users] UHD setup bugs under windows
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1



>     for bcast_addr in get_interfaces():
>   File "C:\Program Files\UHD\share\uhd\utils\usrp_n2xx_net_burner.py", line 
> 199,
>  in win_get_interfaces
>     ipAddr = adNode.ipAddress.decode()
> AttributeError: 'LP_IP_ADDR_STRING' object has no attribute 'ipAddress'
> 

This may actually be an IPv6 related issue.
I added a try/except around this part of the code.


>     if n2xx_revs.has_key(hw_rev): print("Hardware type: %s" %
> n2xx_revs[hw_rev][0])
> AttributeError: 'dict' object has no attribute 'has_key'
> 

Looks like has_key was removed in python 3.0. Most users dont use python
3.0 because of all the breaking changes. I pushed a fix to use the
portable syntax that works on both versions.

Fixes pushed to maint and master branches

-josh



------------------------------

Message: 5
Date: Wed, 18 Apr 2012 18:40:53 -0400
From: Isaac Gerg <[email protected]>
To: [email protected]
Subject: [USRP-users] Using windows DLL (debug symbols on) gives error
Message-ID:
        <cadnn3yxxtbxpdovkizzwrf_ia_0qh3_ilj8z7_nms2gmsvn...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi All,

I have built a UHD windows DLL that has debug symbols in it.  When I try to
use it with my program, i get the following error:
"The application failed to initialize properly"

Nothing prints to the screen.

I get this error even running the compiled version of uhd_find_devices.exe
using the debug dll i created. When I use the DLL that comes with the
latest windows build (no debug symbols) from the ettus site, I get a
different error.  The program prints the following and then crashes (same
behavior I originally had before building my own  uhd.dll with debug
symbols).

"Win32; Microsoft Visual C++ version 10.0; Boost_104700;
UHD_003.004.001-0-release"


Please help.

Isaac
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120418/8c1c1786/attachment-0001.html>

------------------------------

Message: 6
Date: Wed, 18 Apr 2012 15:48:41 -0700
From: Josh Blum <[email protected]>
To: [email protected]
Subject: Re: [USRP-users] Using windows DLL (debug symbols on) gives
        error
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1



On 04/18/2012 03:40 PM, Isaac Gerg wrote:
> Hi All,
> 
> I have built a UHD windows DLL that has debug symbols in it.  When I try to
> use it with my program, i get the following error:
> "The application failed to initialize properly"
> 
> Nothing prints to the screen.
> 
> I get this error even running the compiled version of uhd_find_devices.exe
> using the debug dll i created. When I use the DLL that comes with the
> latest windows build (no debug symbols) from the ettus site, I get a
> different error.  The program prints the following and then crashes (same
> behavior I originally had before building my own  uhd.dll with debug
> symbols).
> 
> "Win32; Microsoft Visual C++ version 10.0; Boost_104700;
> UHD_003.004.001-0-release"
> 
> 
Those installers were built with msvc 2010. Does installing the
equivalent runtime make a difference?
http://www.microsoft.com/download/en/details.aspx?id=5555

And make sure dependency walker doesnt list any errors (just checking).

-josh



------------------------------

Message: 7
Date: Wed, 18 Apr 2012 15:55:57 -0700
From: Josh Blum <[email protected]>
To: [email protected]
Subject: Re: [USRP-users] time outs during Tx
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1



On 04/18/2012 08:18 AM, Sanat Gulvadi wrote:
> Greetings,
> 
> I am using USRP2 REV4 with UHD_003.004.000-325-g7e296167.
> 
> I am trying to transmit from a binary file containing approximately 9
> million samples of type complex float for a certain number of seconds which
> is specified by a command line argument.
> The packet size i am using is 363 samples.
> Tx sampling rate is the default 1Msps which I pulled from the API. (I have
> varied this by changing the interpolation from 4 to 512 but this doesn't
> seem to have affected the problem which I am describing below.)
> 
> //setup metadata for the first packet
>     uhd::tx_metadata_t txMeta;
>     txMeta.start_of_burst = false;
>     txMeta.end_of_burst = false;
>     txMeta.has_time_spec = true;
>     txMeta.time_spec = uhd::time_spec_t(txDuration);
>     double timeout = txDelay + 0.1;

> The problem is that the num_tx_samps returns 0 after 712 packets. I
> initially thought it was because of the time it took to read from the disk
> for each packet and hence I preallocated all the samples in the file to the
> variable filebuff. I verified that filebuff had read all the 9 million odd
> samples from the file.

712 packets is about the size of the SRAM on the USRP. Your send has
backed up and the USRP is waiting for the time you specified on the
first packet.

Did you initialize the time? When is txDuration in relation to the time
on the device? Basically, time spec is an absolute time. See
tx_timed_samples as an example

-josh



------------------------------

Message: 8
Date: Wed, 18 Apr 2012 20:44:05 -0600
From: Mike Roddewig <[email protected]>
To: [email protected]
Subject: [USRP-users] Redirecting UHD messages
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

I need to redirect the UHD messages from stdout. I followed the example in the 
documentation and it does redirect all of the messages except for a version 
string that's printed at start-up. Example:

linux; GNU C++ version 4.4.6 20110731 (Red Hat 4.4.6-3); Boost_104100; 
UHD_003.004.000-37-gbd3eeb51

How do I disable or redirect this message?

Thanks,

Mike

-- 
Mike Roddewig <[email protected]>



------------------------------

Message: 9
Date: Thu, 19 Apr 2012 03:31:59 +0000 (UTC)
From: Huan Len <[email protected]>
To: [email protected]
Subject: Re: [USRP-users] USRP N210 Matlab and Simulink demo error
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Mike McLernon <Mike.McLernon@...> writes:

> 
> Hi Huan,
> 
> In all likelihood, your model is running fine.  Note that the messages you're 
getting are warnings, not
> errors.  The Simulink model sdruFMStereo runs pretty quickly, even in normal 
mode, so it wants to process
> data faster than the USRP hardware can give it.  However, all the receiver 
processing is enabled by the
> DataLen output of the SDRu Receiver block, so there are no gaps in processed 
data.
> 
> How is the sound quality from the model?
> 
> Mike
> 
> -----Original Message-----
> From: usrp-users-bounces@...
> [mailto:usrp-users-bounces@...] On Behalf Of Huan Len
> Sent: Wednesday, April 18, 2012 5:42 AM
> To: usrp-users@...
> Subject: [USRP-users] USRP N210 Matlab and Simulink demo error
> 
> Dear All,
> 
>    I am working N210 in windows environment with Matlab and Simulink. 
> I am really new to USRP, so I wish to get some advice from all of you. 
> I have successfully compiled the demo, namely sdruFMStereo.mdl. 
> I got this run-time error when i try to run the demo. 
> I have no idea what went wrong. 
> Is there any kind soul would help me? Thanks in advance!
> 
> The hardware does not support the requested RX frequency:
> Target frequency: 102.500000 MHz
> Actual frequency: 2.500000 MHz
> ---------- end libuhd warning message output ----------
> Warning: Reported in 'sdruFMStereo/FM Receiver/48045Hz': 
> The queue has underrun by 54400 samples. 
> Try increasing queue duration, buffer size, or throughput rate. 
> Warning: Reported in 'sdruFMStereo/FM Receiver/48045Hz': Th  The queue has 
underrun by 3136 samples. 
> Try increasing queue duration, buffer size, or throughput rate. 
> Warning: Reported in 'sdruFMStereo/FM Receiver/48045Hz': 
> The queue has underrun by 960 samples. 
> Try increasing queue duration, buffer size, or throughput rate. 
> 
> Regards,
> Huan Len
> 
> _______________________________________________
> USRP-users mailing list
> USRP-users@...
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
> 

Hi Mike,

   I am still yet to get any sound from the audio device. With spectrum scope 
connected in the Simulink Model right before the 19n/6 resampler, all I get is 
Noise like signal. Is there anything additional that I need to configure before 
it is able to receive FM radio signals? The daughter board that I am using is 
BasicRX by the way. Thanks for your help. 
 
Huan Len





------------------------------

Message: 10
Date: Wed, 18 Apr 2012 20:44:01 -0700 (PDT)
From: Farrukh Aziz <[email protected]>
To: USRP user forum <[email protected]>
Subject: [USRP-users] Using TVRX2 for MIMO reception
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="utf-8"

I am using TVRX2 dboard with N210. I want to simultaneously receive through the 
two receiver chains on TVRX2. In the Subdev spec I entered "0:RX1 0:RX2" to 
enable dual reception and its working fine. Would the two signals be 
automatically synchronized from the main board or do I still need to give the 
external frequency reference (100MHz) and timing reference (1PPS)?
In the end I went to get two complex signals that are perfectly synchronized. 

thanks

Farrukh Aziz Bhatti
Department of Electrical & Computer Engineering
University of Auckland

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120418/9691b2df/attachment-0001.html>

------------------------------

Message: 11
Date: Wed, 18 Apr 2012 23:46:42 -0400
From: "Marcus D. Leech" <[email protected]>
To: [email protected]
Subject: Re: [USRP-users] Using TVRX2 for MIMO reception
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

On 18/04/12 11:44 PM, Farrukh Aziz wrote:
> I am using TVRX2 dboard with N210. I want to simultaneously receive
> through the two receiver chains on TVRX2. In the Subdev spec I entered
> "0:RX1 0:RX2" to enable dual reception and its working fine. Would the
> two signals be automatically synchronized from the main board or do I
> still need to give the external frequency reference (100MHz) and
> timing reference (1PPS)?
> In the end I went to get two complex signals that are perfectly
> synchronized.
>
The two receiver chips on the TVRX2 get their reference clock from the
motherboard, so they'll be
  phase-locked.  Although as I recall, they use use frac-N synthesis, so
the two tuners will have an
  unpredictable phase offset every time they're tuned.


> thanks
>
> *Farrukh Aziz Bhatti*
> Department of Electrical & Computer Engineering
> University of Auckland
>
>
>
>
> _______________________________________________
> USRP-users mailing list
> [email protected]
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>   


-- 
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120418/fd9499c0/attachment-0001.html>

------------------------------

Message: 12
Date: Thu, 19 Apr 2012 09:01:14 +0200
From: Sanat Gulvadi <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: [USRP-users] time outs during Tx
Message-ID:
        <cah12ylsztq9r2jiogelhfsnt0hptsoj3s3tsqaq4hwquw26...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

Thanks for the reply,

What I am doing to initialize the time is something like this :

uhd::time_spec_t cur_time = uhd::time_spec_t::get_system_time();
uhd::time_spec_t end_time = cur_time + uhd::time_spec_t(txDuration);
//txDuration is the number of seconds it has to send in total which is
passed as a command line argument.

after each packet is sent, i update the cur_time and check if the time is
up.

I just found from one of Marc Epard's previous posts somewhere that one
needs to issue_stream_cmd after every one SRAM full worth of samples. Is
this applicable in my case as well ?

Would the following changes to my code fix the problem ?

if (*condition that checks if full SRAM worth packets are sent*){
stream_cmd.stream_now=true;
*multiusrp*->issue_stream_cmd(stream_cmd);
}

i also changed the has_time_spec in the metadata to false after the first
send(). Is this what you meant ?

Regards,
Sanat


On Thu, Apr 19, 2012 at 12:55 AM, Josh Blum <[email protected]> wrote:

>
>
> On 04/18/2012 08:18 AM, Sanat Gulvadi wrote:
> > Greetings,
> >
> > I am using USRP2 REV4 with UHD_003.004.000-325-g7e296167.
> >
> > I am trying to transmit from a binary file containing approximately 9
> > million samples of type complex float for a certain number of seconds
> which
> > is specified by a command line argument.
> > The packet size i am using is 363 samples.
> > Tx sampling rate is the default 1Msps which I pulled from the API. (I
> have
> > varied this by changing the interpolation from 4 to 512 but this doesn't
> > seem to have affected the problem which I am describing below.)
> >
> > //setup metadata for the first packet
> >     uhd::tx_metadata_t txMeta;
> >     txMeta.start_of_burst = false;
> >     txMeta.end_of_burst = false;
> >     txMeta.has_time_spec = true;
> >     txMeta.time_spec = uhd::time_spec_t(txDuration);
> >     double timeout = txDelay + 0.1;
>
> > The problem is that the num_tx_samps returns 0 after 712 packets. I
> > initially thought it was because of the time it took to read from the
> disk
> > for each packet and hence I preallocated all the samples in the file to
> the
> > variable filebuff. I verified that filebuff had read all the 9 million
> odd
> > samples from the file.
>
> 712 packets is about the size of the SRAM on the USRP. Your send has
> backed up and the USRP is waiting for the time you specified on the
> first packet.
>
> Did you initialize the time? When is txDuration in relation to the time
> on the device? Basically, time spec is an absolute time. See
> tx_timed_samples as an example
>
> -josh
>
> _______________________________________________
> USRP-users mailing list
> [email protected]
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>



--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120419/a1a9f0ad/attachment-0001.html>

------------------------------

Message: 13
Date: Thu, 19 Apr 2012 00:47:25 -0700
From: Josh Blum <[email protected]>
To: Sanat Gulvadi <[email protected]>
Cc: [email protected]
Subject: Re: [USRP-users] time outs during Tx
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1



On 04/19/2012 12:01 AM, Sanat Gulvadi wrote:
> Hi,
> 
> Thanks for the reply,
> 
> What I am doing to initialize the time is something like this :
> 
> uhd::time_spec_t cur_time = uhd::time_spec_t::get_system_time();
> uhd::time_spec_t end_time = cur_time + uhd::time_spec_t(txDuration);
> //txDuration is the number of seconds it has to send in total which is
> passed as a command line argument.
> 
> after each packet is sent, i update the cur_time and check if the time is
> up.
> 

I'm not sure what you are doing. The TX timestamps are used to schedule
transmission, this is the only possible use.

The USRP has a time, and your packet has a time. The USRP compares the
its time to packet time -> and determines to send the packet, wait, or
drop (late packet).

Ask yourself this:
what time is set for the first transmit packet? metadata.time_spec
what is the time on the usrp when you send()? usrp->get_time_now()

Are you trying to schedule a transmission?
This is a good example: tx_timed_samples.cpp

Are you trying to transmit samples from a file?
Another good example and a functional app: tx_samples_from_file.cpp

-josh



------------------------------

Message: 14
Date: Thu, 19 Apr 2012 16:33:28 +0800
From: Eddie Sun <[email protected]>
To: [email protected]
Subject: [USRP-users] Two usrp receive to file at the same time by
        using   multi-thread
Message-ID:
        <cab6xthntojmnmwj5fkkfcnuuh+vohhm3i3nghfsnh0zafdw...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi all,

     i have a question about Two usrp samples_to_file at a same time by
using the MIMO cable, dual ethernet cable mode. The OS is Windows7 and
using cygwin and MSVC 2010.

     i modified the rx_samples_to_file by adding an other usrp, and most of
the variables i declare two of them to save the second usrp parameter( like
declare file2 rate2 freq2....etc), and create two thread, both call the
function "template<typename samp_type> void recv_to_file" to realize the
purpose.

     But now i have a problem while running it, when both thread created
and go into the while loop of the recv_to_file() successfully and it will
show error  like "R6010  abort() has been called" and the process stop. i'm
not sure if the MIMO setting is right or not. i only know that i can run
the process if i comment the "outfile.write((const char*)&buff.front(),
num_rx_samps*sizeof(samp_type));" and "outfile.close();" in the
recv_to_file().

if i don't save the files, the process work fine, but if i put those two
lines back, even i slow down the sampling rate to like both 4M/s(My purpose
is one 20M/s and one 4M/s), and it still not work. Can some one help me or
give me some suggestion?

The main changing part from the rx_samples_to_file.cpp of my program is as
following:

first create the second usrp

    std::cout << boost::format("Creating the usrp device with: %s...") %
args2 << std::endl;
    uhd::usrp::multi_usrp::sptr usrp2 = uhd::usrp::multi_usrp::make(args2);

and add the variable like file2, bw2, rate2, gain2, freq2 to catch the
second usrp's parameter. let the first usrp(Master) use the External clock
and second usrp(Slave) use the MIMO as clock and time

        usrp->set_clock_config(uhd::clock_config_t::external(), 0);

        uhd::clock_config_t clock_config;
        clock_config.ref_source = uhd::clock_config_t::REF_MIMO;
        clock_config.pps_source = uhd::clock_config_t::PPS_MIMO;

        usrp2->set_clock_config(clock_config, 0);

        usrp->set_time_now(uhd::time_spec_t(0.0), 0);
        //sleep a bit while the slave locks its time to the master
        boost::this_thread::sleep(boost::posix_time::milliseconds(100));

and i add a global variable struct like

void sig_int_handler(int){stop_signal_called = true;}
    struct usrp_parameter{
    uhd::usrp::multi_usrp::sptr usrp;
    std::string file;
    size_t spb;
}usrp_p1,usrp_p2;

and use it to save the parameter in the UHD_SAFE_MAIN
    usrp_p1.usrp=usrp;    usrp_p1.file=file;    usrp_p1.spb=spb;
    usrp_p2.usrp=usrp2;    usrp_p2.file=file2;    usrp_p2.spb=spb;

after that i use the command to start the stream
usrp->issue_stream_cmd(stream_cmd);
usrp2->issue_stream_cmd(stream_cmd2);

and create two thread for receiving data at the same time

        HANDLE hThread[2];
        unsigned threadID,threadID2;
        hThread[0] = (HANDLE)_beginthreadex(NULL, 0, &threadfunction1,
&usrp_p1, 0, &threadID);
        hThread[1]= (HANDLE)_beginthreadex(NULL, 0, &threadfunction2,
&usrp_p2, 0, &threadID2);
        WaitForMultipleObjects(THREAD_COUNT,hThread,1,INFINITE);
        CloseHandle(hThread[0]);
        CloseHandle(hThread[1]);

the threadfunction is like

unsigned  __stdcall threadfunction1(void* argu) {
    recv_to_file<std::complex<short> >(usrp_p1.usrp, usrp_p1.file,
usrp_p1.spb);
    _endthreadex(0);
    return 0;
}

i narrow down the recv_to_file() variable number from 4 to 3, cuz i only
need the short type, i replace the io_type to uhd::io_type_t::COMPLEX_INT16;

i'm sure both thread can create successfully and enter the function
recv_to_file, by using some printf(); i can confirm that, but i don't know
how to fix the "saving the file" problem of this run time error. Did i
missing somthing? Or what should i do to debug my program?

Thanks,
Eddie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120419/2776ed10/attachment-0001.html>

------------------------------

Message: 15
Date: Thu, 19 Apr 2012 11:12:00 +0200
From: Sanat Gulvadi <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: [USRP-users] time outs during Tx
Message-ID:
        <CAH12yLsEGPCa1b-fhDHsnyM9H6=0ZWjKgdkbwMyHJ34aaT=s...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

I feel quite silly for having wasted everyones time. I had set the wrong
time_spec.
My apologies.

Regards,
Sanat
On Thu, Apr 19, 2012 at 9:47 AM, Josh Blum <[email protected]> wrote:

>
>
> On 04/19/2012 12:01 AM, Sanat Gulvadi wrote:
> > Hi,
> >
> > Thanks for the reply,
> >
> > What I am doing to initialize the time is something like this :
> >
> > uhd::time_spec_t cur_time = uhd::time_spec_t::get_system_time();
> > uhd::time_spec_t end_time = cur_time + uhd::time_spec_t(txDuration);
> > //txDuration is the number of seconds it has to send in total which is
> > passed as a command line argument.
> >
> > after each packet is sent, i update the cur_time and check if the time is
> > up.
> >
>
> I'm not sure what you are doing. The TX timestamps are used to schedule
> transmission, this is the only possible use.
>
> The USRP has a time, and your packet has a time. The USRP compares the
> its time to packet time -> and determines to send the packet, wait, or
> drop (late packet).
>
> Ask yourself this:
> what time is set for the first transmit packet? metadata.time_spec
> what is the time on the usrp when you send()? usrp->get_time_now()
>
> Are you trying to schedule a transmission?
> This is a good example: tx_timed_samples.cpp
>
> Are you trying to transmit samples from a file?
> Another good example and a functional app: tx_samples_from_file.cpp
>
> -josh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120419/2c5b2eee/attachment-0001.html>

------------------------------

Message: 16
Date: Thu, 19 Apr 2012 10:34:31 +0000
From: Bastien Auneau <[email protected]>
To: [email protected]
Subject: [USRP-users] Access Violation When Running UHD on Windows XP
        32-bit with VS 9 - 2008
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"

Hi

I had the same problem recently, and assumed I just had something wrong 
in my toolchain
I have been using UHD 64 bit under Windows 7 the past half year, 
checking out the last code, compiling an using it several times. I use 
Visual Studio 2008. I compiled boost lib from source

Using the last maint branch (3.4.1) I also have access violation anytime 
UHD code is called
I attach a screenshot of depedency walker to this email
In case the attach file doesn't make it through, it complains for :
_ missing GPSVC.dll IESHIMS.dll MSVCR90D.dll
_ also compains about almost all other DLL because they are x86 (while I 
built UHD 64bit)

Hope this help
Best Regards
Bastien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UHD_dependency_walker.png
Type: image/png
Size: 224978 bytes
Desc: not available
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120419/a0d9adeb/attachment-0001.png>

------------------------------

Message: 17
Date: Thu, 19 Apr 2012 07:34:39 -0400
From: "Marcus D. Leech" <[email protected]>
To: [email protected]
Subject: Re: [USRP-users] Two usrp receive to file at the same time by
        using multi-thread
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

On 19/04/12 04:33 AM, Eddie Sun wrote:
> Hi all,
>
>      i have a question about Two usrp samples_to_file at a same time
> by using the MIMO cable, dual ethernet cable mode. The OS is Windows7
> and using cygwin and MSVC 2010.
>
>      i modified the rx_samples_to_file by adding an other usrp, and
> most of the variables i declare two of them to save the second usrp
> parameter( like declare file2 rate2 freq2....etc), and create two
> thread, both call the function "template<typename samp_type> void
> recv_to_file" to realize the purpose.
>
>      But now i have a problem while running it, when both thread
> created and go into the while loop of the recv_to_file() successfully
> and it will show error  like "R6010  abort() has been called" and the
> process stop. i'm not sure if the MIMO setting is right or not. i only
> know that i can run the process if i comment the "outfile.write((const
> char*)&buff.front(), num_rx_samps*sizeof(samp_type));" and
> "outfile.close();" in the recv_to_file().
>
> if i don't save the files, the process work fine, but if i put those
> two lines back, even i slow down the sampling rate to like both
> 4M/s(My purpose is one 20M/s and one 4M/s), and it still not work. Can
> some one help me or give me some suggestion?
>
> The main changing part from the rx_samples_to_file.cpp of my program
> is as following:
>
> first create the second usrp
>
>     std::cout << boost::format("Creating the usrp device with: %s...")
> % args2 << std::endl;
>     uhd::usrp::multi_usrp::sptr usrp2 =
> uhd::usrp::multi_usrp::make(args2);
>
> and add the variable like file2, bw2, rate2, gain2, freq2 to catch the
> second usrp's parameter. let the first usrp(Master) use the External
> clock and second usrp(Slave) use the MIMO as clock and time
>
>         usrp->set_clock_config(uhd::clock_config_t::external(), 0);
>
>         uhd::clock_config_t clock_config;
>         clock_config.ref_source = uhd::clock_config_t::REF_MIMO;
>         clock_config.pps_source = uhd::clock_config_t::PPS_MIMO;
>
>         usrp2->set_clock_config(clock_config, 0);
>
>         usrp->set_time_now(uhd::time_spec_t(0.0), 0);
>         //sleep a bit while the slave locks its time to the master
>         boost::this_thread::sleep(boost::posix_time::milliseconds(100));
>
> and i add a global variable struct like
>
> void sig_int_handler(int){stop_signal_called = true;}
>     struct usrp_parameter{
>     uhd::usrp::multi_usrp::sptr usrp;
>     std::string file;
>     size_t spb;
> }usrp_p1,usrp_p2;
>
> and use it to save the parameter in the UHD_SAFE_MAIN   
>     usrp_p1.usrp=usrp;    usrp_p1.file=file;    usrp_p1.spb=spb;
>     usrp_p2.usrp=usrp2;    usrp_p2.file=file2;    usrp_p2.spb=spb;
>
> after that i use the command to start the stream
> usrp->issue_stream_cmd(stream_cmd);
> usrp2->issue_stream_cmd(stream_cmd2);
>
> and create two thread for receiving data at the same time
>
>         HANDLE hThread[2];
>         unsigned threadID,threadID2; 
>         hThread[0] = (HANDLE)_beginthreadex(NULL, 0, &threadfunction1,
> &usrp_p1, 0, &threadID); 
>         hThread[1]= (HANDLE)_beginthreadex(NULL, 0, &threadfunction2,
> &usrp_p2, 0, &threadID2); 
>         WaitForMultipleObjects(THREAD_COUNT,hThread,1,INFINITE);
>         CloseHandle(hThread[0]);
>         CloseHandle(hThread[1]);
>
> the threadfunction is like
>
> unsigned  __stdcall threadfunction1(void* argu) { 
>     recv_to_file<std::complex<short> >(usrp_p1.usrp, usrp_p1.file,
> usrp_p1.spb);      
>     _endthreadex(0);   
>     return 0; 
> }
>
> i narrow down the recv_to_file() variable number from 4 to 3, cuz i
> only need the short type, i replace the io_type to
> uhd::io_type_t::COMPLEX_INT16;
>
> i'm sure both thread can create successfully and enter the function
> recv_to_file, by using some printf(); i can confirm that, but i don't
> know how to fix the "saving the file" problem of this run time error.
> Did i missing somthing? Or what should i do to debug my program?
>
> Thanks,
> Eddie
>   
Look at the rx_multi_samples  program that comes with the UHD source--it
is designed to receive multiple
  streams.




-- 
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org





------------------------------

Message: 18
Date: Thu, 19 Apr 2012 06:59:24 -0500
From: Marc Epard <[email protected]>
To: Sanat Gulvadi <[email protected]>
Cc: [email protected]
Subject: Re: [USRP-users] time outs during Tx
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"


On Apr 19, 2012, at 2:01 AM, Sanat Gulvadi wrote:

> I just found from one of Marc Epard's previous posts somewhere that one needs 
> to issue_stream_cmd after every one SRAM full worth of samples. Is this 
> applicable in my case as well ?

That only applies when you are using the custom FPGA to do 100 Msps rx.

-Marc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120419/db5aaff1/attachment-0001.html>

------------------------------

Message: 19
Date: Thu, 19 Apr 2012 14:16:45 +0200
From: "[email protected]" <[email protected]>
To: "Bastien Auneau" <[email protected]>, "usrp"
        <[email protected]>
Subject: Re: [USRP-users] Access Violation When Running UHD on Windows
        XP 32-bit with VS 9 - 2008
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"


If the following patch fixes the crash its a boost / string / path issue.
This is not a real fix, just to test.

$ git diff host/lib/utils/log.cpp host/lib/utils/paths.cpp
diff --git a/host/lib/utils/log.cpp b/host/lib/utils/log.cpp
index 31d1179..b0c069c 100644
--- a/host/lib/utils/log.cpp
+++ b/host/lib/utils/log.cpp
@@ -183,15 +183,15 @@ uhd::_log::log::log(
     const std::string time = 
pt::to_simple_string(pt::microsec_clock::local_time());
     const std::string header1 = str(boost::format("-- %s - level %d") % time % 
int(verbosity));
     const std::string header2 = str(boost::format("-- %s") % 
function).substr(0, 80);
-    const std::string header3 = str(boost::format("-- %s:%u") % 
get_rel_file_path(file) % line);
-    const std::string border = std::string(std::max(std::max(header1.size(), 
header2.size()), header3.size()), '-');
+//    const std::string header3 = str(boost::format("-- %s:%u") % 
get_rel_file_path(file) % line);
+//    const std::string border = std::string(std::max(std::max(header1.size(), 
header2.size()), header3.size()), '-');
     _impl->ss
         << std::endl
-        << border << std::endl
+//        << border << std::endl
         << header1 << std::endl
         << header2 << std::endl
-        << header3 << std::endl
-        << border << std::endl
+//        << header3 << std::endl
+//        << border << std::endl
     ;
 }

diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp
index 4fc877d..3a18a50 100644
--- a/host/lib/utils/paths.cpp
+++ b/host/lib/utils/paths.cpp
@@ -73,13 +73,13 @@ static fs::path get_uhd_pkg_data_path(void){

 std::vector<fs::path> get_image_paths(void){
     std::vector<fs::path> paths = get_env_paths("UHD_IMAGE_PATH");
-    paths.push_back(get_uhd_pkg_data_path() / "images");
+    //paths.push_back(get_uhd_pkg_data_path() / "images");
     return paths;
 }

 std::vector<fs::path> get_module_paths(void){
     std::vector<fs::path> paths = get_env_paths("UHD_MODULE_PATH");
-    paths.push_back(get_uhd_pkg_data_path() / "modules");
+    //paths.push_back(get_uhd_pkg_data_path() / "modules");
     return paths;
 }






> I had the same problem recently, and assumed I just had something wrong 
> in my toolchain
> I have been using UHD 64 bit under Windows 7 the past half year, 
> checking out the last code, compiling an using it several times. I use 
> Visual Studio 2008. I compiled boost lib from source







------------------------------

Message: 20
Date: Thu, 19 Apr 2012 15:37:49 +0200
From: Amr Youssef <[email protected]>
To: [email protected]
Subject: [USRP-users] Questions about OFDM Implementation with
        GNU-Radio
Message-ID:
        <caj6uvlnbkgur0wb8jcvjut_xvint4vzhrzxoo4qytwfkqc_...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi , While i am reading C++ blocks about Implementation of OFDM system
(modulator and demodulator , i mean )  , there is  mysterious concept faces
me  .
In "digital_ofdm_mapper_bcv.cc" , there are a keyword called "occupied
tones" and "occupied carriers " , i need any clarifications about it !
 Also , if any available algorithms , communications algorithms or books
(references) which i can refer to them to relate those  .cc codes to the
communications concepts of OFDM , i kindly need it .

Thanks in-advance

Amr ,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120419/15eb4e28/attachment-0001.html>

------------------------------

Message: 21
Date: Thu, 19 Apr 2012 17:28:52 +0200
From: Sanat Gulvadi <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: [USRP-users] time outs during Tx
Message-ID:
        <cah12yls4os0k2u7zv1knsagu44jmqj5qcxsjjgcvxgctsow...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi again Josh,

Actually it looks like I spoke too soon.
I did look at both the examples you suggested. In my case I want to send as
long as it takes for a certain number of seconds to expire. During this
time, I loop over the samples contained in a file.
Right now for some reason, I am getting the 'U's showing up on stdout along
with my standard verbose output that says a packet was sent. I use time
spec only for the first packet and then make has_time_spec as false for
every subsequent packet to have it sent immediately.
I thought initially the underruns are being caused because of reading from
the disk. Preallocating the whole file contents to a buffer, didn't seem to
help.
Would you please allow me to take a little more of your time by asking you
to look at my code snippet ?

http://pastebin.com/x1dB2B1u <http://pastebin.com/dADe48Pt>

I am not very experienced with c++ and I apologize if my code looks clumsy.

Thanks again !

Best Regards,
Sanat


On Thu, Apr 19, 2012 at 1:59 PM, Marc Epard <[email protected]> wrote:

>
> On Apr 19, 2012, at 2:01 AM, Sanat Gulvadi wrote:
>
> I just found from one of Marc Epard's previous posts somewhere that one
> needs to issue_stream_cmd after every one SRAM full worth of samples. Is
> this applicable in my case as well ?
>
>
> That only applies when you are using the custom FPGA to do 100 Msps rx.
>
> -Marc
>
>


--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120419/546d6b85/attachment-0001.html>

------------------------------

_______________________________________________
USRP-users mailing list
[email protected]
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com


End of USRP-users Digest, Vol 20, Issue 18
******************************************

Reply via email to