#1010639 beep: Doesn't beep - could not open any device

Package:
beep
Source:
beep
Description:
advanced PC-speaker beeper
Submitter:
Richard Z
Date:
2025-05-03 12:12:02 UTC
Severity:
minor
#1010639#5
Date:
2022-05-05 20:24:21 UTC
From:
To:
Dear Maintainer,

installed the beep package and tried beep without any arguments and it does not
work.

$ BEEP_LOG_LEVEL=999 beep
beep-log: Verbose: log_constructor
beep-log: Verbose: beep_driver_console_constructor
beep-log: Verbose: beep_drivers_register 0x5658c6a0 (console)
beep-log: Verbose: beep_driver_evdev_constructor
beep-log: Verbose: beep_drivers_register 0x5658c6e0 (evdev)
beep: Verbose: evdev driver_detect 0x5658c6e0 (nil)
beep: Verbose: b-lib: could not open(2) /dev/input/by-path/platform-pcspkr-
event-spkr: Permission denied
beep: Verbose: console driver_detect 0x5658c6a0 (nil)
beep: Verbose: b-lib: could not open(2) /dev/tty0: Permission denied
beep: Verbose: b-lib: could not stat(2) /dev/vc/0: No such file or directory
beep: Error: Could not open any device


Regards
Richard

#1010639#10
Date:
2022-05-06 08:37:50 UTC
From:
To:
severity -1 minor

 Dear Richard,

* Richard Z <rz@linux-m68k.org> [2022-05-05 22:24:21 CEST]:

 How are you logged into your system?  The udev rule that beep installs
requires you to be logged in on a virtual console.  Please be referred
to the documentation in /usr/share/doc/beep/PERMISSIONS.md.gz why this
is so. What always works is using beep as root, regardless of how people
are logged in, so I don't follow your call for that this is a grave bug
- in fact it works as intended and isn't even a bug at all.

 I am starting to (re)implement a specific beep group to which people
could be added on top of that. This requires a bit testing though, and
will hit unstable and only be in the next release then.  In the meantime
you could add a corresponding udev rule for giving access to users of a
specific group yourself while following the documentation in the
PERMISSIONS file.

 Hope that helps,
Rhonda

#1010639#17
Date:
2025-05-03 12:09:30 UTC
From:
To:
Dear Maintainer,

I met this bug today.
It seems that this script works:

sudo env -u SUDO_GID -u SUDO_COMMAND -u SUDO_USER -u SUDO_UID beep

In fact, there is a permission issue, shown by the last lines of strace beep:

newfstatat(AT_FDCWD, "/dev/input/by-path/platform-pcspkr-event-spkr",
{st_mode=S_IFCHR|0660, st_rdev=makedev(0xd, 0x49), ...}, 0) = 0
openat(AT_FDCWD, "/dev/input/by-path/platform-pcspkr-event-spkr", O_WRONLY) =
-1 EACCES (Permission non accordée)
newfstatat(AT_FDCWD, "/dev/tty0", {st_mode=S_IFCHR|0600, st_rdev=makedev(0x4,
0), ...}, 0) = 0
openat(AT_FDCWD, "/dev/tty0", O_WRONLY) = -1 EACCES (Permission non accordée)
newfstatat(AT_FDCWD, "/dev/vc/0", 0x7ffe1cdd7770, 0) = -1 ENOENT (Aucun fichier
ou dossier de ce nom)

Note that the internal speaker works when I do suspicious things in an xterm.

Yours,
n.