... as in, I should have spent more time in Linux rather than iOS and I would have worked this out before Christmas.
Time to fess up - and don't flame me for being an almighty dufus, but - it's only today, 20 minutes ago in fact, that I realized that I need to do a sched_setscheduler(0, SCHED_FIFO, &p); in order to have my thread priorities honoured. No wonder I was struggling with glitches and pops, any old piece of junk could step in and force me to yield for hundreds, nay thousand of microseconds. I feel like whacking my fat old head against a concrete slab for a few minutes. Maybe 30 or 40 minutes, at 160 bpm.
But there we are.
It's a bit too late to turn up the amp and throw hands all over the keyboard, but via the magic of ssh, Macfusion and the intro to 'Fox on the Run' I have now run for a solid 19 minutes, even more than that, 20 minutes minus the time to go
without a single packet underrunning in ALSA, 8 note polyphony, 900MHz overclock (as in, every Pi out there ever sold should be able to do this).
Brilliant. And clearly, whole new, previously undocumented levels of stupid all at once, but the stupid's now in the past. Well, until the next time my inner idiot rears himself up and imposes himself all over my code.