1.\" $NetBSD: radio.4,v 1.16 2022/07/08 16:50:10 nia 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 slurm?" 42.Cd "radio* at udsbr?" 43.Pp 44.In sys/types.h 45.In sys/ioctl.h 46.In sys/radioio.h 47.Sh DESCRIPTION 48The 49.Nm 50driver provides support for various FM radio cards. 51It provides an uniform programming interface layer above different underlying 52radio hardware drivers. 53.Pp 54For radio tuner controlling there is a single device file available: 55.Pa /dev/radio . 56.Pp 57The following 58.Xr ioctl 2 59commands are supported: 60.Pp 61.Bl -tag -width indent -compact 62.It Dv RIOCSSRCH (int) 63This command assumes that a signal search is required and gives direction 64of search to the driver \- 0 to search down and any non-zero value to search up. 65.It Dv RIOCGINFO (struct radio_info) 66.It Dv RIOCSINFO (struct radio_info) 67Get or set the current hardware device information into the struct radio_info 68structure. 69.Bd -literal 70struct radio_info { 71 int mute; 72 int volume; 73 int stereo; 74 int rfreq; /* reference frequency */ 75 int lock; /* locking field strength */ 76 uint32_t freq; /* in kHz */ 77 uint32_t caps; /* card capabilities */ 78#define RADIO_CAPS_DETECT_STEREO (1<<0) 79#define RADIO_CAPS_DETECT_SIGNAL (1<<1) 80#define RADIO_CAPS_SET_MONO (1<<2) 81#define RADIO_CAPS_HW_SEARCH (1<<3) 82#define RADIO_CAPS_HW_AFC (1<<4) 83#define RADIO_CAPS_REFERENCE_FREQ (1<<5) 84#define RADIO_CAPS_LOCK_SENSITIVITY (1<<6) 85#define RADIO_CARD_TYPE (0xFF<<16) 86 uint32_t info; 87#define RADIO_INFO_STEREO (1<<0) 88#define RADIO_INFO_SIGNAL (1<<1) 89}; 90.Ed 91.Pp 92The 93.Va mute 94field is a boolean. 95.Pp 96The 97.Va volume 98field holds the card volume information and can be at most 255. 99.Pp 100The 101.Va stereo 102field is a boolean. 103.Pp 104The 105.Va rfreq 106holds information about the card reference frequency (not all cards support 107this feature). 108.Pp 109The 110.Va lock 111field holds information about the card locking field strength during 112an automatic search for cards that support this feature. 113.Pp 114The 115.Va freq 116field is the frequency in kHz the card is tuned to. 117.Pp 118The 119.Va caps 120field is read-only and describes the card capabilities. 121The capabilities can have following values: 122.Bl -tag -width indent -compact 123.It Dv RADIO_CAPS_DETECT_STEREO 124The device can determine is it tuned to a stereo signal. 125.It Dv RADIO_CAPS_DETECT_SIGNAL 126The device can determine is it tuned or not. 127.It Dv RADIO_CAPS_SET_MONO 128The device capable to forcible set its output to mono. 129.It Dv RADIO_CAPS_HW_SEARCH 130The device can do hardware search. 131.It Dv RADIO_CAPS_HW_AFC 132The device has an internal hardware automatic frequency control. 133.It Dv RADIO_CAPS_REFERENCE_FREQ 134The device allow to change the reference frequency of a received signal. 135.It Dv RADIO_CAPS_LOCK_SENSITIVITY 136The device allow to change the station lock sensitivity used during search 137operation. 138.It Dv RADIO_CARD_TYPE 139Some cards have several different incarnations. 140This allow to determine the variant of the card. 141Currently not used. 142.El 143.Pp 144The 145.Va info 146field is read-only and describes the current state of the card \- 147tuned/not tuned, stereo signal/mono signal. 148.Bl -tag -width indent -compact 149.It Dv RADIO_INFO_STEREO 150Informs whether the device receives a stereo or mono signal. 151.It Dv RADIO_INFO_SIGNAL 152Informs whether the device receives a valid signal or noise. 153.El 154.El 155.Sh FILES 156.Bl -tag -width /dev/radio -compact 157.It Pa /dev/radio 158.El 159.Sh SEE ALSO 160.Xr radioctl 1 , 161.Xr ioctl 2 , 162.Xr az 4 , 163.Xr bktr 4 , 164.Xr gtp 4 , 165.Xr rt 4 , 166.Xr rtii 4 , 167.Xr sf2r 4 , 168.Xr slurm 4 , 169.Xr udsbr 4 170.Sh HISTORY 171The 172.Nm 173device driver appeared in 174.Ox 3.0 175and 176.Nx 1.6 . 177.Sh AUTHORS 178.An -nosplit 179The 180.Nm 181driver was written by 182.An Vladimir Popov 183and 184.An Maxim Tsyplakov 185for 186.Ox 187and ported to 188.Nx 189by 190.An Lennart Augustsson . 191The man page was written by Vladimir Popov. 192