Start streaming of sound/SDR just before main loop

This prevents buffer overflow during init/creation processes
This commit is contained in:
Andreas Eversberg
2017-02-25 07:09:53 +01:00
parent 04fd1ddcea
commit 2e1999b1ee
13 changed files with 82 additions and 8 deletions

View File

@@ -236,6 +236,14 @@ int uhd_open(const char *device_args, double tx_frequency, double rx_frequency,
return -EIO;
}
return 0;
}
/* start streaming */
int uhd_start(void)
{
uhd_error error;
/* enable rx stream */
memset(&stream_cmd, 0, sizeof(stream_cmd));
stream_cmd.stream_mode = UHD_STREAM_MODE_START_CONTINUOUS;
@@ -243,7 +251,6 @@ int uhd_open(const char *device_args, double tx_frequency, double rx_frequency,
error = uhd_rx_streamer_issue_stream_cmd(rx_streamer, &stream_cmd);
if (error) {
PDEBUG(DUHD, DEBUG_ERROR, "Failed to issue RX stream command\n");
uhd_close();
return -EIO;
}
return 0;