Media clock < 48kHz with AN00203 AVB endpoint?
Posted: Tue Mar 21, 2017 3:22 am
Hello,
I have a recording application where I would like to run my media clock slower than 48kHz (e.g. 12kHz or 16kHz) and interpolate the audio to 48kHz for AVB so it will play nicely with a Macbook, which seems to like a 48kHz sample rate.
Right now I am using the xCORE-200 Multichannel Audio platform and that is what I have based my custom boards on.
I have determined how to generate the media clocks I want simply by changing calculate_wordlen() function in media_clock_support() for the desired sampling rate. For example, if I want 16kHz frame clock I can force calculate_wordlen() to return nanoseconds / 16000. And if I keep all the AVB descriptors the same so it "thinks" it has 48kHz audio, it still shows up on the Macbook.
But now I have an issue where (of course) the samples aren't being put into the ADC receive buffer at the rate the AVB software needs, so I suppose I need to interpolate to 48kHz. Can anyone point to me the easiest spot to insert interpolation (and decimation, if necessary, though I don't care about the DAC)? Initially I can get it going simply by zero stuffing / downsampling because aliasing doesn't matter at this point, I just want to see if it is possible (which I presume it must be, I just don't want to have to change too much stuff to get it to work).
Optimally I would run 16kHz media clock and interpolate to 48kHz but if for some reason 12kHz media clock would work better then that would be fine, too.
Just so you know why this is, I am running TDM and I want the ADC distant from the processor, which means I will run into a setup time issue with a fast bit clock (due to propagation delay through the extension cables). I actually don't need audio above 4 or 5kHz so 12kHz is about the minimum sampling rate I can run.
Cheers,
Adam
I have a recording application where I would like to run my media clock slower than 48kHz (e.g. 12kHz or 16kHz) and interpolate the audio to 48kHz for AVB so it will play nicely with a Macbook, which seems to like a 48kHz sample rate.
Right now I am using the xCORE-200 Multichannel Audio platform and that is what I have based my custom boards on.
I have determined how to generate the media clocks I want simply by changing calculate_wordlen() function in media_clock_support() for the desired sampling rate. For example, if I want 16kHz frame clock I can force calculate_wordlen() to return nanoseconds / 16000. And if I keep all the AVB descriptors the same so it "thinks" it has 48kHz audio, it still shows up on the Macbook.
But now I have an issue where (of course) the samples aren't being put into the ADC receive buffer at the rate the AVB software needs, so I suppose I need to interpolate to 48kHz. Can anyone point to me the easiest spot to insert interpolation (and decimation, if necessary, though I don't care about the DAC)? Initially I can get it going simply by zero stuffing / downsampling because aliasing doesn't matter at this point, I just want to see if it is possible (which I presume it must be, I just don't want to have to change too much stuff to get it to work).
Optimally I would run 16kHz media clock and interpolate to 48kHz but if for some reason 12kHz media clock would work better then that would be fine, too.
Just so you know why this is, I am running TDM and I want the ADC distant from the processor, which means I will run into a setup time issue with a fast bit clock (due to propagation delay through the extension cables). I actually don't need audio above 4 or 5kHz so 12kHz is about the minimum sampling rate I can run.
Cheers,
Adam