LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-01-2009, 01:01 PM   #1
wilson47
Member
 
Registered: Jan 2009
Posts: 50

Rep: Reputation: 15
No System Beep on Dell inspiron 1420


I dual boot slackware 12.2 and Ubuntu 8.10 on my laptop. I don't have a default system beep on
my computer, which can be annoying at times. Sometimes, after doing a pm-suspend in Ubuntu,
the system beep will work for a little while when I am on the console. Any help would be
great!
 
Old 05-01-2009, 04:01 PM   #2
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
There is a package in ubuntu you can install called
Code:
beep
believe it or not, and you can install it using
Code:
sudo apt-get install beep
and you can find more information on how to configure it here: http://packages.ubuntu.com/hardy/beep I have unzipped the man page, and am posting it here for you to read:
Code:
.TH BEEP 1 "November 2006"
.SH NAME
beep \- beep the pc speaker any number of ways
.SH SYNOPSIS
.B beep
[\-\-verbose | \-\-debug] [\-e device | \-\-device device] [\-f N] [\-l N] [\-r N] [\-d N] [\-D N] [\-s] [\-c]
.HP
.B beep
[ OPTIONS ] [-n] [--new] [ OPTIONS ]
.HP
.B beep
[\-h] [\-\-help]
.HP
.B beep
[\-v] [\-V] [\-\-version]
.SH DESCRIPTION
.PP
\fBbeep\fR allows the user to control the pc-speaker with precision, allowing different sounds to indicate different events.  While it can be run quite happily on the command line, it's intended place of residence is within shell/perl scripts, notifying the user when something interesting occurs.  Of course, it has no notion of what's interesting, but it's real good at that notifying part.
.PP
All options have default values, meaning that just typing '\fBbeep\fR' will work.  If an option is specified more than once on the command line, subsequent options override their predecessors.  So '\fBbeep\fR \-f 200 \-f 300' will beep at 300Hz.
.SH OPTIONS
.TP
\fB\-\-verbose\fR, \fB\-\-debug\fR
enable debug output. This option prints a line like the following before each
beep:

[DEBUG] 5 times 200 ms beeps (100 delay between, 0 delay after) @ 1000.00 Hz
.TP
\fB\-e\fR device, \fB\-\-device\fR device
use device as event device. If the switch isn't used, /dev/tty0 and /dev/vc/0 are tried in turn.
.TP
\fB\-f\fR N
beep at N Hz, where 0 < N < 20000.  As a general ballpark, the regular terminal beep is around 750Hz.  N is not, incidentally, restricted to whole numbers.
.TP
\fB\-l\fR N
beep for N milliseconds.
.TP
\fB\-r\fR N
specify the number of repetitions (defaults to 1).
.TP
\fB\-d\fR N, \fB\-D\fR N
specify a delay of N milliseconds between repetitions.  Use of \-d specifies that this delay should only occur \fIbetween\fR beeps, that is, it should not occur after the last repetition.  \-D indicates that the delay should occur after every repetition, including the last.  Normally, \-d is what you want, but if, for example, you are stringing several \fBbeep\fR commands together to play the star wars anthem, you may want control over every delay.
.TP
\fB\-n\fR, \fB\-\-new\fR
this option allows you to break the command line up into specifying multiple beeps.  Each time this option is used, beep starts treating all further arguments as though they were for a new beep.  So for example:

\fBbeep\fR -f 1000 -n -f 2000 -n -f 1500

would produce a sequence of three beeps, the first with a frequency of 1000Hz (and otherwise default values), then a second beep with a frequency of 2000Hz (again, with things like delay and reps being set to their defaults), then a third beep, at 1500Hz.  This is different from specifying a -r value, since -r repeats the same beep multiple times, whereas -n allows you to specify different beeps.  After a -n, the new beep is created with all the default values, and any of these can be specified without altering values for preceeding (or later) beeps.  See the \fBEXAMPLES\fR section if this managed to confuse you.
.TP
\fB\-s\fR, \fB\-c\fR
these options put \fBbeep\fR into input-processing mode.  -s tells \fBbeep\fR to read from stdin, and beep after each newline, and -c tells it to do so after every character.  In both cases, the program will also echo the input back out to stdout, which makes it easy to slip \fBbeep\fR into a text-processing pipeline, see the \fBEXAMPLES\fR section.
.TP
\fB\-h\fR, \fB\-\-help\fR
display usage info and exit
.TP
\fB\-v\fR, \fB\-V\fR, \fB\-\-version\fR
display version information and exit
.SH EXAMPLES
.TP
At its simplest (yet still effective)

\fBbeep\fR
.TP
A more interesting standalone setup

\fBbeep\fR -f 300.7 -r 2 -d 100 -l 400
.TP
As part of a log-watching pipeline

tail -f /var/log/xferlog | grep --line-buffered 'passwd' | \\
.br
\fBbeep\fR -f 1000 -r 5 -s
.TP
When using -c mode, I recommend using a short -D, and a shorter -l, so that the beeps don't blur together.  Something like this will get you a cheesy 1970's style beep-as-you-type-each-letter effect

cat file | \fBbeep\fR -c -f 400 -D 50 -l 10

.TP
A highly contrived example of -n/--new usage

\fBbeep\fR -f 1000 -r 2 -n -r 5 -l 10 --new 

will produce first two 1000Hz beeps, then 5 beeps at the default tone, but only 10ms long each, followed by a third beep using all the default settings (since none are specified).
.PP See also the \fBFREQUENCY TABLE\fR below.

.SH IOCTL WACKINESS
.PP
Some users will encounter a situation where beep dies with a complaint from ioctl().  The reason for this, as Peter Tirsek was nice enough to point out to me, stems from how the kernel handles beep's attempt to poke at (for non-programmers: ioctl is a sort of catch-all function that lets you poke at things that have no other predefined poking-at mechanism) the tty, which is how it beeps.  The short story is, the kernel checks that either:
.PP
- you are the superuser
.PP
- you own the current tty
.PP
What this means is that root can always make beep work (to the best of my knowledge!), and that any local user can make beep work, BUT a non-root remote user cannot use beep in it's natural state.  What's worse, an xterm, or other x-session counts, as far as the kernel is concerned, as 'remote', so beep won't work from a non-priviledged xterm either.  I had originally chalked this up to a bug, but there's actually nothing I can do about it, and it really is a Good Thing that the kernel does things this way.  There is also a solution.
.PP
By default beep is not installed with the suid bit set, because that would just be zany.  On the other hand, if you do make it suid root, all your problems with beep bailing on ioctl calls will magically vanish, which is pleasant, and the only reason not to is that any suid program is a potential security hole.  Conveniently, beep is very short, so auditing it is pretty straightforward.
.PP
Decide for yourself, of course, but it looks safe to me - there's only one buffer and fgets doesn't let it overflow, there's only one file opening, and while there is a potential race condition there, it's with /dev/console.  If someone can exploit this race by replacing /dev/console, you've got bigger problems.  :)
.PP
So the quick, only, and likely safe solution if beep is not beeping when you want it to is (as root):
.PP
# chmod 4755 /usr/bin/beep
.PP
(or wherever you put it)
.PP
The one snag is that this will give any little nitwit the ability to run beep successfully - make sure this is what you want.  If it isn't, a slightly more complex fix would be something like:
.PP
# chgrp beep /usr/bin/beep

# chmod 4750 /usr/bin/beep

.PP
and then add only beep-worthy users to the 'beep' group.
.SH FREQUENCY TABLE
.PP
Several people have asked for some basic help translating music notes to frequencies.  There are a lot of music notes, and several tables online will give you translations, but here are \fIapproximate\fR numbers for the octave of middle C, to get you started.
.PP
Note		Frequency
.ft CW
.nf
C		261.6
C#		277.2
D		293.7
D#		311.1
E		329.6
F		349.2
F#		370.0
G		392.0
G#		415.3
A		440.0
A#		466.2
B		493.9
C		523.2
.ft R
.SH BUGS
.PP
None that I'm aware of, though see the \fBIOCTL WACKINESS\fR section.
.SH REPORTING BUGS
Report bugs to <johnath@johnath.com>
.SH AUTHOR
.PP
This program was written by Johnathan Nightingale (johnath@johnath.com) and is distributed under the GNU General Public License.  For more contributing information, check the source, and past contributors can be found in CREDITS.

Last edited by irishbitte; 05-01-2009 at 04:02 PM.
 
Old 05-01-2009, 04:18 PM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
look in
/etc/modprobe.d/blacklist
to see if the pc speaker isn't blacklisted

depending on the terminal, look in the conf for
xset b off
or
set bell-style none

make sure if you use gnome:
Applications > Accessories > Terminal
beep is enabled.
 
Old 05-02-2009, 01:03 AM   #4
wilson47
Member
 
Registered: Jan 2009
Posts: 50

Original Poster
Rep: Reputation: 15
First off, thanks for the replys!

I installed the "beep" program in Ubuntu, but that still did not produce any sound. I also checked the blacklist file, and the pc speaker isn't listed anywhere. Also, system bell is checked on in the gnome-terminal in Ubuntu. I also didn't see any of those other things that turn of the pc speaker in the conf files...

Can alsamixer control the pc speaker? Could I have it muted/turned off somewhere else?

Thanks for your help,
Glen
 
Old 05-02-2009, 03:26 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
is the speaker connected ?
 
Old 05-02-2009, 02:28 PM   #6
wilson47
Member
 
Registered: Jan 2009
Posts: 50

Original Poster
Rep: Reputation: 15
I think it has to be, as it does work sometimes after a pm-suspend. I've only noticed that
on Ubuntu. Is there any other way that the internal speaker gets turned on, that possibly
pm-suspend is doing?
 
Old 05-04-2009, 09:53 AM   #7
wilson47
Member
 
Registered: Jan 2009
Posts: 50

Original Poster
Rep: Reputation: 15
It looks like this is the exact same problem I am having:
http://fixunix.com/debian/536822-bug...kr-loaded.html

From what I can tell, Slackware 12.2 is not using alsa-driver-1.0.18, so does anybody know if there is a fix? I'll check to see if there is a way to upgrade to the newest version. If anybody has any tips that would be great too.
 
Old 05-04-2009, 12:09 PM   #8
wilson47
Member
 
Registered: Jan 2009
Posts: 50

Original Poster
Rep: Reputation: 15
hello,
after going through my logs after doing a pm-suspend on Ubuntu, I noticed that the beep stops working when I change the sound levels in alsamixer. The message sent at this time is:

Code:
May  4 18:24:28 gordan-the-pig kernel: [  650.692145] hda_intel: azx_get_response timeout, switching to polling mode: last cmd=0x00cf1c00
Anybody know what this is about?
 
Old 05-04-2009, 05:04 PM   #9
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
polling mode means it won't sit waiting for ever, but will poll the device periodically to see if it has 'recovered'. I'd say your speaker is fried, but that is not an expert opinion by any means. YMMV.
 
Old 05-06-2009, 04:20 AM   #10
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
hi

me thinks its the pcspkr module he wants...to use the case speaker?


Code:
su
modprobe pcspkr
if it works...locate modprobe to get full path to executable on your distro and add a line to rc.local

eg

/sbin/modprobe pcspkr

Last edited by aus9; 05-06-2009 at 04:22 AM.
 
Old 05-06-2009, 09:22 AM   #11
wilson47
Member
 
Registered: Jan 2009
Posts: 50

Original Poster
Rep: Reputation: 15
Thank you all for the help, but I seemed to find a hack sufficient enough for my means. I found a solution which is mentioned in this thread: http://www.linuxquestions.org/questi...d-card-723900/

None of the scripts that came with it worked, but after searching around, I finally found one that worked well enough. The script was called "playbeepd", but as I do not recall the website or the author, I will not post the code. If anybody is interested, send me a message and I can send it to you.

Thanks once again for the help. I have learned quite a bit about how the modules work from it.
 
Old 05-06-2009, 11:45 AM   #12
amysaraantony
Member
 
Registered: Apr 2009
Posts: 42

Rep: Reputation: 16
Looks like a hardware issue to me my friend ... Contacting your Vendor/Nearest Service Center should be first on your priority list !

Debian

Last edited by amysaraantony; 05-15-2009 at 08:13 PM.
 
Old 05-06-2009, 07:54 PM   #13
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
glad you got sorted, if you've anyway of explaining what you did to solve the problem, make and model of computer, speaker etc., please do post it, you may help someone else down the line!
 
Old 05-07-2009, 02:04 AM   #14
wilson47
Member
 
Registered: Jan 2009
Posts: 50

Original Poster
Rep: Reputation: 15
So here is a summary of what I did:

1. Realized that there was no kernel module setting that was getting in my way. That is, the pcspkr module was loaded
and not blacklisted. You can find this stuff in /etc/modules.d or similar.

2. Confirmed that the internal speaker did work, that is, it was plugged in, and was in fact able to make noise,
although only loudly, and under very special circumstances.

3. Having given up on getting my internal pc speaker to work (it still would be nice if I could get it to), I looked
into diverting the beep signals that get sent to pcspkr to go play a sound through my sound card/normal
speakers/whatever the proper terminology is, instead.

4. There are a few packages out there, although not all seemed to work for me. There is softbeep found here:
http://0pointer.de/lennart/projects/softbeep/ , which did not cut it for me on Slackware 12.2 or Ubuntu 8.10. Also those
links to the package don't work, and you might need to do some more searching. They are in the Ubuntu repositories at
least, and no compiling is necessary.

5. Since softbeep didn't work, I looked furter and eventually found the Fancy Beeper Daemon which created a new device
at /dev/beep that can capture the beep signals and execute a command to play a .wav via a number of ways. You can find
the package here: http://www.carcosa.net/jason/software/beep/ .

6. This program compiled fine in Ubuntu 8.10, but I needed to download the kernel source to get it to compile in
Slackware 12.2. I found that rather confusing, as the error I got seemed to mean that I didn't have the kernel header
files, which I did. I guess there was a terminology problem somewhere. Anyway, that should indeed compile with the
provided install script.

7. For me, none of the provided daemons worked. I searched around and found the following one from
http://www.shallowsky.com/blog/linux/custom-beep.html . I don't want to reproduce the code here, solong as the link
still works.

8. To finish it all up, I added a file to /etc/rc.d to get everything to run at boot. I called it rc.beep and it
contains:

Code:
#!/bin/bash

/sbin/modprobe beep
/usr/bin/playbeepd &
You will also have to move the script to wherever you want it, and make sure the sound file in the script exists. You
can alternatively give the correct sound file as an argument. I sadly do not know enough about programming to figure out
how to make a real daemon, but this seemed to work well enough.

9. After a pm-suspend, the script got killed for some reason, so, making the daemon still needs to be perfected.

10. Does anybody know how to make slackware handle more than one sound being sent to the audio device? Can it pause the
one playing to play a new sound? That is about the last thing on my list of issues.

I hope this helps!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best distro for a Dell Inspiron 1420 (NOT the 1420n)? futurer0ckstar General 9 09-19-2008 07:44 PM
Unable to install Fedora 8 in my Dell Inspiron 1420 alok.kulkarni Linux - Laptop and Netbook 3 08-22-2008 12:49 AM
all driver for Dell inspiron 1420 rx_b10 Linux - Laptop and Netbook 3 06-16-2008 04:02 PM
suse 10.0 on Dell Inspiron 1420 ankit_mcgill Linux - Newbie 2 10-06-2007 08:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration