2011-10-15 19:02:24     ad1854 sound 2010-Rc5 bf537

Document created by Aaronwu Employee on Aug 28, 2013
Version 1Show Document
  • View in full screen mode

2011-10-15 19:02:24     ad1854 sound 2010-Rc5 bf537

Chris Page (UNITED STATES)

Message: 103879   

 

I am currently updating our current kernel to 2010-RC5. The sound drivers have completely changed. We have succesfully ported the ad1836.c file previously to work with an ad1854. As your forums said   docs.blackfin.uclinux.org/doku.php?id=hw:boards:bf537-ezkit you can get limited audio output. Tansferring previous changes to the new ad183x.c doesn't look to easy. Without modifying ad183x.c in  I2S mode. /dev/dsp is not created I believe because something fails when been probed (no errors are printed to the kernel log).

 

Can I use the old kernel bf5xx_sport, ad1863c (2009) files in this new kernel. Maybe create a new directory and compile them?

 

or

 

Should I just modify the ad183x.c file in the newer linux version. Any advice on where to begin?

QuoteReplyEditDelete

 

 

2011-10-17 00:49:16     Re: ad1854 sound 2010-Rc5 bf537

Sonic Zhang (CHINA)

Message: 103887   

 

You should extend the ad183x.c driver to support your codec and send patch to us for review. ALSA framework changes across kernel verisons. If you don't get your extension merged into mainline kernel, you always lose it in next release.

QuoteReplyEditDelete

 

 

2011-10-18 16:45:28     Re: ad1854 sound 2010-Rc5 bf537

Chris Page (UNITED STATES)

Message: 103963   

 

Hi

 

To modify the codec I am trying to remove all spi control. Not using codecs sound control. Only use the I2S(TDM). I have replaced spi_driver with a platform driver and remove all snd_soc_write and snd_soc_update_bits. These are doing spi writes. I have successully created /dev/dsp (asoc: AD183X <-> bf5xx-tdm mapping ok), however when I run vplay or tone I get a null pointer error shown at the end indicating a sport tx or rx error.

 

Question

 

- Will using a platform_driver be acceptable?

 

- Do I need snd_soc_write configured? If so I am not using SPI or I2C, where is snd_soc_write implemented (should be in soc-core.c)?

 

- soc-core.c todo list includes Support TDM on PCM and I2S. Will TDM still work?

 

 

 

/* ERROR RECEIVED, this occurs after ad183x_hw_params*/

 

Jump to NULL address

 

Kernel OOPS in progress

 

Deferred Exception context

 

CURRENT PROCESS:

 

COMM=vplay PID=261  CPU=0

 

TEXT = 0x02cb4000-0x02cb6890        DATA = 0x02d81890-0x02d81bf0

 

BSS = 0x02d81bf0-0x02d00000  USER-STACK = 0x02d1fea0

 

 

 

return address: [0x(null)]; contents of:

 

 

 

ADSP-BF537-0.3 500(MHz CCLK) 125(MHz SCLK) (mpu off)

 

Linux version 2.6.34.7-ADI-2010R1 (cmd@chris-ubuntu) (gcc version 4.3.5 (ADI-2010R1-RC4) ) #89 Sat Oct 15 14:56:14 EDT 2011

 

 

 

SEQUENCER STATUS:               Not tainted

 

SEQSTAT: 0000002d  IPEND: 8008  IMASK: ffff  SYSCFG: 0006

 

  EXCAUSE   : 0x2d

 

  physical IVG3 asserted : <0xffa007b0> { _trap + 0x0 }

 

  physical IVG15 asserted : <0xffa00fec> { _evt_system_call + 0x0 }

 

  logical irq   6 mapped  : <0xffa003ec> { _bfin_coretmr_interrupt + 0x0 }

 

  logical irq  10 mapped  : <0x000fb50c> { _bfin_rtc_interrupt + 0x0 }

 

  logical irq  12 mapped  : <0x02c45198> { :snd_soc_bf5xx_sport:_rx_handler + 0x0 }

 

  logical irq  13 mapped  : <0x02c45130> { :snd_soc_bf5xx_sport:_tx_handler + 0x0 }

 

  logical irq  16 mapped  : <0x000fdf08> { _bfin_twi_interrupt_entry + 0x0 }

 

  logical irq  18 mapped  : <0x000d02a8> { _bfin_serial_dma_rx_int + 0x0 }

 

  logical irq  19 mapped  : <0x000d0000> { _bfin_serial_dma_tx_int + 0x0 }

 

  logical irq  24 mapped  : <0x000f5378> { _bfin_mac_interrupt + 0x0 }

 

  logical irq  45 mapped  : <0x02c44e5c> { :snd_soc_bf5xx_sport:_err_handler + 0x0 }

 

  logical irq  57 mapped  : <0x000f90f4> { _ads7846_irq + 0x0 }

 

RETE: <0x00000000> /* Maybe null pointer? */

 

 

QuoteReplyEditDelete

 

 

2011-10-18 23:39:27     Re: ad1854 sound 2010-Rc5 bf537

Sonic Zhang (CHINA)

Message: 103969   

 

You forgot to paste the back trace information in your error log.

QuoteReplyEditDelete

 

 

2011-10-19 10:08:57     Re: ad1854 sound 2010-Rc5 bf537

Chris Page (UNITED STATES)

Message: 103993   

 

Hi

 

Here is a total print out. The kernel crashes so I cannot get anymore info. Again I am NOT using spi or i2c. The codec is only been driven by the sport. I realize that I will not be able to control volume etc. but that is ok. It is probably crashing in snd_soc_update_bits (which my codec driver is NOT calling) but I do not want snd_soc_write to be called through spi or i2c. If I do not pass hw_params to the driver I do not get this crash. I just get the following error.

 

/* ERROR WITH HW_PARAMS */

 

tone

 

asoc: machine hw_params failed

 

ERROR: ioctl(SNDCTL_DSP_SPEED,48000) failed, errno=22asoc: machine hw_params failed

 

- Do I need snd_soc_write configured? If so I am not using SPI or I2C, where is snd_soc_write implemented (should be in soc-core.c)?

 

- soc-core.c todo list includes Support TDM on PCM and I2S. Will TDM still work?

 

/* NULL POINTER EXCEPTION WITH HW_PARAMS */

 

root:/> tone

 

TONE: generatiJg sine wave at 1000 Hz...ump to NULL address

 

Kernel OOPS in progress

 

Deferred Exception context

 

CURRENT PROCESS:

 

COMM=tone PID=261  CPU=0

 

TEXT = 0x02d9c000-0x02d9f910        DATA = 0x02dc0910-0x02df18d4

 

BSS = 0x02df18d4-0x02c00000  USER-STACK = 0x02c1fec0

 

 

 

return address: [0x(null)]; contents of:

 

 

 

ADSP-BF537-0.3 500(MHz CCLK) 125(MHz SCLK) (mpu off)

 

Linux version 2.6.34.7-ADI-2010R1 (cmd@chris-ubuntu) (gcc version 4.3.5 (ADI-2010R1-RC4) ) #89 Sat Oct 15 14:56:14 EDT 2011

 

 

 

SEQUENCER STATUS:               Not tainted

 

SEQSTAT: 0000002d  IPEND: 8008  IMASK: ffff  SYSCFG: 0006

 

  EXCAUSE   : 0x2d

 

  physical IVG3 asserted : <0xffa007b0> { _trap + 0x0 }

 

  physical IVG15 asserted : <0xffa00fec> { _evt_system_call + 0x0 }

 

  logical irq   6 mapped  : <0xffa003ec> { _bfin_coretmr_interrupt + 0x0 }

 

  logical irq  10 mapped  : <0x000fb50c> { _bfin_rtc_interrupt + 0x0 }

 

  logical irq  12 mapped  : <0x02c49198> { :snd_soc_bf5xx_sport:_rx_handler + 0x0 }

 

  logical irq  13 mapped  : <0x02c49130> { :snd_soc_bf5xx_sport:_tx_handler + 0x0 }

 

  logical irq  16 mapped  : <0x000fdf08> { _bfin_twi_interrupt_entry + 0x0 }

 

  logical irq  18 mapped  : <0x000d02a8> { _bfin_serial_dma_rx_int + 0x0 }

 

  logical irq  19 mapped  : <0x000d0000> { _bfin_serial_dma_tx_int + 0x0 }

 

  logical irq  24 mapped  : <0x000f5378> { _bfin_mac_interrupt + 0x0 }

 

  logical irq  45 mapped  : <0x02c48e5c> { :snd_soc_bf5xx_sport:_err_handler + 0x0 }

 

  logical irq  57 mapped  : <0x000f90f4> { _ads7846_irq + 0x0 }

 

RETE: <0x00000000> /* Maybe null pointer? */

 

RETN: <0x02d3fbd8> /* kernel dynamic memory (maybe user-space) */

 

RETX: <0x00000480> /* Maybe fixed code section */

 

RETS: <0x0011618e> { _snd_soc_update_bits + 0x16 }

 

PC  : <0x00000000> /* Maybe null pointer? */

 

DCPLB_FAULT_ADDR: <0x0287fae0> /* kernel dynamic memory (maybe user-space) */

 

ICPLB_FAULT_ADDR: <0x00000000> /* Maybe null pointer? */

 

PROCESSOR STATE:

 

R0 : 0287faa0    R1 : 0000000c    R2 : 00000080    R3 : 00000006

 

R4 : 00000001    R5 : 0000000c    R6 : 0000000c    R7 : ffffff7f

 

P0 : 00206610    P1 : ffffffa8    P2 : 00000000    P3 : 02d3fc3c

 

P4 : 0287faa0    P5 : 0287faa0    FP : 00000058    SP : 02d3fafc

 

LB0: 000b3962    LT0: 000b3956    LC0: 00000000

 

LB1: 02c497fa    LT1: 02c4978e    LC1: 00000000

 

B0 : 00000000    L0 : 00000000    M0 : 00010000    I0 : 00000058

 

B1 : 000000c0    L1 : 00000000    M1 : 00000001    I1 : 0287faa0

 

B2 : 7ffff000    L2 : 00000000    M2 : 00001802    I2 : a1c86000

 

B3 : 00000000    L3 : 00000000    M3 : 0000005b    I3 : 00c244ba

 

A0.w: 00000000   A0.x: 00000000   A1.w: 00000000   A1.x: 00000000

 

USP : 02c1fdac  ASTAT: 02002062

 

 

 

Hardware Trace:

 

   0 Target : <0x00003efc> { _trap_c + 0x0 }

 

     Source : <0xffa00744> { _exception_to_level5 + 0xa4 } CALL pcrel

 

   1 Target : <0xffa006a0> { _exception_to_level5 + 0x0 }

 

     Source : <0xffa00554> { _bfin_return_from_exception + 0x18 } RTX

 

   2 Target : <0xffa0053c> { _bfin_return_from_exception + 0x0 }

 

     Source : <0xffa005f8> { _ex_trap_c + 0x74 } JUMP.S

 

   3 Target : <0xffa00584> { _ex_trap_c + 0x0 }

 

     Source : <0xffa0080a> { _trap + 0x5a } JUMP (P4)

 

   4 Target : <0xffa007b0> { _trap + 0x0 }

 

      FAULT : <0x00000000> /* Maybe null pointer? */

 

     Source : <0x0011618c> { _snd_soc_update_bits + 0x14 } CALL (P2)

 

   5 Target : <0x00116178> { _snd_soc_update_bits + 0x0 }

 

     Source : <0x0011923a> { _dapm_seq_run_coalesced + 0x172 } CALL pcrel

 

   6 Target : <0x00119232> { _dapm_seq_run_coalesced + 0x16a }

 

     Source : <0x00118d10> { _pop_wait + 0xc } RTS

 

   7 Target : <0x00118d04> { _pop_wait + 0x0 }

 

     Source : <0x0011922e> { _dapm_seq_run_coalesced + 0x166 } CALL pcrel

 

   8 Target : <0x0011922a> { _dapm_seq_run_coalesced + 0x162 }

 

     Source : <0x00118d48> { _pop_dbg + 0x28 } RTS

 

   9 Target : <0x00118d42> { _pop_dbg + 0x22 }

 

     Source : <0x00118d30> { _pop_dbg + 0x10 } IF CC JUMP pcrel (BP)

 

  10 Target : <0x00118d20> { _pop_dbg + 0x0 }

 

     Source : <0x00119226> { _dapm_seq_run_coalesced + 0x15e } CALL pcrel

 

  11 Target : <0x0011920a> { _dapm_seq_run_coalesced + 0x142 }

 

     Source : <0x00119150> { _dapm_seq_run_coalesced + 0x88 } IF CC JUMP pcrel

 

  12 Target : <0x00119136> { _dapm_seq_run_coalesced + 0x6e }

 

     Source : <0x00119122> { _dapm_seq_run_coalesced + 0x5a } IF CC JUMP pcrel

 

  13 Target : <0x00119114> { _dapm_seq_run_coalesced + 0x4c }

 

     Source : <0x00118d48> { _pop_dbg + 0x28 } RTS

 

  14 Target : <0x00118d42> { _pop_dbg + 0x22 }

 

     Source : <0x00118d30> { _pop_dbg + 0x10 } IF CC JUMP pcrel (BP)

 

  15 Target : <0x00118d20> { _pop_dbg + 0x0 }

 

     Source : <0x00119110> { _dapm_seq_run_coalesced + 0x48 } JUMP.L

 

Kernel Stack

 

Stack info:

 

SP: [0x02d3ff24] <0x02d3ff24> /* kernel dynamic memory (maybe user-space) */

 

Memory from 0x02d3ff20 to 02d40000

 

02d3ff20: 02dc09f8 [0298e90a] 00008000  00000000  00000000  02d40000  0298e90a  0298e90a

 

02d3ff40: 02d9cef4  ffa01050  02003044  02d9d277  028a45cf  02d9d264  028a45ce  00000000

 

02d3ff60: 00000000  00000000  00000000  00000000  00000000  00000000  7ffff000  000000c0

 

02d3ff80: 00000000  00000000  00000000  00000000  00000000  0000005b  00001802  00000001

 

02d3ffa0: 00010000  00c244ba  a1c86000  00000000  00000001  02c1fdac  02c1fdb8  02dc0b94

 

02d3ffc0: 02dc0ad8  02d39250  02d963c0  0298e900  00000004  00000003  000000c0  02dc09f8

 

02d3ffe0: 00000064  0000e900  000000c0  02dc0b94  00000003  00000003  00000004  00000006

 

Return addresses in stack:

 

Modules linked in: snd_ad183x snd_soc_ad183x snd_bf5xx_tdm snd_soc_bf5xx_tdm snd_soc_bf5xx_sport

 

Kernel panic - not syncing: Kernel exception

 

Hardware Trace:

 

Stack info:

 

SP: [0x02d3fa20] <0x02d3fa20> /* kernel dynamic memory (maybe user-space) */

 

FP: (0x02d3fb14)

 

Memory from 0x02d3fa20 to 02d40000

 

02d3fa20:[001ae1b0] 0017794e  02d3fafc  001ae1b0  001ed3ce  001ed3ce  001ed3ce  02d3fa50

 

02d3fa40: 00004338  02d3fafc  00008008  02d3fafc  0000003f  0000003f  00000027  000197f4

 

02d3fa60: 0003000b  21ac87fc  00000027  001fc6f0  001f2bf4  001f29f4  001f1cc0  000350fc

 

02d3fa80: 00000009  001f1cec  02d3e000  00000001  00000024  00000100  00000101  00000004

 

02d3faa0: 00000100 <000162b2> 00000006  00033dfc  001fe4a4  029dc5d0  001f18bc  00000006

 

02d3fac0: 001fc6f0  ffa00386  00202fd0  029dc5d0  001f18bc  00000006  ffa00748  001ea000

 

02d3fae0: 00008008  0000002d  0000000c  00000001  ffa00c90  001f18a8  00000480  00000480

 

02d3fb00: 00008008  0000002d  00000000  02d3fbd8  00000480 (00000000)<0011618e> 0287faa0

 

02d3fb20: 02002062  02c497fa  000b3962  02c4978e  000b3956  00000000  00000000  00000000

 

02d3fb40: 00000000  00000000  00000000  00000000  7ffff000  000000c0  00000000  00000000

 

02d3fb60: 00000000  00000000  00000000  0000005b  00001802  00000001  00010000  00c244ba

 

02d3fb80: a1c86000  0287faa0  00000058  02c1fdac  00000058  0287faa0  0287faa0  02d3fc3c

 

02d3fba0: 00000000  ffffffa8  00206610  ffffff7f  0000000c  0000000c  00000001  00000006

 

02d3fbc0: 00000080  0000000c  0287faa0  0287faa0  00206610  00000006  02042080  020420ac

 

02d3fbe0: 0283c660  0011923e  02d3fbe4  00000000  00000080  ffa01dda  00118b90  00000000

 

02d3fc00: 00000000  0000000c  00000000  02d3fc84  001193e6  029d4c00  02d3fc2c  029d4c58

 

02d3fc20: 00000006  02d3fc3c  0000000c  00000058  00000001  00000001  00118c02  029d4b98

 

02d3fc40: 029d4b98  02d3fc7c  00119732  0287fafc  0287fb0c  0287faa0  00000001  00000001

 

02d3fc60: 00000001  00000000  0287faa0  00000000  00000001  00206610  02bb80d4  02d3fc7c

 

02d3fc80: 02d3fc7c  029d4a78  029d4c58 <02d84c58> 00119ea4  0287fafc  00000001  0287faa0

 

02d3fca0: 029d4970  0287fb0c  00000000  00000001  0287f0a0  00000001  00010000  000001d0

 

02d3fcc0: 0287faa8  02be4590  00116d0e  02bb8164  02d84d80  0287f0a0  00000000  02bb80e4

 

02d3fce0: 029dc5d0  0287faa0  00000000  00000000  00000000  0287f0a0 <00107a10> 0287f0a0

 

02d3fd00: 0287f0a0  00000000  00000000  0287f0a0  00000000  02dc0b94  00000001  00000007

 

02d3fd20: 00000004 <00107702> 00205f88  00000008  0287f0a0  ffa02b38  00108a70  0287f0a0

 

02d3fd40: 00205f88  00000000  000000c0  0010aa8e  00000000  0287f0a0  00000000  0010aaa4

 

02d3fd60: 00000000  00000000  02d98dd4  00000800  00000000  00000002  020568c0  00115052

 

02d3fd80: 02056640  02d20c00  02d20000  020566c0  00000000  00044cfa  00000003  00000000

 

02d3fda0: 00000015  7fffffff  0009f52e <000ccff2> 02838600  00000028  00000027  000ce37c

 

02d3fdc0: 00000000  000ce37c  00000000  00000000  02079aa0 <000c7bf2> 02852428  02852800

 

02d3fde0: 02d3e000  0010af02  02bb8800  00000000  0287f0a0  00000001  02dc0b94  21dbbfba

 

02d3fe00: 000c7c3c  0000000a  00000000  02852400  02d3fe48  0000c7e8  0010b21a  02bb8800

 

02d3fe20: 02bb8800  02d39250  00000001  02dc0b94  00000029  00000000  02042920  00000000

 

02d3fe40: 00110c72  02d3fef0  00000029  000c5d56  0284d6e0  00111fa0  0287f0a0  00000029

 

02d3fe60: 000c6092  00000029  0011248c  02bb8800  00000004  02852400  00000029  00000002

 

02d3fe80: 02ab7c58  0284d6e0  02c1fdb8 <00047914> 023b71c0  00000004  02d39250  02d3fef0

 

02d3fea0: 02dc0b94  000000c0  000000c0  02042920  0204294c  02c1fd80  02d3fef0  00000000

 

02d3fec0: 00000000  00047a38  023b71c0  00000004  02dc0b94  000000c0  02dc09f8  00000064

 

02d3fee0: 00202fd0  02d96120  02d3e008  02d3fef0  00000000  00000000  00000000 <ffa00942>

 

02d3ff00: 00047a08  00000000  ffffe000  067905c6  02c1fd80  0000fffe  0000e900  00000064

 

02d3ff20: 02dc09f8  0298e90a  00008000  00000000  00000000  02d40000  0298e90a  0298e90a

 

02d3ff40: 02d9cef4  ffa01050  02003044  02d9d277  028a45cf  02d9d264  028a45ce  00000000

 

02d3ff60: 00000000  00000000  00000000  00000000  00000000  00000000  7ffff000  000000c0

 

02d3ff80: 00000000  00000000  00000000  00000000  00000000  0000005b  00001802  00000001

 

02d3ffa0: 00010000  00c244ba  a1c86000  00000000  00000001  02c1fdac  02c1fdb8  02dc0b94

 

02d3ffc0: 02dc0ad8  02d39250  02d963c0  0298e900  00000004  00000003  000000c0  02dc09f8

 

02d3ffe0: 00000064  0000e900  000000c0  02dc0b94  00000003  00000003  00000004  00000006

 

Return addresses in stack:

 

    address : <0x000162b2> { ___do_softirq + 0x76 }

 

   frame  1 : <0x0011618e> { _snd_soc_update_bits + 0x16 }

 

    address : <0x02d84c58> { :snd_soc_ad183x:_snd_ad1854_probe + 0x824 }

 

    address : <0x00107a10> { _snd_pcm_do_prepare + 0x10 }

 

    address : <0x00107702> { _snd_pcm_action_single + 0x26 }

 

    address : <0x000ccff2> { _uart_start + 0x66 }

 

    address : <0x000c7bf2> { _do_output_char + 0x146 }

 

    address : <0x00047914> { _vfs_write + 0x68 }

 

    address : <0xffa00942> { _system_call + 0x6a }

 

Kernel is dead from this point

QuoteReplyEditDelete

 

 

2011-10-19 14:58:50     Re: ad1854 sound 2010-Rc5 bf537

Chris Page (UNITED STATES)

Message: 103995   

 

I have got rid of the null pointer exception by passing SND_SOC_CUSTOM as apposed to SND_SOC_SPI in snd_soc_codec_set_cache_io and adding my own codec hw_write as follows

 

codec->write  = my_hw_write;

 

static int my_hw_write(void *control_data, const char *data, int len) {

 

return 2;  //ALSA doesn't really take in to account if you are not controlling the codec.

 

}

 

I can get tone and vplay to run but I get no sound. As in the last kernel I am implementing the ad1854 with no controls. The codec should still be run by the sport driver. I get /dev/dsp: Input/output error and again no sound. Any ideas?

QuoteReplyEditDelete

 

 

2011-10-19 20:33:41     Re: ad1854 sound 2010-Rc5 bf537

Chris Page (UNITED STATES)

Message: 103999   

 

The driver is getting stuck at SYNC() in sport_tx_dma_start. I get an error ERROR: write(/dev/dsp) failed, errno=5. I have hooked a scope to the clock of the I2s and I am not getting anything.

 

The tx channel of the dma is 4 which is correct. I am using the sport with i2s and the 1836 codec driver modified. Driver mounts fine. What could I have configured incorrectly or not set to get stuck here? What could stop the sport from toggling the clock line?

QuoteReplyEditDelete

 

 

2011-10-21 03:51:19     Re: ad1854 sound 2010-Rc5 bf537

Scott Jiang (CHINA)

Message: 104065   

 

Your codec seems like ad73311, you can refer that driver.  Does alsa probe your card successfully? And you should check your clock first.

QuoteReplyEditDelete

 

 

2011-10-26 11:51:48     Re: ad1854 sound 2010-Rc5 bf537

Chris Page (UNITED STATES)

Message: 104189   

 

Thanks,

 

I successfully got it running. Had to modify a few files as opposed to one in previous releases. Fixed by setting the internal clock for sport.

Attachments

    Outcomes