Hi,
I am trying to add use multiple serializers (4 TX and 4 RX) in DM8148 McASP0. I am using the PSP release linux-2.6.37-psp04.01.00.05.patch1 that has code for 1 TX and 1 RX usage. This framework uses ASoC to playback and capture stream using McASP0.
I have gotten 1 TX and 1 RX working in my board using DM5148 McASP. But when I add 3 more channels, nothing is working. Following are the modifications I made to the default architecture.
1. In arch/arm/mach-omap2/devices.c I have defined that I am using McASP0 as given below.
static struct resource ti81xx_mcasp_resource[] = {
{
.name = "mcasp",
.start = TI81XX_ASP0_BASE,
.end = TI81XX_ASP0_BASE + (SZ_1K * 12) - 1,
.flags = IORESOURCE_MEM,
},
/* TX event */
{
.start = TI81XX_DMA_MCASP0_AXEVT,
.end = TI81XX_DMA_MCASP0_AXEVT,
.flags = IORESOURCE_DMA,
},
/* RX event */
{
.start = TI81XX_DMA_MCASP0_AREVT,
.end = TI81XX_DMA_MCASP0_AREVT,
.flags = IORESOURCE_DMA,
},
};
2. I have defined the serializers I will be using in arch/arm/mach-omap2/board-ti8148evm.c as given below.
static u8 ti8148_iis_serializer_direction_mcasp0[] = {
TX_MODE, TX_MODE, TX_MODE, TX_MODE,
RX_MODE, RX_MODE, RX_MODE, RX_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
};
static struct snd_platform_data ti8148_evm_snd_data = {
.tx_dma_offset = 0x46000000,
.rx_dma_offset = 0x46000000,
.op_mode = DAVINCI_MCASP_IIS_MODE,
.num_serializer = ARRAY_SIZE(ti8148_iis_serializer_direction_mcasp0),
.tdm_slots = 1,
.serial_dir = ti8148_iis_serializer_direction_mcasp0,
.asp_chan_q = EVENTQ_2,
.version = MCASP_VERSION_2,
.txnumevt = 4,
.rxnumevt = 4,
};
3. I have mentioned that I will use 4 dai's in McASP0 in sound/soc/davinci/davinci-evm.c as given below.
static struct snd_soc_dai_link grg_dai[] = {
{
.name = "PCM3501E.0", /* Codec name */
.stream_name = "PCM3501EStream.0", /* Stream name */
.cpu_dai_name = "davinci-mcasp.0", /* McASP instance to be Used */
.codec_dai_name = "pcm3501e-hifi",
.codec_name = "pcm3501e-codec.0", /* for multi-codec */
.platform_name = "davinci-pcm-audio", /* for multi-platform */
.init = NULL, /* codec/machine specific init - e.g. add machine controls */
.ops = &grg_snd_soc_ops, /* machine stream operations */
},
{
.name = "PCM3501E.1", /* Codec name */
.stream_name = "PCM3501EStream.1", /* Stream name */
.cpu_dai_name = "davinci-mcasp.0", /* McASP instance to be Used */
.codec_dai_name = "pcm3501e-hifi",
.codec_name = "pcm3501e-codec.1", /* for multi-codec */
.platform_name = "davinci-pcm-audio", /* for multi-platform */
.init = NULL, /* codec/machine specific init - e.g. add machine controls */
.ops = &grg_snd_soc_ops, /* machine stream operations */
},
{
.name = "PCM3501E.2", /* Codec name */
.stream_name = "PCM3501EStream.2", /* Stream name */
.cpu_dai_name = "davinci-mcasp.0", /* McASP instance to be Used */
.codec_dai_name = "pcm3501e-hifi",
.codec_name = "pcm3501e-codec.2", /* for multi-codec */
.platform_name = "davinci-pcm-audio", /* for multi-platform */
.init = NULL, /* codec/machine specific init - e.g. add machine controls */
.ops = &grg_snd_soc_ops, /* machine stream operations */
},
{
.name = "PCM3501E.3", /* Codec name */
.stream_name = "PCM3501EStream.3", /* Stream name */
.cpu_dai_name = "davinci-mcasp.0", /* McASP instance to be Used */
.codec_dai_name = "pcm3501e-hifi",
.codec_name = "pcm3501e-codec.3", /* for multi-codec */
.platform_name = "davinci-pcm-audio", /* for multi-platform */
.init = NULL, /* codec/machine specific init - e.g. add machine controls */
.ops = &grg_snd_soc_ops, /* machine stream operations */
},
};
Note - The codec I am using is PCM3501e and in its driver I have defined 4 codec dais to correspond to this definition.
4. When the board boots up, I can see that 4 pcm nodes come up as given below.
controlC0 pcmC0D0p pcmC0D1p pcmC0D2p pcmC0D3p
pcmC0D0c pcmC0D1c pcmC0D2c pcmC0D3c timer
5. Also enabling the debug messages I am seeing that each of the codec dai's are getting DMA allocated. See the dump at the end of the post.
6. When I try to playback a file using aplay, I see that no DMA IRQs are getting generated. The dump is given below.
Kindly tell me what I am missing.
===========================================================================================================
Register dump with first channel accessed.
aplay -D"hw:0,0" -r16000 -traw -fS16_LE -c1 sine.wav.raw
...
Reg Value (0x0) : 44307302
Reg Value (0x10) : 0
Reg Value (0x14) : b400000f
Reg Value (0x18) : 0
Reg Value (0x1c) : 7c000090
Reg Value (0x20) : 0
Reg Value (0x44) : 1f00
Reg Value (0x48) : 0
Reg Value (0x4c) : 0
Reg Value (0x50) : 0
Reg Value (0x60) : 1f00
Reg Value (0x64) : ffff
Reg Value (0x68) : 74
Reg Value (0x6c) : 2
Reg Value (0x70) : 18009f
Reg Value (0x74) : 8000
Reg Value (0x78) : 0
Reg Value (0x7c) : 0
Reg Value (0x80) : 104
Reg Value (0x84) : 0
Reg Value (0x88) : 0
Reg Value (0x8c) : 0
Reg Value (0xa0) : 1f00
Reg Value (0xa4) : ffff
Reg Value (0xa8) : 18074
Reg Value (0xac) : 82
Reg Value (0xb0) : bf
Reg Value (0xb4) : 0
Reg Value (0xb8) : 1
Reg Value (0xbc) : 0
Reg Value (0xc0) : 175
Reg Value (0xc4) : 0
Reg Value (0xc8) : 85000000
Reg Value (0xcc) : 0
Reg Value (0x100) : 0
Reg Value (0x104) : 0
Reg Value (0x108) : 0
Reg Value (0x10c) : 0
Reg Value (0x110) : 0
Reg Value (0x114) : 0
Reg Value (0x118) : 0
Reg Value (0x11c) : 0
Reg Value (0x120) : 0
Reg Value (0x124) : 0
Reg Value (0x128) : 0
Reg Value (0x12c) : 0
Reg Value (0x130) : 0
Reg Value (0x134) : 0
Reg Value (0x138) : 0
Reg Value (0x13c) : 0
Reg Value (0x140) : 0
Reg Value (0x144) : 0
Reg Value (0x148) : 0
Reg Value (0x14c) : 0
Reg Value (0x150) : 0
Reg Value (0x154) : 0
Reg Value (0x158) : 0
Reg Value (0x15c) : 0
Reg Value (0x180) : 11
Reg Value (0x184) : 11
Reg Value (0x188) : 11
Reg Value (0x190) : 2
Reg Value (0x194) : 2
Reg Value (0x200) : 0
Reg Value (0x204) : 0
Reg Value (0x208) : 0
Reg Value (0x20c) : 0
Reg Value (0x210) : 0
Reg Value (0x214) : 0
Reg Value (0x280) : 0
Reg Value (0x284) : 0
Reg Value (0x288) : 0
Reg Value (0x28c) : 0
Reg Value (0x290) : 0
Reg Value (0x294) : 0
Reg Value (0x1000) : 11004
Reg Value (0x1004) : 0
Reg Value (0x1008) : 1004
Reg Value (0x100c) : 0
===========================================================================
debug prints when the playback is happening
Enter McASP : davinci_mcasp_startup +953
EDMA: EER0 00000000
asoc: pcm3501e-hifi <-> davinci-mcasp.0 info:
asoc: rate mask 0x8
asoc: min ch 1 max ch 2
asoc: min rate 16000 max rate 16000
Enter McASP : davinci_mcasp_set_dai_fmt +518
Exit : grg_snd_soc_hw_params +65
Enter: sound/soc/codecs/pcm3501e.c +38
Enter McASP : davinci_mcasp_hw_params +865
Enter McASP : davinci_hw_common_param +705
Enter McASP : davinci_hw_param +766
Enter McASP : davinci_config_channel_size +621
davinci_pcm: audio_set_dma_params_play channel = 191 dma_ptr = 872a0000 period_size=fa0
davinci_pcm: audio_set_dma_params_play channel = 191 dma_ptr = 872a0fa0 period_size=fa0
EDMA: ER0 00000000
EDMA: EER0 00000100
pcm3501e-codec pcm3501e-codec.0: Setting standby bias
pcm3501e-codec pcm3501e-codec.0: Setting bias prepare
pcm3501e-codec pcm3501e-codec.0: Setting full bias
Enter McASP : davinci_mcasp_trigger +915
Enter McASP : davinci_mcasp_start +463
Enter McASP : mcasp_start_tx +416
ALSA sound/core/pcm_lib.c:1765: playback write error (DMA or IRQ trouble?)
ALSA sound/core/pcm_lib.c:1765: playback write error (DMA or IRQ trouble?)
Enter McASP : davinci_mcasp_trigger +915
Enter McASP : davinci_mcasp_stop +498
Enter McASP : mcasp_stop_tx +489
EDMA: EER0 00000000
pop wq checking: PCM3501E Playback status: inactive waiting: yes
pcm3501e-codec pcm3501e-codec.0: Setting bias prepare
pcm3501e-codec pcm3501e-codec.0: Setting standby bias