diff --git a/Dockerfile b/Dockerfile index d907aad..05b46bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ RUN uhd_images_downloader # install RTL-SDR API RUN git clone https://github.com/krakenrf/librtlsdr /opt/librtlsdr \ && cd /opt/librtlsdr && mkdir build && cd build \ - && cmake ../ -DINSTALL_UDEV_RULES=ON && make && make install && ldconfig + && cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON && make && make install && ldconfig FROM blah2_env as blah2 LABEL maintainer="30hours " diff --git a/src/capture/kraken/Kraken.cpp b/src/capture/kraken/Kraken.cpp index b85b971..93bf901 100644 --- a/src/capture/kraken/Kraken.cpp +++ b/src/capture/kraken/Kraken.cpp @@ -20,13 +20,17 @@ Kraken::Kraken(std::string _type, uint32_t _fc, uint32_t _fs, // store all valid gains std::vector validGains; - int nGains; + int nGains, status; + status = rtlsdr_open(&devs[0], 0); + check_status(status, "Failed to open device for available gains."); nGains = rtlsdr_get_tuner_gains(devs[0], nullptr); check_status(nGains, "Failed to get number of gains."); std::unique_ptr _validGains(new int[nGains]); - int status = rtlsdr_get_tuner_gains(devs[0], _validGains.get()); + status = rtlsdr_get_tuner_gains(devs[0], _validGains.get()); check_status(status, "Failed to get number of gains."); validGains.assign(_validGains.get(), _validGains.get() + nGains); + status = rtlsdr_close(devs[0]); + check_status(status, "Failed to close device for available gains."); // update gains to next value if invalid for (int i = 0; i <= _gain.size(); i++) @@ -49,8 +53,11 @@ void Kraken::start() int status; for (size_t i = 0; i < channelIndex.size(); i++) { - status = rtlsdr_open(&devs[i], channelIndex[i]); + std::cout << "[Kraken] Setting up channel " << i << "." << std::endl; + rtlsdr_dev_t* dev; + status = rtlsdr_open(&dev, i); check_status(status, "Failed to open device."); + devs.push_back(dev); status = rtlsdr_set_center_freq(devs[i], fc); check_status(status, "Failed to set center frequency."); status = rtlsdr_set_sample_rate(devs[i], fs); diff --git a/src/capture/kraken/Kraken.h b/src/capture/kraken/Kraken.h index 872bac9..405dad2 100644 --- a/src/capture/kraken/Kraken.h +++ b/src/capture/kraken/Kraken.h @@ -9,7 +9,8 @@ /// Requires a custom librtlsdr which includes method rtlsdr_set_dithering(). /// The original steve-m/librtlsdr does not include this method. /// This is included in librtlsdr/librtlsdr or krakenrf/librtlsdr. -/// @author 30hours +/// Also works using 2 RTL-SDRs which have been clock synchronised. +/// @author 30hours, Michael Brock /// @todo Add support for multiple surveillance channels. /// @todo Replay support.