On Wednesday, April 15, 2015 12:25:03 AM lee wrote: > > Hi, > > when the pcspkr module (or how it's called; I haven't compiled atm) is > loaded, somehow the built-in speaker is used to sometimes beep. There > also seems to be the option to play this beep via the sound card --- > which usually sounds nicer. > > How is this done? Do I need to load a different module for that, or > does it require to use some sort of additional software?
If you mean how to configure the kernel for it then just load the right module. I remember seeing a "PC Speaker Emulation" or similar module but I can't find it now so it may be gone. Anyways, this only applies to the console (VT). Software just writes the BEL character (0x07) to it's terminal (stdout) to play a beep. You can also open "/dev/console" directly and play this character or use ioctl calls to play sounds with different frequencies and duration but this requires root privileges. Modern desktop terminal emulators will already be using the sound card to play the BEL character. On KDE for example you can choose any sound file to play or just show a notification. -- Fernando Rodriguez