1 |
On 05/28/2011 12:50 PM, Alan Mackenzie wrote: |
2 |
> Hi, Gentoo. |
3 |
> |
4 |
> It occurred to me the other day that I am clueless about how a sound |
5 |
> card works. How do the data get into it? Does the sound card use an |
6 |
> interrupt to ask for more data? |
7 |
|
8 |
The data is placed in RAM. The card reads it from there using a DMA |
9 |
operation. You can read about it here: |
10 |
|
11 |
http://en.wikipedia.org/wiki/Direct_memory_access |
12 |
|
13 |
|
14 |
> What form do the data take? |
15 |
|
16 |
It's raw data, and its form depends on what the card is expecting. What |
17 |
the card is expecting is programmable by the card's driver. |
18 |
|
19 |
|
20 |
> Say I feed an mp3 through the card. Does |
21 |
> the Athlon do the decompression, or does the sound card do it? |
22 |
|
23 |
The MP3 is decoded by your CPU (by software like libmad, xine, |
24 |
gstreamer, etc.) The decoded data is send to the driver, the driver |
25 |
applies any needed conversions to it (according to what the card |
26 |
expects), and then places it in RAM so the card can get it by means of DMA. |
27 |
|
28 |
|
29 |
> Last of all, is there a command line program which can play a CD by |
30 |
> feeding its data into the sound card? |
31 |
|
32 |
Today this works the same playing any other audio. The fact that audio |
33 |
in this case comes from a CD doesn't matter. An application reads the |
34 |
audio from the CD, sends it to the driver, and from there it gets to the |
35 |
sound card. |