On Wed, Jan 27, 2010 at 11:18:50AM +1100, Aaron Mason wrote:
> 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.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
as in, you can see that the speaker header on the mainboard is not
connected? yes, you /probably/ won't get beeps if there is a speaker
header on the board, and it is not connected to a speaker. but some
machines might also send the beep to the audio output lines ...
> > 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.
there is already an easy way to choose frequency/duration:
# echo CACAL2CA > /dev/speaker
--
[email protected]
SDF Public Access UNIX System - http://sdf.lonestar.org