RT1050 WM8960 codec - change audio parameters

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

RT1050 WM8960 codec - change audio parameters

ソリューションへジャンプ
1,751件の閲覧回数
pazdimpazdim
Contributor II

Hello.

I am using I.mx RT1050 evk with WM8960 codec for audio playback. SDK example plays 16 khz 16bit stereo sound. Its working good - I created corresponding raw audio file and transmit it to EVK via ethernet. But I need to work with 8 khz 16bit mono sound. Default configuration from example:

/* Clock pre divider for sai1 clock source */
#define DEMO_SAI1_CLOCK_SOURCE_PRE_DIVIDER (1U)
/* Clock divider for sai1 clock source */
#define DEMO_SAI1_CLOCK_SOURCE_DIVIDER (63U)
/* Get frequency of sai1 clock */
#define DEMO_SAI_CLK_FREQ (CLOCK_GetFreq(kCLOCK_AudioPllClk) / (DEMO_SAI1_CLOCK_SOURCE_DIVIDER + 1U) / (DEMO_SAI1_CLOCK_SOURCE_PRE_DIVIDER + 1U))

format.bitWidth = kSAI_WordWidth16bits;
format.channel = 0U;
format.sampleRate_Hz = kSAI_SampleRate16KHz;
format.masterClockHz = DEMO_SAI_CLK_FREQ;
format.protocol = config.protocol;
format.stereo = kSAI_Stereo;
format.isFrameSyncCompact = false;
format.watermark = FSL_FEATURE_SAI_FIFO_COUNT / 2U;

What parameters do I need to change? I tried to set sampleRate_HZ to 8KHz, stereo to kSAI_MonoRight. But I do not understand the CLOCK parameters. How do I calculate them? The frequency of transmitting is reduced by 4 times (16khz to 8khz and stereo to mono) and the playback frequency is reduced by 2 times (16khz to 8khz), right?

ラベル(1)
タグ(2)
0 件の賞賛
1 解決策
1,351件の閲覧回数
pazdimpazdim
Contributor II

I found the problem. WM8960 inserts zeros after each byte in u-law mode. The target device uses the PCMU without zeros (each byte is informational). How do I configure DMA to automatically insert zeros?

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
1,352件の閲覧回数
pazdimpazdim
Contributor II

I found the problem. WM8960 inserts zeros after each byte in u-law mode. The target device uses the PCMU without zeros (each byte is informational). How do I configure DMA to automatically insert zeros?

0 件の賞賛
1,351件の閲覧回数
pazdimpazdim
Contributor II

I need a sound in the format of PCMU. I changed the fields DACCOMP and ADCCOMP of register 09h. After processing in audio editor, I saw that the stereo sound. How do I set the SAI or MQS to mono?

...

And this is only for the PCMU/PCMA, the raw sound is received as 8000 kHz mono.

0 件の賞賛