I'm having similar issues to the user who posted here http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/229575.aspx
After reading through that thread and following suggestions, I'm still having issues.
I'm getting input/output error from arecord and 'ALSA sound/core/pcm_lib.c:1765: capture write error (DMA or IRQ trouble?)' shows up in dmesg
I have only one serializer enabled in RX Mode
static u8 mcasp_iis_serializer_direction[] = {
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, INACTIVE_MODE,
};
static struct snd_platform_data vhe022_snd_data1 = {
.tx_dma_offset = 0x46400000,
.rx_dma_offset = 0x46400000,
.asp_chan_q = EVENTQ_1,
.tdm_slots = 2, /* number of channels */
.op_mode = DAVINCI_MCASP_IIS_MODE,
.num_serializer = ARRAY_SIZE(mcasp_iis_serializer_direction),
.serial_dir = mcasp_iis_serializer_direction,
.version = MCASP_VERSION_2,
.txnumevt = 0,
.rxnumevt = 1,
};
Yet if I look at the registers for MCASP1 (the one this is being mapped to), it seems that serailizers 6-15 are also in RX Mode before and after running arecord. I also paused it in gdb right before the actual read call, and found the registers have the same contents.
Physical (Virtual) : Value
0x4803C180 (0x2ab1e180): 0x00000002
0x4803C184 (0x2ad35184): 0x00000000
0x4803C188 (0x2acc2188): 0x00000000
0x4803C18C (0x2acd018c): 0x00000000
0x4803C190 (0x2aba2190): 0x00000000
0x4803C194 (0x2aba6194): 0x00000000
0x4803C198 (0x2ad17198): 0x00000002
0x4803C19C (0x2ad0a19c): 0x00000002
0x4803C1A0 (0x2abac1a0): 0x00000002
0x4803C1A4 (0x2ab0f1a4): 0x00000002
0x4803C1A8 (0x2ab2c1a8): 0x00000002
0x4803C1AC (0x2ab901ac): 0x00000002
0x4803C1B0 (0x2acd61b0): 0x00000002
0x4803C1B4 (0x2abb01b4): 0x00000002
0x4803C1B8 (0x2ab4e1b8): 0x00000002
0x4803C1BC (0x2acf31bc): 0x00000002
I also added a quick log to davinci-mcasp.c in the function davinci_hw_common_param (around line 630)
for (i = 0; i < dev->num_serializer; i++) {
mcasp_clr_bits(dev->base + DAVINCI_MCASP_XRSRCTL_REG(i), 0x3); //Addition: attempt to force clear bits
mcasp_set_bits(dev->base + DAVINCI_MCASP_XRSRCTL_REG(i),
dev->serial_dir[i]);
printk("serial_dir[%d] = %d\n", i, dev->serial_dir[i]); //Addition: print assigned serial dir
printk("Serial mode at 0x%08X set to %d\n", //Addition: print value after assignment
dev->base + DAVINCI_MCASP_XRSRCTL_REG(i),
mcasp_get_reg(dev->base + DAVINCI_MCASP_XRSRCTL_REG(i)));
Which then prints:
serial_dir[0] = 2
Serial mode at 0xFA03C180 set to 2
serial_dir[1] = 0
Serial mode at 0xFA03C184 set to 0
serial_dir[2] = 0
Serial mode at 0xFA03C188 set to 0
serial_dir[3] = 0
Serial mode at 0xFA03C18C set to 0
serial_dir[4] = 0
Serial mode at 0xFA03C190 set to 0
serial_dir[5] = 0
Serial mode at 0xFA03C194 set to 0
serial_dir[6] = 0
Serial mode at 0xFA03C198 set to 2
serial_dir[7] = 0
Serial mode at 0xFA03C19C set to 2
serial_dir[8] = 0
Serial mode at 0xFA03C1A0 set to 2
serial_dir[9] = 0
Serial mode at 0xFA03C1A4 set to 2
serial_dir[10] = 0
Serial mode at 0xFA03C1A8 set to 2
serial_dir[11] = 0
Serial mode at 0xFA03C1AC set to 2
serial_dir[12] = 0
Serial mode at 0xFA03C1B0 set to 2
serial_dir[13] = 0
Serial mode at 0xFA03C1B4 set to 2
serial_dir[14] = 0
Serial mode at 0xFA03C1B8 set to 2
serial_dir[15] = 0
Serial mode at 0xFA03C1BC set to 2
When arecord is run.
So... I'm a bit puzzled as to why these registers aren't being set, and I think this may at least be part of the cause of my issue.