Topic: How PCI audio cards work?

Hi!

Can anyone (old rme wolfs?) explain how pci audio cards work, more of why are they so prone to dropouts and how exactly do they occur?

I'm interested in:

How the card behaves at lowest level (data link on pci bus) while recording / playback? Does it fire interrupt when single buffer is full? Is the buffer physically on a card or is it in a driver? What ASIO buffer control adjusts? Does it adjust chunk size that card sends down the bus, or does it adjust frequency of data chunks?

What is the 'asio poured in hardware' concept that was used in RME cards? What tasks did they do internally on xilinx chip?

What is audio dropout? Who exactly misses the data packet in which place? Does it happen on the hardware level - interrupt not taken care of on time, or does it start with software, as DAW not talking to ASIO driver on time? or ASIO driver not sending data request on time? Or sending it of too low priority that it gets through too late?..

Why is it impossible to tweak audio drivers that they get priority over network, video and storage subsystems [in windows]?
Why sending 2Mbit stream down the bus which has 500 times more throughput and is not used by anything else, still so hard these days? Why is taking priority over audio is like taking  candy from a baby?

Thanks!!!

2 (edited by ramses 2015-12-13 17:06:12)

Re: How PCI audio cards work?

So you want 10-35y of experience in a few sentences ..

> Why is it impossible to tweak audio drivers that they get priority over network,
> video and storage subsystems [in windows]?

Windows is not a real time Operating system. What I understood so far. When a device driver receives an interrupt it starts a DPC (deferred procedure call). This runs on a core and can't be interrupted by anything else (process scheduler, etc). Its only a convention, that device programmer know, that these non interruptable driver routines shall run not for too long, too avoid blocking the kernel for too long for other also important tasks. If there is a bad driver which doesnt give the core free early enough and your audio driver and/or DAW application runs on the same core, which is blocked by this driver for too long, then you have a typical situation why dropouts can occur or why you require a bigger ASIO buffer size to mitigate this.

Other reasons of bad audio performance are, when you use energy saving settings in the BIOS and in the Operating System. They lead to 2 things. Either the CPU frequency changes depending on load or parts of the CPU are being send to sleep state. Both, frequency changes and sleep states (C-States) lead to delay as it takes time to synchronize on a different clock speed. And waking up parts of cores takes even much more delay. So its a good idea to at least set C-States to perhaps C0, disable EIST, and then see how far you come. If all runs satisfactory you can try to re-enable EIST, Turbo boost and decide whether you want to allow maybe up to C3 sleep state.

Whats also not beneficial is the feature CPU core parking as this also leads to a more laffy behaviour of the CPU. It takes time, until the parked cores are back there.

Other reasons for bad performance can be the mainboard layout and the Chipset in use. Nowadays the PCI slots at the end of the day also terminate on an PCIe Bridge ... so data from a parallel bus design land on a serial bus design (PCIe). Depending the PCIe Lane distribution on the mainboards this can be a good or a bad design.

Some technical background you can read on the homepage of LatencyMon. Read this information 3-5 times. Until you maybe start to understand what the issue is.
http://www.resplendence.com/latencymon

Some performance tuning tips I gave here already in a different threat.
https://www.forum.rme-audio.de/viewtopic.php?id=22948

On a perfect tuned Windows 7 system you will see with LatencyMon on an IDLE (!) system, where no other program runs, values down to 1,75µs. Usually between 5-10µs with little spikes up to perhaps 50µs.
This gives you the Headroom, being able to work longer with small ASIO buffer sizes, shall you require them for some reason, i.e. when playing an electronic drumkit and if you have a virtual instrument on the PC.
Or if you use playback functions of the DAW instread of doing the headphone mixes purely on the recording interface.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

3 (edited by pranza 2015-12-13 20:10:22)

Re: How PCI audio cards work?

Hi, Ramses!
Yeah, but how come we still have to make excuses for 8 core systems runing at several times higher frequencies, cpus being almost idle and still everything performing worse than pentium 3 500 on a 440bx chipset and ess2 maestro on-board audio?
That pentium 3 i got is indestructible, you can freeze gui, get cpu at 100% with say, attempting to load facebook on it, and audio is still rock solid.
Why after three decades windows kernel is still so stupid it can't get a higher priority for audio? Why threads can't get priority over something less relevant? Why some card drivers perform excellent and some other are hardly possible to get dropout-free? RME is step ahead here, so that's why I wanted to hear some low-level details. Why cards can't DMA? Why they have to wait for cpu each time?.. Why CPU has to serve them last but not first instead? Why they don't make drivers that would bomb kernel with irq requests that it's so much of them and card gets attention no matter what? Like making a slider in a driver panel, that if OS doesn't want to timely respond to requests that come when needed, they would come three, four, ten times more often?

Re: How PCI audio cards work?

Recently posted in the Cubase forums:

https://www.youtube.com/watch?v=GUsLLEk … r_embedded

Explains pretty well what determines real time audio performance.

Re: How PCI audio cards work?

Thanks, Marqs.
The guy knows the deal, he still doesn't answer why it is so stupid, as there are all means for this to be avoided.

I mean, if there are 8 cores, okay, 4 cores, so why on earth can't one core take audio irqs, the others take all others and be happy? IRQ priorities, IRQ mapping to core, why it doesn't happen? And how can it be made to happen?

Re: How PCI audio cards work?

Microsoft doesn't seem to see a demand for it. The audio recording market is only a fraction of the total computer market.

But why discuss it "to death" if you are not in the position to change it... wink

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

Re: How PCI audio cards work?

Well, there should be a way. But we have to know exactly what is happening, because without that only charlatanic „disable everything but audio“ works for granted. But no one is willing to answer in depth. There are all means to make it work fine along with other things. There are even real time solutions working along with windows.