I am working on an embedded system so I am looking for a simple way to sync two devices for streaming audio. I have audio coming in from a source over usb and I want to route it to a codec, but apparently the difference in clock speeds between these devices is giving me underruns. I tried fiddling with ALSA and it did help adding the dmix plugin with .asoundrc file, but the underruns still occur just not as bad. When I play with period_size and buffer_size variables in the dmix plugin it does not seem to change anything. Is there an intelligent way to do this?