Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

By loading the pcspkr module with modprobe, I was able to make the beep program work – yes, I'm positive the sound is coming from the on-board beeper and not the sound card.

But

echo -e '/a'

makes no sound. In my terminal preferences, "audible beep" is selected.

Any clue what might be the problem?

share|improve this question

2 Answers 2

Try

printf '\a'

to print a actual BEL charater.

echo -e '/a'

prints [SLASH,A] instead of [BEL]

share|improve this answer
    
More generally, note the difference between / and \ -- / is just a regular character to the shell and echo; \ can act as an escape character. –  Michael Kjörling Jul 5 '13 at 13:38
    
@MichaelKjörling, good point, although \ is also a regular character to echo, you need printf if you want escape sequences. The single quotes suppress any specialness / or \ might have for the shell itself, so its just printf or echo that matter. –  David X Jul 5 '13 at 20:59
    
Still doesn't work, I have tried to write chr(7) to /dev/tty and that doesn't make a sound either. So I guess the problem is not in the escape sequence... –  Yan King Yin Jul 6 '13 at 4:35
    
@DavidX Hence "can act", not "does act". –  Michael Kjörling Jul 6 '13 at 8:46
    
@YanKingYin, huh, I just checked my terminal prefs and I have it enabled as well, and I'm not getting any beeps from \a either. (I assumed it was off since I find it rather annoying.) (@MichaelKjörling, fair point.) –  David X Jul 7 '13 at 0:54

Okay, per http://superuser.com/a/22769/35630: try editing /etc/modprobe.d/blacklist.conf and adding a # in front of the blacklist pcspkr line. I'm not sure if it works yet since I can't reboot at the moment to test it (for unrelated reasons).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.