The following actions can be taken to
achieve the same constant audio latency in either direction over a wireless network
(from the PDM pins on one CC35xx device platform to the PDM pins on another CC35xx
device platform):
- One node must be defined as audio clock controller and the other node must be
defined as audio clock peripheral. The peripheral must use an external audio
clock source with adjustable rate.
- For both nodes, set PDM:STPWPER = N × (PDM:FIFOCTL2.TRGLVL), where N is a whole
number.
- The value of PDM:STPWPER equals audio latency in number of frames.
- The value of PDM:STPWPER also equals the memory buffer size in number of
samples.
- Perform samplestamp capture on the controller when it transmits the RF packet
synchronization word, and include the value of the fixed-point samplestamp in
the transmitted packet.
- Perform samplestamp capture on the peripheral when it receives the RF packet
synchronization word, and store the samplestamp value of the master in the RF
packet. Calculate the difference between the samplestamp values of the
controller and peripheral, which is used to:
- Initially offset the PDM:STPWCNT counter of the peripheral so that it
matches the samplestamp value of the master.
- While running, adjust the external audio clock source rate so that the
difference between the samplestamp values of the peripheral and the
controller approach 0.
- For both nodes, set up DMA pointers and DMA start triggers so that the value of
STPWCNT represents the input and output buffer positions of the current frame on
the ADx pins.