3 ms·
For context switch timestamps would I be using something like perf on Linux? Would buffer level checking entail, eg. checking snd_pcm_avail() when my audio cod
by nyanpasu64 2y ago
For context switch timestamps would I be using something like perf on Linux?
Would buffer level checking entail, eg. checking snd_pcm_avail() when my audio code begins and ends (assuming I'm talking directly to hardware rather than PipeWire)? Dunno if PipeWire has a similar API considering it's a delay-based audio daemon and probably checking snd_pcm_avail when a client requests would slow it down.
- PaulDavisThe1st 2y agoBuffer level makes almost no sense. All that matters is/are: 1. how soon after the device deadline (typically marked by an interrupt) until a kernel thread wakes up to deal with the device? (you have no control over this) 2. what is the additional delay until a user-space application thread wakes up to deal with the required data flow? (you have very little control over this, assuming you've done the obvious and used the correct thread scheduling class and priority) 3. does user space code read & write data before the next device deadline? (you have a lot of control over this) As noted above, cyclictest is the canonical tool for testing the kernel side of this sort of thing.