I'm trying to use an I2S audio source from an ADV7604 with the mcasp 1 interface on a DM8168 Z3 board. We've developed our own board which has the ADV7604 on it. The ADV7604 is working with video, I can see I2S audio signals being generated by the ADV7604, I've added driver code to the linux kernel to handle the audio information, but I keep getting the message
arecord: pcm_read:1617: read error: Input/output error
when I try to do a capture with arecord. I also get a dmesg of
capture write error (DMA or IRQ trouble?)
The arecord command I'm using is
arecord -Dhw:0,1 -t wav -f S32_LE -r 48000 -c 2 -d 5 tmp.wav
The I2S being sent by the digital HDMI source is 24 bit so I changed the driver to add support for 24 bit and tried
arecord -Dhw:0,1 -t wav -f S24_LE -r 48000 -c 2 -d 5 tmp.wav
but I get the same result.
The system is reporting the presence of the audio device correctly:
asoc: HDMI-DAI-CODEC <-> hdmi-dai mapping ok
asoc: adv7604-hifi <-> davinci-mcasp.1 mapping ok
ALSA device list:
#0: TI81XX EVM
When I do "arecord -l" I get:
**** List of CAPTURE Hardware Devices ****
card 0: EVM [TI81XX EVM], device 1: ADV7604 adv7604-hifi-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0
The changes I made to the linux kernel are:
board-ti8168evm.c:
added:
static struct platform_device ti8168_adv7604_snd_driver = {
.name = "adv7604-sound",
.id = -1,
};
changed:
static u8 ti8168_mcasp1_serializer_direction[] = {
RX_MODE, RX_MODE, INACTIVE_MODE, INACTIVE_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
};
static struct snd_platform_data ti8168_evm_mcasp1_data = {
.tx_dma_offset = 0x46400000,
.rx_dma_offset = 0x46400000,
.op_mode = DAVINCI_MCASP_IIS_MODE,
.num_serializer = ARRAY_SIZE(ti8168_mcasp1_serializer_direction),
.tdm_slots = 2,
.serial_dir = ti8168_mcasp1_serializer_direction,
.asp_chan_q = EVENTQ_1,
.version = MCASP_VERSION_2,
.txnumevt = 0,
.rxnumevt = 1,
};
in ti8168_evm_init:
platform_device_register( &ti8168_adv7604_snd_driver );
I didn't make any changes in devices.c since it looked right for mcasp 1.
I added an adv7604.c sound driver file to sound/soc/codecs which has the "adv7604-sound" sound driver and the "adv7604-hifi"
I also added:
#if (defined(CONFIG_VIDEO_ADV7604) || defined(CONFIG_VIDEO_ADV7604_MODULE))
{
.name = "ADV7604_SOC_LINK",
.stream_name = "ADV7604",
.cpu_dai_name= "davinci-mcasp.1",
.codec_dai_name = "adv7604-hifi",
.codec_name = "adv7604-sound",
.platform_name = "davinci-pcm-audio",
.init = evm_adv7604_init,
.ops = &evm_ext_master_ops,
},
#endif
to the ti81xx_evm_init array in sound/soc/davinci/davinci-evm.c
It looks like everything is recognized and connected, but I keep getting the capture write error (DMA or IRQ trouble?) message. I can see data being sent on the mcasp signals so I would expect to end up with a wav file filled with at least noise, but I didn't expect to keep getting this timeout. I believe the message is being generated by the routine wait_for_avail in sound/core/pcm_lib.c. It looks like it's waiting for data to become available, but none appears.
The kernel is linux 2.6.37 with PSP 04.04.00.01.
Anybody have any suggestions?
Carl