Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: beep without a pc speaker (Read 529 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

beep without a pc speaker

I'm playing with an amd ryzen 5700U system. One thing I noticed is that it doesn't have any pc-speaker or beep channel in the sound device which lspci says is Renoir Radeon High Definition Audio Controller.

Alsa mixer shows a bunch o standard channels, but no beep channel is present.

I have beep installed and if I modprobe pcspkr beep works without error, but no sound is produced.

If pcspkr module is unloaded it says no device can be opened.

I can write a command to make beeps eg play -q -n synth 0.1 sin 440 vol 0.15 &>/dev/null, but that is not a substitute for the real beep functionality ie things like tput bel.

Is there some kernel module that can substitute another audio channel for the pc speaker?

Re: beep without a pc speaker

Reply #1
Maybe your motherboard has pc-speaker output contacts and you just need to buy the speaker itself. If not, and if your audio controllers doesn't have beep channel, maybe you could connect some cheap internal audio controller especially for beeps.

There is project for visual beeps here: https://thelig.ht/code/xvisbell Perhaps you can somehow adapt it for your needs.

Re: beep without a pc speaker

Reply #2
Thanks, but I suspect that I have no easy way to make a 'standard' PC Speaker.

I have no 'Beep' channel and I believe the device created by modprobe pcspkr is not doing anything active. It's a bit surprising that there's no way to hook the event that I can find. It seems that individual audio drivers have various ways to create a beep that works. My intel NUC has a HDA Intel PCH card with Realtek 283. There's a beep channel, but it doesn't work until the loopback channel is enabled. The new AMD has HDA Intel PCH card with Realtek 897; there's no beep channel, but there's a loopback which doesn't change anything.

An approach would be to create a  userspace event device and have it execute a command when a beep is called for. I think it could be based on the libfuse example cuse.c. I will have a few days over Christmas to waste.

Re: beep without a pc speaker

Reply #3
Apologies for necro-bump of this thread. I believe I have solved my terminal beep problem using some code from here.

I have packaged it into an AUR  & tested on a couple of systems which don't have built in PC speakers.

Basically it's a kernel module which creates an event device and also a misc char device where it writes a byte each time the event sees a beep.  I added an alsa listener daemon to do simple beeps.

The original git repo contains different daemons which allow sound files to be played for each beep.