Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

2014-02-07

Linux SDR API committed to media treee!

Yaw, a big day for me. After the two years of work, it is finally there! Mauro just committed basic SDR API stuff to Media tree for kernel 3.15.

So when you next time see new /dev/swradio0 device node appearing to file system, you know where it is coming from :)

[media] devices.txt: add video4linux device for Software Defined Radio

Add Antti at the V4L2 revision list sdr


I have almost 100 SDR patches waiting on my queue, adding new features and hardware support, including kernel SDR drivers for Mirics MSi3101 and Realtek RTL2832U based devices.

Check out my kernel SDR tree


Related tools etc.

Big thanks to VideoForLinux API rockstar Hans Verkuil for tons of comments and reviews.

2014-01-26

Hacking with SDR API gain contols

 

I finally pull requested initial Linux kernel SDR API, after many many review rounds! It will go mainline Kernel 3.15 as it is just a little bit too late for 3.14... Now it is time to design needed controls. I started already from the tuner gain controls, as you likely saw from the picture above. Now there is own controls for LNA, Mixer and RF gain.

I uploaded to GitHub some related software for test. Patches are more than welcome!

Will the Linux be first OS having native SDR support :)

2013-04-16

SDR API requirement specification


Recently I posted 2nd RFC of Kernel SDR API requirements. Currently I am performing some tests (Mirics FlexiTV SDR) how it could be integrated to the V4L2 API.

Here is current view of implementation control flow, listed in order from device to application:
  • Kernel device driver
    • controls device
  • Kernel V4L2 API
    • Kernel - user-space interface
  •  libv4l
    • existing library for applications
    • covers API from applications
    • makes raw format conversions to well known formats 

LINUX KERNEL SDR API REQUIREMENT SPECIFICATION

LINUX KERNEL SDR API REQUIREMENT SPECIFICATION
=====================================================================


Ideal SDR specific requirements (basics SDR settings)
*********************************************************************

operation mode
*  values: ADC (Rx) or DAC (Tx)
*  operations
     GET, inquire what HW supports
     GET, get current value
     SET, set desired value

sampling resolution
*  values: 1 - 32 (unit: bit)
     16 bit could be enough, but better to leave some room for future
*  operations
     GET, inquire what HW supports
     GET, get current value
     SET, set desired value

sampling rate
*  values: 1 - infinity (unit: Hz, symbols per second)
     currently 500 MHz is more than enough
*  operations
     GET, inquire what HW supports
     GET, get current value
     SET, set desired value

TODO:
*  inversion?


Practical SDR specific requirements (SDR settings for RF tuner)
*********************************************************************

RF frequency
*  values: 1 - infinity (unit: Hz)
     currently 100 GHz is more than enough
*  operations
     GET, inquire what HW supports
       there could be unsupported ranges between lower and upper freq
     GET, get current value
     SET, set desired value

IF frequency (intermediate frequency)
*  values: 0 - infinity (unit: Hz)
     currently 500 MHz is more than enough
*  operations
     GET, get current value

tuner lock (frequency synthesizer / PLL)
*  values: yes/no
*  operations
     GET, get current value

tuner gains
*  gain and attenuation
*  there could be multiple places to adjust gain on tuner signal path
*  is single overall gain enough or do we want more manual fine tuning?

tuner filters
*  there could be multiple filters on tuner signal path (RF/IF)
*  do we need to control filters at all?
*  calculate from sampling rate?


TODO:
*  pass RF standard to tuner?
   Passing standard is clearly against idea, but some RF tuners does
   "black magic" according to standard. That magic is usually setting
   filters and and gains, but it could be more...

*  inversion?


Hardware specific requirements (board settings)
*********************************************************************

antenna switch
*  values: 0 - 32 (unit: piece)
*  operations
     GET, inquire what HW supports
     GET, get current value
     SET, set desired value

external LNA
*  values: -200000 - 200000 (unit: dB/1000)
*  operations
     GET, inquire what HW supports
     GET, get current value
     SET, set desired value
* range from -200dB to 200dB should be enough

multiple ADCs / DACs on single device
*  there could be multiple ADCs and DACs on single device
*  resources could be shared which limits concurrent usage
*  eg. device has 2 ADC + 2 DAC = 4 total, but only 2 could be used
   at the time


Kernel specific requirements
*********************************************************************

device locking between multiple APIs
*  same device could support multiple APIs which could not be used at
   same time
*  for example DVB API and V4L2 API
*  locking needed


DOCUMENT VERSION HISTORY
=====================================================================
2012-10-15 Antti Palosaari <crope@iki.fi>
* Initial version

2013-04-11 Antti Palosaari <crope@iki.fi>
* add version history
* order requirements per sections
* add IF frequency (intermediate frequency)
* add tuner lock (frequency synthesizer / PLL)
* add external LNA
* add TODOs

2012-07-12

[PATCH RFC] add LNA support for DVB API

LNA (Low-noise amplifier)

LNA is small antenna signal amplifier inside DVB device. Usually it is external component located between antenna connector and RF-tuner. There is usually amplifiers between whole signal path but LNAs and those which are inside of device. Normal LNA we have in digital television device is simple on/off. When it is off it bypass signal, causing still some loss, and when it is on it amplifies signal using some static factor. That factor is called gain and unit used usually is Decibel (dB).
There is also LNAs offering more than one gain level. For example external DVB-T/C LNA NXP BGU7033. It does have 3 modes, 10 dB, 5 dB and bypass -2 dB.

LNAs having even more adjustable gain levels are called variable gain amplifier (VGA). Also there is LNAs/VGAs integrated to the RF-tuner... But I am not going to go deeper these two cases as main need for that LNA API addition is simple external LNAs between RF-tuner and antenna connector.


comments for DVB LNA API


[PATCH RFC] add LNA support for DVB API


2012-07-11

DTMB support for DVB API

V4L2 SDR API

It has been rather slow progress week. Initially I started studying changes needed to support SDR (Software Defined Radio) via Kernel API. For me it sounds quite easy and logical to extend DVB API for SDR. Just adding new delivery system and implement other relative small changes for DVB-core. After some discussion on Linux-Media mailing list, idea of extending DVB API was refused as V4L2 API is more correct API for that kind of stuff. V4L2 API covers FM-radio, camera, web-camera and analogue television stuff whilst DVB API is used only for digital television. Unfortunately I have quite zero experience from V4L2 devices. After hacking with Silicon Laboratories Si472x based USB FM-radio I decided to leave whole SDR for a while. Have to get more suitable radio for V4L2 learning...

DTMB support for DVB API

After adversity with the SDR I decided to do easier DVB enhancements I planned. DTMB (Digital Terrestrial Multimedia Broadcast) is Chinese digital television standard and there is some existing Linux Kernel drivers for that standard. One of those drivers, HDIC HD29L2, was made by me in last autumn and initial interest is coming from there. Big work for whole DTMB API support was done during last Christmas holiday. I even ran some initial RFCs but never finalized work. Learning many research papers and listing all the used parameters, finding out equivalent ones from the existing API, was quite many working days in that time!


1. [PATCH RFCv3] add DTMB support for DVB API
2. [PATCH RFCv3] add DTMB support for DVB API