fmtools-2.0.8/0000755000000000000000000000000013765502335010103 5ustar fmtools-2.0.8/COPYING0000644000000000000000000004313107527346024011140 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. fmtools-2.0.8/INSTALL0000644000000000000000000000047212215370003011117 0ustar You may build directly from Git or use a distribution tarball. If you build from Git, make sure you have Autoconf and Automake installed, and run: autoreconf -i Afterward, or if you are starting from a distribution tarball, run: ./configure make To install the executables, run as superuser: make install fmtools-2.0.8/Makefile.am0000644000000000000000000000360612217426132012133 0ustar AM_CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes bin_PROGRAMS = fm fmscan fm_SOURCES = fm.c fmlib.c fmlib.h fmscan_SOURCES = fmscan.c fmlib.c fmlib.h dist_man_MANS = fm.1 fmscan.1 EXTRA_DIST = \ debian/changelog \ debian/compat \ debian/control \ debian/copyright \ debian/rules \ debian/source/format \ INSTALL \ README #### The rest of this file is just for the testsuite. It is just #### boilerplate from the Autoconf manual describing how to use #### Autotest. # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ echo '# Signature of the current package.' && \ echo 'm4_define([AT_PACKAGE_NAME],' && \ echo ' [@PACKAGE_NAME@])' && \ echo 'm4_define([AT_PACKAGE_TARNAME],' && \ echo ' [@PACKAGE_TARNAME@])' && \ echo 'm4_define([AT_PACKAGE_VERSION],' && \ echo ' [@PACKAGE_VERSION@])' && \ echo 'm4_define([AT_PACKAGE_STRING],' && \ echo ' [@PACKAGE_STRING@])' && \ echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \ echo ' [@PACKAGE_BUGREPORT@])'; \ echo 'm4_define([AT_PACKAGE_URL],' && \ echo ' [@PACKAGE_URL@])'; \ } >'$(srcdir)/package.m4' EXTRA_DIST += $(TESTSUITE_AT) $(srcdir)/package.m4 $(TESTSUITE) atlocal.in DISTCLEANFILES = atconfig TESTSUITE = $(srcdir)/testsuite TESTSUITE_AT = \ $(srcdir)/testsuite.at \ $(srcdir)/test-fm.at \ $(srcdir)/test-fmscan.at \ $(srcdir)/package.m4 check-local: atconfig atlocal $(TESTSUITE) $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) installcheck-local: atconfig atlocal $(TESTSUITE) $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \ $(TESTSUITEFLAGS) clean-local: test ! -f '$(TESTSUITE)' || \ $(SHELL) '$(TESTSUITE)' --clean AUTOM4TE = $(SHELL) $(srcdir)/build-aux/missing --run autom4te AUTOTEST = $(AUTOM4TE) --language=autotest $(TESTSUITE): $(TESTSUITE_AT) $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at mv $@.tmp $@ fmtools-2.0.8/NEWS0000644000000000000000000001104512215153367010577 0ustar 2.0.6: Sat Sep 14 14:34:34 PDT 2013 / Ben Pfaff - Work with tuners that do not support V4L2_CID_AUDIO_VOLUME. - fmscan: Print frequency values to full precision. 2.0.2 through 2.0.5: - Debian packaging updates. 2.0.1: Sat Jan 9 13:28:53 PST 2010 / Ben Pfaff - Fix bugs that prevented fm and fmscan from working outside "test" mode (used by the testsuite. - Better support radios that do not have volume control. - Make fm report when the radio is muted and tell the user how to unmute it. - Packaging improvements. 2.0: Sat Dec 12 21:18:52 PST 2009 / Ben Pfaff - Rewrite to use video4linux2 API. - Add "-q" (quiet) and "-T" (tuner) options to fmscan. - Improve fmscan frequency calculations. It should now be better at accurately finding radio stations. - Add Autotest test suite and, in the process, convert the packaging to use Autoconf and Automake. - Some code and some documentation used a range of 0-65535 for volume, other code and other documentation used a range of 0-100. This has been consistently changed to 0-100. 1.0.2: Thu Nov 23 1:41:00 PDT 2006 / Ben Pfaff - Fix version number reported by fm and fmscan programs, as well as the version number included in the manpages. Bug report by "Petr Slansky" . - No functional changes. 1.0.1: Sat Oct 7 1:05:00 PDT 2006 / Ben Pfaff - Make fm able to sleep for a user-specified time, or forever, after applying settings. This makes fm usable with radio tuner drivers that turn off the radio after the fd used for tuning is closed. Idea and patch from Dave Ulrick . 1.0: Sat Sep 3 12:21:00 PDT 2004 / Ben Pfaff - New maintainer. New home page is http://benpfaff.org/fmtools - Updated email addresses. - Integrated Debian packaging. - Made fmscan threshold configurable from command line. - Use videodev.h header detached from kernel to avoid including kernel headers. 0.99.1: Fri Aug 16 23:08:30 CDT 2002 / Russell Kroll - fm, fmscan: fix the FSF's address in the headers Fri Aug 16 23:07:49 CDT 2002 / Russell Kroll - COPYING: put in the modern version of the GPL v2, with the correct address for the FSF. Fri Aug 16 23:05:33 CDT 2002 / Russell Kroll - Makefile: reworked a bunch of stuff, and added such useful things like install targets. Hopefully this will make packaging less of a hack. Fri Aug 16 22:55:41 CDT 2002 / Russell Kroll - fm: do the VIDIOCGAUDIO first so there's always good data in the struct Fri Aug 16 22:48:10 CDT 2002 / Russell Kroll - fm.1: incorporated the man page written by Ben Pfaff. Fri Aug 16 22:47:01 CDT 2002 / Russell Kroll - fm: set va.balance to 32768 rather than relying on whatever junk happens to be in the struct. Reported by ahmet inan. Fri Aug 16 22:43:47 CDT 2002 / Russell Kroll - fm: applied patch from Viktor Rosenfeld to fix the rounding so that channels like 99.95 MHz can be tuned. 0.99.0: Sat Feb 3 22:41:12 CST 2001 - Russell Kroll - Final cleanups for 0.99.0. This source has been sitting around for awhile, so it's probably time to push towards 1.0 and call it done. How much can you do to a pair of radio programs, anyway? Thu Jan 4 17:29:49 CST 2001 - Russell Kroll - fmscan: ioctl/code cleanups, ala fm - fmscan: -d support - fm: -d support for multiple devices (/dev/radio1 and so on) - fm: ioctl results checked, other coding cleanups 0.2.5 and earlier: Mon Apr 12 20:32:13 MDT 1999 - -t option for selecting the tuner on multi-tuner boards (radio-cadet, etc) Wed Feb 3 13:13:01 MST 1999 - fmtools 0.2.4 released - 'devices' target added to Makefile - documentation updated for fmscan and /dev/radio0 - programs now use /dev/radio0 instead of old(er) /dev/radio - fmscan added - small code cleanups - -o added to oneliner usage display Sat Jan 16 23:55:15 MST 1999 - fmtools 0.2.3 released - -o (override frequency range checks) introduced after some l-k discussion Sun Jan 10 22:17:07 MST 1999 - fmtools 0.2.2 released - overflows and negative values during volume changes fixed - exit codes are now sane - the division should now accurately reflect 100% volume Thu Jul 30 08:39:50 MDT 1998 - We now support fine tuning on cards that fly the VIDEO_TUNER_LOW flag. Thanks to Ben Pfaff for this addition. fmtools-2.0.8/README0000644000000000000000000001506211311257357010763 0ustar fmtools: simple V4L2 radio card programs Maintained by Ben Pfaff Originally by Russell Kroll Web: http://benpfaff.org/fmtools Git: git://repo.or.cz/fmtools.git License ======= This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Package information =================== This is a pair of hopefully useful control programs for Video for Linux 2 (V4L2) radio card drivers. The focus is on control, so you may find these programs a bit unfriendly. Users are encouraged to investigate the source and create wrappers or new programs based on this design. fm - a simple tuner fmscan - a simple band scanner fm == This is a simple program that will send commands to your V4L2 radio cards. It was written mostly so I could have something to send commands at the drivers being created or debugged here. The usual mode of operation is to tell the radio to come on to a given freqency. In these examples, 94.3 will be used since that's a station that happens to get tuned here frequently. To turn the radio on to that frequency at the default volume, you'd do "fm 94.3" and call it done. If you wanted to crank it up to full volume, another argument would be needed and the command becomes "fm 94.3 100". Volumes range from 0 (off) to 100 (full intensity). There is a -q option that will suppress messages about tuning, volume changes, and so forth. Keeping your tuner quiet may not seem like such a useful thing at first, but it can be very handy inside an IRC script. Having a program scribble on your channel window when you do /KILO or similar is not enjoyable. Besides direct tuning, there are also "on" and "off" commands. They will turn the card on and off (mute) as you may have guessed. Finally, there is volume control. To go up a notch, use +. To go down a notch, use -. Simple. fm configuration ---------------- You can create a file called .fmrc in your home directory that contains values for the default volume and default volume stepping. This way, you can have your radio card always come on at a certain volume when you don't explicitly list it on the command line. The volume stepping controls how much the volume changes during a - or + operation. This file is not required for operation of the program, and it will not even give so much as a peep if it doesn't find it. The defaults are used when you don't specify values. The values are 12.5% for default volume and 10% for default volume stepping. Here's what a real .fmrc might look like ... VOL 50 INCR 10 Here we say the default volume is 50%. Then we say the increment value for volume changes with + and - is 10%. These values were obtained by playing around with the numbers until things behaved the way I wanted. Be aware that some cards only have a couple of volume steps, so you may not notice a change right away. The Cadet hardware, for example, has two settings: off and *VERY LOUD*. Any volume setting will turn it on. The Aztech card has 4 settings (off, low, medium, high) and you'll notice it change when you cross the boundaries. The Aimslab RadioReveal card is actually based on analog volume control, with 10 steps emulated within that range. There are some other options available: -d - select device. If you have more than one V4L2 radio card in your system for some reason, use -d to select the right one. This is probably only useful if you like writing drivers for these things. -o - override card frequency range - Some radio card drivers don't actively enforce the frequencies that you can tune to. Use this switch and fm will send any frequency you want to the driver. This alone will not make an unmodified card receive frequencies from outside the design range. You have to change the tuner hardware in order to enjoy such broadcasts. -t - select tuner - Certain cards have multiple tuners - usually used for different bands. The ADS Cadet driver is known to support this, specifically using 0 for FM and 1 for AM. To tune AM frequencies, remember that fm expects MHz style input, and do the following: For 1200 kHz, enter 'fm -t 1 1.2', since 1.2 MHz == 1200 kHz. Yes, tuning am frequencies with 'fm' seems backwards, but that's life. Crafty hackers may want to add some code to make the program check argv[0] and behave differently. fmscan ====== This simple little program will command your radio card through the radio band and show which ones have a accumulated signal strength of 50% or higher. This process can take awhile, and can vary greatly depending on the radio card in use. By default, the range scanned is 87.9-107.9 MHz in .2 MHz steps, since that's the standard band here in the USA. Users in other regions should set the appropriate information for best results. V4L2 /dev entries ================ By default, these programs use /dev/radio0 to access the hardware. This can be changed with -d if you have more than one. If you have been using v4l radio cards for awhile, you may already have a /dev/radio. That is now "legacy", and should be symlinked to /dev/radio0. To create the proper device entry, either do "make devices" as root, or create it by hand with mknod (c 81 64). The proper device listing looks something like this in 'ls -la' ... lrwxrwxrwx 1 root root 11 Jan 20 03:19 /dev/radio -> /dev/radio0 crw-r--r-- 1 root root 81, 64 Jan 20 03:19 /dev/radio0 Other cards follow the same pattern - radio1 would be (81, 65), and so on. The owner and permission data should be set to values that agree with your system's personality. If it's mostly a solitary system with few or no users, the above settings will be fine. However, if you have other people running around on your system, consider making the device part of a "radio" group or maybe even "console" if you use such a thing. That will keep random individuals from doing odd things to your radio like changing it to a classical station while you're listening to some death metal (or vice versa). You have been warned. fmtools-2.0.8/atlocal.in0000644000000000000000000000000011311102245012015 0ustar fmtools-2.0.8/build-aux/0000755000000000000000000000000013765502335011775 5ustar fmtools-2.0.8/configure.ac0000644000000000000000000000035112217426245012364 0ustar AC_INIT([fmtools], [2.0.7], [blp@cs.stanford.edu]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([foreign]) AC_PREREQ([2.59]) AC_CONFIG_SRCDIR([fm.c]) AC_PROG_CC AC_CONFIG_TESTDIR([.]) AC_CONFIG_FILES([Makefile atlocal]) AC_OUTPUT fmtools-2.0.8/debian/0000755000000000000000000000000013765502335011325 5ustar fmtools-2.0.8/debian/changelog0000644000000000000000000001053113765502335013177 0ustar fmtools (2.0.8) unstable; urgency=medium * Orphan package. * Update to policy 4.5.1.0. This only required changing priority from "extra" to "optional". * Upgrade to debhelper 13 by using dependency on debhelper-compat instead of using debian/compat. No other changes needed. * debian/rules: Enable "bindnow" hardening (suggested by Lintian). -- Ben Pfaff Sun, 13 Dec 2020 13:17:17 -0800 fmtools (2.0.7) unstable; urgency=low * New upstream release. -- Ben Pfaff Sat, 21 Sep 2013 16:35:03 -0700 fmtools (2.0.6) unstable; urgency=low * New upstream release. * rules: Replace by trivial three-line "dh" version. * control: Upgrade to policy 3.9.4. * Upgrade to debhelper 9 (no changes necessary). -- Ben Pfaff Sat, 14 Sep 2013 14:41:58 -0700 fmtools (2.0.5) unstable; urgency=low * Build fmtools properly from "make dist" generated tarball. Closes: #604766. Thanks to Sebastian Andrzej Siewior for reporting the problem. -- Ben Pfaff Wed, 24 Nov 2010 05:27:04 -0800 fmtools (2.0.4) unstable; urgency=low * debian/control: Use "linux-any" wildcard for architecture, instead of listing all the GNU/Linux architectures by hand as before. Closes: #604683. Thanks to Konstantinos Margaritis for reporting the problem. -- Ben Pfaff Tue, 23 Nov 2010 09:39:14 -0800 fmtools (2.0.3) unstable; urgency=low * debian/control: Add armel to Architectures, since Debian buildds use that architecture even though Debian policy does not mention it. * debian/source/format: Add and initialize to 1.0. -- Ben Pfaff Sat, 01 May 2010 11:52:24 -0700 fmtools (2.0.2) unstable; urgency=low * debian/control: Limit Architecture: to Linux, since this is a Linux-specific package. -- Ben Pfaff Sat, 27 Mar 2010 10:51:43 -0700 fmtools (2.0.1) unstable; urgency=low * New upstream release. The new release uses Automake, so a "configure" command had to be added to "rules". * Update to Debhelper 7. * Update to newer Debian policy version. -- Ben Pfaff Sat, 09 Jan 2010 13:30:15 -0800 fmtools (1.0.2) unstable; urgency=low * New upstream release. -- Ben Pfaff Thu, 23 Nov 2006 13:43:02 -0800 fmtools (1.0.1) unstable; urgency=low * New upstream release: Make fm able to sleep for a user-specified time, or forever, after applying settings. This makes fm usable with radio tuner drivers that turn off the radio after the fd used for tuning is closed. Idea and patch from Dave Ulrick . * Upgrade to debhelper V5. -- Ben Pfaff Sat, 7 Oct 2006 13:35:35 -0700 fmtools (1.0) unstable; urgency=low * New upstream release. Now a native Debian package. -- Ben Pfaff Sat, 4 Sep 2004 12:20:06 -0700 fmtools (0.99.1-4) unstable; urgency=low * Fix doubled manpages in 0.99.1-2. Oops! -- Ben Pfaff Sun, 15 Aug 2004 17:08:54 -0700 fmtools (0.99.1-2) unstable; urgency=low * Patch from "Gregory P. Smith" to add user-definable threshold to fmscan. Modified patch slightly to match the command-line argument a float instead of an int. Closes: #264500. -- Ben Pfaff Sun, 15 Aug 2004 16:56:20 -0700 fmtools (0.99.1-1) unstable; urgency=low * New upstream release. * Don't use kernel headers. Closes: #223161. -- Ben Pfaff Sat, 6 Dec 2003 22:38:53 -0800 fmtools (0.99.0-1) unstable; urgency=low * New upstream version. Closes: 90705 -- Ben Pfaff Sun, 25 Mar 2001 15:54:07 -0500 fmtools (0.2.1-2) unstable; urgency=low * Redo with debhelper. Closes: #91157. -- Ben Pfaff Sun, 25 Mar 2001 12:16:45 -0500 fmtools (0.2.1-1) unstable; urgency=low * New upstream source. * Fix copyright file. -- Ben Pfaff Thu, 30 Jul 1998 11:30:24 -0400 fmtools (0.2.0-1) unstable; urgency=low * Added Debian control files. * Put in my VIDEO_TUNER_LOW fix. -- Ben Pfaff Fri, 10 Jan 1997 15:06:38 -0500 Local Variables: mode:debian-changelog End: fmtools-2.0.8/debian/control0000644000000000000000000000060313765502314012724 0ustar Source: fmtools Section: sound Priority: optional Maintainer: Debian QA Group Standards-Version: 4.5.1.0 Build-Depends: debhelper-compat (= 13) Package: fmtools Architecture: linux-any Depends: ${shlibs:Depends}, ${misc:Depends} Description: FM radio tuner Command-line utility for adjusting the frequency and volume and muting and unmuting FM radio cards. fmtools-2.0.8/debian/copyright0000644000000000000000000000163010116414156013246 0ustar This package contains fmtools by Russell Kroll , now maintained by Ben Pfaff . Also packaged for Debian by Ben Pfaff. Upstream sources hosted at http://benpfaff.org/fmtools Copyright for fmtools: Copyright (C) 1998 Russell Kroll This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. On Debian GNU/Linux systems, a copy of the GNU General Public License can be found in /usr/share/common-licenses/GPL. fmtools-2.0.8/debian/rules0000755000000000000000000000011513765502335012402 0ustar #!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: dh $@ fmtools-2.0.8/debian/source/0000755000000000000000000000000012217426530012616 5ustar fmtools-2.0.8/debian/source/format0000644000000000000000000000000411367074333014030 0ustar 1.0 fmtools-2.0.8/fm.10000644000000000000000000000522311322174707010564 0ustar .TH FM 1 "fm 1.0.2" .SH NAME fm \- control frequency, volume, mute/unmute of FM radio card .SH SYNOPSIS .HP .B fm [ .B \-h ] [ .B \-o ] [ .B \-q ] [ .B \-d .I device ] [ .B \-t .I tuner ] [ .B \-T .B none | .B forever | .I time ] .B on | .B off | .B + | .B \- | .B freq [ .I volume ] .SH DESCRIPTION .B fm is a program to control the frequency, volume, and mute/unmute state of an FM radio card, using the video4linux interface introduced in 2.1.x series Linux kernels. .SS OPTIONS .PP .TP .B \-h Print a usage message to standard output, and exit. .TP .B \-o Ignore frequency range limits of card. Use if you suspect that the card supports a wider frequency range than its driver believes. .TP .B \-q Quiet mode. Keeps information on station and volume from being printed on standard output. .TP \fB\-d \fIdevice Sets \fIdevice\fR as the device to tune. The default is \fB/dev/radio0\fR. .TP \fB\-t \fItuner Sets \fItuner\fR as the tuner on the selected device to adjust. The default is tuner 0. Most radio devices have only a single tuner. .TP \fB\-T none \fR| \fBforever \fR| \fItime After tuning, sleep for the time specified or forever. Time is specified in seconds by default. A suffix of .B m indicates minutes, .B h indicates hours, or .B d indicates days. .IP The .B -T option is useful with radio card drivers that only maintain the tuner settings while the tuner's file descriptor remains open. Try using this option if running .B fm ordinarily produces only a single "pop" from your speakers. .TP .BI freq Frequency to tune the radio to, in MHz. For instance, \fB88.9\fR specifies a frequency of 88.9 MHz. AM tuner values are also specified in MHz; for instance, 530 kHz would be specified as \fB.530\fR. .TP .BI on Turn the radio on (unmute). .TP .BI off Turn the radio off (mute). .TP .BI volume Specify the desired volume, in percent. Not all radio devices support volume control. .TP .BI + Increase the current volume. .TP .BI - Decrease the current volume. .SH CONFIGURATION .B fm reads \fI$HOME\fB/.fmrc\fR, if it exists, to obtain default settings. Each line may take one of the following forms: .TP .BR VOL \ percent Specifies default volume (default: 12.5%). .TP .BR INCR \ percent Volume increment used for .B + and .B - options (default: 10%). .TP .BR TIME Default sleep time (default: .BR none ). .PP All other lines are ignored. .SH SEE ALSO .TP Additional documentation: .B /usr/share/doc/fmtools/README .TP The fmtools homepage: .B http://benpfaff.org/fmtools .SH AUTHORS Russell Kroll , now maintained by Ben Pfaff . Sleep time feature contributed by Dave Ulrick . This manpage written by Ben Pfaff. fmtools-2.0.8/fm.c0000644000000000000000000002264112020514005010632 0ustar /* fm.c - simple V4L2 compatible tuner for radio cards Copyright (C) 2004, 2006, 2009, 2012 Ben Pfaff Copyright (C) 1998 Russell Kroll This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include #include #include #include #include #include #include #include #include #include #include "fmlib.h" #define DEFAULT_DEVICE "/dev/radio0" static double clamp(double percent) { return percent < 0.0 ? 0.0 : percent > 100.0 ? 100.0 : percent; } static int convert_time (const char *string) { if (strcmp(string, "forever") == 0 || strcmp(string, "-") == 0 || atoi(string) < 0) return 0; else if (strcmp(string, "none") == 0 || strcmp(string, "0") == 0) return -1; else { char worktime[80+1]; int inttime; const char *suffix; suffix = string + strspn(string, "0123456789"); strncpy(worktime, string, suffix - string); worktime[suffix - string] = '\0'; inttime = atoi(worktime); switch (*suffix) { case 's': case '\0': break; case 'm': inttime *= 60; break; case 'h': inttime *= 60 * 60; break; case 'd': inttime *= 24 * 60 * 60; break; default: break; } return inttime; } } static char * format_time (char *buffer, const char *string) { if (strcmp(string, "forever") == 0 || strcmp(string, "-") == 0 || atoi(string) < 0) strcpy(buffer, "forever"); else if (strcmp(string, "none") == 0 || strcmp(string, "0") == 0) strcpy(buffer, "none"); else { char worktime[80+1]; const char *suffix; char *format; int int_time; suffix = string + strspn(string, "0123456789"); strncpy(worktime, string, suffix - string); worktime[suffix - string] = '\0'; int_time = atoi(worktime); switch (*suffix) { case 'm': format = "%d minute(s)"; break; case 'h': format = "%d hour(s)"; break; case 'd': format = "%d day(s)"; break; case 's': case '\0': default: format = "%d second(s)"; break; } sprintf(buffer, format, int_time); } return buffer; } static void maybe_sleep(const struct tuner *tuner, const char *wait_time) { char message[80+1]; int int_wait_time; int_wait_time = convert_time(wait_time); if (int_wait_time > 0) { printf("Sleeping for %s\n", format_time(message, wait_time)); tuner_sleep(tuner, int_wait_time); } else if (int_wait_time == 0) { printf("Sleeping forever...CTRL-C exits\n"); for (;;) pause(); } } static void usage(void) { printf("fmtools fm version %s\n\n", VERSION); printf("usage: %s [-h] [-o] [-q] [-d ] [-t ] " "[-T none|forever|time] |on|off []\n\n", program_name); printf("A small controller for Video for Linux radio devices.\n\n"); printf(" -h display this help\n"); printf(" -o override frequency range limits of card\n"); printf(" -q quiet mode\n"); printf(" -d select device (default: /dev/radio0)\n"); printf(" -t select tuner (default: 0)\n"); printf(" -T