radio.4 revision 1.2
$OpenBSD: radio.4,v 1.2 2001/10/08 08:52:50 mpech Exp $

Copyright (c) 2001 Vladimir Popov
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

.Dd September 21, 2001 .Dt RADIO 4 .Os .Sh NAME .Nm radio .Nd device-independent radio driver layer .Sh SYNOPSIS .Fd #include <sys/types.h> .Fd #include <sys/ioctl.h> .Fd #include <sys/radioio.h> .Sh DESCRIPTION The .Nm driver provides support for various FM radio cards. It provides an uniform programming interface layer above different underlying radio hardware drivers.

p For radio tuner controlling there is a single device file available:

a /dev/radio .

p The following .Xr ioctl 2 commands are supported:

p l -tag -width indent -compact t Dv RIOCSMUTE (u_long) This command mutes or unmutes the device. This operation does not affect volume value of the device. t Dv RIOCGMUTE (u_long) This command returns current mute state of the device. t Dv RIOCSMONO (u_long) This command sets the device output to mono even if the device receive a stereo signal (forced mono). t Dv RIOCGMONO (u_long) This command returns current forced mono state of the device. t Dv RIOCGVOLU (u_long) This command returns current volume of the device. t Dv RIOCSVOLU (u_long) This command sets current volume of the device. t Dv RIOCGFREQ (u_long) This command returns frequency the device is tuned to. t Dv RIOCSFREQ (u_long) This command sets working frequency of the device. t Dv RIOCSSRCH (u_long) This command assumes that a signal search is required and gives direction of search to the driver - 0 to search down and any non-zero value to search up. t Dv RIOCGCAPS (u_long) This command returns the device capabilities. The capabilities can have following values: l -tag -width indent -compact t Dv RADIO_CAPS_DETECT_STEREO The device can determine is it tuned to a stereo signal. t Dv RADIO_CAPS_DETECT_SIGNAL The device can determine is it tuned or not. t Dv RADIO_CAPS_SET_MONO The device capable to forcible set its output to mono. t Dv RADIO_CAPS_HW_SEARCH The device can do hardware search. t Dv RADIO_CAPS_HW_AFC The device has an internal hardware automatic frequency control. t Dv RADIO_CAPS_REFERENCE_FREQ The device allow to change the reference frequency of a received signal. t Dv RADIO_CAPS_LOCK_SENSITIVITY The device allow to change the station lock sensitivity used during search operation. t Dv RADIO_CAPS_CARD_TYPE Some cards have several different incarnations. This allow to determine the variant of the card. Currently not used. .El t Dv RIOCGINFO (u_long) This commands returns current state of the device. l -tag -width indent -compact t Dv RADIO_INFO_SIGNAL Informs whether the device receives a valid signal or noise. t Dv RADIO_INFO_STEREO Informs whether the device receives a stereo or mono signal. .El t Dv RIOCGREFF (u_long) This command returns current value of the device's reference frequency. t Dv RIOCSREFF (u_long) This command sets reference frequency of the device. t Dv RIOCGLOCK (u_long) This command returns current value of the device's station lock sensitivity. t Dv RIOCSLOCK (u_long) This command sets station lock sensitivity of the device. .El .Sh FILES l -tag -width /dev/radio -compact t Pa /dev/radio .El .Sh SEE ALSO .Xr ioctl 2 , .Xr az 4 , .Xr sf2r 4 , .Xr sf4r 4 .Sh BUGS You can have only one card of the same type. For example, if you have two aztech FM tuners, the first card with jumper set to port 0x358 and the second one - to 0x350, you can use only one aztech card (in the kernel, that is) either with port 0x350 or 0x358. Don't even try to compile support for the second card into the kernel.