ALSA DMA or ISA not working on IMX6Q

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ALSA DMA or ISA not working on IMX6Q

9,330 Views
johnturnur
Contributor III

hi,

We are having a hardware with IMX6Q and TAS5706 audio amplifier chip.

Its configuration is different than standard SABRE SD board.

I have written a driver which works with ALSA.

I am able to communicat IC with I2C commands.

But i am not able to tranfer data .

getting follwoing error

"playback write error (DMA or IRQ trouble?)"

"aplay: pcm_write"

"write error: I/O error"

At this time state is in SNDRV_PCM_STATE_RUNNING.

Thanks,

Labels (6)
30 Replies

1,057 Views
fabio_estevam
NXP Employee
NXP Employee

Which kernel version are you using? Have you loaded the SDMA firmware?

0 Kudos

1,057 Views
johnturnur
Contributor III

Hi,

Fabio

I am using SDMA firmware 1.1.

Thanks

0 Kudos

1,057 Views
johnturnur
Contributor III

hi

Any input on this issue?


0 Kudos

1,057 Views
johnturnur
Contributor III

I am using ANDROID 13.4.1 ICS code only and I have modified it for our custome hardware.

my board confing file is the same as imx6, its should load the default SDMA firmware.

Thanks for this information.

0 Kudos

1,057 Views
lily_zhang
NXP Employee
NXP Employee

hello, John:

Besides AUDMUX pin configuration, please also check mxc_audio_platform_data configurations in your board files.

1,057 Views
johnturnur
Contributor III

Hi,

My here is my mxc_audio_platform_data

static struct mxc_audio_platform_data tas5706_data = {

.ssi_num = 1,

.src_port = 2,

.ext_port = 6,

// .hp_gpio = SABRESD_HEADPHONE_DET,

.hp_active_low = 1,

// .mic_gpio = SABRESD_MICROPHONE_DET,

.mic_active_low = 1,

.init = mxc_tas5706b_init,

.clock_enable = tas5706b_clk_enable,

};

And my debug log which can give you some information:

alsa_aplay youcantdothat_44s.wav                          
snd_pcm_playback_open
snd_pcm_open
snd_pcm_open_file
imx_ssi_startup
snd_imx_open
imx_hifi_startup IN
tas5706b_clk_enable
imx_hifi_startup OUT
snd_pcm_hw_constraints_complete
snd_pcm_mmap
Playing WAVE 'youcantdothat_44s.wpdata snd_pcm_lib_ioctl_fifo_size fifosize =16 width 0, ch 2
av' : Signed 16 bit Little Endianpdata snd_pcm_lib_ioctl_fifo_size fifosize =16 width 0, ch 2
, Rate 44100 Hz, Stereo
pdata snd_pcm_lib_ioctl_fifo_size fifosize =16 width 0, ch 2
pdata snd_pcm_lib_ioctl_fifo_size fifosize =16 width 0, ch 2
imx_hifi_hw_params IN

tas5706_set_dai_fmt SND_SOC_DAIFMT_CBM_CFM
tas5706_set_dai_fmt SND_SOC_DAIFMT_I2S
tas5706_set_dai_fmt SND_SOC_DAIFMT_NB_NF
for_debug Has removed tas5706_set_dai_fmtimx_ssi_set_dai_tdm_slot
imx_ssi_set_dai_fmt
imx_ssi_set_dai_fmt SND_SOC_DAIFMT_I2S

for_debug Has removed tas5706_set_fll
for_debug Has removed tas5706_set_dai_sysclkimx_hifi_hw_params OUT

tas5706_hw_params tas5706->lrclk 44100

tas5706_hw_params SNDRV_PCM_FORMAT_S16_LE

tas5706_hw_params error Register = 255imx_ssi_hw_params
snd_soc_dai_set_dma_data  SNDRV_PCM_STREAM_PLAYBACK
imx_ssi_hw_params SNDRV_PCM_FORMAT_S16_LE
snd_imx_pcm_hw_params
imx_ssi_dma_alloc
filter
snd_pcm_prepare
snd_pcm_action_single in
snd_imx_pcm_prepare

for_debug Has removed tas5706_set_bias_level
snd_pcm_action_single out
snd_pcm_prepare out 0
snd_pcm_lib_write
snd_pcm_lib_write_transfer IN
COPYFRM IN
COPYFRM OUT
snd_pcm_lib_write_transfer OUT
snd_pcm_update_state
snd_pcm_lib_write
snd_pcm_lib_write_transfer IN
COPYFRM IN
COPYFRM OUT
snd_pcm_lib_write_transfer OUT
snd_pcm_update_state
snd_pcm_lib_write
snd_pcm_lib_write_transfer IN
COPYFRM IN
COPYFRM OUT
snd_pcm_lib_write_transfer OUT
snd_pcm_update_state
snd_pcm_lib_write
snd_pcm_lib_write_transfer IN
COPYFRM IN
COPYFRM OUT
snd_pcm_lib_write_transfer OUT
snd_pcm_action in
snd_pcm_action_single in
snd_pcm_do_start
snd_imx_pcm_trigger
imx_ssi_trigger
snd_pcm_post_start IN
snd_pcm_post_start NOTI TIME IN
snd_pcm_post_start NOTI TIME OUT
snd_pcm_post_start OUT
snd_pcm_action_single out
snd_pcm_action OUT 0
snd_pcm_update_state
snd_pcm_lib_write
snd_pcm_update_hw_ptr
snd_pcm_update_hw_ptr0
snd_imx_pcm_pointer
snd_imx_pcm_pointer: 0 0
state 3 wait_time = 1000
perror playback write error (DMA or IRQ trouble?)
aplay: pcm_write:1604: snd_pcm_action in
snd_pcm_action_single in
write error: I/O error
snd_imx_pcm_trigger
imx_ssi_trigger
snd_pcm_action_single out
snd_pcm_action OUT 0
snd_imx_pcm_hw_free
snd_pcm_release
snd_imx_pcm_hw_free
imx_ssi_shutdown
imx_hifi_shutdown IN
tas5706b_clk_enable
imx_hifi_shutdown OUT
snd_imx_close

0 Kudos

1,057 Views
JerryFan
NXP Employee
NXP Employee

I guess you connected the TAS5706 with i.MX6Q using ESAI bus, right? AndTAS5706 is the bus master or slave(the bus master supplies the bit/frame clock)? And if TAS5706 is the master, please probe the bit/frame clock to make sure they are OK. The ESAI within i.MX6Q can not transfer any data without the bit/frame clock when it is in slave mode.

1,057 Views
johnturnur
Contributor III

Hi,

Thanks for your reply

We have connected throught I2S on AUD6. IMX6 provides all clocking source to the TAS5706.

TAS5706 is a slave device.

I have configured the

   MX6Q_PAD_DI0_PIN2__AUDMUX_AUD6_TXD,     /* AUD6_TXD     */
    MX6Q_PAD_DI0_PIN3__AUDMUX_AUD6_TXFS,    /* AUD6_TXFS    */
    MX6Q_PAD_DI0_PIN15__AUDMUX_AUD6_TXC,    /* AUD6_TXC     */

What else settings are required on IMX6Q side and  TAS5706 audio driver side?


Thanks

0 Kudos

1,057 Views
JerryFan
NXP Employee
NXP Employee

So the playback hang or no music can be heard? Please probe the TXFS and TXC firstly when playing .

0 Kudos

1,057 Views
johnturnur
Contributor III


Thansk for your information. I will try.

No music comes out, and I think i wait for the DMA.

Following is my log for alsa_aplay -Dplughw:0,0 -v 1.wav, Any clue for this log.

Plug PCM:

Hardware PCM card 0 'o' device 0 subdevice 0

Its setup is:

  stream       : PLAYBACK

  access       : RW_INTERLEAVED

  format       : S16_LE

  subformat    : STD

  channels     : 2

  rate         : 44100

  exact rate   : 44100 (44100/1)

  msbits       : 16

  buffer_size  : 22052

  period_size  : 5513

  period_time  : 125011

  tstamp_mod   : NONE

  period_step  : 1

  avail_min    : 5513

  period_event : 0

  start_threshold  : 22052

  stop_threshold   : 22052

  silence_threshold: 0

  silence_ssize : 0

  boundary     : 1445199872

  appl_ptr     : 0

  hw_ptr       : 0

0 Kudos