Readit News logoReadit News
humbledrone commented on An appeal to Apple from Anukari   anukari.com/blog/devlog/a... · Posted by u/humbledrone
krackers · 4 months ago
>While I can't share any technical details... The engineer provided some suggestions and hints that I can use right now to maybe — just maybe — get things working in the short term

Great that you have a workaround now, but the fact that you can't even share what the workaround is, ironically speaks to the last line in https://news.ycombinator.com/item?id=43904921 of how Apple communicates

>there’s this trick of setting it to this but then change to that and it’ll work. Undocumented but now you know

When you do implement the workaround, maybe you could do it in an overtly-named function spottable via disassembly so that others facing similar constraints of latency-sensitive GPU have some lead as to the magic incantation to use?

humbledrone · 4 months ago
Despite enjoying your idea, I probably won't do that, but certainly anyone who actually has this same problem should reach out to me and I'll put them in touch with the right folks at Apple, who can share the info.
humbledrone commented on An appeal to Apple from Anukari   anukari.com/blog/devlog/a... · Posted by u/humbledrone
humbledrone · 4 months ago
Hey everyone, it worked, I had a super productive conversation with exactly the right person on the Metal team! Thanks for helping me get Apple's attention. I didn't at all expect this amount of support.

https://anukari.com/blog/devlog/productive-conversation-appl...

humbledrone commented on An appeal to Apple from Anukari   anukari.com/blog/devlog/a... · Posted by u/humbledrone
Someone · 4 months ago
One thing I don’t understand: if latency is important for this use case, why isn’t the CPU busy preparing the next GPU ‘job’ while a GPU ‘job’ is running?

Is that a limitation of the audio plug-in APIs?

humbledrone · 4 months ago
I attempted to preempt your question in the section of my blog post, "Why don’t you just pipeline the GPU code so that it saturates the GPU?" It's one of the less-detailed sections though so maybe you have further questions? I think the main thing is that since Anukari processes input like MIDI and audio data in real-time, it can't work ahead of the CPU, because those inputs are not available yet.

Possibly what you describe is a bit more like double-buffering, which I also explored. The problem here is latency: any form of N-buffering introduces additional latency. This is one reason why some gamers don't like triple-buffering for graphics, because it introduces further latency between their mouse inputs and the visual change.

But furthermore, when the GPU clock rate is too low, double-buffering or pipelining don't help anyway, because fundamentally Anukari has to keep up with real time, and every block it processes is dependent on the previous one. With a fully-lowered GPU clock, the issue does actually become one of throughput and not just latency.

humbledrone commented on An appeal to Apple from Anukari   anukari.com/blog/devlog/a... · Posted by u/humbledrone
jonas21 · 4 months ago
I'm having trouble understanding what the problem is -- as in, what are the actual symptoms that users are seeing? How much latency can the app tolerate and how much are you seeing in practice? It would be helpful (to me at least) in thinking about potential solutions if that information were available up front.

Perhaps there's something in this video that might help you? They made a lot of changes to scheduling and resource allocation in the M3 generation:

https://developer.apple.com/videos/play/tech-talks/111375/

humbledrone · 4 months ago
It's a real-time audio app, so if it falls behind real time, no audio. You get cracks, pops, and the whole thing becomes unusable. If the user is doing audio at 48 kHz, the required latency is 1/48,000 seconds per sample, or realistically somewhat less than that to account for variance and overhead.

u/humbledrone

KarmaCake day2329March 10, 2009
About
https://anukari.com evan@anukari.com
View Original