The device /dev/sndstat/ is the simplest device provided by the sound driver. A read-only device file, its only purpose is to report information about the sound driver in human-readable form. It is much like the files found in the /proc filesystem (and arguably should be found there).
The device is really meant for human use; it will probably never be read from a program, as you can get the same information more easily using ioctl calls. It is useful for checking your hardware configuration (DMA channel, IRQ number, etc.) and for finding out the version of the sound driver being used.
Included in the output are some "magic numbers" you can pass to a kernel loader program such as LILO to configure the sound driver at run-time.
Here is a sample output, produced using the shell cat command:
% cat /dev/sndstat Sound Driver:3.5.2-960330 (Tue May 21 19:08:17 EDT 1996 root, Linux fizzbin 2.0.0 #1 Tue May 21 19:22:57 EDT 1996 i386 Kernel: Linux fizzbin 2.0.0 #1 Tue May 21 19:22:57 EDT 1996 i386 Config options: a80002 Installed drivers: Type 1: OPL-2/OPL-3 FM Type 2: SoundBlaster Type 6: SoundBlaster 16bit Type 7: SB MPU Card config: SoundBlaster at 0x220 irq 5 drq 1,5 (SB MPU at 0x0 irq 1 drq 0) OPL-2/OPL-3 FM at 0x388 irq 0 drq 0 Audio devices: 0: SoundBlaster Pro 3.2 Synth devices: 0: Yamaha OPL-3 Midi devices: 0: SoundBlaster Timers: 0: System clock Mixers: 0: SoundBlaster
The shell command above is the usual way of reading this device.[2] I won't write any code that uses it, and in fact I recommend against developing any software that relies on the format of the output. In the future, it is likely to change as the sound driver is enhanced.
[2] Incidentally, trying to browse the device using less produces an error message. Surprisingly, the more program does work.
Programming /dev/dsp
Sound Programming Basics