On 05/28/2011 12:50 PM, Alan Mackenzie wrote:
Hi, Gentoo.

It occurred to me the other day that I am clueless about how a sound
card works.  How do the data get into it?  Does the sound card use an
interrupt to ask for more data?

The data is placed in RAM. The card reads it from there using a DMA operation. You can read about it here:

http://en.wikipedia.org/wiki/Direct_memory_access


What form do the data take?

It's raw data, and its form depends on what the card is expecting. What the card is expecting is programmable by the card's driver.


Say I feed an mp3 through the card.  Does
the Athlon do the decompression, or does the sound card do it?

The MP3 is decoded by your CPU (by software like libmad, xine, gstreamer, etc.) The decoded data is send to the driver, the driver applies any needed conversions to it (according to what the card expects), and then places it in RAM so the card can get it by means of DMA.


Last of all, is there a command line program which can play a CD by
feeding its data into the sound card?

Today this works the same playing any other audio. The fact that audio in this case comes from a CD doesn't matter. An application reads the audio from the CD, sends it to the driver, and from there it gets to the sound card.


Reply via email to