Subject: cdplay & sound.o autoloading

From: Derek Lee <[email-masked]>
Date: Thu, 15 Aug 1996 20:36:54 -0400

I have been seeing something strange on my system. The autoloading of
the sound module works most of the time. The problem is with the CD
playing programs (cdplay from cdtool 1.0 or workman). They do not send
a request the sound module to kerneld. But they work if the module has
been loaded at some point in the past. In fact, they would continue to
work even if the sound module has been removed from the kernel!

--Derek Lee

Here is a more systematic account. 
There are several situations:
(A) after power-on boot
(B) (A) + 'insmod sound' + 'rmmod sound' 
		(so that lsmod does not show sound.o)
(C) Ctrl-Alt-Del or /sbin/reboot after (B)
		(ie reboot after I can get sound on all programs)
(D) Reboot by physical reset button after (B)

			cdplay/workman	sox utility
(A)&(D)
request sound.o		N		Y	
sound.o loaded		N		Y
Sound?			N		Y

NB: cdplayers do not abort even if no sound. They just spin the CD.
    There is no sound from either Line Out or Speaker socket.

(B)&(C)
request sound.o		N		Y	
sound.o loaded		N		Y
Sound?			Y		Y

An interpretation is: 
(1) cdplay/workman needs something physically initialized in the sound card. 
(2) cdplay/workman do not need the sound.o module after the initialization.
(3) This initialization is done by sound.o. 
(4) The initialized state of the card survives Ctrl-Alt-Del but not physical
    reset.

Possible solutions are:
(a) Load sound.o on bootup and be done with it.
(b) Perform 'insmod sound;rmmod sound' and 'rmmod' on bootup, so that
    things are initialized.

Here are some system specs from `kdstat` and `cat /dev/sndstat`:

kdstat: Version 2.0.0, pid=120, delay=60, nokeep, nodebug

Sound Driver:3.5.4-960630 (Sun Aug 11 02:40:45 EDT 1996 root,
Linux boson 2.0.0 #1 Fri Jun 14 00:48:45 EDT 1996 i586)   <---- what is this?
Kernel: Linux boson 2.0.12 #1 Sun Aug 11 02:43:29 EDT 1996 i586
Config options: a80002

Installed drivers: 
Type 1: OPL-2/OPL-3 FM
Type 2: Sound Blaster
Type 7: SB MPU-401

Card config: 
Sound Blaster at 0x220 irq 5 drq 1,5
SB MPU-401 at 0x330 irq 5 drq 0
OPL-2/OPL-3 FM at 0x388 drq 0

Audio devices:
0: Sound Blaster 16 (4.13)

Synth devices:
0: Yamaha OPL-3

Midi devices:
0: Sound Blaster 16

Timers:
0: System clock

Mixers:
0: Sound Blaster

---

From: Gerry Jensen <[email-masked]>
Date: Mon, 19 Aug 1996 21:28:11 -0600 (MDT)

> work even if the sound module has been removed from the kernel!

Playing audio CDs does not use the sound driver.  However, unless the
sound card has been initialized, you will not be able to hear audio CDs
through your soundcard (you can probably hear them if the speakers are
plugged directly into the CD player though).  The sound card is
initialized when the sound module is first loaded. After that, audio CDs
will still play even if the sound module is removed because the card has
already been initialized and that's all that's needed.

You could play a sound clip upon bootup or when you login to initialize
the card.  Perhaps just putting something like 
"modprobe sound ; rmmod sound"  in a boot file would do the trick too. 

Gerry