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
Media clock < 48kHz with AN00203 AVB endpoint? Topic is solved
-
- XCore Expert
- Posts: 580
- Joined: Thu Nov 26, 2015 11:47 pm
-
- XCore Expert
- Posts: 580
- Joined: Thu Nov 26, 2015 11:47 pm
I am trying to do the rate adaption in the buffer_manager_to_tdm task tdm.receive and tdm.send functions... looking promising but not there yet. Right now I am trying to do something like zero order hold so e.g. if you want 24kHz media clock it will send each sample twice over Ethernet with the frames put into the c_audio chanend at 48kHz rate (so twice per 24kHz frame)...
-
- XCore Expert
- Posts: 580
- Joined: Thu Nov 26, 2015 11:47 pm
The buffer_manager_to_tdm task seems to be a suitable place to do this. I don't use the DAC at present so I haven't done much on it other than pulling samples from the chanend and dropping them. I have got zero order hold and zero stuffing working on the ADC with 24kHz and 12kHz media clocks, so that seems to be OK for me at this point in time. The tdm.receive() function is where I am doing the processing.