* fmtools information
*
* Russell Kroll <rkroll@exploits.org>
*
* Program support page: http://www.exploits.org/v4l/fmtools.html
*
* Released under the GNU GPL - See COPYING for details.

Package information
===================

This is intended to become a collection of interesting programs that
control the v4l radio card drivers.  Right now there is just the tuner
which is called "fm", but other things such as spectrum and fmscan are
on the way "RSN".  I'm not much for interfaces, so hopefully some 
graphically minded hacker out there will make something nice, yet useful.
Meanwhile, this will get you started.

fm
==

This is a very simple controller that will send commands to tuner 0 of the 
first v4l radio card on the system.  It was written mostly so I could have
something to send commands at the drivers being created or debugged here.

I'll discuss the options a little, but it should be fairly simple to run.

The usual mode of operation is to tell the radio to come on to a given
freqency.  In these examples, 94.3 will be used since that's a station
that happens to get tuned here frequently.

To turn the radio on to that frequency at the default volume, you'd do
"fm 94.3" and call it done.  If you wanted to crank it up to full volume, 
another argument would be needed and the command becomes "fm 94.3 65535".
Volumes range from 0 (off) to 65535 (full intensity).  This is a direct
link to the value used in the v4l API by the actual drivers.

There is a -q option that will suppress messages about tuning, volume
changes, and so forth.  Keeping your tuner quiet may not seem like such
a useful thing at first, but it can be very handy inside an IRC script.
Having a program scribble over your channel window when you do /KILO
or similar is not enjoyable.

Besides direct tuning, there are also "on" and "off" commands.  They will
turn the card on and off (mute) as you may have guessed.

Finally, there is volume control.  To go up a notch, use +.  To go down
a notch, use -.  Simple.

Configuration
-------------

You can create a file called .fmrc in your home directory that contains
values for the default volume and default volume stepping.  This way,
you can have your radio card always come on at a certain volume when you
don't explicitly list it on the command line.  The volume stepping 
controls how much the volume changes during a - or + operation.

This file is not required for operation of the program, and it will not
even give so much as a peep if it doesn't find it.  The defaults are
used when you don't specify values.  The values are 12.5% for default 
volume and 10% for default volume stepping.  

Here's what a real .fmrc might look like ...

VOL 32000
INCR 6554

Here we say the default volume is 32000 - just shy of 50%.  Then we
say the increment value for volume changes with + and - is 6554 - 
approximately 10%.  These values were obtained by playing around with
the numbers until things behaved the way I wanted. 

Devices
=======

This program uses /dev/radio.  Note - this must be the v4l device
and not either of the two earlier /dev/radios created for the
first radioreveal (non-mainstream) kernel driver or the /dev/radio 
that appeared around 2.1.65. 

The proper device listing looks something like this...

   0 crw-r--r--   1 root     root      81,  64 Jun  8 00:57 /dev/radio

If you don't have this, or your device isn't major 81 and minor 64,
"mknod /dev/radio c 81 64" as root and you'll be in business.  The
owners and permissions should be set in a manner consistent with your
system's personality.  If it's mostly a single user machine, the
644 mode shown above will be fine.  

However, if you have other people running around on your system, consider 
making the device part of a "radio" group or maybe even "console" if you
use such a thing.  That will keep random individuals from doing odd things
to your radio like changing it to a classical station while you're
listening to some death metal (or vice versa).  You have been warned.
