Messages in this thread | | | From | (Zygo Blaxell) | Subject | Re: New snapshot of modutils | Date | 18 Feb 1999 13:02:16 -0500 |
| |
In article <E10DA8B-0003wO-00@devel2.axiom.internal>, David Woodhouse <David.Woodhouse@mvhi.com> wrote: >amorsen@sscnet.com said: >> For a while I have been wondering why the sound drivers do not just >> initialize the mixer levels to zero. Then the post-install script can >> set the levels to anything the user wants, and no noise should be >> heard.
Not all mixer levels should default to zero. A GUS MAX has two levels of mixer inside of it, one for the old GUS compatibility and one for the CS4231 on the MAX card. In fact, the sound driver puts two devices in /dev/sndstat and you can use the old GUS codec for playback at the same time as the new GUS MAX codec. In this particular case there are mixer outputs of the old mixer that are fed into inputs of the new mixer, but only the new mixer is available from user space with the GUS MAX driver. Therefore, if the GUS MAX driver is used, it should set the old GUS mixer to default values of 100 and the new GUS mixer should have default values of 0.
Don't get me started about Sound Blasters. "Bass" and "Treble" should be 50 by default (or perhaps 75 if there is a logarithmic -> linear scale conversion), not zero.
It would be better to say that the default should be silence for all user-visible mixer values, and distribution vendors should add support for mixer state save/restore.
>Still no good. Common situation: > User has sound modules autoloaded by kerneld/kmod, to save memory.
Oooh, 100 _kilo_bytes of RAM. Just under half the size of a single bash process. :-)
> User sets CD sound level, starts listening to CD. > Sound modules are unloaded.
There's your real problem right there. If you want a device driver to preserve its state, don't unload its module. Conversely, if you unload a module, expect the device to be disabled. Doesn't the sound driver currently disable the sound card outputs when the module is unloaded anyway? Unfortunately I can't verify this with the hardware in front of me at the moment.
Red Hat 5.2 loads the sound module in /etc/rc.d/rc.sysinit. Since it's not an autoclean module if it's loaded explicitly, the sound module is never unloaded. Mixer settings are saved at shutdown time and restored at boot.
I know that some time in the past, if I unloaded the sound module for my sound card (GUS MAX), I would get silence from line inputs. It took a while for me to figure out why this was happening; the symptoms were that when I closed xmixer, a minute or two later the sound would just go dead. If I unload the bttv video capture module (or even close the device) the tuner stops providing sound. If I unload the serial port module, the serial port goes into the same state it was in at power-up (i.e. DTR etc settings are not preserved). If I unload a network card module, the link beat LEDs on the card go off for many ethernet card types. If I unload the Aztech radio card driver, the card remains tuned and active, but I expect that to be fixed soon and I code all applications assuming that it is necessary to keep the device open for the entire time that the radio is to be active.
> Something opens /dev/dsp. > Sound modules reset the mixer levels on loading.
-- Zygo Blaxell, Linux Engineer, Corel Corporation, zygob@corel.ca (work), zblaxell@furryterror.org (play). It's my opinion, I tell you! Mine! All MINE! Size of 'diff -Nurw [...] winehq corel' as of Thu Feb 18 12:14:00 EST 1999 Lines/files: In 3905 / 14, Out 30668 / 391, Both 34339 / 394
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |