2

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?

2 Answers 2

1

Try

printf '\a'

to print a actual BEL charater.

echo -e '/a'

prints [SLASH,A] instead of [BEL]

6
  • More generally, note the difference between / and \ -- / is just a regular character to the shell and echo; \ can act as an escape character.
    – user
    Commented Jul 5, 2013 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
    Commented Jul 5, 2013 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... Commented Jul 6, 2013 at 4:35
  • @DavidX Hence "can act", not "does act".
    – user
    Commented Jul 6, 2013 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
    Commented Jul 7, 2013 at 0:54
1

Okay, per https://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).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .