RADIO(4)
π RADIO(4) β the kernel interfaces manual, but make it cute π
okay bestie, welcome to RADIO(4), straight out of the Kernel Interfaces Manual β¨ this is the page for the radio driver layer, and no cap, it's actually kind of iconic π
π NAME π
radio β the device-independent radio driver layer π
like, it's the layer. the vibe layer between you and the hardware. iykyk.
β¨ SYNOPSIS β¨
here's how the thing gets attached to the kernel, bestie β all these are literally valid:
radio* at az?
radio* at bktr?
radio* at gtp?
radio* at rt?
radio* at rtii?
radio* at sf2r?
radio* at slurm?
radio* at udsbr?
and for your C file, you're gonna include these, exactly these, no substitutions π:
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/radioio.h>
π¦ DESCRIPTION π¦
so the radio driver is the support system for a whole bunch of FM radio cards πΈ it gives you one uniform programming interface layer sitting on top of all the different underlying radio hardware drivers β like a group chat where everyone's on their best behaviour π
for controlling the radio tuner you've got exactly one device file, and it's:
/dev/radio
the following ioctl(2) commands are supported, and yes i'm listing every single one π
RIOCSSRCH(int) β this command assumes a signal search is needed and tells the driver which direction to go:0searches down β¬οΈ, and any non-zero value searches up β¬οΈRIOCGINFO(struct radio_info)RIOCSINFO(struct radio_info) β these two get or set the current hardware device information into thestruct radio_infostructure π«Ά
and here's that struct, verbatim, because there's literally no other way to do it:
struct radio_info {
int mute;
int volume;
int stereo;
int rfreq; /* reference frequency */
int lock; /* locking field strength */
uint32_t freq; /* in kHz */
uint32_t caps; /* card capabilities */
#define RADIO_CAPS_DETECT_STEREO (1<<0)
#define RADIO_CAPS_DETECT_SIGNAL (1<<1)
#define RADIO_CAPS_SET_MONO (1<<2)
#define RADIO_CAPS_HW_SEARCH (1<<3)
#define RADIO_CAPS_HW_AFC (1<<4)
#define RADIO_CAPS_REFERENCE_FREQ (1<<5)
#define RADIO_CAPS_LOCK_SENSITIVITY (1<<6)
#define RADIO_CARD_TYPE (0xFF<<16)
uint32_t info;
#define RADIO_INFO_STEREO (1<<0)
#define RADIO_INFO_SIGNAL (1<<1)
};
okay now field-by-field, because you deserve the tea β:
- the
mutefield is a boolean β - the
volumefield holds the card volume information, and it can be at most255π - the
stereofield is a boolean β - the
rfreqfield holds information about the card reference frequency β and btw not all cards support this feature π - the
lockfield holds information about the card locking field strength during an automatic search, for the cards that support this feature π - the
freqfield is the frequency in kHz that the card is tuned to π» - the
capsfield is read-only and describes the card's capabilities π
the capabilities can have the following values β these are the β¨main characterβ¨ constants:
RADIO_CAPS_DETECT_STEREOβ the device can determine whether it's tuned to a stereo signalRADIO_CAPS_DETECT_SIGNALβ the device can determine whether it's tuned or notRADIO_CAPS_SET_MONOβ the device is capable of forcibly setting its output to monoRADIO_CAPS_HW_SEARCHβ the device can do a hardware searchRADIO_CAPS_HW_AFCβ the device has an internal hardware automatic frequency controlRADIO_CAPS_REFERENCE_FREQβ the device allows you to change the reference frequency of a received signalRADIO_CAPS_LOCK_SENSITIVITYβ the device allows you to change the station lock sensitivity used during the search operationRADIO_CARD_TYPEβ some cards have several different incarnations, so this lets you determine the variant of the card. it's currently not used π
the info field is read-only and describes the current state of the card β tuned/not tuned, stereo signal/mono signal π
RADIO_INFO_STEREOβ informs whether the device receives a stereo or a mono signalRADIO_INFO_SIGNALβ informs whether the device receives a valid signal or noise πΆ
π FILES π
/dev/radio
πΈ SEE ALSO πΈ
radioctl(1), ioctl(2), az(4), bktr(4), gtp(4), rt(4), rtii(4), sf2r(4), slurm(4), udsbr(4)
go read your friends too, bestie, they're all linked π«Ά
β HISTORY β
the radio device driver appeared in OpenBSD 3.0 and NetBSD 1.6 π§ lowkey a legacy icon, honestly.
π AUTHORS π
the radio driver was written by Vladimir Popov and Maxim Tsyplakov for OpenBSD, and ported to NetBSD by Lennart Augustsson π and the man page itself was written by Vladimir Popov βοΈ
ok so real talk β all the capability and info bits live insidestruct radio_infoand a bunch of them are read-only, so don't come forcapsorinfoexpecting to write to them, they will not be taking that energy π andRADIO_CARD_TYPEis literally unused right now, so likeβ¦ it's giving placeholder. periodt. π
and that's the whole page, bestie π this was RADIO(4) from the Debian build of the manual, dated October 20, 2001 β hope you slayed your tuning π β¨
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2001 Vladimir Popov
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms