Hi Martin,

Thanks for looking into it. Meanwhile I collected more information and it
does get weirder.

I'm attaching a basic C++ program that does nothing useful, it just RX
streams until CTRL+C kills it. Compiling instructions for Linux are in the
first lines of the code.
On Ubuntu 18.04, everything works even with UHD 3.11, meaning that I can
kill the binary and rerun it right away as many times as I want.
On Ubuntu 16.04, UHD 3.11 seems to have the "state" that I mentioned
earlier in this thread, meaning that CTRL+C kills the board until reboot
("/usr/lib/uhd/utils/b2xx_fx3_utils -D" may work too, but I haven't tried
it as a soft reboot).

I wrote this test code in a hurry, and hopefully there aren't distracting
bugs. The same does happen in production code, which I can't attach for
obvious reasons.

Thanks,
Dario

On Thu, Apr 19, 2018 at 3:34 PM, Martin Braun <[email protected]>
wrote:

> On 03/21/2018 10:12 PM, Dario Fertonani wrote:
> > No comments on this? It's a major bug introduced in the new release, in
> > my opinion.
> >
> > Anybody can replicate it by running the official test file linked below,
> > when compiled with UHD 3.11 from Ubuntu PPA.
> >
> >     https://github.com/manuts/uhd-examples/blob/master/rx_multi_
> samples.cpp
>
> Just for the record, this is not the source location for official examples.
>
> > Just run it long enough (with proper "nsamps" option), kill it via
> > CTRL+C while still streaming, then relaunch. It dies instantly with
> > errors like the following.
> >
> >     [ERROR] [STREAMER] recv packet demuxer unexpected sid 0x1fffc
> >     [ERROR] [STREAMER] recv packet demuxer unexpected sid 0x10006
> >     DError: Receiver error ERROR_CODE_OVERFLOW (Out of sequence error)
>
> Dario,
>
> sorry for the delayed response. We'll need to triage this and see what's
> going on.
>
> Thanks for bringing this up,
>
> Martin
>
>
>
> >
> > In my case I ran the following command, but the nsamps value doesn't
> > really matter as long as it's long enough for the user to kill the first
> > run via CTRL+C.
> >
> >     $ ./rx_multi_samples --nsamps 10000000
> >
> >
> > Thanks,
> > Dario
> >
> >
> >
> > On Thu, Mar 8, 2018 at 5:30 PM, Dario Fertonani
> > <[email protected] <mailto:[email protected]>> wrote:
> >
> >     Thank you Martin, logging is fixed now.
> >     However, something must have changes in the rx_streamer behavior.
> >     Basic receive code that has compiled/worked since the 3.9.x days no
> >     longer works. This is for B210 under Ubuntu 16.04, g++ 5.4, UHD fro
> >     3.11 from PPA.
> >
> >     The receiver works the first time after B210 boot (and associated
> >     FPGA image load). Then, after CTRL+C or equivalent interruptions,
> >     the same binary fails right away with these errors (the SID change
> >     at every run)
> >
> >         [ERROR] [STREAMER] recv packet demuxer unexpected sid 0xfffffff6
> >         [ERROR] [STREAMER] recv packet demuxer unexpected sid 0xfffcfff5
> >
> >     as soon as the recv function is called. This suggests that 1)
> >     there's some stale state from the previous run, and 2) a B210 reboot
> >     clears that state.
> >     Is there a way to clean that state from C++ API? Or, more in
> >     general, a way to get the rx_stream to work without rebooting the
> board?
> >
> >     Thanks,
> >     Dario
> >
> >     On Thu, Mar 8, 2018 at 12:49 PM, Martin Braun
> >     <[email protected] <mailto:[email protected]>> wrote:
> >
> >         On 03/08/2018 09:56 AM, Dario Fertonani wrote:
> >         > Hi Martin,
> >         >
> >         > Our code doesn't compile on Ubuntu 16.04 with UHD 3.11 from
> PPA (UHD
> >         > 3.10.x works well). This is on "amd64" ark, with g++ that dies
> out with
> >         > a missing header (copied below)
> >         >
> >         >     fatal error: uhd/utils/msg.hpp: No such file or directory
> >         >
> >         >
> >         > I can probably fix the headers with some trial and error, but
> there's a
> >         > deeper question: Did anything significant change in the "msg"
> API?
> >
> >         Dario,
> >
> >         everything related to the logging API (msg.hpp falls into this
> >         category)
> >         was completely re-done between 3.10 and 3.11. I'll refer to the
> >         manual
> >         page: http://files.ettus.com/manual/page_logging.html
> >         <http://files.ettus.com/manual/page_logging.html>
> >
> >         ...and this email:
> >         http://lists.ettus.com/pipermail/usrp-users_lists.
> ettus.com/2017-April/024653.html
> >         <http://lists.ettus.com/pipermail/usrp-users_lists.
> ettus.com/2017-April/024653.html>
> >
> >         -- M
> >
> >         >
> >         > Thanks,
> >         > Dario
> >         >
> >         >
> >         > On Mon, Mar 5, 2018 at 1:51 PM, Martin Braun via USRP-users
> >         > <[email protected]
> >         <mailto:[email protected]>
> >         <mailto:[email protected]
> >         <mailto:[email protected]>>> wrote:
> >         >
> >         >     Two more comments:
> >         >
> >         >     - Binary installers are currently building and will be
> >         made available
> >         >     shortly on the usual spots: Ubuntu PPA is here:
> >         >     https://launchpad.net/~ettusresearch/+related-packages
> >         <https://launchpad.net/~ettusresearch/+related-packages>
> >         >     <https://launchpad.net/~ettusresearch/+related-packages
> >         <https://launchpad.net/~ettusresearch/+related-packages>>
> >         >
> >         >     ...and Windows+Fedora binaries will be published here:
> >         >
> >          http://files.ettus.com/binaries/uhd/uhd_003.011.000.
> 000-release/ <http://files.ettus.com/binaries/uhd/uhd_003.011.000.
> 000-release/>
> >         >
> >          <http://files.ettus.com/binaries/uhd/uhd_003.011.000.
> 000-release/
> >         <http://files.ettus.com/binaries/uhd/uhd_003.011.000.
> 000-release/>>
> >         >
> >         >     (but aren't there yet).
> >         >
> >         >     - Because we changed out dev model, you will need to
> >         manually reset
> >         >     maint branch if you're tracking that on git. The following
> >         commands will
> >         >     work:
> >         >
> >         >     $ git checkout maint
> >         >     $ git remote update
> >         >     $ git reset --hard @{u}
> >         >
> >         >     Cheers,
> >         >     Martin
> >         >
> >         >
> >         >     On 03/05/2018 12:20 PM, Martin Braun wrote:
> >         >     > Hi all,
> >         >     >
> >         >     > today we've tagged the release for UHD 3.11.0.0. We
> >         found a bunch of
> >         >     > issues during RC testing, but not enough to warrant
> >         another release
> >         >     > candidate.
> >         >     > Some of the issues we fixed were actually
> >         usability-related, but there
> >         >     > was an actual bug with the images downloader, which
> >         might not properly
> >         >     > update the correct images after doing git pull, and we
> >         found and
> >         >     fixed a
> >         >     > bug in the X300 firmware which manifests as the GPSDO
> >         not being found
> >         >     > (if you were running master branch with the X300, we
> >         highly recommend
> >         >     > upgrading).
> >         >     >
> >         >     > There is one known N310 issue which is still open as of
> >         this release:
> >         >     > When running UHD natively on the device in a
> >         multi-threading scenario,
> >         >     > it is possible to encounter race conditions which lead
> >         to UHD dropping
> >         >     > command packets. We will be releasing a bugfix release
> >         within a few
> >         >     > weeks to address this issue, along with anything else we
> >         might
> >         >     have missed.
> >         >     >
> >         >     > Please find the tag on github here:
> >         >     >
> >         >
> >          https://github.com/EttusResearch/uhd/releases/
> tag/release_003_011_000_000
> >         <https://github.com/EttusResearch/uhd/releases/
> tag/release_003_011_000_000>
> >         >
> >          <https://github.com/EttusResearch/uhd/releases/
> tag/release_003_011_000_000
> >         <https://github.com/EttusResearch/uhd/releases/
> tag/release_003_011_000_000>>
> >         >     >
> >         >     > Cheers!
> >         >     >
> >         >     > Martin
> >         >     >
> >         >     >
> >         >     > Changelog:
> >         >     > ## 003.011.000.000
> >         >     > * N310: Added driver
> >         >     > * UBX: Add support for CAL antenna for Rev E
> >         >     > * Added the module peripheral manager (MPM) with all
> >         subcomponents
> >         >     (N310
> >         >     >   drivers, mpm_shell, RPC server, BIST, etc.)
> >         >     > * UHD: Added rpclib as a internally tracked dependency
> >         >     > * UHD: Reduced the usage of Boost
> >         >     > * UHD: Updated uhd_images_downloader: Now uses more
> >         elaborate manifest
> >         >     >   to optimize downloads
> >         >     > * UHD: Introduced uhdlib internal include paths
> >         >     > * UHD: Add support for configuration files. USRP
> >         settings can now
> >         >     be set
> >         >     >   using a uhd.conf file in addition to device args
> >         >     > * UHD: Add narrow and narrow_cast
> >         >     > * gr-usrptest: Various bugfixes
> >         >     > * Updated required Vivado version to 2017.4
> >         >     > * Updated all license headers to use SPDX identifiers
> >         and correctly
> >         >     >   identify Ettus Research as part of National Instruments
> >         >     > * This release includes all bugfixes and features from
> >         previous
> >         >     >   releases, in particular, the 3.10.* release cycle
> >         >     >
> >         >
> >         >
> >         >     _______________________________________________
> >         >     USRP-users mailing list
> >         >     [email protected]
> >         <mailto:[email protected]>
> >         <mailto:[email protected]
> >         <mailto:[email protected]>>
> >         >
> >          http://lists.ettus.com/mailman/listinfo/usrp-users_
> lists.ettus.com
> >         <http://lists.ettus.com/mailman/listinfo/usrp-users_
> lists.ettus.com>
> >         >
> >          <http://lists.ettus.com/mailman/listinfo/usrp-users_
> lists.ettus.com
> >         <http://lists.ettus.com/mailman/listinfo/usrp-users_
> lists.ettus.com>>
> >         >
> >         >
> >
> >
> >
>
>
//  Compile:
//      g++ rxTest.cpp -o rxTest -std=c++11 -O3 -luhd -lboost_system
//  Run:
//      ./rxTest
#include <iostream>
#include <uhd/usrp/multi_usrp.hpp>


//
int main( )
{
    
    //constants
    const double SamplingRate_Hz =   8e6;
    const double  CarrierFreq_Hz = 100e6;
    const unsigned ChunkSamples = 1024;
    
    //init board and set frequencies
    auto rfBoardPtr = uhd::usrp::multi_usrp::make( uhd::device_addr_t( "" ) );
    rfBoardPtr->set_clock_source( "internal" );
    rfBoardPtr->set_time_unknown_pps( 0.0 );
    rfBoardPtr->set_rx_rate( SamplingRate_Hz );
    rfBoardPtr->set_rx_freq( uhd::tune_request_t( CarrierFreq_Hz ) );
    
    //stream
    std::vector< std::complex< float > > rxSampleVec( ChunkSamples );
    uhd::stream_args_t streamParams( "fc32" , "sc16" );
    streamParams.channels = { 0 };
    auto rxStreamPtr = rfBoardPtr->get_rx_stream( streamParams );
    uhd::stream_cmd_t rxStreamCmd( uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS );
    rxStreamCmd.stream_now = true;
    rxStreamPtr->issue_stream_cmd( rxStreamCmd );
    std::cout << "Receiving samples..." << std::endl;
    while ( true )
    {
        uhd::rx_metadata_t rxMetaData;
        if ( rxStreamPtr->recv( rxSampleVec.data( ) , ChunkSamples , rxMetaData ) < ChunkSamples )
        {
            std::cerr << "Error in UHD recv." << std::endl;
            std::cerr << rxMetaData.to_pp_string( false ) << std::endl;
            return -1;
        }
    }
    
    //return
    return 0;
    
}

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

Reply via email to