Can someone fluent in Linux help me with this?

Format _C:

2[H]4U
Joined
Jun 12, 2001
Messages
3,885
I want to create this program for Windows I have a PC with Linux mint but I don't know anything about the bash or terminal/command line so can someone either create it (and email me the file) or tell me what exactly I am supposed to enter.

This is so my RTL-SDR dongle can receive NRSC-5 (AKA HD Radio) broadcasts

Thank You in advance the text is below on how to create the program



Code:
# nrsc5

This program receives NRSC-5 digital radio stations using an RTL-SDR dongle. It offers a command-line interface as well as an API upon which other applications can be built. Before using it, you'll first need to compile the program using the build instructions below.

## Building on Ubuntu, Debian or Raspbian

    $ sudo apt install git build-essential cmake autoconf libtool libao-dev libfftw3-dev librtlsdr-dev
    $ git clone https://github.com/theori-io/nrsc5.git
    $ cd nrsc5
    $ mkdir build
    $ cd build
    $ cmake [options] ..
    $ make
    $ sudo make install
    $ sudo ldconfig

Available build options:

    -DUSE_NEON=ON            Use NEON instructions. [ARM, default=OFF]
    -DUSE_SSE=ON             Use SSSE3 instructions. [x86, default=OFF]
    -DUSE_FAAD2=ON           AAC decoding with FAAD2. [default=ON]
    -DLIBRARY_DEBUG_LEVEL=1  Debug logging level for libnrsc5. [default=5]

You can test the program using the included sample capture:

    $ xz -d < ../support/sample.xz | src/nrsc5 -r - 0

## Building on Fedora

Follow the Ubuntu instructions above, but replace the first command with the following:

    $ sudo dnf install make patch cmake autoconf libtool libao-devel fftw-devel rtl-sdr-devel libusb-devel

## Building on macOS using [Homebrew](https://brew.sh)

    $ curl https://raw.githubusercontent.com/theori-io/nrsc5/master/nrsc5.rb > /tmp/nrsc5
    $ brew install --HEAD -s /tmp/nrsc5

## Building for Windows

To build the program for Windows, you can either use [MSYS2](http://www.msys2.org) on Windows, or else use a cross-compiler on an Ubuntu, Debian or macOS machine. Scripts are provided to help with both cases.

### Building on Windows with MSYS2

Install [MSYS2](http://www.msys2.org). Open a terminal using the "MSYS2 MinGW 32-bit" shortcut. (Or use the 64-bit shortcut if you prefer a 64-bit build.)

    $ pacman -Syu

If this is the first time running pacman, you will be told to close the terminal window. After doing so, reopen using the same shortcut as before.

    $ pacman -Su
    $ pacman -S git
    $ git clone https://github.com/theori-io/nrsc5.git
    $ nrsc5/support/msys2-build

You can test your installation using the included sample file:

    $ cd ~/nrsc5/support
    $ xz -d sample.xz
    $ nrsc5.exe -r sample 0

If the sample file does not work, make sure you followed all of the instructions. If it still doesn't work, file an issue with the error message. Please put "[Windows]" in the title of the issue.

Once everything is built, you can run nrsc5 independently of MSYS2. Copy the following files from your MSYS2/mingw32 directory (e.g. C:\\msys64\\mingw32\\bin):

* libnrsc5.dll
* nrsc5.exe

### Cross-compiling for Windows from Ubuntu / Debian

    $ sudo apt install mingw-w64
    $ support/win-cross-compile 32

Replace `32` with `64` if you want a 64-bit build. Once the build is complete, copy `*.dll` and `nrsc5.exe` from the `build-win32/bin` (or `build-win64/bin`) folder to your Windows machine.

### Cross-compiling for Windows from macOS

    $ brew install mingw-w64
    $ support/win-cross-compile 32

Replace `32` with `64` if you want a 64-bit build. Once the build is complete, copy `*.dll` and `nrsc5.exe` from the `build-win32/bin` (or `build-win64/bin`) folder to your Windows machine.

## Usage

### Command-line options:

    frequency                       center frequency in MHz or Hz
                                      (do not provide frequency when reading from file)
    program                         audio program to decode
                                      (0, 1, 2, or 3)
    -g gain                         gain
                                      (example: 49.6)
                                      (automatic gain selection if not specified)
    -d device-index                 rtl-sdr device
    -p ppm-error                    rtl-sdr ppm error
    -H rtltcp-host                  rtl_tcp host with optional port
                                      (example: localhost:1234)
    -r iq-input                     read IQ samples from input file
    -w iq-output                    write IQ samples to output file
    -o audio-output                 write audio to output WAV file
    -q                              disable log output
    -l log-level                    set log level
                                      (1 = DEBUG, 2 = INFO, 3 = WARN)
    -v                              print the version number and exit
    --am                            receive AM signals
                                      (default is FM)
    -T                              enable bias-T
    -D direct-sampling-mode         enable direct sampling
                                      (1 = I-ADC input, 2 = Q-ADC input)
    --dump-aas-files dir-name       dump AAS files
                                      (WARNING: insecure)
    --dump-hdc file-name            dump HDC packets

### Examples:

Tune to 107.1 MHz and play audio program 0:

    $ nrsc5 107.1 0

Tune to 107.1 MHz and play audio program 0. Manually set gain to 49.0 dB and save raw IQ samples to a file:

    $ nrsc5 -g 49.0 -w samples1071 107.1 0

Read raw IQ samples from a file and play back audio program 0:

    $ nrsc5 -r samples1071 0

Tune to 90.5 MHz and convert audio program 0 to WAV format for playback in an external media player:

    $ nrsc5 -o - 90.5 0 | mplayer -

### Keyboard commands:

To switch between audio programs at runtime, press <kbd>0</kbd>, <kbd>1</kbd>, <kbd>2</kbd>, or <kbd>3</kbd>.

To quit, press <kbd>Q</kbd>.

### RTL-SDR drivers on Windows

If you get errors trying to access your RTL-SDR device, then you may need to use [Zadig](http://zadig.akeo.ie/) to change the USB driver. Once you download and run Zadig, select your RTL-SDR device, ensure the driver is set to WinUSB, and then click "Replace Driver". If your device is not listed, enable "Options" -> "List All Devices".
 
Project won't build, it vomits on trying to build libnrsc5.dll with hundreds of lines of this

Code:
Undefined reference to 'CMPLXF'

on the file: CMakeFiles/nrsc5.dir/objects.a

Could be a cross compiling dependency hell issue, or the code is old and requires and older build environment. Either way, won't build and I don't want to spend hours debugging it.

Maybe you can try compiling it on Windows with the Msys2.
 
won't build
Thank You I thought I was doing something wrong I guess not but I appreciate someone trying :)
I did try the Windows version a year or so ago when I first saw this and I also got a bunch of errors so I guess the project is not complete
 
I'm sure the project is complete, it just requires some older version(s) of whatever libraries/compilers to work properly. The build status gets to 97% before it vomits, so it's probably just a few files with issues.

It's a common problem with compiling on Linux, nobody tries to maintain backwards compatibility, so just one slight version change can break everything, requiring you to dig into the source code and start fixing stuff.

I would recommend filing a bug report on the github page and see if someone can help.
 
Project won't build, it vomits on trying to build libnrsc5.dll with hundreds of lines of this

Code:
Undefined reference to 'CMPLXF'

on the file: CMakeFiles/nrsc5.dir/objects.a

Could be a cross compiling dependency hell issue, or the code is old and requires and older build environment. Either way, won't build and I don't want to spend hours debugging it.

Maybe you can try compiling it on Windows with the Msys2.
CMPLXF is a macro used to define complex numbers (e.g. there's square root of -1 component) which is part of the C11 standard. How old is the compiler?

I was able to build it on RedHat 8, though I had to hunt down some dependencies and enable the codeready-builder and epel (Fedora project extra packages) repos to get all of them. That was a Linux build though. I haven't tried cross-compiling it.
 
CMPLXF is a macro used to define complex numbers (e.g. there's square root of -1 component) which is part of the C11 standard. How old is the compiler?

I was able to build it on RedHat 8, though I had to hunt down some dependencies and enable the codeready-builder and epel (Fedora project extra packages) repos to get all of them. That was a Linux build though. I haven't tried cross-compiling it.

Compiler is whatever comes on Fedora 36. I wasn't able to build a Linux binary either because of a whole different set of issues.

It being able to build on Redhat 8 confirms my suspicions you need a friggin ancient version of Linux to be able to build it. Redhat 8 was released all the way back in 2002.
 
Compiler is whatever comes on Fedora 36. I wasn't able to build a Linux binary either because of a whole different set of issues.

It being able to build on Redhat 8 confirms my suspicions you need a friggin ancient version of Linux to be able to build it. Redhat 8 was released all the way back in 2002.
Sorry, RedHat Enterprise Linux 8, released in May 2019 though I'm on a newer minor release. Guess I've fallen into a habit of just saying "RedHat" rather than to bother adding "Enterprise" since plain RedHat died nearly 20 years ago.
 
Thank You I thought I was doing something wrong I guess not but I appreciate someone trying :)
I did try the Windows version a year or so ago when I first saw this and I also got a bunch of errors so I guess the project is not complete
IDK what went wrong but I built it with MSYS2 on Win10. The instructions aren't quite right. First you need to install libtool before trying to build, then the test instructions with a sample audio file aren't quite right either. I don't have USB radio hardware so I can't test properly, but the sample file plays on my Win10 machine.

Changes in RED from instructions provided at https://github.com/theori-io/nrsc5

Install MSYS2. Open a terminal using the "MSYS2 MinGW 32-bit" shortcut. (Or use the 64-bit shortcut if you prefer a 64-bit build.) I did a 64-bit build.

$ pacman -Syu
If this is the first time running pacman, you will be told to close the terminal window. After doing so, reopen using the same shortcut as before.

$ pacman -Su
$ pacman -S libtool
$ pacman -S git
$ git clone https://github.com/theori-io/nrsc5.git
$ nrsc5/support/msys2-build
You can test your installation using the included sample file:

$ cd ~/nrsc5/support
$ xz -d sample.xz
$ ../build/src/nrsc5.exe -r sample 0

PM me if you want binaries from some random guy on the internets, but I don't think you'll have much trouble building it yourself.
 
Last edited:
IDK what went wrong but I built it with MSYS2 on Win10. The instructions aren't quite right. First you need to install libtool before trying to build, then the test instructions with a sample audio file aren't quite right either. I don't have USB radio hardware so I can't test properly, but the sample file plays on my Win10 machine.

Changes in RED from instructions provided at https://github.com/theori-io/nrsc5

Install MSYS2. Open a terminal using the "MSYS2 MinGW 32-bit" shortcut. (Or use the 64-bit shortcut if you prefer a 64-bit build.) I did a 64-bit build.

$ pacman -Syu
If this is the first time running pacman, you will be told to close the terminal window. After doing so, reopen using the same shortcut as before.

$ pacman -Su
$ pacman -S libtool
$ pacman -S git
$ git clone https://github.com/theori-io/nrsc5.git
$ nrsc5/support/msys2-build
You can test your installation using the included sample file:

$ cd ~/nrsc5/support
$ xz -d sample.xz
$ ../build/src/nrsc5.exe -r sample 0

PM me if you want binaries from some random guy on the internets, but I don't think you'll have much trouble building it yourself.
You have a PM
 
Looks like there's a PKGBUILD on the aur, too, if you're on archlinux. There may be some issues with how it's set up, though, so might actually be easier to follow the projects own build instructions.
 
Back
Top