My DAC is internally clocked at 48khz, I need to feed it from a stream that is also 48khz but is clocked from a different source.
The two sources will drift over time and any buffering in between will inevitably overflow or underflow.
Unfortunately, there is no rate control mechanism available for the source.
How can this best be handled?
Would it be acceptable to duplicate or toss the occasional sample to compensate? I'm estimating 1 sample every ~70k samples for 30ppm difference.
As your clocks are running at essentially two different speeds, you have no choice but to duplicate or discard samples.
Keep a count of how many samples have been read/written, and calculate how many samples you expect to have been read/written based on the current time. A discrepancies can then be adjusted for by duplicating/discarding samples.