[alsa-devel] Writing a new sound driver

Eliot Blennerhassett linux at audioscience.com
Sun Aug 12 05:02:09 CEST 2007


Hi Mike,

On Sunday 12 August 2007 10:46:07 Michael Bourgeous wrote:
> I am the developer of the work-in-progress MyHD/TL880 Linux driver.
> The TL880 chip can act as a sound input and output device, but it
> doesn't seem to support DMA for sound.  Is it possible to write a
> sound driver for ALSA that uses a polling mechanism?  

Yes.

Read about the copy and silence callbacks here:
http://www-old.alsa-project.org/~iwai/writing-an-alsa-driver/x1409.htm

Get the alsa-driver source code and grep -r "\.copy" to find drivers that use 
this method. E.g. RME, asihpi

Does it support interrupts?
If so see 
http://www-old.alsa-project.org/~iwai/writing-an-alsa-driver/x773.htm

otherwise you need to use a timer to poll the transfer status and call
snd_pcm_period_elapsed appropriately  similar to the High-frequent timer 
interrupts section of the above reference.  

> Also, how would 
> I integrate this driver with my core driver for accessing the TL880?
> The chip's features span four separate kernel subsystems: v4l, dvb,
> sound, and fb.

What are dependencies if any between these functions on the chip?

> I guess my main question is this: what is the bare minimum of code and
> hardware functionality required to write a sound driver?

The "dummy" driver provides a starting point to which you can add your own 
functionality.

For alsa driver code implementing mixer controls is almost completely 
independent of audio I/O (apart from very top level where they belong to the 
same card object), so you can leave it out to start with,  unless you need to 
set some controls to get audio out!

--
Eliot



More information about the Alsa-devel mailing list