Interfacing KSDR in C/C++

Discuss KerberosSDR - 4x Coherent RTL-SDR
Post Reply
Jacky2k
Posts: 2
Joined: Sat May 04, 2019 8:10 am

Interfacing KSDR in C/C++

Post by Jacky2k » Sat May 04, 2019 8:14 am

Hi everyone,

I'd like to buy a KSDR for some applications I have in mind but I could not find out yet how to interface the KSDR from my own software. In my case this is a C++ application. Is there some sort of C/C++ library that sits on top of librtlsdr or do I have to control the KSDR (the noise source) manually and do the correlation/correction my self?
Best regards,
Fabian

User avatar
kb3cs
Posts: 34
Joined: Thu Apr 04, 2019 2:15 pm

Re: Interfacing KSDR in C/C++

Post by kb3cs » Sat May 04, 2019 5:21 pm

grab a copy of the KSDR code and see how it's done
Last edited by kb3cs on Sun May 05, 2019 12:54 pm, edited 1 time in total.

Jacky2k
Posts: 2
Joined: Sat May 04, 2019 8:10 am

Re: Interfacing KSDR in C/C++

Post by Jacky2k » Sat May 04, 2019 7:36 pm

OK, so no C library?
I know how to do it, but I am lazy and was hoping to save some time ;)

User avatar
kb3cs
Posts: 34
Joined: Thu Apr 04, 2019 2:15 pm

Re: Interfacing KSDR in C/C++

Post by kb3cs » Sat May 04, 2019 10:36 pm

but allow yourself a full review of the existing code first before declaring yourself too lazy to be lazy :geek:

rtlsdrblog
Site Admin
Posts: 2368
Joined: Mon Nov 19, 2012 11:54 pm

Re: Interfacing KSDR in C/C++

Post by rtlsdrblog » Sun May 05, 2019 1:09 am

The code is all open source, so please feel free to take a look. It's not in API form though, you'd need to build your own interface.

The core C code handles the RTL-SDR driver interface and control, plus the syncing and gate functions. The Python code does the DSP and GUI. You can see how the Python code interfaces with the core C code, and then build a similar interface in your C++ program.

Stromeko
Posts: 15
Joined: Wed May 01, 2019 6:32 pm

Re: Interfacing KSDR in C/C++

Post by Stromeko » Sun May 12, 2019 8:12 am

I've had a quick look, but there aren't really any comments (and still lots of occurences of Hydra). It would be highly appreciated if the general structure of the code and the layout of the FIFO / control channels was explained somewhere.

From my reading of the code (mostly just the C) the most highlevel structure is this: a thread per receiver to read into a circular buffer. Syncing the receivers produces an offset into each circular buffer (except one, I guess) to align the samples. Control (configuring the receivers) goes through some sort of FIFO and is then dispatched to all four receivers.

One of the questions I have is if you need to re-sync after each control change?

Post Reply