Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Understanding the PC audio chain (Read 4974 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Understanding the PC audio chain

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!

Understanding the PC audio chain

Reply #1
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.

Understanding the PC audio chain

Reply #2
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

Understanding the PC audio chain

Reply #3
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.

Understanding the PC audio chain

Reply #4
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.

 

Understanding the PC audio chain

Reply #5
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).

Understanding the PC audio chain

Reply #6
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.

Understanding the PC audio chain

Reply #7
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 ?