Solved enable console beep

I want to have my console beep, even though the sound is rather primitive, it works, I use it for alerts so I take action. And, maybe I like the simplicity of it, though you can additionally control the tone and duration, play multiple notes, etc. You can really get creative there, if you want ...

That said, I did have it working before at some point (at this point years ago), but I'm not quite sure what changed. I am using a custom kernel (required for pf traffic shaping). I have "device speaker" in my kernel configuration and speaker in /etc/make.conf (I think I need only one).

I recall being able to use the cmdline program 'beep' to send tones directly to the speaker and that for regular users, I had to make some sort of change. I cannot even send any tones as root.
 
The speaker is often not connected any more on mainboards. And some mainboards actually route the 'speaker' audio through the soundcard. The speaker(4) device refers to the speaker connection on the mainboard, usually on the headers that's also used for the power and reset switches, and HD and power LEDs.
 
With
speaker_load="YES"
in /boot/loader.conf, here's my beep in /usr/local/bin:
Code:
#!/bin/sh
echo "G" > /dev/speaker
Yes, echo "G" > /dev/speaker worked. Hmm, I need to figure out why beep doesn't work then. I take it the letter must be the note of the tone to play.
 
So, why does echo G > /dev/speaker work whereas beep does not? Do I need to configure something differently?
 
I am back to using rc.local and rc.shutdown.local to beep on my devices.
Using a service seemed overkill.
 
Back
Top