I am looking for a way to find out whether the clocks of two snd_pcm_t's are perfectly in sync and don't deviate (or only deviate by a constant phase).
short answer:no You would need hardware that would count the bit clock transitions and provide the delta. Few devices provide this in the consumer space, and when they do they actually perform an asynchronous sample-rate conversion on the fly (cf. Freescale DSP563xx). Analog Devices also provides dedicated sample-rate converters that perform this comparison and resampling; they are typically used when multiple masters are present. All this nice hardware wouldn't work anyway for USB where audio is transmitted in packets every ms; it's hard to guess what the real audio speed is. That's the reason why I introduced the resampling enable/disable in the PA module-loopback code, only the user/system designer will know if you have one master or more, and whether you should enable variable-rate interpolation. Cheers - PL