HydrogenAudio

CD-R and Audio Hardware => Audio Hardware => Topic started by: goodsound on 2006-05-11 17:13:05

Title: Understanding the PC audio chain
Post by: goodsound on 2006-05-11 17:13:05
I want to learn more about the entire PC audio chain. More specifically how and what components (hardware and software) does the audio data flow through between the source (harddisk, cd-drive) and the speakers. i.e. once it is put on the IDE bus what happens to it until it reaches the DAC. And a little bit information on what is the role of each component in the chain.

I believe Pohlmann's 4th ed book has a new chapter added on "PC Audio" but I haven't got my hands on it yet or dont know how much it would cover. Or if you could suggest some other reading or some links to some online reading would be great!

Thanks!
Title: Understanding the PC audio chain
Post by: hankwang on 2006-05-13 21:44:56
once it is put on the IDE bus what happens to it until it reaches the DAC. And a little bit information on what is the role of each component in the chain.

Why would you want to know this? A program (process) opens  a file through the operating system, reads the data, and sends it to the soundcard driver that is in the operating system. The soundcard driver is usually not your business and implemented very differently depending on whether you run Windows, Linux, or OSX. If the soundcard uses DMA, the OS tells the card, which is on the PCI bus, at which memory location the audio data is residing, along with the sample rate/channels/bit depth, after which the soundcard reads the data by itself. When the soundcard is finished reading and playing, it gives an interrupt that signals the OS that the data transfer is ready and the OS puts fresh data into the buffer, and signals the user process that it needs fresh data.

I believe that with most general-purpose soundcards, the DSP on the soundcard does the mixing, sample-rate conversion, and volume adjustments all digitally, after which it is sent to the DAC.
Title: Understanding the PC audio chain
Post by: MikeFord on 2006-05-15 06:02:03
The hardware side I think is kind of "techy" and boring, chunks of data move from storage to some kind of buffer on the card, and the card clocks it out to the DAC or port or whatever.

The software is much more of a "routine shuttle launch" mess. I don't really understand all of what goes on in Windows (let alone anything else), but I think there is some issue about windows "mixer" that apparently likes to scale the data that passes through it. Its enough of a pest that something called ASIO was created, and its some kind of direct software path
Title: Understanding the PC audio chain
Post by: goodsound on 2006-05-15 17:20:14
Quote
A program (process) opens a file through the operating system, reads the data, and sends it to the soundcard driver that is in the operating system.

As MikeFord indicated, via the windows mixer before the soundcard driver processes it ?

That’s the kind of information I am seeking. The “flow” of the digital audio data inside the pc. Maybe I’ll try re-phrasing my question/requirement -

I am particularly interested in knowing about components in the flow of digital audio data that do any kind of processing(dsp, resampling,etc..) on the data, be it hardware or software. Although in this regard, it doesn’t look like there will be much hardware in the way of the data, so I don’t know if this thread should be in the hardware forum or not.
Title: Understanding the PC audio chain
Post by: Firon on 2006-05-15 18:33:48
Your program outputs decoded audio with waveOut or DirectSound, which passes the audio through kmixer (which may resample and apparently always dithers), and then kmixer sends it to the card's drivers, I would assume. The drivers then probably send it to the DSP, where it gets resampled to 48KHz on most consumer cards, then it probably goes to the DAC.
Title: Understanding the PC audio chain
Post by: goodsound on 2006-05-15 22:22:35
Thanks Firon, that helped. I think we are headed in the right direction. Now I understand why people talk about using KS and ASIO, instead of wO and DS. Because KS and ASIO allow you to bypass the kmixer.
(That confirms I have a problem with KS and WDM in my Windows(Me) setup, I will start a seperate thread for that).
Title: Understanding the PC audio chain
Post by: hankwang on 2006-05-16 10:14:08
Quote
As MikeFord indicated, via the windows mixer before the soundcard driver processes it ?

I don't know much about Windows, but I'm pretty sure that most of the mixing and resampling (CD, mic, pc speaker, line in, PCM, balance, master volume, etc.) is done inside the soundcard. The windows mixer (sound daemon in Linux) only needs to mix the PCM sound data from different programs, and resample if the different programs are using different sampling frequencies, before sending it to the sound card.
Title: Understanding the PC audio chain
Post by: goodsound on 2006-05-17 17:45:27
now where does WDM fit into this puzzle ?

Seems like KS is a part of WDM(?). In that case if I have WDM drivers from the soundcard installed, does that mean it is bypassing kmixer (and using KS instead) anyway ?