Unix Programming - accessing the sound card from a module

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > August 2006 > accessing the sound card from a module





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author accessing the sound card from a module
Yellow

2006-08-28, 1:42 pm

hi there,
I've just started learning how to create kernel modules. I already
created some really simple modules, and they ran fine. But now I have
an issue: I want to record 3 seconds of sound, and then play it. But I
don't know how to use the soundcard from within kernel space. I made a
program in user space that manages to do it, by reading and writing to
/dev/dsp. but I'm not managing to do this from the kernel, because it
complains that it can't find the open, close and write symbol. maybe
modules can't call these functions.
Does any one here know how to use devices from the kernel? do I need to
use some kernel structures? how can I find some information on it?
sorry for such newbie question.
regards,

Bo Yang

2006-08-30, 1:33 pm


Yellow wrote:
> hi there,
> I've just started learning how to create kernel modules. I already
> created some really simple modules, and they ran fine. But now I have
> an issue: I want to record 3 seconds of sound, and then play it. But I
> don't know how to use the soundcard from within kernel space. I made a
> program in user space that manages to do it, by reading and writing to
> /dev/dsp. but I'm not managing to do this from the kernel, because it
> complains that it can't find the open, close and write symbol. maybe
> modules can't call these functions.
> Does any one here know how to use devices from the kernel? do I need to
> use some kernel structures? how can I find some information on it?
> sorry for such newbie question.
> regards,

I am not very good at kernle programing , but I have readed some kernel
codes . Do you know , when the kernel find it need a module to be
loaded
what will it do ? Yes , it call the function called user_helper to do
that . And
this function will fork a new process and set the enviroment and then
execute the modprobe command to complete the task .
I think you can just do your work in the same way ?
What is your opinion ?

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com