Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My computer stopped beeping. Audio works. My default audio device has a separate beep function which has a separate volume control (now set to 100, usually too loud). I wrote a program that calls curses's beep function (man beep) that reports what beep returns (the man page tells me that older versions always returned SuCCESS). beep returns -1, strerror returns SUCCESS.
Regarding the beep in general, can you share some info on your setup - distro, desktop, etc?
Regarding the ncurses sample program, I'm not an expert at this, but as far as I can tell, beep() calls putp(), which in turn calls tputs(). According to the tputs man page, "It does not detect I/O errors: X/Open states that tputs ignores the return value of the output function putc.". I read this as meaning beep should return OK if it could send the BELL request to the terminal, whether that produces a sound or not. This is what happened for me with alerts turned off in my desktop sound preferences.
the speaker no longer beeps no matter what you try? It might be that the speaker itself has gone out and needs replaced.
The speaker makes every other sound *but* the beep. The original IBM PC had a chip (the 8042) that controlled the keyboard but was also used for other purposes, among them generating sine waves. One programmed it by sending I/O to the 8042's port, first telling it what frequency to use then the length of time. Eventually IBM-type PCs no longer had 8042s or their ports. They either ignored attempts to write to the 8042's port or treated them as a privilege violation. For compatibility's sake some started capturing the attempt and making their own beep. This matters in some cases because some audio players lock out multiple attempts to make sound and some won't play from background, which means I won't hear a warning beep interrupt listening to the stuff I have playing.
I used to have IBM Thinkpads that had specially-privileged beeps. The drivers that come with the builtin audio (Realtek) have a special beep function, which has its own volume control. which dmesg reports as loading. I suppose it's possible there's a hardware failure that causes the beep to not-work while all other sound does.
I asked because the output of curses's beep on my system is ambiguous: -1 seems to report failure, errno=0 reports success. If beep() reports failure, then perhaps I have a software problem.
I tried booting into DOS and running the short assembler program that beeps, but that didn't work back when the beep worked. As near as I can tell Windoze doesn't make a 'real' beep.
The mixer for the builtin audio has a switch for the beep: it's off; I don't know how that happened: I've never turned it off.
Quote:
amixer -c 0 set Beep Playback Switch on
turns it on. I added this to rc.local.
Oddly, the beep program still makes no beep.
Quote:
echo -ne "\007"
does.
Aftermath: it stopped working again a few minutes later. Then my internal speakers stopped working but the audio to the jack started working (but ignores volume control). I think the audio chip is misbehaving.
Aftermath 2: After reboot the PCM control has disappeared, so I can't control the volume. An hour later it has returned. /proc/asound/timers doesn't report whether any audio is playing, as it used to: more data consistent with hardware misbehavior.
Last edited by RandomTroll; 05-03-2016 at 08:55 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.