[USRP-users] C API call in Windows fails with no last_error

Sivan Toledo stoledo at tau.ac.il
Tue Nov 7 06:18:39 EST 2017


A bit of progress. The error_string might have been used by two threads, so
I allocated a new buffer for error messages in the thread that starts
streaming and receives samples. This revealed the error message: TX/RX.
What is is error?

On Tue, Nov 7, 2017 at 1:06 PM, Sivan Toledo <stoledo at tau.ac.il> wrote:

> Hi,
>
> I've ported a code from the C++ API to the C API; it runs okay on Linux
> but fails on Windows. The failure occurs at the function:
>
> void radioRxStartStreaming(void) {
>   uhd_stream_cmd_t stream_cmd;
>
>   size_t n;
>   uhd_rx_streamer_max_num_samps(rx_stream, &n);
>   fprintf(stderr,"### UHD max samples %d ###\n",n);
>
>   fprintf(stderr,"### starting rx streaming ###\n");
>
>   stream_cmd.stream_mode = UHD_STREAM_MODE_START_CONTINUOUS;
>   stream_cmd.stream_now = true;
>
>   if (uhd_rx_streamer_issue_stream_cmd(rx_stream, &stream_cmd)) {
>     uhd_rx_streamer_last_error(rx_stream, error_string,
> ERROR_STRING_LENGTH);
>     fprintf(stderr,"### cannot start UHD rx streamer: <%s>
> ###\n",error_string);
>   } else {
> fprintf(stderr,"### started rx streaming ###\n");
>   }
> }
>
> issue_stream_command fails but last_error returns an empty string.
> The functions uhd_rx_streamer_make(&rx_stream) and
> uhd_usrp_get_rx_stream(usrp, &stream_args, rx_stream) are called prior to
> the attempt to start the stream, but from another thread. I am using
> pthreads in both Linux and Windows (using a pthreads library) and have not
> had a problem with this with the C++ API.
>
> I'm using UHD 3.9.7, installed from uhd_3.9.7-release_Win64_VS2013.exe
> <http://files.ettus.com/binaries/uhd/uhd_003.009.007-release/uhd_3.9.7-release_Win64_VS2013.exe>.
> The code is linked against visual studio 12.0 (which I think is VS2013)
>
> Any idea what might be going wrong? It's difficult to debug when the error
> message is empty.
>
> Thanks, Sivan
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20171107/6c581e41/attachment-0002.html>


More information about the USRP-users mailing list