A Disclaimer

This is a general disclaimer — a grain of salt, if you will — that should be taken before reading my posts on matters of philosophy and religion.

My degree is in computer science, and I am employed full-time. No matter how much spare time I devote to reading philosophical works, I remain, at best, a dilettante of philosophy in an academic sense.

For those readers who have advanced degrees in philosophy, I can only apologize in advance for any choice of words you may find sophomoric, or for any blatant errors you may discover in my posts. In either case, you’re always welcome to leave a comment or send me an e-mail.

That being said, I do strongly believe that I am well-qualified to comment on philosophical matters, if only in a recreational capacity. My qualifications for indulging in these philosophical musings are very simple: I am a living human being, capable of independent logical reasoning. I believe that it’s every person’s right, if not responsibility, to evaluate his or her beliefs as objectively as possible.

Being a computer scientist gives me an additional affinity towards logical thought, which is why most of my posts are written from a perspective of pure logic.

I realize that a lot of my arguments may not be new, and are probably thoroughly covered elsewhere. It is simply my desire to be heard, to encourage conversation, and to ensure that my words will contribute to an ever-growing body of rational thought on the web.

Getting the Damn STB TV Tuner Working in RedHat 9

My computer came with a PCI TV tuner card from STB. The manufacturer provided drivers for Windows 98, but of course, shortly thereafter, the manufacturer disappeared from the face of the earth. Obtaining a suitable driver for Windows XP was nearly impossible until the recent development of open-source WDM drivers for all BT848-based tuner cards. However, although getting the card to work under Linux was a bit tricky, it was not at all impossible. This is a brief log of the steps I took to get the damn thing to work under RedHat 9.

At first I tried to use xawtv just to see if I could get a picture. And in fact, it actually showed Channel 3, which got me excited. However, there was no sound, and I couldn’t change the channel. I knew that the configuration of bttv was somehow wrong. After poring over the BTTV HOWTO document, I came up with the following lines to add to /etc/modules.conf:

# TV settings
alias char-major-81 bttv
pre-install bttv /sbin/modprobe -k tuner; /sbin/modprobe -k msp3400
options bttv radio=1 card=3
options tuner type=2

The parameters specified above correctly identify the STB TV PCI card, and even enable FM radio functionality, which the card supports.

After a reboot, xawtv worked wonderfully. However, there was soon a new problem: I installed an updated accelerated video driver from NVIDIA, which made xawtv crash with a segmentation fault. After searching the web for answers, I found the following solution: simply start xawtv with the command line xawtv -device /dev/video0. That’s it!

One more minor issue was getting the program called tvtime to work. This program is vastly superior to xawtv, but it had a slight problem where it automatically turned up the tuner volume all the way, and let the user control the volume through the mixer. This wasn’t good because the STB card clips the audio if it’s above 50% volume, so it sounded really distorted and rectified. All I needed to do to fix this was find the line of code where tvtime sets the tuner volume, and change the default number. The number that it was setting the volume to was 60000 (presumably the maximum is 65535). So I changed it to 32000 and recompiled. It now runs marvelously.
(Update 10-24-04: I submitted a bug report to tvtime, and the author added a preference to control the audio gain on the tuner card itself. Thanks!)

Getting the Damn Aureal Sound Card Working in RedHat 9

This is a brief how-to on getting my Aureal-based sound card (Turtle Beach Montego) to work under RedHat Linux 9. I’m sure I’m not the only one who owns such a card, so this might be useful for someone in the future.

RedHat did not recognize my sound card upon installation, so naturally I thought it wasn’t supported. This was until I stumbled upon a driver at SourceForge that purported to provide support for Aureal-based cards.

I downloaded the project’s distribution files, and tried to compile it… but the compiler couldn’t get past 10 lines of code before it choked. The source files were obviously written for an earlier version of the kernel.

However, all hope was not lost. I downloaded a CVS snapshot of the project (instead of the distribution), and tried to compile that. Miraculously, that only gave one or two errors. Then, all I did was comment out the two offending lines of code, and it compiled successfully. The output was a kernel module called au8830.o.

Installing it was a different issue altogether.

This driver uses a combination of open- and closed-source code. The closed-source portion that came with the driver was compiled with a much earlier version of gcc. Because of this, insmod would not allow me to load the module. It gave an error that the module needs to be compiled with gcc version greater than 3. Fortunately, insmod can be forced to load the module anyway by issuing the -f option.

With the -f option, insmod tried to load it, but reported a few unresolved externals. I realized that I needed to load the soundcore module first. After loading soundcore, I tried loading my module again, and what do you know? It loaded successfully!

/dev/dsp was working like a charm, but sound in KDE (aRts?) wasn’t loading properly. I went into the KDE Control Center, into the Sound Server tab, and changed the server startup setting from “autodetect” to “Threaded OSS.” That seemed to do the trick, and it’s been working fine ever since.

To automate the process of loading the module at boot time, I edited my /etc/modules.conf file and added the following lines:

# Sound configuration
post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || :
pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || :
pre-install au8830 /sbin/modprobe soundcore; /sbin/insmod -f au8830
alias char-major-14 sound
alias sound-slot-0 sound
alias sound au8830
alias midi au8830

This will ensure that the au8830 module will be loaded after the soundcore module, and that the au8830 module will be force-loaded with the -f option.

Viewing Various Image Formats with VB 6

Here’s some ancient code of mine written in Visual Basic 6 to view different image formats not natively supported (at the time) by VB. Enjoy.

  • PNG Viewer — An ambitious effort to support a major portion of the PNG (Portable Network Graphics) specification using nothing but VB6 code. This program will display most PNG files (interlaced, alpha channels, etc). It may have some trouble with the most obscure instances of PNG formats, but otherwise it’s flawless. Sadly, I’ve stopped development on it a long time ago (what with the existence of libpng and all…) but it could still be useful for some minor applications.
  • JPG Viewer — A JPEG viewer written entirely in VB6.
  • TGA Viewer — This offers pretty complete support for the TGA (Truevision Targa) format.
  • PCX Viewer — Full support for the ZSoft PCX format. Apparently this format is still actually used in some commercial applications (namely Lotus Notes).
  • RAS Viewer — Full support for the Sun Rasterfile format.
  • PPM Viewer — Supports the Portable Pixel Map format (ASCII and Binary). PPM files are usually true-color pictures, unlike the PGM and PBM formats below.
  • PGM Viewer — Supports the Portable Grey (Gray?) Map format (ASCII and Binary).
  • PBM Viewer — Supports the Portable Bit Map format (ASCII and Binary).
  • FLI Animation Viewer — This simple program actually plays a FLI animation by dumping it frame by frame. It doesn’t really support variable timing, and it doesn’t have controls for playback. It just dumps.
  • PSD Viewer — Moderate support for Photoshop PSD files.
  • SGI Viewer — Supports the SGI formats .RGB and .BW.
  • CUT Viewer — Supports the Dr. Halo CUT format.
  • BSV Viewer — This is a viewer for images that were saved using QBasic’s BSAVE command. Only BSAVEs done in SCREEN 13 are supported.

Assembler and Linker for SIC/XE

The SIC/XE architecture is the brainchild of Leland L. Beck, who is the author of System Software: An Introduction to Systems Programming [1]. This book is used in many university courses that deal with language processors. The SIC (Simplified Instructional Computer) architecture itself is completely made-up and has never been implemented for any practical application. All of its functions are entirely conceptual and will never serve a purpose in the real world. So, of course, in my Language Processors class in college, one of the assignments was to write an assembler for the SIC/XE instruction set, and a linker/loader for compiled SIC/XE object code. Let’s just say that, by the end of this assignment, I really started to hate the name “SIC/XE,” and so will you.

To begin with, here is the assembler for the SIC/XE assembly language: download source code and executable. There is no documentation included, since you should already know what you’re doing if you’re actually downloading this. However, here are some quick facts about the assembler.

  • The assembler is for SIC/XE only, not SIC
  • It does support literals
  • It does not support macros
  • It does not support external references or definitions
  • It does create relocatable programs with Modification records

And now, here is the linker/loader for programs compiled with the assembler: download source code and executable. There is also no documentation for the linker/loader, but here are some quick facts:

  • The linker is only for SIC/XE programs, not SIC
  • It supports external references
  • It only supports modification records with import reference numbers, e.g. M00002405+02
  • It outputs a file called outfile, which is simply a dump of the SIC/XE’s memory as it would appear if the program were completely loaded. The file also includes a dump of all external references and their addresses.

This code is freeware, but please give me credit where appropriate if you’re actually going to use it. These programs come as-is, and with no warranty whatsoever.

Reference:

1. Beck, Leland L. System Software: An Introduction to Systems Programming, 3rd ed. 1997, Addison Wesley Longman, Inc.