1.\" $RuOBSD: radio.4,v 1.4 2001/10/26 05:38:43 form Exp $ 2.\" $OpenBSD: radio.4,v 1.30 2016/08/31 15:55:46 tedu Exp $ 3.\" 4.\" Copyright (c) 2001 Vladimir Popov 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 22.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23.\" ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26.\" 27.Dd $Mdocdate: August 31 2016 $ 28.Dt RADIO 4 29.Os 30.Sh NAME 31.Nm radio 32.Nd device-independent radio driver layer 33.Sh SYNOPSIS 34.Cd "radio* at bktr?" 35.Cd "radio* at fms?" 36.Cd "radio* at udsbr?" 37.Pp 38.In sys/types.h 39.In sys/ioctl.h 40.In sys/radioio.h 41.Sh DESCRIPTION 42The 43.Nm 44driver provides support for various FM radio cards. 45It provides an uniform programming interface layer above different underlying 46radio hardware drivers. 47.Pp 48For radio tuner controlling there is a single device file available: 49.Pa /dev/radio . 50.Pp 51The following 52.Xr ioctl 2 53commands are supported: 54.Pp 55.Bl -tag -width indent -compact 56.It Dv RIOCSSRCH (int) 57This command assumes that a signal search is required and gives direction 58of search to the driver \- 0 to search down and any non-zero value to search up. 59.It Dv RIOCGINFO (struct radio_info) 60.It Dv RIOCSINFO (struct radio_info) 61Get or set the current hardware device information into the struct radio_info 62structure. 63.Bd -literal 64struct radio_info { 65 int mute; 66 int volume; 67 int stereo; 68 int rfreq; /* reference frequency */ 69 int lock; /* locking field strength */ 70 u_int32_t freq; /* in kHz */ 71 u_int32_t caps; /* card capabilities */ 72#define RADIO_CAPS_DETECT_STEREO (1<<0) 73#define RADIO_CAPS_DETECT_SIGNAL (1<<1) 74#define RADIO_CAPS_SET_MONO (1<<2) 75#define RADIO_CAPS_HW_SEARCH (1<<3) 76#define RADIO_CAPS_HW_AFC (1<<4) 77#define RADIO_CAPS_REFERENCE_FREQ (1<<5) 78#define RADIO_CAPS_LOCK_SENSITIVITY (1<<6) 79#define RADIO_CARD_TYPE (0xFF<<16) 80 u_int32_t info; 81#define RADIO_INFO_STEREO (1<<0) 82#define RADIO_INFO_SIGNAL (1<<1) 83 u_int32_t tuner_mode; 84#define RADIO_TUNER_MODE_RADIO (1<<0) 85#define RADIO_TUNER_MODE_TV (1<<1) 86 u_int32_t chan; 87 u_int32_t chnlset; 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 tuner_mode 119field is the current tuning mode of the tuner. 120Valid modes are: 121.Pp 122.Bl -tag -width indent -compact 123.It Dv RADIO_TUNER_MODE_RADIO 124The tuner operates in FM radio mode. 125.It Dv RADIO_TUNER_MODE_TV 126The tuner operates in TV mode. 127.El 128.Pp 129The 130.Va caps 131field is read-only and describes the card capabilities. 132The capabilities can have the following values: 133.Pp 134.Bl -tag -width indent -compact 135.It Dv RADIO_CAPS_DETECT_STEREO 136The device can determine if it is tuned to a stereo signal. 137.It Dv RADIO_CAPS_DETECT_SIGNAL 138The device can determine if it is tuned or not. 139.It Dv RADIO_CAPS_SET_MONO 140The device is capable of forcibly setting its output to mono. 141.It Dv RADIO_CAPS_HW_SEARCH 142The device can do hardware search. 143.It Dv RADIO_CAPS_HW_AFC 144The device has an internal hardware automatic frequency control. 145.It Dv RADIO_CAPS_REFERENCE_FREQ 146The device allows changing the reference frequency of a received signal. 147.It Dv RADIO_CAPS_LOCK_SENSITIVITY 148The device allows changing the station lock sensitivity used during search 149operation. 150.It Dv RADIO_CARD_TYPE 151Some cards have several different incarnations. 152This allows the variant of the card to be determined. 153Currently not used. 154.El 155.Pp 156The 157.Va info 158field is read-only and describes the current state of the card \- 159tuned/not tuned, stereo signal/mono signal. 160.Pp 161.Bl -tag -width indent -compact 162.It Dv RADIO_INFO_STEREO 163Informs whether the device receives a stereo or mono signal. 164.It Dv RADIO_INFO_SIGNAL 165Informs whether the device receives a valid signal or noise. 166.El 167.Pp 168The 169.Va chan 170holds the TV channel the card is tuned to. 171.Pp 172The 173.Va chnlset 174specifies the TV channel set currently being used. 175The tuner uses the current channel set to derive the tuning frequency 176from the channel number. 177Western Europe is the default channel set. 178The following is a list of valid channel sets: 179.Pp 180.Bl -tag -width indent -compact 181.It 1 182U.S.A. Broadcast 183.It 2 184U.S.A. Cable IRC 185.It 3 186U.S.A. Cable HRC 187.It 4 188Western Europe 189.It 5 190Japan Broadcast 191.It 6 192Japan Cable 193.It 7 194Former U.S.S.R. and C.I.S. Countries 195.It 8 196Australia 197.It 9 198France 199.El 200.El 201.Pp 202Either 203.Va freq 204or 205.Va chan 206can be used to tune to FM radio stations or TV channels, 207respectively. 208Some devices may not support both functionalities. 209.Sh CHIPSETS 210The TEA5757; TEA5759 is a 44-pin integrated AM/FM stereo radio circuit. 211The radio part is based on the TEA5712. 212The TEA5757 is used in FM-standards in which the local oscillator frequency 213is above the radio frequency (e.g. European and American standards). 214The TEA5759 is the version in which the oscillator frequency is below 215the radio frequency (e.g. Japanese standards). 216To conform with the Japanese standards, it is necessary to set the flags' least 217significant bit to 1. 218The TEA5757; TEA5759 has a 25-bit read-write shift register. 219The TEA5757 chips are used in 220.Xr fms 4 221cards. 222.Sh FILES 223.Bl -tag -width /dev/radio -compact 224.It Pa /dev/radio 225.El 226.Sh SEE ALSO 227.Xr radioctl 1 , 228.Xr ioctl 2 , 229.Xr bktr 4 , 230.Xr fms 4 , 231.Xr intro 4 , 232.Xr udsbr 4 , 233.Xr radio 9 234.Sh HISTORY 235The 236.Nm 237device driver appeared in 238.Ox 3.0 . 239.Sh AUTHORS 240.An -nosplit 241The 242.Nm 243driver was written by 244.An Vladimir Popov Aq Mt jumbo@narod.ru 245and 246.An Maxim Tsyplakov Aq Mt tm@oganer.net . 247The man page was written by 248.An Vladimir Popov Aq Mt jumbo@narod.ru . 249