We are using Mediatek MT7628AN ver:1 ECO-2 based SKYLAB EVB with LEDE 17.01.2 ( 4.4 kernel) SDK. We have enabled the ALSA and sound drivers to play WAV file by configuring the I2S pins as PCM interface. When we play the a wave file like below.. we are seeing GDMA errors saying " gdma: only support 4 byte buswidth" and the WAV file play termintate with errors.. ( see below ). Please let us know how to support 16 bit GDMA transfers ( GDMA being used to transfer the PCM data from ALSA to external CODEC) over PCM enabled I2S pins.
aplay -D plughw:1,0 /etc/config/8k16bitpcm.wav
Playing WAVE '/etc/config/8k16bi[ 1013.839294] BITS1: 16, buswidth1: 2
tpcm.wav' : Sign
[ 1013.847645] gdma-rt2880 10002800.gdma: only support 4 byte buswidth
ed 16 bit Little
[ 1013.862797] mt7628-pcm 10002000.pcm: ASoC: 10002000.pcm hw params failed: -22
Endian, Rate 8000 Hz, Mono
aplay: set_params:1297: Unable to install hw params:
Thanks for the information ElektromAn..
We will check from the I2S/PCM interface driver. The requirement is that.. on the other side of CPU, which is the CODED only supports 16 bit PCM. So, do you suggest to club two 16bit samples in one 32 bit src/dst DMA address to do DMA?
A quick look at the data sheet suggests that I2S data can be 24 or 16 bits. The 32 byte FIFO buffer can use either direct writes or GDMA. The register is one word (wide). Stereo sound is accomplished by alternating 1 word left, then 1 word right based on the WS signal (Word Select line).
GDMA channel 2 (tx) and 3 (rx) seem to be assigned to I2S.
Thanks for the response.. Our requirement is to use only PCM interface( not I2S) on MT7628, since the CODEC only supports 13 bit PCM . So we are trying to play 16bit Mono Wave file. GDMA for PCM is TX- 6, and RX-4 . Aplay is setting the format as 16 bit LE. But the DMA driver throwing the below error. (saying only support 32 bit buswidth )
gdma-rt2880 10002800.gdma: only support 4 byte buswidth mt7628-pcm 10002000.pcm: ASoC: 10002000.pcm hw params failed: -22
We are seeing for the ways of playing 16bit Mono wave file using 32 bit DMA on Mt7628.
Fill your data as needed for 16Bit Mono, into a dword.
Maybe you must pack the data, i.e. 2 * 16Bit samples into one dword.
The datasheet is bluerred in this section,
I assume the first sample is for bit 0-15 and the second is bit 16-31
Since we are using aplay to play a WAV file.. we have to see at which layer we need this 16 bit packing into 32 bit data. Probably we have to do this at around ALSA layer before we give the buffer to DMA. Let us know any existing implementation which is used for PCM interface.
Also.. any particular reason.. the PCM interface driver is not available/discontinues in LEDE code branches? Only I2S interface driver (ralink-i2s.c ) is available in 17.01 ( linux-4.4 ) SDK.