1.\" $NetBSD: radio.4,v 1.12 2011/03/27 12:45:28 njoly Exp $ 2.\" $RuOBSD: radio.4,v 1.4 2001/10/26 05:38:43 form Exp $ 3.\" $OpenBSD: radio.4,v 1.3 2001/12/05 10:58:54 mickey Exp $ 4.\" 5.\" Copyright (c) 2001 Vladimir Popov 6.\" All rights reserved. 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24.\" ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27.\" 28.Dd October 20, 2001 29.Dt RADIO 4 30.Os 31.Sh NAME 32.Nm radio 33.Nd device-independent radio driver layer 34.Sh SYNOPSIS 35.Cd "radio* at az?" 36.Cd "radio* at bktr?" 37.Cd "radio* at gtp?" 38.Cd "radio* at rt?" 39.Cd "radio* at rtii?" 40.Cd "radio* at sf2r?" 41.Cd "radio* at udsbr?" 42.Pp 43.In sys/types.h 44.In sys/ioctl.h 45.In sys/radioio.h 46.Sh DESCRIPTION 47The 48.Nm 49driver provides support for various FM radio cards. 50It provides an uniform programming interface layer above different underlying 51radio hardware drivers. 52.Pp 53For radio tuner controlling there is a single device file available: 54.Pa /dev/radio . 55.Pp 56The following 57.Xr ioctl 2 58commands are supported: 59.Pp 60.Bl -tag -width indent -compact 61.It Dv RIOCSSRCH (int) 62This command assumes that a signal search is required and gives direction 63of search to the driver \- 0 to search down and any non-zero value to search up. 64.It Dv RIOCGINFO (struct radio_info) 65.It Dv RIOCSINFO (struct radio_info) 66Get or set the current hardware device information into the struct radio_info 67structure. 68.Bd -literal 69struct radio_info { 70 int mute; 71 int volume; 72 int stereo; 73 int rfreq; /* reference frequency */ 74 int lock; /* locking field strength */ 75 uint32_t freq; /* in kHz */ 76 uint32_t caps; /* card capabilities */ 77#define RADIO_CAPS_DETECT_STEREO (1\*[Lt]\*[Lt]0) 78#define RADIO_CAPS_DETECT_SIGNAL (1\*[Lt]\*[Lt]1) 79#define RADIO_CAPS_SET_MONO (1\*[Lt]\*[Lt]2) 80#define RADIO_CAPS_HW_SEARCH (1\*[Lt]\*[Lt]3) 81#define RADIO_CAPS_HW_AFC (1\*[Lt]\*[Lt]4) 82#define RADIO_CAPS_REFERENCE_FREQ (1\*[Lt]\*[Lt]5) 83#define RADIO_CAPS_LOCK_SENSITIVITY (1\*[Lt]\*[Lt]6) 84#define RADIO_CARD_TYPE (0xFF\*[Lt]\*[Lt]16) 85 uint32_t info; 86#define RADIO_INFO_STEREO (1\*[Lt]\*[Lt]0) 87#define RADIO_INFO_SIGNAL (1\*[Lt]\*[Lt]1) 88}; 89.Ed 90.Pp 91The 92.Va mute 93field is a boolean. 94.Pp 95The 96.Va volume 97field holds the card volume information and can be at most 255. 98.Pp 99The 100.Va stereo 101field is a boolean. 102.Pp 103The 104.Va rfreq 105holds information about the card reference frequency (not all cards support 106this feature). 107.Pp 108The 109.Va lock 110field holds information about the card locking field strength during 111an automatic search for cards that support this feature. 112.Pp 113The 114.Va freq 115field is the frequency in kHz the card is tuned to. 116.Pp 117The 118.Va caps 119field is read-only and describes the card capabilities. 120The capabilities can have following values: 121.Bl -tag -width indent -compact 122.It Dv RADIO_CAPS_DETECT_STEREO 123The device can determine is it tuned to a stereo signal. 124.It Dv RADIO_CAPS_DETECT_SIGNAL 125The device can determine is it tuned or not. 126.It Dv RADIO_CAPS_SET_MONO 127The device capable to forcible set its output to mono. 128.It Dv RADIO_CAPS_HW_SEARCH 129The device can do hardware search. 130.It Dv RADIO_CAPS_HW_AFC 131The device has an internal hardware automatic frequency control. 132.It Dv RADIO_CAPS_REFERENCE_FREQ 133The device allow to change the reference frequency of a received signal. 134.It Dv RADIO_CAPS_LOCK_SENSITIVITY 135The device allow to change the station lock sensitivity used during search 136operation. 137.It Dv RADIO_CARD_TYPE 138Some cards have several different incarnations. 139This allow to determine the variant of the card. 140Currently not used. 141.El 142.Pp 143The 144.Va info 145field is read-only and describes the current state of the card \- 146tuned/not tuned, stereo signal/mono signal. 147.Bl -tag -width indent -compact 148.It Dv RADIO_INFO_STEREO 149Informs whether the device receives a stereo or mono signal. 150.It Dv RADIO_INFO_SIGNAL 151Informs whether the device receives a valid signal or noise. 152.El 153.El 154.Sh FILES 155.Bl -tag -width /dev/radio -compact 156.It Pa /dev/radio 157.El 158.Sh SEE ALSO 159.Xr radioctl 1 , 160.Xr ioctl 2 , 161.Xr az 4 , 162.Xr bktr 4 , 163.Xr gtp 4 , 164.Xr rt 4 , 165.Xr rtii 4 , 166.Xr sf2r 4 , 167.Xr udsbr 4 168.Sh HISTORY 169The 170.Nm 171device driver appeared in 172.Ox 3.0 173and 174.Nx 1.6 . 175.Sh AUTHORS 176The 177.Nm 178driver was written by Vladimir Popov and Maxim Tsyplakov. 179The man page was written by Vladimir Popov. 180