Open olofson opened 7 years ago
This probably explains it:
2064.000000: h (0x11c1208) [ 0 ] START()
0.000000: h (0x115e5b8) [ 1 ] Audiality 2: Incorrect timestamp for voice 0x115e5b8! (2048.000000 frames late.)
ADDXIC
a2_add_xic() is hardwired to the pre-A2_interface timestamping and messaging methods. Trivial fix.
The more hairy part is destroying XICs. We have the same problem in some other cases as well, I think. The problem is, handles and underlying objects don't keep track of which interface they "belong" to - and even if they did, we'd have to deal with interfaces being closed before these objects are destroyed.
See also #337.
Calls like a2_OpenSink() and a2_OpenSource() sometimes fail, with the engine printing "Voice has no units (A2MT_ADDXIC)". Adding a substantial delay between spawning the target voice, and attaching to it, avoids the problem.
Notably, the streamstress and streamtest tests are broken, and will not work at all with some drivers. Low latency drivers, such as JACK, seem to work better, but there are still issues.
Apparently, the xinsert client setup messages arrive before the engine knows anything about the target voice. This is a solved problem (A2_TNEWVOICE; a handle that serves as a message queue until the actual voice has been created), and works for "everything" else. Did I forget something in the xinsert API when refactoring the API?