Re: make OpenBSD beep at start

2010-01-26 Thread Jean-Francois
 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.



Re: make OpenBSD beep at start

2010-01-26 Thread Aaron Mason
On Wed, Jan 27, 2010 at 9:02 AM, Jean-Francois jfsimon1...@gmail.com 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



Re: make OpenBSD beep at start

2010-01-26 Thread Jacob Meuser
On Wed, Jan 27, 2010 at 11:18:50AM +1100, Aaron Mason wrote:
 On Wed, Jan 27, 2010 at 9:02 AM, Jean-Francois jfsimon1...@gmail.com 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

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: make OpenBSD beep at start

2010-01-25 Thread Markus Hennecke
jean-francois wrote:
 Can someone give a hin on how to make the speaker to beep for example with 
 a command or a C program ?

man speaker(4), if you are on i386 or amd64.

Kind regards,
  Markus



Re: make OpenBSD beep at start

2010-01-25 Thread ropers
2010/1/25 Markus Hennecke markus-henne...@markus-hennecke.de:
 jean-francois wrote:
 Can someone give a hin on how to make the speaker to beep for example with
 a command or a C program ?

 man speaker(4), if you are on i386 or amd64.

I'm so stupid. Of course it says right on that man page that there's
/dev/speaker, so with the right permissions:

# cat somefile  /dev/speaker

That should work. It did for me, on IA-32.

regards,
--ropers



Re: make OpenBSD beep at start

2010-01-25 Thread Jean-Francois
Le lundi 25 janvier 2010 18:55:21, vous avez icrit :
 2010/1/25 Markus Hennecke markus-henne...@markus-hennecke.de:
  jean-francois wrote:
  Can someone give a hin on how to make the speaker to beep for example
  with a command or a C program ?
 
  man speaker(4), if you are on i386 or amd64.

 I'm so stupid. Of course it says right on that man page that there's
 /dev/speaker, so with the right permissions:

 # cat somefile  /dev/speaker

 That should work. It did for me, on IA-32.

 regards,
 --ropers

Ok, that's because I tried it and it did not work that I asked the question.
So now I know the box has the speaker not wired actually.

Thanks.



Re: make OpenBSD beep at start

2010-01-25 Thread Julian Leyh

Am 24.01.10 01:32, schrieb jean-francois:

Hi list,

Can someone give a hin on how to make the speaker to beep for example with
a command or a C program ?

I started to write a little C program thinking there was a beep() functione,
but it seems not 

Regards.



how about midiplay(1)?



Re: make OpenBSD beep at start

2010-01-25 Thread Jacob Meuser
On Mon, Jan 25, 2010 at 09:02:47PM +0100, Jean-Francois wrote:
 Le lundi 25 janvier 2010 18:55:21, vous avez icrit :
  2010/1/25 Markus Hennecke markus-henne...@markus-hennecke.de:
   jean-francois wrote:
   Can someone give a hin on how to make the speaker to beep for example
   with a command or a C program ?
  
   man speaker(4), if you are on i386 or amd64.
 
  I'm so stupid. Of course it says right on that man page that there's
  /dev/speaker, so with the right permissions:
 
  # cat somefile  /dev/speaker
 
  That should work. It did for me, on IA-32.
 
  regards,
  --ropers
 
 Ok, that's because I tried it and it did not work that I asked the question.
 So now I know the box has the speaker not wired actually.

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'.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: make OpenBSD beep at start

2010-01-25 Thread ropers
2010/1/25 Julian Leyh jul...@vgai.de:
 Am 24.01.10 01:32, schrieb jean-francois:

 Hi list,

 Can someone give a hin on how to make the speaker to beep for example with
 a command or a C program ?

 I started to write a little C program thinking there was a beep()
 functione,
 but it seems not 

 Regards.


 how about midiplay(1)?

I can confirm that midiplay works; I've used it in the past, before I
knew any better. But using a midi file player to play a *.mid file via
the PC speaker is a very roundabout way to produce a beep. I like
redirecting stuff to /dev/speaker better. YMMV.

regards,
--ropers



Re: make OpenBSD beep at start

2010-01-24 Thread J.C. Roberts
On Sun, 24 Jan 2010 01:32:14 +0100 jean-francois
jfsimon1...@gmail.com wrote:

 Hi list,
 
 Can someone give a hin on how to make the speaker to beep for example
 with a command or a C program ?
 
 I started to write a little C program thinking there was a beep()
 functione, but it seems not 
 
 Regards.
 


use vi



Re: make OpenBSD beep at start

2010-01-24 Thread Otto Moerbeek
On Sun, Jan 24, 2010 at 12:10:51AM -0800, J.C. Roberts wrote:

 On Sun, 24 Jan 2010 01:32:14 +0100 jean-francois
 jfsimon1...@gmail.com wrote:
 
  Hi list,
  
  Can someone give a hin on how to make the speaker to beep for example
  with a command or a C program ?
  
  I started to write a little C program thinking there was a beep()
  functione, but it seems not 
  
  Regards.
  
 
 
 use vi

That only works if your brain does not have a working built-in insert
vs command mode bit. Some people have it. Others not.

-Otto



Re: make OpenBSD beep at start

2010-01-24 Thread ropers
Those only work *on the console*, which may not be on the actual
OpenBSD box (because the user may be using serial console
redirection/ssh/whatever. There may still be uses for a program that
produces a PC speaker beep on the machine it runs on.


regards,
--ropers

2010/1/24 Constantine A. Murenin muren...@gmail.com:
 On 23/01/2010, joshua stein j...@openbsd.org wrote:
  Can someone give a hin on how to make the speaker to beep for example
with
   a command or a C program ?


 echo

  (that's control+v, then control+g)

 or

  /usr/bin/printf \a

 or

  putchar('\a');

 C.



Re: make OpenBSD beep at start

2010-01-24 Thread Bryan Irvine
echo $'\a'


On Sat, Jan 23, 2010 at 4:32 PM, jean-francois jfsimon1...@gmail.com wrote:
 Hi list,

 Can someone give a hin on how to make the speaker to beep for example with
 a command or a C program ?

 I started to write a little C program thinking there was a beep() functione,
 but it seems not 

 Regards.



make OpenBSD beep at start

2010-01-23 Thread jean-francois
Hi list,

Can someone give a hin on how to make the speaker to beep for example with 
a command or a C program ?

I started to write a little C program thinking there was a beep() functione, 
but it seems not 

Regards.



Re: make OpenBSD beep at start

2010-01-23 Thread joshua stein
 Can someone give a hin on how to make the speaker to beep for example with
 a command or a C program ?

echo 

(that's control+v, then control+g)



Re: make OpenBSD beep at start

2010-01-23 Thread Constantine A. Murenin
On 23/01/2010, joshua stein j...@openbsd.org wrote:
  Can someone give a hin on how to make the speaker to beep for example with
   a command or a C program ?


 echo

  (that's control+v, then control+g)

or

  /usr/bin/printf \a

or

  putchar('\a');

C.



Re: OpenBSD beep

2005-12-19 Thread Daniel A. Ramaley
On Sunday 18 December 2005 03:05, you wrote:
And my machine is old, it's Celeron 500 on Chaintech CT-6BTA3 with
 Intel 82440BX chipset, and my motherboard didn't provide any
 information about cpu/system temp...

I'd suggest opening the case and seeing if all cooling fans are running; 
on older machines the moving parts often start to wear out. I'm not 
familiar with your exact hardware, but many motherboards will emit a 
speaker beep if there is a problem. If you have the manual for the 
board, try looking up the beep code; you'll need to pay attention to 
how often it happens and the pattern of beeps when it does.


Dan Ramaley
Network Programmer/Analyst
(515) 271-4540
Dial Center 118, Drake University



Re: OpenBSD beep

2005-12-19 Thread dimaz

Daniel A. Ramaley wrote:


On Sunday 18 December 2005 03:05, you wrote:
 


And my machine is old, it's Celeron 500 on Chaintech CT-6BTA3 with
Intel 82440BX chipset, and my motherboard didn't provide any
information about cpu/system temp...
   



I'd suggest opening the case and seeing if all cooling fans are running; 
on older machines the moving parts often start to wear out. I'm not 
familiar with your exact hardware, but many motherboards will emit a 
speaker beep if there is a problem. If you have the manual for the 
board, try looking up the beep code; you'll need to pay attention to 
how often it happens and the pattern of beeps when it does.



Dan Ramaley
Network Programmer/Analyst
(515) 271-4540
Dial Center 118, Drake University

 

I'll look in case, but I don't think that it's only hardvare, openbsd is 
impact on this, because in past, when my mini-server were running on 
linux there were no such beeps...




Re: OpenBSD beep

2005-12-19 Thread Simon Morgan
On 19/12/05, dimaz [EMAIL PROTECTED] wrote:
 I'll look in case, but I don't think that it's only hardvare, openbsd is
 impact on this, because in past, when my mini-server were running on
 linux there were no such beeps...

Why do you think Daniel said wear out? Things wear out over time
(fans being a prime example, especially the cheap shit ones that seem
to be par of the course these days), not because of the transition
from one operating system to another.



Re: OpenBSD beep

2005-12-18 Thread dimaz

Johan wrote:


Have you checked your PC clock battery?? It could be running low.

Johan

On 12/17/05, *dimaz* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
wrote:


Brian A. Seklecki wrote:

PC speaker beep (something action on the console?)

Or possibly hardware alarm?

~BAS

On Sat, 2005-12-17 at 09:12, dimaz wrote:


I've installed OpenBSD on my small server, before on server was
linux,
and 2-3 times a day my server beeps (3 times)...
What does it mean? And how I can control this beeps?





Nothing on console, nothing on /var/log/messages; /var/log/secure;
I don't think that it's hardware alarm, my hardware seems to be ok :)
last messages in dmesg:

arp info overwritten for 192.168.3.79 http://192.168.3.79 by
00:80:48:b7:97:79 on vr0
arp info overwritten for 192.168.3.79 http://192.168.3.79 by
00:11:95:d1:79:0a on vr0
arp info overwritten for 192.168.3.79 http://192.168.3.79 by
00:80:48:b7:97:79 on vr0
arp info overwritten for 192.168.3.79 http://192.168.3.79 by
00:11:95:d1:79:0a on vr0

Dbt I don't think that it can cause pc speaker beeps :)



Oh, may be, may be... My clock battery is old...



Re: OpenBSD beep

2005-12-18 Thread Bachman Kharazmi
On 18/12/05, Brian A. Seklecki [EMAIL PROTECTED] wrote:
 PC speaker beep (something action on the console?)

 Or possibly hardware alarm?
true. therefor check your system/cpu temp in bios, let the system run
for a while in bios-mode and check if your cpu temp is increasing
without any load. Also check if there's any warning-mode enabled.
/bkw

 ~BAS

 On Sat, 2005-12-17 at 09:12, dimaz wrote:
  I've installed OpenBSD on my small server, before on server was linux,
  and 2-3 times a day my server beeps (3 times)...
  What does it mean? And how I can control this beeps?




--
##
BKW - Bachman Kharazmi
bahkha AT gmail DOT com
uin: #24089491
SWEDEN
##



Re: OpenBSD beep

2005-12-18 Thread dimaz

Bachman Kharazmi wrote:


On 18/12/05, Brian A. Seklecki [EMAIL PROTECTED] wrote:
 


PC speaker beep (something action on the console?)

Or possibly hardware alarm?
   


true. therefor check your system/cpu temp in bios, let the system run
for a while in bios-mode and check if your cpu temp is increasing
without any load. Also check if there's any warning-mode enabled.
/bkw
 


~BAS

On Sat, 2005-12-17 at 09:12, dimaz wrote:
   


I've installed OpenBSD on my small server, before on server was linux,
and 2-3 times a day my server beeps (3 times)...
What does it mean? And how I can control this beeps?
 

   




--
##
BKW - Bachman Kharazmi
bahkha AT gmail DOT com
uin: #24089491
SWEDEN
##

 

My system configuration is standart, I've don't change any 
warning-mode settings...
And my machine is old, it's Celeron 500 on Chaintech CT-6BTA3 with Intel 
82440BX chipset, and my motherboard didn't provide any information about 
cpu/system temp...




OpenBSD beep

2005-12-17 Thread dimaz
I've installed OpenBSD on my small server, before on server was linux, 
and 2-3 times a day my server beeps (3 times)...

What does it mean? And how I can control this beeps?



Re: OpenBSD beep

2005-12-17 Thread Jasper Lievisse Adriaanse
On Sat, 17 Dec 2005 17:12:58 +0300
dimaz [EMAIL PROTECTED] wrote:

 I've installed OpenBSD on my small server, before on server was linux,
 and 2-3 times a day my server beeps (3 times)...
 What does it mean? And how I can control this beeps?
Have you checked your logs for anything out of the normal?
Maybe a dmesg might be helpfull?

Jasper

--
Security is decided by quality -- Theo de Raadt

[demime 1.01d removed an attachment of type application/pgp-signature]



Re: OpenBSD beep

2005-12-17 Thread dimaz

Jasper Lievisse Adriaanse wrote:


On Sat, 17 Dec 2005 17:21:39 +0300
dimaz [EMAIL PROTECTED] wrote:

 


Jasper Lievisse Adriaanse wrote:

   


On Sat, 17 Dec 2005 17:12:58 +0300
dimaz [EMAIL PROTECTED] wrote:



 

I've installed OpenBSD on my small server, before on server was linux, 
and 2-3 times a day my server beeps (3 times)...

What does it mean? And how I can control this beeps?
  

   


Have you checked your logs for anything out of the normal?
Maybe a dmesg might be helpfull?

Jasper



 

I've checked my root mailbox my /var/log/secure and /var/log/messages 
and nothing found...
   


Please say so too on [EMAIL PROTECTED]

It would help _a lot_ if you also posted your dmesg to misc@ so we know at
least what platform you are using!


 


Sorry... :)
dmesg:

   OpenBSD 3.8 (GENERIC) #138: Sat Sep 10 15:41:37 MDT 2005
   [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC
   cpu0: Intel Celeron (GenuineIntel 686-class, 128KB L2 cache) 501 MHz
   cpu0:
   FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR
   real mem  = 200908800 (196200K)
   avail mem = 176447488 (172312K)
   using 2478 buffers containing 10149888 bytes (9912K) of memory
   mainbus0 (root)
   bios0 at mainbus0: AT/286+(2a) BIOS, date 12/28/99, BIOS32 rev. 0 @
   0xfb010
   apm0 at bios0: Power Management spec V1.2
   apm0: AC on, battery charge unknown
   apm0: flags 70102 dobusy 1 doidle 1
   pcibios0 at bios0: rev 2.1 @ 0xf/0xb648
   pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdf00/144 (7 entries)
   pcibios0: PCI Exclusive IRQs: 11 15
   pcibios0: PCI Interrupt Router at 000:07:0 (Intel 82371SB ISA rev
   0x00)
   pcibios0: PCI bus #1 is the last bus
   cpu0 at mainbus0
   pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
   pchb0 at pci0 dev 0 function 0 Intel 82443BX AGP rev 0x03
   ppb0 at pci0 dev 1 function 0 Intel 82443BX AGP rev 0x03
   pci1 at ppb0 bus 1
   pcib0 at pci0 dev 7 function 0 Intel 82371AB PIIX4 ISA rev 0x02
   pciide0 at pci0 dev 7 function 1 Intel 82371AB IDE rev 0x01: DMA,
   channel 0 wired to compatibility, channel 1 wired to compatibility
   wd0 at pciide0 channel 0 drive 0: SAMSUNG SP0802N
   wd0: 16-sector PIO, LBA48, 76351MB, 156368016 sectors
   wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
   pciide0: channel 1 ignored (disabled)
   uhci0 at pci0 dev 7 function 2 Intel 82371AB USB rev 0x01: irq 11
   usb0 at uhci0: USB revision 1.0
   uhub0 at usb0
   uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
   uhub0: 2 ports with 2 removable, self powered
   Intel 82371AB Power rev 0x02 at pci0 dev 7 function 3 not configured
   vr0 at pci0 dev 14 function 0 VIA VT6105 RhineIII rev 0x86: irq 15
   address 00:0d:88:b3:61:46
   ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface
   ukphy0: OUI 0x004063, model 0x0034, rev. 4
   xl0 at pci0 dev 15 function 0 3Com 3c905B 100Base-TX rev 0x30: irq
   11, address 00:50:04:9f:ce:5e
   exphy0 at xl0 phy 24: 3Com internal media interface
   isa0 at pcib0
   isadma0 at isa0
   pckbc0 at isa0 port 0x60/5
   pckbd0 at pckbc0 (kbd slot)
   pckbc0: using irq 1 for kbd slot
   wskbd0 at pckbd0: console keyboard
   pcdisplay0 at isa0 port 0x3b0/16 iomem 0xb/32768
   wsdisplay0 at pcdisplay0 mux 1: console (80x25, vt100 emulation),
   using wskbd0
   pcppi0 at isa0 port 0x61
   midi0 at pcppi0: PC speaker
   spkr0 at pcppi0
   sysbeep0 at pcppi0
   npx0 at isa0 port 0xf0/16: using exception 16
   biomask 7ffd netmask fffd ttymask 
   pctr: 686-class user-level performance counters enabled
   mtrr: Pentium Pro MTRR support
   dkcsum: wd0 matches BIOS drive 0x80
   root on wd0a
   rootdev=0x0 rrootdev=0x300 rawdev=0x302
   arp info overwritten for 192.168.1.2 by 00:0b:cd:a7:55:0b on vr0
   arp info overwritten for 192.168.1.2 by 00:11:2f:69:bf:9a on vr0
   arp info overwritten for 192.168.1.2 by 00:0b:cd:a7:55:0b on vr0
   arp info overwritten for 192.168.1.2 by 00:11:2f:69:bf:9a on vr0



Re: OpenBSD beep

2005-12-17 Thread Brian A. Seklecki
PC speaker beep (something action on the console?)

Or possibly hardware alarm?

~BAS

On Sat, 2005-12-17 at 09:12, dimaz wrote:
 I've installed OpenBSD on my small server, before on server was linux, 
 and 2-3 times a day my server beeps (3 times)...
 What does it mean? And how I can control this beeps?



Re: OpenBSD beep

2005-12-17 Thread dimaz

Brian A. Seklecki wrote:


PC speaker beep (something action on the console?)

Or possibly hardware alarm?

~BAS

On Sat, 2005-12-17 at 09:12, dimaz wrote:
 

I've installed OpenBSD on my small server, before on server was linux, 
and 2-3 times a day my server beeps (3 times)...

What does it mean? And how I can control this beeps?
   



 


Nothing on console, nothing on /var/log/messages; /var/log/secure;
I don't think that it's hardware alarm, my hardware seems to be ok :)
last messages in dmesg:

   arp info overwritten for 192.168.3.79 by 00:80:48:b7:97:79 on vr0
   arp info overwritten for 192.168.3.79 by 00:11:95:d1:79:0a on vr0
   arp info overwritten for 192.168.3.79 by 00:80:48:b7:97:79 on vr0
   arp info overwritten for 192.168.3.79 by 00:11:95:d1:79:0a on vr0

Dbt I don't think that it can cause pc speaker beeps :)