This is a "plugin" for the Video Disk Recorder (VDR).

Written by:                  Sebastian Kuhlen <DiCon@tankwar.de>

Project's homepage:          http://analogradio.tankwar.de/

See the file COPYING for license information.
See the section "Credits" for information on which additional code this plugin
is based on.

Description:

This plugin enables VDR to get input from an analog radio device, as it can be
found on many analog tv tuner cards. It uses video4linux functions to control
/dev/radioX.


Installation:

You do not need any extraordinary libraries or anything. Simply proceed as
usual: Extract to your "PLUGIN/src"-directory, create a symlink "analogradio"
and execute "make plugins".
The only thing you should check, is whether you have and where you have your
/dev/radio device file and which /dev/dsp you want to use. If your radio device
is somewhere else than /dev/radio and /dev/radio is not a symlink to it, you
should pass the right one as a command line option (see below).
As dsp-device you can either use your soundcard and pass the sound through a
loopback cable to the line in jack or get it directly from the card using the
btaudio module from the kernel (Drivers->Sound->OSS->btaudio). Again: If it
differs from /dev/dsp, pass the right one. Note that for the soundcard solution
line-in has to be setup for recording (the command line options before and
after may help you, see below). Also note, that btaudio adds two dsp-devices,
so make sure to use the right (the "digital") one.


Command line options:

-a cmd    --after=cmd    execute command after muting the radio device
-b cmd    --before=cmd   execute command before unmuting the radio device
This executes commands before/after unmuting/muting the tuner. This is intended
for instructing your sound mixer to set the line-in, your tuner is connected
to, as the recording device and reset it if neccessary.
Example for OSS drivers using aumix: --before="aumix -l R"

-m name   --mode=name    Use one of following audio modes:
                         OSS (default)
                         RAW
                         ALSA (currently not supported)
With this option you can select wether your audio device is an OSS device, an
ALSA device or whether it supplies raw data (48 kHz , 16 Bit LE, Stereo).
NOTE: ALSA currently does nothing! This feature will be added in later!

-r dev    --devradio=dev set radio device (default: /dev/radio)
-s dev    --devaudio=dev set audio device (default: /dev/snd or /dev/dsp)
Use a different device than /dev/radio or /dev/dsp (which are usually symlinks
to your real devices).


Setup menu:

You can access analogradio's setup menu as usual through VDR
(Setup->Plugins->analogradio).

Tuner Volume (0-100):     This is the volume used to unmute the tuner.
                          Default: 90
Mute tuner if not used:   Mute the tuner if it is no longer in use
                          (e.g: When switching back to tv)
                          Default: Yes


Channel list:

Currently this plugin runs as a source for a terrestrial signal. I don't know
if this might interfer with real DVB-T cards and I don't know of any advantages
or disadvantages when running as an other source. I simply chose T, because the
physical source is the same *gg*.

Simply add your channel to your channels.conf:
EinsLive:106700:I1C0D0M0B8T8G8Y0:T:0:0:300:0:0:1:0:0:0
EinsLive ADR:11053:I1C12D12M0B8T8G8Y0:T:0:0:6120:0:0:1:0:0:0
Name:Frequency:Parameter:Source:SRate:VPID:APID:TPID:CA:SID:NID:TID:RID

Name:      The name of the radio station
Frequency: The frequency in kHz (1 MHz = 1000 kHz, of course)
           To receive ADR this is the transponder frequency in MHz
Parameter: Simply use I0C23D0M16B8T8G8Y0
           I0:  Mono
           I1:  Stereo
           C0:  Default mode
           C12: ADR mode
           D0:  Vertical (polarisation for ADR)
           D12: Horizontal (polarisation for ADR)
           To this plugin the rest doesn't mean anything, but VDR won't run
           without those parameters.
Source:    T, as mentioned above
SRate:     0
VPID:      0 <- this is a must. Otherwise VDR expects a video stream
APID:      Should not be 0
           To receive ADR, this must be the carrier frequency in kHz
TPID:      0
CA:        0
SID:       1
NID:       0
TID:       0
RID:       0

All you need to know is the frequency and the name (although you also may
invent one).
If you have a card that is compatible to the TechniSat TechniPC/MediaFocus
driver (http://people.freenet.de/mediafocus/), you can receive Astra Digital
Radio (ADR) by entering the transponder frequency, polarisation, carrier
frequency and setting "C12" to enable ADR.


Usage:

Simply switch to the channel, you want to listen to, as you switch to a usual
tv channel. It should behave like all the DVB radio channels.


Additional information for:

- DVB-T
  If you are using DVB-T devices (or anything else using source T in
  channels.conf), you will probably get problems because the system will be
  unable to decide, which of the "T"-devices provides DVB-T and which uses the
  analogradio-plugin. To avoid this, simply open device.c of this plugin and
  change line 26 from
    source = cSource::FromString("T");
  to "S" or "C", depending on which kind of source is not used in your system.
  Don't forget to change your channels.conf accordingly.

- Hauppauge PVR 350:
  This card is supported (the revision working with the ivtv-driver) and has
  been tested with ivtv 0.3.7a.
  To make it work, you should know, that ivtv uses /dev/video24 to output
  raw-audio. So you should load this plugin like this:
    analogradio -r "/dev/radio0" -s "/dev/video24" -m RAW
  The rest shouldn't differ from usual WinTV cards.

- ADR:
  In "tools" you can find a script to convert an eventually existing adr.conf
  file to the channels.conf format by running
    sh adr2vdr.sh adr.conf >> /video/channels.conf
  Of course you have to enter the correct paths to your adr.conf and
  channels.conf and certainly you will still have to enter the names of the
  stations manually into your channels.conf.


Credits:

- The general plugin (of course) is based on Klaus Schmidinger's Video Disc
  Recorder (http://www.cadsoft.de/vdr/)
- The V4L1 way to tune the radio device has been derived from Gerd Knorr's
  implementation of the radio application of the xawtv-package.
  (http://linux.bytesex.org/xawtv/)
- The included ADR support is based on Peter Schlaf's implementation for his
  TechniSat TechniPC/MediaFocus driver (http://people.freenet.de/mediafocus/)


Bugs:

Please tell me about them. You can contact me via E-Mail (see above) or in the
corresponding thread(s) of http://www.vdrportal.de (mainly in german).


Have fun and good luck ;)
