Try to answer before you open the answers. Guessing is fine; checking your guess is how you learn.
QUICK REVIEW (5 minutes)
- What do a DAC and an ADC do?
- Where does the DAC live on a typical PC, and how does the codec connect to the chipset?
- What is audiodg.exe, and what jobs does it do?
- Name the two Windows services that run the audio system.
- What is the difference between shared mode and exclusive mode?
- What is an audio endpoint? Give two examples.
- Why is 44.1 kHz enough for human hearing?
- What is the data rate of CD audio (44,100 Hz, 16-bit, stereo)?
- What is a buffer underrun, and what does it sound like?
- Is FLAC lossless or lossy? Is MP3?
ANSWER KEY — DO NOT READ UNTIL YOU'VE ANSWERED
Click to reveal answers
1. DAC and ADC
A DAC turns numbers into a smooth electric wave (for speakers). An ADC measures an electric wave and turns it into numbers (for microphones).
2. Where the DAC lives
In the audio codec chip on the motherboard (often a Realtek chip, but check yours). The codec connects over a small serial link to the HD Audio controller in the chipset.
3. audiodg.exe
Windows Audio Device Graph Isolation. It is the audio engine process: it mixes all apps' streams, applies volume and effects (APOs), and converts sample rates.
4. The two services
Windows Audio (Audiosrv) and Windows Audio Endpoint Builder (AudioEndpointBuilder).
5. Shared vs exclusive
In shared mode the engine mixes all apps in one agreed format. In exclusive mode one app talks to the device buffer directly, giving lower delay but no mixing and no other sounds.
6. Endpoint
The thing sound goes to or comes from. Examples: Speakers, Headphones, Microphone, a Digital output such as HDMI.
7. 44.1 kHz
Human hearing reaches about 20 kHz. By the Nyquist rule you must sample at more than twice the highest frequency, so about 40 kHz. 44.1 kHz covers that.
8. CD data rate
44,100 × 16 × 2 = 1,411,200 bits per second, about 1.4 Mbit/s.
9. Underrun
The hardware reached the end of its buffer before new samples arrived. You hear a click, stutter or crackle.
10. FLAC and MP3
FLAC is lossless. MP3 is lossy.
UNDERSTANDING QUESTIONS
Q1. Why does the HD Audio controller use DMA instead of letting the CPU copy each sample?
Answer
At 48,000 samples per second per channel, copying one at a time would waste the CPU. With DMA the controller reads whole buffers straight from RAM, and only sends an interrupt when it needs a refill. The CPU is free in between.Q2. Why does Windows run the audio engine in a separate process (audiodg.exe)?
Answer
The engine loads effect plug-ins (APOs), some from outside vendors. If one of them crashes, only `audiodg.exe` fails (and is restarted), not the whole system or the apps playing sound. That is the "isolation" in its name.Q3. Why does a small buffer reduce delay but raise the risk of glitches?
Answer
Delay is the number of samples in the buffer divided by the sample rate, so fewer samples mean less delay. But a small buffer empties quickly, so the software has to refill it often and exactly on time. Any late refill causes an underrun.Q4. Why can you not simply raise the bit depth to hear more detail than a 16-bit file has?
Answer
Bit depth is fixed when the audio is recorded or converted. Playing a 16-bit file at 24-bit adds no new detail; it only stores the same values in bigger numbers. Extra bits help during recording and editing, not for recovering lost information.Q5. Why does lossy compression get smaller files, and what is the cost?
Answer
It removes sounds that people are unlikely to notice (for example quiet sounds hidden by louder ones close in pitch). That removes a lot of data. The cost is that the removed detail cannot be restored, and repeated re-saving can make the damage visible.SCENARIO QUESTIONS (Troubleshooting)
S1. The taskbar speaker has a red cross and says no audio device is installed, but your headphones are plugged in. Where do you look first?
Answer
Check that the services **Windows Audio** and **Windows Audio Endpoint Builder** are running (`Get-Service Audiosrv, AudioEndpointBuilder`), then check Device Manager under *Sound, video and game controllers* for a warning icon or a disabled device. Also check `mmsys.cpl` with *Show Disabled Devices* ticked.S2. A video plays on your PC but the sound comes out of the TV, not the speakers. Why?
Answer
Windows made the HDMI endpoint the **default playback device** (or the app has its own output choice). Set the speakers as the default in Settings → System → Sound or `mmsys.cpl`, and check the app's own output setting.S3. Music crackles when the PC is also doing heavy work, and "System interrupts" is high in Task Manager. What do you suspect?
Answer
A driver is running long ISRs/DPCs (a DPC hog) so the audio driver cannot refill its buffer in time, causing underruns. Use a tool such as LatencyMon to find the driver, then update, roll back or remove it.S4. Your Bluetooth headphones make videos look out of sync: the lips move before you hear the words. What is the cause and a fix?
Answer
Bluetooth adds delay (often 100 ms or more) from compression and radio buffering. Good players compensate, but some do not. Use a player with an audio delay setting, use a wired or low-latency headset, or move closer to reduce retransmissions.S5. A music app says "device in use" and a video call has no sound after you enabled "exclusive control" for the headset. What happened?
Answer
An app in exclusive mode owns the device buffer, so the engine cannot mix other streams into it. Close that app, or untick *Allow applications to take exclusive control of this device* in the device's Advanced tab.INTERVIEW QUESTIONS
I1. Explain the Windows audio stack from application to hardware.
Answer
The app (or a higher-level API such as Media Foundation) opens a WASAPI stream. In shared mode the Windows Audio service's engine in `audiodg.exe` converts, mixes, applies volume and APOs, and hands the mixed stream to the audio driver (via Kernel Streaming/port class). The driver fills a RAM buffer; the HD Audio controller reads it by DMA and sends it to the codec's DAC, then an amplifier drives the speaker.I2. What is the difference between WASAPI, DirectSound, MME and ASIO?
Answer
WASAPI is the modern core Windows API. MME (waveOut) and DirectSound are older APIs, mostly layered on top of the engine/WASAPI path today. ASIO is a third-party low-latency driver model used by music software that bypasses the Windows engine.I3. How do sample rate and bit depth affect quality and file size?
Answer
Sample rate sets the highest pitch that can be captured (up to half the rate, by Nyquist). Bit depth sets the precision of each sample and the dynamic range (about 96 dB at 16-bit). Uncompressed size is sample rate × bit depth × channels per second, so raising either raises the file size.I4. What is the default device versus the default communications device?
Answer
Two defaults per direction. The default device is used by most apps. The default communications device is used by call or chat apps that ask for the communications role. They may be the same or different, for example speakers for music and a headset for calls.I5. How would you diagnose crackling audio?
Answer
Look for underruns: high CPU, a DPC-hogging driver (LatencyMon), a bad effect (try disabling enhancements), a rate mismatch (try another default format), a bad or outdated audio driver, or radio problems if Bluetooth. Change one thing at a time and test.PRACTICAL TASK
Draw a one-page "audio map of my PC". Using your Practical Lab results, draw the nine stages of the chain from Section 7 as boxes, and under each box write the real name from your PC (for example your player app, audiodg.exe, your audio driver name and version, your codec chip, your default endpoint and its format).
Why This Matters
When sound breaks, you can use the map to ask "which stage?" instead of guessing. No sound at all may be a stopped service, the wrong default endpoint, or a driver problem, and each of those lives at a different box on your map.
CHAPTER SUMMARY
- Hardware: a DAC turns numbers into a voltage wave and an ADC does the reverse. On a PC both live in the audio codec chip, linked to the chipset's HD Audio controller. USB, Bluetooth and HDMI devices carry their own DAC.
- Drivers: bus, class and vendor drivers give Windows a standard endpoint view. The controller uses DMA and interrupts.
- Windows audio:
AudiosrvandAudioEndpointBuilderrun the system. The engine inaudiodg.exemixes streams, applies volume, effects and sample-rate conversion. Apps use WASAPI (shared or exclusive mode). - Endpoints: playback and recording devices, each with a format. Default device versus default communications device.
- Digital audio: sample rate (Nyquist), bit depth, PCM, channels. CD audio is about 1.4 Mbit/s. Lossless versus lossy.
- Buffering: buffers smooth the stream. Small buffers mean low delay but risk glitches. A DPC hog causes crackle. Bluetooth adds a lot of delay.
- The chain: file → player → decoder → WASAPI → engine → RAM buffer → driver → DMA → codec DAC → amplifier → speaker.