Hi all,
I am working on a custom board based on AT91SAM9G20 to make working th audio section.
The hardware is like the EVB, connecting Wolfson WM8731 to SSC and I2C bus.
I was able to play something, but it doesn't work 100% of the times.
I see some error on I2C bus:
Code:
i2c-adapter i2c-0: wrote 2 bytes
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 A
i2c-adapter i2c-0: i2c_outb: 0x10 A
i2c-adapter i2c-0: i2c_outb: 0x23 A
i2c-adapter i2c-0: wrote 2 bytes
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 A
i2c-adapter i2c-0: i2c_outb: 0x0e A
i2c-adapter i2c-0: i2c_outb: 0x42 A
i2c-adapter i2c-0: wrote 2 bytes
atmel_ssc_hw_params: RCMR=00010721 RFMR=0000008f TCMR=00010702 TFMR=0000008f
atmel_ssc_dai: Starting clock
atmel_ssc_dai,hw_params: SSC initialized
WM8731 I2C Codec 0-001b: wm8731_pcm_prepare
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 A
i2c-adapter i2c-0: i2c_outb: 0x12 A
i2c-adapter i2c-0: i2c_outb: 0x01 A
i2c-adapter i2c-0: wrote 2 bytes
transmit enabled SSC_SR=0x000104cf
at91sam9g20ek_set_bias_level : level= 1 mclk_on=0
WM8731 I2C Codec 0-001b: wm8731_set_bias_level
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 A
i2c-adapter i2c-0: Used 3 tries to write to client at 0x1b: success
i2c-adapter i2c-0: i2c_outb: 0x0c NA
i2c-adapter i2c-0: sendbytes: NAK bailout.
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: NAK from device addr 0x1b msg #0
at91sam9g20ek_set_bias_level : level= 0 mclk_on=1
WM8731 I2C Codec 0-001b: wm8731_set_bias_level
WM8731 I2C Codec 0-001b: wm8731_mute: 0
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 A
i2c-adapter i2c-0: Used 2 tries to write to client at 0x1b: success
i2c-adapter i2c-0: i2c_outb: 0x0a A
i2c-adapter i2c-0: i2c_outb: 0x00 A
i2c-adapter i2c-0: wrote 2 bytes
ALSA sound/core/pcm_lib.c:1641: playback write error (DMA or IRQ trouble?)
WM8731 I2C Codec 0-001b: wm8731_mute: 1
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 A
i2c-adapter i2c-0: i2c_outb: 0x0a A
i2c-adapter i2c-0: i2c_outb: 0x08 NA
i2c-adapter i2c-0: sendbytes: NAK bailout.
atmel_ssc_shutdown: transmit disabled SSC_SR=0x000000c0
atmel_ssc_dau: Stopping clock
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 A
i2c-adapter i2c-0: i2c_outb: 0x12 NA
i2c-adapter i2c-0: sendbytes: NAK bailout.
pop wq checking: Playback status: inactive waiting: yes
at91sam9g20ek_set_bias_level : level= 1 mclk_on=1
WM8731 I2C Codec 0-001b: wm8731_set_bias_level
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 A
i2c-adapter i2c-0: Used 2 tries to write to client at 0x1b: success
i2c-adapter i2c-0: i2c_outb: 0x0c A
i2c-adapter i2c-0: i2c_outb: 0x57 NA
i2c-adapter i2c-0: sendbytes: NAK bailout.
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: NAK from device addr 0x1b msg #0
at91sam9g20ek_set_bias_level : level= 2 mclk_on=1
WM8731 I2C Codec 0-001b: wm8731_set_bias_level
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: NAK from device addr 0x1b msg #0
atmel_ssc_startup: SSC_SR=0x192
asoc: WM8731 <-> atmel-ssc0 info:
asoc: rate mask 0x6fe
asoc: min ch 1 max ch 2
asoc: min rate 8000 max rate 96000
i2c-adapter i2c-0: master_xfer[0] W, addr=0x1b, len=2
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: i2c_outb: 0x36 NA
i2c-adapter i2c-0: NAK from device addr 0x1b msg #0
Lots of NAK are reported by codec. Once it reach this state any command sent will be replied with a NAK, so the only solution is to power on/off the board and restart the configuration.
The kernel is 2.6.30.
I tested also the new EVB AT91SAM9x5ek that use the same codec and a new kernel 2.6.39.
The audio is very bad and to have the audio working you must switch the master volume to unmute/mute.
A noise is in any case present.
Has anyone been able to get the audio section properly working?
On at91sam9g45ek EVB using another codec with AC97 everything works.
After this analisys I think that we can focus on the issue related to i2c communication between the micro and the codec through i2c.
Any comments or help is welcome.