Hi Matthias
Yeah, you will have noticed in the spec that properly syncing the audio streams between two devices is an exercise left to the reader. Each audio packet is prepended with a sequence number, which the devices are supposed to use for synchronization. I've noticed that this seems to have limited utility, if the difference is too large (as few as 8 packets) the devices will play audio out of sync.
Audio latency depends on how many audio packets you are willing to pre-buffer. It could be as high as 160ms + device processing. That is if you pre-buffer 8 audio packets (which are 20ms each). The less pre-buffer, the lower the latency, but the higher the chance of stream instability.
I am currently not pre-buffering audio, which makes the stream unstable, but minimizes latency and makes syncing audio between devices extremely simple. The biggest trouble is if the buffer on my devices runs empty, my devices tend to disconnect completely.
In the Android source code, the code does flush the L2CAP buffer if required.
So I guess, basically I need to know when the device buffer is about to run empty so I can do something about it. What is the size of the outgoing L2CAP buffer in btstack, and can I influence that?
Apologies if I'm not very clear. I'm still very much still learning about BLE, so part of what I'm doing is trying different stuff to see what works.
I can see why LE Audio (and isochronous streams) was invented. ASHA is quite the hack...
Thanks,
Sherman