I2c Error in using BeagleBone Black with custom audio cape ( using ti’s TLV320AIC3107 codec )

audiobeaglebone blacki2ci2stexas instruments

I have made custom audio cape using TLV320AIC3107 codec and here is a schematic diagram.

Audio cape using TLV320AIC3107

For connection with BeagleBone Black I refer audio cape which is available in market. here is a link: CircuiCo – Audio cape.

I installed the DT Overlay as follows:

root@beaglebone:~# echo BB-BONE-AUDI-02 > /sys/devices/bone_capemgr.8/slots

root@beaglebone:~# dmesg

[  254.659557] bone-capemgr bone_capemgr.8: part_number 'BB-BONE-AUDI-02', version 'N/A'
[  254.659641] bone-capemgr bone_capemgr.8: slot #7: generic override
[  254.659659] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 7
[  254.659677] bone-capemgr bone_capemgr.8: slot #7: 'Override Board Name,00A0,Override Manuf,BB-BONE-AUDI-02'
[  254.659784] bone-capemgr bone_capemgr.8: slot #7: Requesting part number/version based 'BB-BONE-AUDI-02-00A0.dtbo
[  254.659802] bone-capemgr bone_capemgr.8: slot #7: Requesting firmware 'BB-BONE-AUDI-02-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[  254.668469] bone-capemgr bone_capemgr.8: slot #7: dtbo 'BB-BONE-AUDI-02-00A0.dtbo' loaded; converting to live tree
[  254.668961] bone-capemgr bone_capemgr.8: slot #7: #4 overlays
[  254.678886] of_get_named_gpio_flags: can't parse gpios property
[  254.682895] 1-0018 supply IOVDD not found, using dummy regulator
[  254.682971] 1-0018 supply DVDD not found, using dummy regulator
[  254.683035] 1-0018 supply AVDD not found, using dummy regulator
[  254.683096] 1-0018 supply DRVDD not found, using dummy regulator
[  254.692524] davinci_evm sound.13:  tlv320aic3x-hifi <-> 48038000.mcasp mapping ok
[  254.701641] bone-capemgr bone_capemgr.8: slot #7: Applied #4 overlays.

Which seems to have installed successfully. To confirm:

root@beaglebone:~# cat /proc/asound/devices
  2: [ 0- 0]: digital audio playback
  3: [ 0- 0]: digital audio capture
  4: [ 0]   : control
 33:        : timer

root@beaglebone:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=EVM
    DA830 EVM, 
    Default Audio Device
sysdefault:CARD=EVM
    DA830 EVM, 
    Default Audio Device

root@beaglebone:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: EVM [DA830 EVM], device 0: AIC3X tlv320aic3x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Now I try to play wave file :

root@beaglebone:~/Desktop# aplay -vv test_stereo_8000Hz_8bit_PCM.wav 
Playing WAVE 'test_stereo_8000Hz_8bit_PCM.wav' : Unsigned 8 bit, Rate 8000 Hz, Stereo
Plug PCM: Linear conversion PCM (S16_LE)
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : U8
  subformat    : STD
  channels     : 2
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 8
  buffer_size  : 16000
  period_size  : 1000
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1000
  period_event : 0
  start_threshold  : 16000
  stop_threshold   : 16000
  silence_threshold: 0
  silence_size : 0
  boundary     : 2097152000
Slave: Hardware PCM card 0 'DA830 EVM' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 16
  buffer_size  : 16000
  period_size  : 1000
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1000
  period_event : 0
  start_threshold  : 16000
  stop_threshold   : 16000
  silence_threshold: 0
  silence_size : 0
  boundary     : 2097152000
  appl_ptr     : 0
  hw_ptr       : 0
#######   +                                        | 19% 

after that board freezes and not responding.

When I check dmesg, I see the following error:

root@beaglebone:~/Desktop# dmesg

[  904.298073] omap_i2c 4819c000.i2c: Arbitration lost
[  905.330496] omap_i2c 4819c000.i2c: controller timed out

Any one have Idea ? what's wrong ?

Best Answer

Rather than trying at kernel level I would suggest trying it at uboot level.

uboot has some i2c tools builtin using which you may set i2c bus number and further probe for available i2c slave devices which ideally should detect your codecs i2c ID automatically if everything is fine.

If it doesn't then something might be wrong with the SDA and SCL pull up. Also check to which i2c bus you have connected this codec and whether a pull up is required for that or not.