Please note: this page was mirrored from http://bigbang.vtc.vsc.edu/fmradio/fmlinux.html |
Much thanks go to rkroll@(no_spam)exploits.org (remove the "(no_spam)") for cleaning up the code, porting it kernel 2.1, and making it conform to the new standard TV/Radio tuner API. He did a lot of work, essentially re-writing the whole driver based on our tuning code. Thanks so much, Russell! See his website at http://aztech.exploits.org/.
You can still use the driver found here for kernel 2.0.x.
Type:
insmod radio.oIf it says "Aztech Radio Card module loaded" or something like that, then it probably worked. You should hear sound from the card and everything! However, you will have to do this each time you reboot, so it's probably best to find a permanent home for radio.o (/usr/src/linux/modules may be a good idea), and put the above command in an rc file somewhere.
Go to your /dev directory, and create a special file for the radiocard. Since the module uses major number 39 (minor 0), use the following command:
mknod radiocard c 39 0Note: The module was compiled under the following conditions (this may be useful for you to know):
Un-gz and un-tar the driver distribution. Uncompress them anywhere, and move the file radio.c to your /usr/src/linux/drivers/char directory, and the file radio.h in the /usr/src/linux/include/linux directory.
Edit the file /usr/src/linux/drivers/char/Config.in. This file tells linux what to ask when you do a make config. You need to tell the kernel makefile to ask about the radio card.
Add the following near the end of this file (just before the endmenu ):
tristate 'Aztech/Packard Bell FM Radio Card support' CONFIG_AZRADIOEdit the file /usr/src/linux/drivers/char/Makefile. This is the Makefile for all of the character device drivers. By adding the radio driver to this file, you ensure that the driver will actually be compiled and linked into the kernel, or that a loadable module will be properly generated.
ifeq ($(CONFIG_AZRADIO),y) L_OBJS += radio.o else ifeq ($(CONFIG_AZRADIO),m) M_OBJS += radio.o endif endifEdit the file mem.c. This file contains a function that is called by the kernel when booting. Placing the initialization function in this file makes the kernel initialize the card at boot.
Add the following to the end of the file, but before the return 0; :
#ifdef CONFIG_AZRADIO radio_init (); #endifEdit the file /usr/src/linux/include/linux/major.h. Look for an unused major number. We use 39, for reasons I don't remember. If you choose to use this number (if it's not used by something else, go ahead), add this line where number 39 would go:
#define AZRADIO_MAJOR 39If you set up your card to use port $358 instead of the default $350, you will have to make a small modification to /usr/src/linux/drivers/char/radio.c. Find the following line in the file:
#define RADIOPORT 0x350and change 0x350 to 0x358.
That's almost everything! At this point you should try compiling your kernel (make config, make xconfig, etc.). If it gives no errors, install your new kernel and reboot.
Now, you've rebooted and all is well. Go to your /dev directory, and create a special file for the radiocard. If you used major number 39, use the following command:
mknod radiocard c 39 0
echo 106.1 > /dev/radiocardAs you probably guessed, this tunes the card to 106.1 MHz. Use a similar command to tune your favorite station.
echo {command} > /dev/radiocard
Commands | |
stereo | allows stereo tuning if possible |
mono | forces reception in mono |
on | turns the volume on |
off | mutes the volume |
+ | turns the volume up one notch |
- | turns the volume down one notch |
{number} | tunes the receiver |
If you are really inspired by this, maybe you could code a decent client!