FM receiver with Novena-RF

I’ve recently procured a Novena system equipped with the Novena-RF SDR.

The system is installed with the following OS:

$ uname -a
Linux novena-one 4.4.0-00156-gc9ba6e8 #12 SMP PREEMPT Fri Feb 19 14:32:59 SGT 2016 armv7l GNU/Linux
$ cat /etc/debian_version 
10.7

I’ve been able to now successfully compile the novena_rf.ko kernel module
as per the instructions provided.

At this point, I can do the following:

  1. Load kernel module with prepare_novena.sh script

    ./prepare_novena_rf.sh

    • mkdir -p /lib/firmware
    • cp /home/gsamu/Novena-RF/driver/binary/novena_rf.bit /lib/firmware/novena_rf.bit
    • chmod a+r /lib/firmware/novena_rf.bit
    • ‘[’ -e /dev/novena_rf ‘]’
    • insmod /home/gsamu/Novena-RF/driver/binary/novena_rf.ko
    • chmod a+rw /dev/novena_rf
    • chmod a+rw /dev/spidev2.0
    • ‘[’ -e /sys/class/gpio/gpio135 ‘]’
    • echo 135
    • ‘[’ -e /sys/class/gpio/gpio124 ‘]’
    • echo 124
    • ‘[’ -e /sys/class/gpio/gpio122 ‘]’
    • echo 122
    • chmod a+rw /sys/class/gpio/gpio135/direction
    • chmod a+rw /sys/class/gpio/gpio135/value
    • chmod a+rw /sys/class/gpio/gpio124/direction
    • chmod a+rw /sys/class/gpio/gpio124/value
    • chmod a+rw /sys/class/gpio/gpio124/edge
    • chmod a+rw /sys/class/gpio/gpio122/direction
    • chmod a+rw /sys/class/gpio/gpio122/value
  2. Check operation of driver

    SoapySDRUtil --make=“driver=novena”

    ######################################################

    Soapy SDR – the SDR abstraction library

    ######################################################

    Make device driver=novena
    [INFO] Loading FPGA image /lib/firmware/novena_rf.bit
    GPIO122: set to 1
    GPIO122: set to 1
    spi mode: 0x0
    bits per word: 8
    max speed: 4000000 Hz (4000 KHz)
    [INFO] Connected to Board on Novena | Firmware: ? Device: Novena Protocol: ?

    [INFO] LMS6002: ver=0x2, rev=0x0
    driver=NOVENA-RF
    hardware=NOVENA

Note that I also see in the system logs here:

[ 4829.841959] NovenaRF initializing EIM configuration..
[ 4829.842008] EIM_CSnGCR1 0x31910B8F
[ 4829.842014] EIM_CSnGCR2 0x00001000
[ 4829.842021] EIM_CSnRCR1 0x05000000
[ 4829.842028] EIM_CSnRCR2 0x00000000
[ 4829.842032] EIM_CSnWCR1 0x03080000
[ 4829.842038] EIM_WCR 0x00000701
[ 4829.842042] EIM_WIAR 0x00000010
[ 4829.842047] resetting CS0 space to 64M and enabling 32M CS1 and 32M CS2 space.
[ 4829.842051] EIM configured
  1. Run the ASCII art FFT plotter example

    /usr/lib/uhd/examples/rx_ascii_art_dft --rate=1e6 --freq=1.8e9 --gain=30 –ref-lvl=-60

    Creating the usrp device with: …
    [INFO] [UHD] linux; GNU C++ version 8.2.0; Boost_106700; UHD_3.13.1.0-3
    Using Device: Single USRP:
    Device: Audio
    Mboard 0: Audio
    RX Channel: 0
    RX DSP: 0
    RX Dboard: 0
    RX Subdev: SoapyRF
    TX Channel: 0
    TX DSP: 0
    TX Dboard: 0
    TX Subdev: None

    Setting RX Rate: 1.000000 Msps…
    Actual RX Rate: 1.000000 Msps…

    Setting RX Freq: 1800.000000 MHz…
    Actual RX Freq: 1800.000000 MHz…

    Setting RX Gain: 30.000000 dB…
    Actual RX Gain: 0.000000 dB…

    [INFO] [UHDSoapyDevice] Using format CF32.

    Done!

(note that I get the expected output here…)

So far so good. I was hoping to take things to the next level by trying to
use the Novena-RF as an FM receiver. I’ve tried to follow the tutorial
GNURadio FM Receiver - Getting Started (http://play.fallows.ca/wp/radio/software-defined-radio/gnuradio-fm-receiver-getting-started/). I downloaded the GRC file and updated the frequencies to some local radio stations, but it does not seem to be working.

I see the following in the GNU Radio console

<<< Welcome to GNU Radio Companion 3.7.13.4 >>>

Block paths:
	/usr/share/gnuradio/grc/blocks

Loading: "/home/gsamu/FM_RX_1a.grc"
>>> Done

Generating: '/home/gsamu/fm_receiver.py'

Generating: '/home/gsamu/fm_receiver.py'

Executing: /usr/bin/python2 -u /home/gsamu/fm_receiver.py

gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.13.4
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp 
e[32;1m[INFO] [UHD] e[39;0mlinux; GNU C++ version 8.2.0; Boost_106700; UHD_3.13.1.0-3
e[31;0m[ERROR] [UHD] e[39;0mDevice discovery error: unknown key format: 0
e[31;0m[ERROR] [UHD] e[39;0mDevice discovery error: unknown key format: 0
e[31;0m[ERROR] [UHD] e[39;0mDevice discovery error: unknown key format: 0
e[31;0m[ERROR] [UHD] e[39;0mDevice discovery error: unknown key format: 0
-- Using subdev spec '0:0'.
e[33;1m[WARNING] [MULTI_USRP] e[39;0mSetting DC offset compensation is not possible on this device.
gr::log :INFO: audio source - Audio sink arch: alsa
e[32;1m[INFO] [UHDSoapyDevice] e[39;0mUsing format CF32.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:0,0), Device or resource busy.

aUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaU

I’m not clear on the next steps? It seems that it can’t open the sound device? The audio sink has no device specified. But ther are also device discovery
errors. Any pointers would be greatly appreciated.

You should be using “Osmocom Source” with Device Arguments: soapy=0,device=novena not “RTL-SDR Source”

Hello. I’ve given that a try but it still doesn’t seem to work.

Block paths:
/usr/share/gnuradio/grc/blocks

Loading: “/home/gsamu/FM_RX_1a.grc”

Done
Error: Cannot create connection.

Generating: ‘/home/gsamu/fm_receiver.py’

Generating: ‘/home/gsamu/fm_receiver.py’

Generating: ‘/home/gsamu/fm_receiver.py’

Executing: /usr/bin/python2 -u /home/gsamu/fm_receiver.py

gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.13.4
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp [INFO] [UHD] linux; GNU C++ version 8.2.0; Boost_1
06700; UHD_3.13.1.0-3
[ERROR] [UHD] Device discovery error: unknown key
format: 0
[ERROR] [UHD] Device discovery error: unknown key
format: 0
[ERROR] [UHD] Device discovery error: unknown key
format: 0
[ERROR] [UHD] Device discovery error: unknown key
format: 0
– Using subdev spec ‘0:0’.
[WARNING] [MULTI_USRP] Setting DC offset compensat
ion is not possible on this device.
[WARNING] [MULTI_USRP] Setting DC offset is not po
ssible on this device.
gr::log :INFO: audio source - Audio sink arch: alsa
gr::log :INFO: audio_alsa_sink0 - [hw:CARD=imxaudioes8328,DEV=0]: unable to support sampling rate 24000
Card requested 44100 instead.
[INFO] [UHDSoapyDevice] Using format CF32.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:0,0), Device or resource busy.

aUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaU

My FM receiver definition: https://pastebin.com/ibNec2BM

Your receiver definition errors when I try to load it. Set the audio sink rate to 44100 or Perhaps you can select another audio device for output with “pavucontrol”.

Hello. I’ve set the audio sink rate to 44100 and specified device “pulse” again. What’s interesting is that I hear a clicking sound from the speakers about once per second. Additionally in the pavucontrol panel I see under “Playback” the ALSA python task (from gnuradio) appearing and disappearing (see attached image). It’s as though it gets access to the sound, then is blocked and it does this in a cycle. I feel it’s very close and related to the sound device that is being used.

aplay -L

default
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
jack
JACK Audio Connection Kit
pulse
PulseAudio Sound Server
sysdefault:CARD=imxaudioes8328
imx-audio-es8328,
Default Audio Device
dmix:CARD=imxaudioes8328,DEV=0
imx-audio-es8328,
Direct sample mixing device
dsnoop:CARD=imxaudioes8328,DEV=0
imx-audio-es8328,
Direct sample snooping device
hw:CARD=imxaudioes8328,DEV=0
imx-audio-es8328,
Direct hardware device without any conversions
plughw:CARD=imxaudioes8328,DEV=0
imx-audio-es8328,
Hardware device with all software conversions
usbstream:CARD=imxaudioes8328
imx-audio-es8328
USB Stream Output

Most audio devices accept 48,000 - so you might try setting the “Audio Sink” to 48,000 and the Rational Resampler Interpolation to 48 otherwise the Rational Resampler with the 44,100 sink would need values like Interpolation 441 and Decimation 2500 (I am not sure values so large will work) for the FM to be decoded correctly.