discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Issue_stream_cmd, Segmentation Fault


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Issue_stream_cmd, Segmentation Fault
Date: Wed, 10 Feb 2016 15:24:54 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

Which version are you running? 4ae7a6015ba719a4720f61cc6f3857de2ebda89f
should fix this issue.

Also, is this really what you want to happen? If you just call
issue_stream_cmd() with a STOP command, it will stop, but all the data
will still flow through the graph, instead of getting flushed.
Especially as you are stopping and starting the flow graph.

My guess is you don't really need stop() here.

Cheers,
M


On 02/10/2016 03:07 PM, Zhihong Luo wrote:
> Hi All,
> 
> In the manual, it says to use issue_stream_cmd:
> 
> After starting the flow graph, the user should call stop()
> <https://gnuradio.org/doc/doxygen/classgr_1_1block.html#a0863bc16f7c84adf4cddf5d53124450e>on
> this block, then issue any desired arbitrary stream_cmd_t structs to the
> device
> 
> Therefore, I tried to stop() then issue the stream command, but it ran
> into segmentation fault. My code is:
>  
>     uhd::stream_cmd_t
> stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);
>      size_t num_requested_samples= 10000;
>      stream_cmd.num_samps = size_t(num_requested_samples);
>      stream_cmd.stream_now = true;
>      stream_cmd.time_spec = uhd::time_spec_t();
>     ...
>     std::cout << "starting flow graph" << std::endl;
>     tb->start();
>     usrp_source->stop();
>     usrp_source->issue_stream_cmd (stream_cmd);
> 
> Even if I delete the issue_stream_cmd line, there is still a
> segmentation fault. Can someone point out where I made a mistake? Thanks.
> 
> Zhihong Luo
> 
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]