[LAD] PCM player as kernel module

Jens M Andreasen jens.andreasen at comhem.se
Thu Nov 1 14:09:54 UTC 2007


On Wed, 2007-10-31 at 18:48 +0530, Avadhoot Punde wrote:
> Hi all
> 
> As part of a bigger project, I need to develop a module which reads
> PCM data from a file and feeds it to sound driver. Is it possible to
> develop such a module without actually writing device driver, I mean
> just by using existing functions such as snd_pcm_open and all that ?
> Can someone throw more light on this ? 
> 

For an example of how to use ALSA, you may want to have a look at this
kit:

  http://amirhirsch.com/ps3synth.tar


$ tar -xf ps3synth.tar && cd ps3synth

If you are on Intel hardware, you'll need to edit line 49 in play.c
from:

  // Signed 16-bit big-endian format 
  snd_pcm_hw_params_set_format(handle, params,
                              SND_PCM_FORMAT_S16_BE);
  
.. to:

  // Signed 16-bit little-endian format 
  snd_pcm_hw_params_set_format(handle, params,
                              SND_PCM_FORMAT_S16_LE);
 
.. and then:

$ make && ./square|./filter|./play

Despite the name of the archive, this is all standard C.

> Regards,
> Avadhoot 
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev at lists.linuxaudio.org
> http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
-- 




More information about the Linux-audio-dev mailing list