Giter VIP home page Giter VIP logo

v4l2-fm-radio's Introduction

This is a minimal (but usable) example of the SDR interface the Linux Kernel has, without relying on large external projects or complex libraries.

The FM decoder pass is written in SSE3/AVX2 including a relatively accurate and generalized vectorized ATAN2 function which may also be of interest to others. Generally the USB subsystem uses more CPU than this project does when playing FM radio.

Feel free to re-use any and all of this code for any project you wish. I chose the MIT license for a reason, afterall.

Usage is very simple: The program accepts a single argument, the frequency (in the standard I'm used to here in the US of "102.1" for example) and attempts to autodetect and find the appropriate SDR dongle. It was tested with the RTL-SDR dongle, and sits in the sub-1% CPU usage when running.

While the player is running you can use the standard V4L2 utility v4l2-ctl to change the radio station on the fly; presuming the device is /dev/swradio0 (it usually is unless you have multiple devices) you would use...

v4l2-ctl -d /dev/swradio0 --tuner-index=1 -f 102.1

...to change the station to 102.1 on the fly. I have no immediate plans to add any user interface to this utility, as the codebase is meant to be kept as simple as possible while still using directly usable.

v4l2-fm-radio's People

Contributors

wolfwings avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

sweetymarc

v4l2-fm-radio's Issues

Allocation issue

Compiled it (make / no issues) on a Ubuntu 18.04 box with 32 gb ram, (dell 7530)

Connected to an rtl-sdr (as a baseline test)

./player 95.5 
Failed to allocate input buffer!
RIFF����WAVEfmt ���}���data����

I only have about 8 gb of my 32gb in use.
Any ideas why it thinks it can't allocate (2048 * 1024) ?

I added some code to check errno and it is returning
ENOMEM Not enough space/cannot allocate memory

My C is really rusty (haven't used for over 20 years) but this seems odd to me. Wondered if you had any suggestions. Very interested to see this code work! Thank you for posting.

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.