Mailinglist Archive: opensuse-factory (520 mails)

< Previous Next >
Re: [opensuse-factory] https://bugzilla.opensuse.org/show_bug.cgi?id=1030936
On 2017-04-25 14:17, Stefan Seyfried wrote:
On 25.04.2017 13:37, Carlos E. R. wrote:
On 2017-04-25 10:58, Stefan Seyfried wrote:

no, it does not change it in the boot loader. But the beeper is universal
in that it works just everywhere -- console,
bootloader, BIOS, even GTK programs! :-)

I use it for example on my home server to notify me of serious errors (file
system, disk problems, stuff you'd rather
notice sooner than later).
Works very well as someone in my family will call me and complain that the
box in the closet is issuing annoying beeps :-)
Of course I could also use the sound card, add an amplifioer and play some
wav file. But that's much more effort.

I tried to do that, but I found that a daemon can not beep: it needs
having the terminal.

How did you do it?

(in C code)
echo -en '\007' > /dev/tty1

or, to avoid the problem of "is a terminal there at all?"
- open /dev/input/eventX corresponding to pcspkr
- write struct input_event filled with EV_SND/SND_TONE/hz value into that
file descriptor.

I want to try that someday, but I use Pascal (Lazarus), so I'll think
how to translate that one day, so thanks :-)

If you can point to some C code doing it, it would help, of course.


Notes for later use:

cat /proc/bus/input/devices

I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
S: Sysfs=/devices/platform/pcspkr/input/input6
U: Uniq=
H: Handlers=kbd event3
B: PROP=0
B: EV=40001
B: SND=6


Mmm...

https://bugs.freedesktop.org/show_bug.cgi?id=90826

http://2010-2014.itech-planet.net/content/reading-device-input-directly-fromto-devinputeventx-ubuntu-c



But usually, just writing (char)'\007' to a terminal is enough.


cer@Telcontar:~> echo -en '\007' > /dev/tty10
bash: /dev/tty10: Permission denied
cer@Telcontar:~>

Only works as root. Other terminals, depends on who owns each terminal.
Or have user belong to group tty...

--
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)

< Previous Next >
Follow Ups