beep broken in 10.04 ?

Asked by Roland Burton

I recently upgraded from the previous LTS to 10.4 and now beep doesn't emit any sound. I use beep a lot for programming, especially Qt, so it is important to me. Simply, typing "beep" at a terminal doesn't beep. Is this a known problem? A feature of rewriting the sound system? Can I revert to something that works for beep, even though it doesn't include the nice sounds from the new sound system?

Thanks for your extensive discussion. It helped me a lot.

By including:

rmmod pcspkr || true
modprobe pcspkr || true

in file: /etc/rc.local

Then the beep function is started at login.
However, I wanted to use the beep in KAlarm, and the beep function of KAlarm (a Qt function) does not work.
Fortunately KAlarm allows to start up an arbitrarily function at an alarm, so I chose to start-up "beep" with an alarm, and that works.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu beep Edit question
Assignee:
No assignee Edit question
Solved by:
Uwe Geuder
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Uwe Geuder (ubuntulp-ugeuder) said :
#1

You are correct. It just doesn't seem to work anymore. Time to file a bug?

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#2

Please read https://bugs.launchpad.net/ubuntu/+source/beep/+bug/478669 and try the workaround in that thtread.

Hth

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

in short from terminal type:

sudo modprobe pcspkr

then try beep:

beep -f 300.7 -r 2 -d 100 -l 400

if works please add the pcspkr at the end of the /etc/modules so the kernel module will be loaded at pc boot, type:

gksudo gedit /etc/modules

and add the row

pcspkr

save and exit

Hope this helps

Revision history for this message
Uwe Geuder (ubuntulp-ugeuder) said :
#4

I found this bug report:

https://bugs.launchpad.net/bugs/331589

The problem seems to have been that on some system the beep was extremely loud. Could it been that the work around has been to disable it for all systems just to protect the users' ears? I didn't have the time to read the whole discussion now.

Anyway the one-time solution is:

sudo modprobe pcspkr

(at least for my sound card the volume is OK)

The permanent solution is probably to remove/comment the line

blacklist pcspkr

from /etc/modprobe.d/blacklist.conf

Revision history for this message
Roland Burton (rwburton) said :
#5

Thanks folks for a speedy and complete solution!

Revision history for this message
Roland Burton (rwburton) said :
#6

Whoops, speedy but

1) Sudo modprobe restores the beep if we type beep from the terminal. OK

2) Commenting out the blacklist entry had no obvious effect at that point, as beep was restored.

3) in Qt, Qt QApplication::beep(); still does not beep.

4) rebooting cause the computer to lose the beep typed from terminal; restored by (1) as above.

Revision history for this message
Uwe Geuder (ubuntulp-ugeuder) said :
#7

> 2) Commenting out the blacklist entry had no obvious effect at that point, as beep was restored.

That's expected. The blacklist change was intended for the next reboot.

> 4) rebooting cause the computer to lose the beep typed from terminal; restored by (1) as above.

The modprobe is only valid until the next reboot. That's by design.

In order to get it loaded automatically, it must not be blacklisted. If it does not get loaded on reboot even after its no longer blacklisted, you might want to try the suggestion by marcobra above. Add it the /etc/modules. (I don't know exactly whether this is required in this case. Many other modules get loaded without being listed in that file. I haven't had time to test it myself now)

> 3) in Qt, Qt QApplication::beep(); still does not beep.

OK, so Qt uses obviously a different mechanism than the pcspkr kernel module. I have no idea how it works. Qt this open source. So read the source and check what Qt beep does! Sorry ;)

Revision history for this message
Roland Burton (rwburton) said :
#8

So lets forget about the Qt problem; I'll deal with it later. Here's two things I did that doesn't make sense to me, but it might to you

1)restart no-modification install
2)beep doesn't work
3)sudo modprobe pcspkr
4)beep works MAKES SENSE
5)sudo gedit /etc/modprobe.d/blacklist.conf (and comment out "blacklist pcspkr")
6)beep still works MAKES SENSE
7)restart
8)beep doesn't work (5) DOESN"T MAKE BEEP PERMANENT
9)sudo modprobe pcspkr
10)beep doesn't work SURPRISE (5) MAKES (3) NOT WORK

In other words commenting out "blacklist pcspkr" somehow makes sudo modprobe pcspkr not work any more. This is reversible.

repeat steps 1-10 (after undoing 5), but replace 5 with sudo gedit /etc/modules (and add pcspkr) and we get the same result

In othr words, adding pcspkr to /etc/modules somehow makes sudo modprobe pcspkr not work any more. This is reversible.

Let's not lose track of what I am trying to do, which is to permanently restore the beep. The above may be useful to you but it didn't permanently restore the beep. I can always do (3) each time I need the beep, of course.

Back in the days, I used to stuff a sock in the speaker if the beep was annoying. I feel that many changes have been made and they haven't been integrated very well. I can now make an excellent barking dog sound from the gui that looks like a speaker (but doesn't seem to have any identification on it so I can refer to it by name) Soon I would like my program to bark like a dog, after I get the beep back. Am I asking for too much?

I would never uninstall Lucid and install Vista, that is just too weird, but if there was an easy way to get Hardy back, I'd be tempted.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#9

Please add the pcspkr at the end of the /etc/modules so the kernel module will be loaded at pc boot, type:

gksudo gedit /etc/modules

and add the row

pcspkr

save and exit then reboot and try

Hope this helps

Revision history for this message
Roland Burton (rwburton) said :
#10

Thanks, Marco. I think I followed your instruction exactly
1) Added pcspkr to /etc/modules
2) rebooted
3) checked for beep at terminal, no beep
---So Marco's recommendation doesn't fix it

4) Then I typed sudo modprobe pcspkr (which should install pcspkr temporarily)
5) checked for beep, still no beep
---Marco's recommendation disables installing the temporary fix

6) removed pcspkr from /etc/modules
7) rebooted
8) checked for beep, no beep
9) I typed sudo modprobe pcspkr (which should install pcspkr temporarily)
10) beep works now

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#11

Very strange can you test again and please verify if the pcspkr modle is loaded with this command:

lsmod | grep -i pcspkr

Thank you

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#12

The /etc/modules must grant the loading of the kernel module at startup so is pretty the same as typing:

sudo modprobe pcspkr

So please insert the row into the /etc/modules then reboot your pc

Try beep

beep -f 300.7 -r 2 -d 100 -l 400

if don't works please verify if the kernel module is loaded:

lsmod | grep -i pcspkr

if is loaded please unload it:

sudo rmmod pcspkr

then reload and test beep:

sudo modprobe pcspkr

and test beep:

beep -f 300.7 -r 2 -d 100 -l 400

If works might be you have to dress/add some option to the /etc/modules file.

BTW in my env, Ubuntu 10.04 32 bits, beep is working good and i have the module loaded at startup by inserting the row into the /etc/modules file without any additional option...

Please also verify you have not blacklisted the module into the /etc/modprobe.d/blacklist.conf file.

Hth

Revision history for this message
Roland Burton (rwburton) said :
#13

1) remove pcspkr from blacklist
2) insert pcspkr into /etc/modules
3) boot
4) check for beep -> NO BEEP
5) lsmod | grep -i pcspkr ->pcspkr 1518 0
6) sudo rmmod pcspkr
7)sudo modprobe pcspkr
8) check for beep -> BEEPS OK

"If works might be you have to dress/add some option to the /etc/modules file."
Any sugggestions on what to add?

When I do sudo modprobe pcspkr, (which apparently works) I get the following

WARNING: All config files need .conf: /etc/modprobe.d/alsa-base, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/blacklist-modem, it will be ignored in a future release.

Sounds like this is telling me I must edit some mysterious config file, maybe?

Revision history for this message
Best Uwe Geuder (ubuntulp-ugeuder) said :
#14

Thanks Roland for your detailed testing and the list 1) - 10) above.

I agree it doesn't make sense.

From your last post with the list 1) - 8) it looks like 2 things are not equivalent:

1) pcspkr module loaded
2) terminal beep works

In other words if pcspkr is loaded during boot (in the way you did it), terminal beep does not work.

If pcspkr module is loaded manually after beep terminal beep works.

I guess this is some sequence problem.

I don't have the time to test right now, but I could speculate something along these lines:

Could it be that alsa/pulseaudio initiailization somehow resets the PC speaker system? So if pcspkr get loaded too early, it will be reset and become non-functional later in the startup. If you load it manually later it just works fine, because nobody touches it anymore.

As said I don't have time to investigate this in depth right now. A work-around would probably be to put the pcspkr module loading into you desktop startup. For a real solution one would probably need to study the various bugs that seem to be open already in this area and do more investigations.

Revision history for this message
Roland Burton (rwburton) said :
#15

This is a can of worms, and I don't want you to fix it for me, I want you to fix it for Ubuntu. I don't have the background to fix it or I would; I have the time. It seems to me that regardless of hardware differences and perhaps "order of install" issues, we have the following things happening in Ubuntu
1) Programmers who are working on their own problem, just want to have beep back working like it used to.
2) People using Ubuntu in libraries want a very quiet beep, or none at all.
3) People demanding progress want to change the pitch or loudness or many other options
4) the GUI people want a nice dialog where they can set everything.
5) People who want excellent audio, want to integrate all of the above.

So, no it isn't fixed for me and I'm trying to see if I can regress to Hardy, or perhaps to fedora,

If I choose "fixed my problem" will this tell you that Ubuntu is OK, or will it tell you that you shouldn't be wasting time on this one?