On Wed, Jan 27, 2010 at 9:02 AM, Jean-Francois <[email protected]> wrote:
>> does this thing have an azalia(4)? because with at least some, the "beep"
>> volume and mute is controlled through the mixer. it should be unmuted
>> by default, but the volume could be low. but then this also depends on
>> the codec ... I didn't see a dmesg in this thread. if you do have an
>> azalia(4), please also include the output of 'mixerctl -v'.
>>
> I will check. The bios neither beeps. As it's a mini PC, I did not know if
it
> was normal or not. Speaker is certainly not wired.
> Thanks for the help.
>
> I just want to add a beep in rc.local because I mounted a NAS server and as
no
> screen wired, the beep will give information that system has been
completely
> loaded.
>
>
Yep, very simple to do if the console is redirected to com0:
#include <fcntl.h>
#include <dev/isa/spkrio.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#define FREQUENCY 2000
#define DURATION 50
int main(void) {
int spkr;
tone_t tone;
tone.frequency=FREQUENCY;
tone.duration=DURATION;
spkr = open("/dev/speaker", O_WRONLY, 0);
ioctl(spkr, SPKRTONE, &tone);
close(spkr);
return 0;
}
With a little effort you could make this so that you can define it on
the command line.
Or you could go by a previous suggestion and make it play a little
song by piping a text file into /dev/speaker.
--
Aaron Mason - Programmer, open source addict
I've taken my software vows - for beta or for worse