WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Pc Speaker doesnt work  (Read 3326 times)

Offline newbie_es

  • Newbie
  • *
  • Posts: 5
Pc Speaker doesnt work
« on: July 16, 2009, 04:45:11 AM »
Im newbie in TC but Im in a hurry to make the pc speaker work.

I can't load pcspkr module, I think is compiled in the kernel, but how can I load it to make the beep work?

I have tried the 'beep' application, but it doesnt work because the module is not loaded...

Im not interested in loading alsa modules (if not necessary), I just need a beep from pcspekar for an application.

Thanks.

Offline newbie_es

  • Newbie
  • *
  • Posts: 5
Re: Pc Speaker doesnt work
« Reply #1 on: July 16, 2009, 01:39:54 PM »
I found the solution and I want to share it with all of you.

As I didn't have the pcspkr module, I looked for it in the internet, but I coudn't load it because it wasn't exactly the same version of core.

I got a module source file (pcspkr.c) and I tries to compile it in TC (after download make, gcc, linux-headers and some more extensions), but I didn't success. While I was trying to compile it, there was an error because I didn't find the "as" executable.

So I went back to my ubuntu 9.04 in my desktop pc, and I tried to compile it there. It compiled ok, but in the TC there was an error trying to load it with "sudo insmod pcspkr.ko".

The solution was to get the linux-headers from TC and compile the module in my Ubuntu 9.04 using the linux-headers of TC. It compiled ok and when I tried to load the module there was a satisfying beep :)
With lsmod I can see the module loaded.

Maybe it is too simple for all of you, but I think that it can be helpfull to some people like me, who don't know too much about linux and need to turn on the pc speaker.

P.S.: Sorry about my english, I know I have to improve it.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Pc Speaker doesnt work
« Reply #2 on: July 16, 2009, 01:47:57 PM »
Quote
While I was trying to compile it, there was an error because I didn't find the "as" executable.
The binutils.tcel extension provides the as command.
10+ Years Contributing to Linux Open Source Projects.

Offline newbie_es

  • Newbie
  • *
  • Posts: 5
Re: Pc Speaker doesnt work
« Reply #3 on: July 16, 2009, 01:51:35 PM »
Thanks for the info, I will try next time to compile it in TC.

Btw, is there any way to know if a file is in a extension without having to look for it one by one?

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Pc Speaker doesnt work
« Reply #4 on: July 16, 2009, 02:04:23 PM »
The info files is often times helpful to specify additional extensions usually required.
But to answer your question, no, not currently. You could grab all the .list files, merge, and grep.
10+ Years Contributing to Linux Open Source Projects.

Offline Sinclair

  • Newbie
  • *
  • Posts: 2
PC Speaker
« Reply #5 on: June 10, 2010, 07:48:18 PM »
I have the same problem, I tried to compile the module, but I have some errors:
asm/8253pit.h: No such file or directory
'struct input_dev' has no member named 'cdev'

Any idea or another solution ???

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: Pc Speaker doesnt work
« Reply #6 on: June 11, 2010, 02:15:19 AM »
the kernel-headers extension has i8253.h, this may work in place of 8253pit.h

try this:
Code: [Select]
ln -s i8253.h /usr/local/src/linux-headers-2.6.29.1/arch/x86/include/asm/8253pit.hThen recompile
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline ElmerFudd

  • Newbie
  • *
  • Posts: 2
Re: Pc Speaker doesnt work
« Reply #7 on: November 10, 2010, 10:08:13 AM »
I'm trying the same trick, but it doesn't work for me.

I downloaded the 2.6.33.3 kernel source, copied the pcspkr.c source file, made my own Makefile containing :

obj-m := pcspkr.o

and did:

make -C /usr/src/linux SUBDIRS=`pwd` modules

After I insmod pcspkr.ko I still get no beeps, even though I still get them from my old slackware distro. I can see with udevadm monitor that it loads and unloads, but it doesn't show up in /sys/devices/platform as I would suspect. What am I missing ?

Offline ElmerFudd

  • Newbie
  • *
  • Posts: 2
Re: Pc Speaker doesnt work
« Reply #8 on: November 11, 2010, 10:18:55 AM »
Apparently newer kernels requires a recompilation in order to support PC speaker, regardless of it being a module or not.

It seems a bit silly to me, as we are talking about 3 lines of code in the kernel, but there you go.