Re: [LAD] PCM player as kernel module

From: Jens M Andreasen <jens.andreasen@email-addr-hidden>
Date: Thu Nov 01 2007 - 16:09:54 EET

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@email-addr-hidden
> http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev

-- 
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Thu Nov 1 16:15:03 2007

This archive was generated by hypermail 2.1.8 : Thu Nov 01 2007 - 16:15:03 EET