Code Monkey home page Code Monkey logo

airspyhf's Introduction

User mode driver for Airspy HF+

This repository contains host software (Linux/Windows) for Airspy HF+, a high performance software defined radio for the HF and VHF bands.

http://www.airspy.com/airspy-hf-plus

How to build host software on Windows:

For VisualStudio 2013 or later:

  • git clone https://github.com/airspy/airspyhf.git host
  • Download https://github.com/libusb/libusb/releases/download/v1.0.20/libusb-1.0.20.7z
  • Extract libusb-1.0.20.7z to host directory
    • You should have host\libusb-1.0.20
  • Download ftp://mirrors.kernel.org/sourceware/pthreads-win32/pthreads-w32-2-9-1-release.zip
  • Extract pthreads-w32-2-9-1-release.zip to host directory
    • You should have host\libpthread-2-9-1-win
  • Navigate to src and Launch airspyhf.sln with VisualStudio 2013 or later
  • In Visual Studio, choose Release, x86 or x64 then Build Solution

For MinGW:

git clone https://github.com/airspy/airspyhf.git host

cd host

mkdir build

cd build

Normal version:

cmake ../ -G "MSYS Makefiles" -DLIBUSB_INCLUDE_DIR=/usr/local/include/libusb-1.0/

Debug version:

cmake ../ -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DLIBUSB_INCLUDE_DIR=/usr/local/include/libusb-1.0/

make

make install

How to build the host software on Linux:

Prerequisites for Linux (Debian/Ubuntu/Raspbian):

sudo apt-get install build-essential cmake libusb-1.0-0-dev pkg-config

Build host software on Linux:

wget https://github.com/airspy/airspyhf/archive/master.zip

unzip master.zip

cd airspyhf-master

mkdir build

cd build

cmake ../ -DINSTALL_UDEV_RULES=ON

make

sudo make install

sudo ldconfig

Clean CMake temporary files/dirs:

cd airspyhf-master/build

rm -rf *

Principal authors:

Ian Gilmour [email protected] and Youssef Touil [email protected]

http://www.airspy.com

This file is part of Airspy HF (with user mode driver based on Airspy R2, itself based on HackRF project see http://greatscottgadgets.com/hackrf/).

airspyhf's People

Contributors

aeroevan avatar alexandrerouma avatar amontefusco avatar guruofquality avatar hayguen avatar jj1bdx avatar jvde-github avatar martin-zs avatar martinherren avatar mm6dos avatar nickbp avatar paultag avatar touil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airspyhf's Issues

missing command line apps

There doesn't seem to be any of the airspy apps along with this repo.
I was looking for the
airspyhf_rx app, so the airspy HF+ can be used with openwebrx.

Linux install of /etc/udev/rules.d/52-airspyhf.rules maybe could add group and mode

In order to remove the need to run everything accessing the AirspyHF+ via sudo; I'm wondering if the following is acceptable as a change to the s/w? (If so, I'll PR it). It does work.

The distributed 52-airspyhf.rules file does not specify the group id or mode for the created device file /dev/airspyhf-*. I've added GROUP="dialout", MODE="0660", to the file and now I can use the AirspyHF+ without sudo. My file is as follows:

$ cat /etc/udev/rules.d/52-airspyhf.rules 
ATTR{idVendor}=="03eb", ATTR{idProduct}=="800c", SYMLINK+="airspyhf-%k", GROUP="dialout", MODE="0660", TAG+="uaccess"
$

I picked dialout as the group as I was already a member. I don't know if there's a better choice (maybe gpio or netdev? - neither is great!)

Thoughts. As I said, I'm happy to PR this.

release new version

hi,
what do you think to release a new version since the last is from 2018?
thank you

missing getopt.c from source tree (MSVC)

Fixed by copying getopt directory from airspy-tools directory to airspyhf tools directory

Skipping update step for 'airspyhf'
  No patch step for 'airspyhf'
  Performing configure step for 'airspyhf'
  -- Udev rules not being installed, install them with -DINSTALL_UDEV_RULES=ON
  -- Configuring done
  CMake Error at tools/src/CMakeLists.txt:28 (add_library):
    Cannot find source file:

      ../getopt/getopt.c

    Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
    .hpp .hxx .in .txx


  CMake Error at tools/src/CMakeLists.txt:28 (add_library):
    No SOURCES given to target: libgetopt_static

can't set sample rate

I'm trying to use the airspyhf fork to get airspyhf_rx to work, but I get complaints that the sample rate is unsupported

root@airspy:~/openwebrx# airspyhf_info 
airspyhf_lib_version: 1.4.1

Found AirSpy board 1
Firmware Version: R1.00.00
Part ID Number: 0x00000001
Serial Number: 0x3230342034313037
Supported sample rates:
	0.768000 MSPS
Close board 1


root@airspy:~/openwebrx# airspyhf_rx -f144.9 -r /dev/stdout -a768000
argument error: unsupported sample rate

Compile error

When I try to compile airspyhf, I get the following error:
make
[ 25%] Linking CXX shared module libairspyhfSupport.so
/usr/bin/ld: CMakeFiles/airspyhfSupport.dir/Settings.cpp.o:(.data.rel.ro._ZTV13SoapyAirspyHF[_ZTV13SoapyAirspyHF]+0x148): undefined reference to SoapySDR::Device::hasIQBalanceMode(int, unsigned long) const' /usr/bin/ld: CMakeFiles/airspyhfSupport.dir/Settings.cpp.o:(.data.rel.ro._ZTV13SoapyAirspyHF[_ZTV13SoapyAirspyHF]+0x150): undefined reference to SoapySDR::Device::setIQBalanceMode(int, unsigned long, bool)'
/usr/bin/ld: CMakeFiles/airspyhfSupport.dir/Settings.cpp.o:(.data.rel.ro._ZTV13SoapyAirspyHF[_ZTV13SoapyAirspyHF]+0x158): undefined reference to SoapySDR::Device::getIQBalanceMode(int, unsigned long) const' /usr/bin/ld: CMakeFiles/airspyhfSupport.dir/Streaming.cpp.o: in function SoapyAirspyHF::getStreamFormats[abi:cxx11](int, unsigned long) const':
Streaming.cpp:(.text+0x777): undefined reference to SoapySDR::ConverterRegistry::listTargetFormats(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: CMakeFiles/airspyhfSupport.dir/Streaming.cpp.o: in function SoapyAirspyHF::setupStream(int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::vector<unsigned long, std::allocator > const&, std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::less<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > const&)':
Streaming.cpp:(.text+0xc35): undefined reference to SoapySDR::ConverterRegistry::listSourceFormats(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: Streaming.cpp:(.text+0xc94): undefined reference to SoapySDR::ConverterRegistry::getFunction(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, SoapySDR::ConverterRegistry::FunctionPriority const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/airspyhfSupport.dir/build.make:116: libairspyhfSupport.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/airspyhfSupport.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Ubuntu 19.10, Linux 5.3.0-51-generic #44-Ubuntu SMP Wed Apr 22 21:09:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Firmware Flash Tool is missing

A Tool to upgrade the device's firmware is missing for the Airspy HF+.
Please provide the sources how to flash this device.
A Linux binary is missing.

Mixing 'cdecl' and 'stdcall'

When building with clang-cl and for 32-bit (x86), there is this important warning:

libairspyHF/src/airspyhf.c(514,81): warning: cast between incompatible calling conventions 'cdecl' and 'stdcall'; calls through this pointer

      may abort at runtime [-Wcast-calling-convention]
  ...= prepare_transfers(device, LIBUSB_ENDPOINT_IN | AIRSPYHF_ENDPOINT_IN, (libusb_transfer_cb_fn)airspyhf_libusb_transfer_callback);
                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libairspyHF/src/airspyhf.c(407,13): note: consider defining 'airspyhf_libusb_transfer_callback' with the 'stdcall' calling convention
static void airspyhf_libusb_transfer_callback(struct libusb_transfer* usb_transfer)
            ^
            __RPC_CALLEE

No warning in 64-bit mode since stdcall == cdecl AFAIK. Ref: https://en.wikipedia.org/wiki/X86_calling_conventions#Microsoft_x64_calling_convention

But with this patch, there's no warning in 32-bit mode:

--- a/libairspyhf/src/airspyhf.c 2022-08-30 08:29:38
+++ b/libairspyhf/src/airspyhf.c 2022-08-30 09:39:44
@@ -404,7 +404,7 @@
        return NULL;
 }

-static void airspyhf_libusb_transfer_callback(struct libusb_transfer* usb_transfer)
+static void LIBUSB_CALL airspyhf_libusb_transfer_callback(struct libusb_transfer* usb_transfer)
 {
        airspyhf_complex_int16_t *temp;
        airspyhf_device_t* device = (airspyhf_device_t*) usb_transfer->user_data;

The airspyhf/tools/src/README omits AM Modulation Examples

The airspyhf/tools/src/README omits AM Modulation Examples
(eg. AM, LSB, USB, ...)

Comparing airspyhf tools README with the csdr README, I was able see what was needed for csdr compatability with airspyhf hardware, for further modifying the csdr incantation/pipes for AM modulation.

  1. Remove the shift_addition_cc pipe, think this is for the rtl-sdr hardware not being accurate.

  2. Augment the csdr fir_decimate_cc pipe with airspyhf's "2 0.25 HAMMING" values.

  3. Included an additional "csdr fractional_decimator_ff 8" pipe.

$ airspyhf_rx -z -d -r stdout -f 0.970 | csdr fir_decimate_cc 2 0.25 HAMMING | csdr amdemod_cf | csdr fastdcblock_ff | csdr agc_ff | csdr limit_ff | csdr fractional_decimator_ff 8 | csdr convert_f_s16 | play -t s16 -r 48000 -

From here, users should be able to get SSB LSB/USB working too.

Next on my list, NFM.

FT8 decoding (airspyhf_rx vs rtl_sdr)

FT8 decoding works well with RTL-SDR V3 Dongle:

$ ~/librtlsdr/src/rtl_sdr -s 1000000 -f 14074000 -g 20 -O dm=4:dm=20E6 - | csdr convert_u8_f | csdr fir_decimate_cc 250 0.00166665 HAMMING > /tmp/ft8_14074000.c2

$ ./ft8d backup/ft8_14074000.c2 
 00   2.6  -9 -0.15 14074124 VU3CER VU3FOE MK68   MK68
 00   3.8  -6 -0.15 14074424 VU3CER VU3FOE MK68   MK68
 00   3.1  -5 -0.15 14074523 VU3CER VU3FOE MK68   MK68
 00   3.3   3 -0.14 14074623 VU3CER VU3FOE MK68   MK68
 00   3.8  12 -0.13 14074723 VU3CER VU3FOE MK68   MK68

The ft8d binary comes from https://github.com/pavel-demin/ft8d project.

Next, I tried using Airspy HF+ Discovery instead of the RTL-SDR V3 Dongle.

$ airspyhf_rx -r /dev/stdout -a 384000 -f 14.074000 -g on -m on - | csdr fir_decimate_cc 80 0.00166665 HAMMING > /tmp/ft8_14074000.c2"

$ ./ft8d backup/ft8_14074000.c2
<no decodes>

https://github.com/airspy/airspyhf/blob/master/tools/src/airspyhf_rx.c <-- I am using this to grab the IQ samples. I am guessing that the output format is CF32 which is directly supported by csdr tools. I could be totally wrong here.

No luck here!

Next, I tried using the Airspy HF+ Discover with rx_tools.

$ rx_sdr -s 384000 -f 14074000 -I CF32 -F CF32 - | csdr fir_decimate_cc 80 0.00166665 HAMMING > /tmp/ft8_14074000.c2

$ ./ft8d backup/ft8_14074000.c2
<no decodes>

No luck here either.

To ensure that FT8 traffic in always on the air, I use my https://github.com/kholia/Easy-Digital-Beacons-v1 project to generate such test FT8 traffic.

I am trying to understand where the bug is. Am I using csdr correctly? Or is airspyhf_rx subtly different in its behavior compared to rtl_sdr?

Note: All software versions are freshly built from git repos.

Screenshot_2021-10-31_18-56-39

When airspyhf_rx is operated in .wav mode (-w flag), I can play and decode the resultant .wav files just fine. So, what could be subtly different in the stdout mode?

Sample files:

rtl_sdr_internal_antenna_14074000.c2.txt - Recorded via RTL-SDR.

This IQ file can be opened in inspectrum software.

Proper RTL-SDR @ 4800 - Screenshot_2021-10-31_20-38-16

The FSK signal is clearly visible in the RTL-SDR recording.

hello_14074000.c2.txt - Recorded via Airspy HF+ Discovery.

Screenshot_2021-10-31_21-05-40

The signal looks like FSK too but doesn't decode. The timing (needed for decoding FT8 signals) seems to be quite fine.

What could be my next debugging steps to determine how airspyhf_rx is different from rtl_sdr? Thanks for the help.

airspyhf_set_user_output purpose

Not really an issue, just a help request.
What is the function

int ADDCALL airspyhf_set_user_output(airspyhf_device_t* device, airspyhf_user_output_t pin, airspyhf_user_output_state_t value)

meant to do ?
Do I should expect an airspyhf_get_user_output in the near future ?
Asking just to know if it is worth to implement into the Extio dll.

Supported Samplerates

Hi,
I was searching on the Internet for the supported samplerates of the Airspy HF+. Unfortunately, I couldn't find any information. Could you provide a list of supported samplerates?

Thanks,
Tobias

bandwidth in sdr# limited to a very small value

I am using a airspy mini, conneted to a raspberry pi 3b+, running Spy Server v2.0.1629.

The raspberry pi 3b+ connected to my router with a 1000Mbps wired network.

My computer running Windows 10 64bit connected to my router with 5Ghz wifi.

I am running sdr#, connted to my spy server.

The available bandwidth is very limited, even not satisfied for listening to FM radio.

Below are my screenshots, notice the bandwidth in red circle, they are the max value i can toggle.

But when i connet my airspy mini directly to my computer usb port, they are not so limited.

I dont know why my airspy mini is acting like this when using spy server, i just wanna it to act as that it were connected directly to my usb port.

Please can anyone help me.

1
2
3

Below is my spyserver.config file:

SPY Server Configuration File

bind_host = 0.0.0.0
bind_port = 5555
maximum_clients = 10
allow_control = 1
maximum_bandwidth = 500000
fft_fps = 30
fft_bin_bits = 16
device_type = AirspyOne
device_serial = 0
initial_frequency = 99800000
frequency_correction_ppb = 0
initial_gain = 12
enable_bias_tee = 0
buffer_size_ms = 100
buffer_count = 20

Possible optimization

-ffast-math is not included i -O3, and SDR doesn't really need strict IEEE754 complience.

Something to think about, perhaps.

Callback never called

SDRangel successfully uses this library on Windows + recent versions of Linux, but it doesn't appear to work on MacOS (and in the past there were some reports of it not working on some Linux distributions with USB 3 ports, but OK when forced to USB 2). Functions to set the frequency and sample rate seem OK, but the callback never appears to be called.

It seems that the example airspyhf_rx program doesn't work on MacOS with the same symptoms (Tested using Big Sur using libusb 1.0.26 and 1.0.23), although some say other SDR software can run OK.

Any idea what the problem might be or how to debug? Thanks

Option to get integer I/Q stream

Hello,

would it be possible to have an option to get the I/Q stream as 16 bit integer samples (int16_t). I see there is a conversion function from int to float so the original stream from USB should be integers. This is the format I would like to access.

If you don't have time I can look closer at the code and try to find an elegant (not too ugly) way to do this.

Thank you and best regards.

Building under MINGW depends on non-existent airspyhf.rc

With the latest update, I notice that I still have to delete the reference to MINGW in airpsyhf/src/CMakeLists.txt because all it does is try to build the resource file and the dependency win32/airpsyhf.rc is NOT part of the distribution, so it always fails. When I inquired about this long ago, I was told the resource file was not needed and just delete the reference in CMakeLists.txt. It would be nice if that was fixed in the distribution so that those of us building under MINGW don't always have to delete the reference from CMakeLists.txt when changes affect that CMakeLists.txt from you folks.

HF+ Discover compatibility on Raspberry Pi OS (model 4B)

Trying to set up the Spyserver on raspberry pi, however; it appears that the system doesn’t recognise the Airpsy discovery with those drivers.

Curious if this is some compatibility issue or some other case?

Tried various config settings ranging from detection modes to serial numbers, the result is “server busy” response on SDR#.

Clues?

Build on Fedora

Would it be possible to add these Fedora directions to the main pages?

I finally got airspyhf to install on Fedora and update airspyone_host from 1.0.9 (from Fedora repos) to 1.0.11. I was able to clean up what I was doing and simplify it thanks to https://wiki.polaire.nl/doku.php?id=airspy_mini_fedora so here is how to do it:

Prerequisites for Linux (Fedora):

sudo groupadd plugdev
sudo usermod -a -G plugdev $USER

Reboot Fedora.

sudo dnf groupinstall "Development Tools" 
sudo dnf install cmake gcc-c++ libusb libusb-devel pkgconf

Build host software on Linux (Fedora):

wget https://github.com/airspy/airspyhf/archive/master.zip
unzip master.zip
cd airspyhf-master
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo bash -c 'echo /usr/local/lib >>/etc/ld.so.conf.d/local.conf'
sudo bash -c 'echo /usr/local/lib64 >>/etc/ld.so.conf.d/local.conf'
sudo ldconfig
sudo udevadm control --reload-rules
sudo udevadm trigger

These also work for airspyone_host. Uninstall the Fedora version if installed with sudo dnf remove airspyone_host then continue. This might also remove Gqrx so you will have to reinstall it with sudo dnf install gqrx if that happens.

Build host software on Linux (Fedora):

wget https://github.com/airspy/airspyone_host/archive/master.zip
unzip master.zip
cd airspyone_host-master
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo bash -c 'echo /usr/local/lib >>/etc/ld.so.conf.d/local.conf'
sudo bash -c 'echo /usr/local/lib64 >>/etc/ld.so.conf.d/local.conf'
sudo ldconfig
sudo udevadm control --reload-rules
sudo udevadm trigger

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.