Bug 2129387

Summary: Systemd causes PC Speaker to emit a loud beep during reboot/poweroff, after suspend&resume
Product: [Fedora] Fedora Reporter: Kamil Páral <kparal>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: awilliam, bcotton, edgar.hoch, fedoraproject, filbranden, flepied, lnykryn, msekleta, ryncsn, ssahani, s, systemd-maint, travneff, yuwatana, zbyszek
Target Milestone: ---Flags: bcotton: fedora_prioritized_bug+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AcceptedFreezeException
Fixed In Version: systemd-251.6-609.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-17 22:55:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2009540    

Description Kamil Páral 2022-09-23 14:43:17 UTC
Description of problem:
After upgrading to Fedora 37 (systemd 251), but laptop started producing an extremely loud and annoying beep when rebooting or shutting down. It's a PC Speaker sound, and as such, it ignores any configuration of the regular speakers, including volume level, mute status, and even headphones plugged in! On my laptop, it's extremely loud and unpleasant, and if it happens during night when my family is sleeping, I'm beginning to see red.

On desktop [1] and test [2] lists, I got confirmation from other people that they experience it too.

[1] https://lists.fedoraproject.org/archives/list/desktop@lists.fedoraproject.org/thread/73QO72BIBAWX7YT7NAJ2GZQAT4UCFIER/
[2] https://lists.fedoraproject.org/archives/list/test@lists.fedoraproject.org/thread/73QO72BIBAWX7YT7NAJ2GZQAT4UCFIER/

There are more complaints on the internet:
https://www.reddit.com/r/archlinux/comments/uwzhui/shutdown_message_and_beep_after_upgrading_to/
https://forum.endeavouros.com/t/solved-loud-beep-at-shutdown/27389

which seem to point to this issue as a root cause or related to it:
https://github.com/systemd/systemd/issues/23520

I have to confirm that together with that beep, I also started to see messages like "System is going down NOW" in a VT which briefly flash on the screen during reboot (sometimes too fast to notice). So it seems plausible that these messages cause the beep to occur. (These messages also seem to sometimes break plymouth, the graphical screen during reboot, but that's not the point of this bug report).

It is interesting that the beep is emitted only sometimes. I haven't found a pattern yet. It seems like a race condition of sort. Other people claimed it happens always for them.


Please, abusing the PC speaker needs to stop, at least on graphical desktops! There is zero benefit in flashing the message on the screen for a fraction of a second, and the beep will make users extremely angry. If I were in the same room as my family sleeping when the beep occurred, and were I just a regular user, this would probably be the last day of Linux on my laptop. The beep is that loud and uncomfortable, especially at night.


Version-Release number of selected component (if applicable):
systemd-251.4-53.fc37.x86_64
kernel-5.19.10-300.fc37.x86_64
plymouth-22.02.122-2.fc37.x86_64
Thinkpad P1 gen3


How reproducible:
randomly, in my case (but others claim it beeps every time)

Steps to Reproduce:
1. ask the system to reboot or power off
2. hear a loud PC speaker beep (in my case, sometimes, possibly a race condition)

Expected results:
PC Speaker shouldn't be used on end-user graphical desktops. I have no idea about servers.

Comment 1 Kamil Páral 2022-09-23 14:47:04 UTC
I don't expect people to want to block Fedora 37 on this problem, but I'll at least propose it for a freeze exception, in case the freeze starts before this is resolved. I also nominate this as a Prioritized Bug, because I think many of our users will be extremely annoyed if we release in this state.

The solution likely includes a revert in systemd to no longer send the VT announce messages, or possibly blacklisting the pcspkr kernel module (at least on desktops), as an alternative.

Comment 2 Adam Williamson 2022-09-26 15:25:18 UTC
Funny thing is, I seem to remember this always used to happen *before* systemd. So it might be that this is sort of restoring an old behaviour rather than a new one. I agree it's kinda annoying and probably silly, though. For desktops at least.

Comment 3 Adam Williamson 2022-09-26 15:26:36 UTC
+4 in https://pagure.io/fedora-qa/blocker-review/issue/921 , marking accepted.

Comment 4 Zbigniew Jędrzejewski-Szmek 2022-10-01 18:25:46 UTC
Hmm, so the patches from https://github.com/systemd/systemd/issues/23520 are already included in v251.2,
and Kamil reported the issue with systemd-251.4-53.fc37.x86_64. So the that fix is clearly not enough.

In https://github.com/systemd/systemd/issues/23520#issuecomment-1141290377 the following was recommended:

 busctl set-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager EnableWallMessages b false

Can somebody who can reproduce the issue test if this fixes it? If yes, then most likely we need
to disable those messages altogether by default.

Comment 5 Kamil Páral 2022-10-03 07:10:26 UTC
I finally found the reproducer! The beep doesn't occur when I cleanly boot my system and restart it. But when I SUSPEND AND RESUME it, it then beeps during reboot/poweroff! So whatever fix was applied earlier, it doesn't persist through suspend&resume.

>  busctl set-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager EnableWallMessages b false

This indeed silences the beep, and it persists through suspend&resume.

Comment 6 Ben Cotton 2022-10-05 14:41:09 UTC
In today's Prioritized Bugs meeting, we accepted this as a Prioritized Bug.

Comment 7 Kamil Páral 2022-10-13 09:22:48 UTC
@zbyszek.pl Can we please get a patch in F37 quickly, now that it's fixed in upstream? It would be great to have this fixed in F37 Final. Thanks!

Comment 8 Fedora Update System 2022-10-13 21:54:50 UTC
FEDORA-2022-bb55f82158 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-bb55f82158

Comment 9 Kamil Páral 2022-10-14 08:55:42 UTC
(In reply to Fedora Update System from comment #8)
> FEDORA-2022-bb55f82158 has been submitted as an update to Fedora 37.
> https://bodhi.fedoraproject.org/updates/FEDORA-2022-bb55f82158

Beeping is gone! :-)

Comment 10 Zbigniew Jędrzejewski-Szmek 2022-10-14 09:34:34 UTC
Beep! I mean thanks for checking.

Comment 11 Zbigniew Jędrzejewski-Szmek 2022-10-17 17:06:30 UTC
So… the update has been "pending→stable" for the last three days. Do I need to do something to push it out?

Comment 12 Fedora Update System 2022-10-17 22:55:06 UTC
FEDORA-2022-bb55f82158 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Kamil Páral 2022-10-18 07:57:40 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #11)
> So… the update has been "pending→stable" for the last three days. Do I need
> to do something to push it out?

To explain: This was because we're in a Final freeze, and during freeze, QA takes care of pushing things stable if they have an approved freeze exception. We wait a while to confirm that it's working well and also consider the risk of breaking something important. So everything was working as intended.