[#5633] Power test with ad1836/ad1938, after rtc wake up, audio play error

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

[#5633] Power test with ad1836/ad1938, after rtc wake up, audio play error

Submitted By: Vivi Li

Open Date

2009-10-21 05:15:03     Close Date

2009-11-27 03:44:10

Priority:

Medium     Assignee:

Barry Song

Status:

Closed     Fixed In Release:

2010R1

Found In Release:

2010R1     Release:

Category:

Audio     Board:

STAMP

Processor:

BF537     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Duplicate

Uboot version or rev.:

    Toolchain version or rev.:

gcc4.1-09r1-rc9

App binary format:

N/A     

Summary: Power test with ad1836/ad1938, after rtc wake up, audio play error

Details:

 

Power test with ad1836/ad1938 audio driver on bf537-stamp, after wake up from mem or standby, error message shows up when vrec|vplay. And alsa tool also can not work properly.

 

Bellow is the log for ad1836:

--

Linux version 2.6.31.4-ADI-2010R1-pre-svn7669 (test@uclinux50-bf537-ad9960-ad1836) (gcc version 4.1.2 (ADI svn)) #55 Tue Oct 20 9

register early platform devices

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Limiting kernel memory to 56MB due to anomaly 05000263

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x00127c90

  rodata    = 0x00127c90-0x001883d8

  bss       = 0x00189000-0x0019a30c

  data      = 0x0019a30c-0x001ac000

    stack   = 0x001aa000-0x001ac000

  init      = 0x001ac000-0x008f6000

  available = 0x008f6000-0x037ff000

  DMA Zone  = 0x03e00000-0x04000000

Hardware Trace Active and Enabled

Boot Mode: 0

Reset caused by Software reset

Blackfin support (C) 2004-2009 Analog Devices, Inc.

Compiled for ADSP-BF537 Rev 0.2

Blackfin Linux support by http://blackfin.uclinux.org/

Processor Speed: 500 MHz core clock and 125 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

  External memory: cacheable in instruction cache

Data Cache Enabled for CPU0

  External memory: cacheable (write-back) in data cache

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 14223

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600 ip=10.100.4.50f

PID hash table entries: 256 (order: 8, 1024 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 47596k/65536k RAM, (7464k init code, 1179k kernel code, 529k data, 2048k dma, 6720k reserved)

NR_IRQS:98

Configuring Blackfin Priority Driven Interrupts

console [ttyBF0] enabled, bootconsole disabled

console [ttyBF0] enabled, bootconsole disabled

Calibrating delay loop... 997.37 BogoMIPS (lpj=1994752)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (16 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 48 KB (36 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

stamp_init(): registering device resources

bio: create slab <bio-0> at 0

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

NET: Registered protocol family 1

msgmni has been set to 92

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

bfin-uart: Blackfin serial driver

bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART

brd: module loaded

bfin_mii_bus: probed

bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=24)@sclk=125MHz)

bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

Advanced Linux Sound Architecture Driver Version 1.0.20.

ALSA device list:

  No soundcards found.

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 1972-06-22 17:35:33 UTC (78082533)

IP-Config: Complete:

     device=eth0, addr=10.100.4.50, mask=255.255.255.0, gw=10.100.4.174,

     host=bf537-stamp, domain=, nis-domain=(none),

     bootserver=10.100.4.174, rootserver=10.100.4.174, rootpath=

Freeing unused kernel memory: 7464k freed

dma_alloc_init: dma_page @ 0x0208b000 - 512 pages at 0x03e00000

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/

\    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/

/     \.___.d|    .'           - http://www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.15.2 (2009-10-20 13:18:46 CST) hush - the humble shell

 

root:/> PHY: 0:01 - Link is Up - 100/Full

 

root:/> version

kernel:    Linux release 2.6.31.4-ADI-2010R1-pre-svn7669, build #55 Tue Oct 20 13:26:55 CST 2009

toolchain: bfin-linux-uclibc-gcc release gcc version 4.1.2 (ADI svn)

user-dist: release svn-9004, build #691 Tue Oct 20 13:22:23 CST 2009

root:/> modprobe snd_ad1836

dma rx:3 tx:4, err irq:45, regs:ffc00800

asoc: AD1836 <-> bf5xx-tdm mapping ok

root:/> tone

TONE: generating sine wave at 1000 Hz...

^C

root:/> vrec -w -S -b 16 -s 48000 -t 5|vplay

Recording WAVE : 16 bit, Speed 48000 Hz Stereo ...

Playing WAVE : 16 bit, Speed 48000 Hz Stereo ...

root:/> arecord -t wav -c 2 -f S16_LE -r 48000 -d 5 |aplay

Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

root:/>

root:/> rtcwake -s 15 -m mem

wakeup from "mem" at Thu Jun 22 17:36:28 1972

PM: Syncing filesystems ... done.

Freezing user space processes ... (elapsed 0.00 seconds) done.

Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.

Suspending console(s) (use no_console_suspend to debug)

PHY: 0:01 - Link is Down

Restarting tasks ... done.

PHY: 0:01 - Link is Up - 100/Full

root:/>

root:/> vrec -w -S -b 16 -s 48000 -t 5|vplay

Recording WAVE : 16 bit, Speed 48000 Hz Stereo ...

Playing WAVE : 16 bit, Speed 48000 Hz Stereo ...

 

/dev/dsp: Input/output error

root:/>

root:/> arecord -t wav -c 2 -f S16_LE -r 48000 -d 5 |aplay

Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

(It can not stop here until you press Ctrl+C)

--

 

Follow-ups

 

--- Vivi Li                                                  2009-10-21 05:25:15

For AD1938 wake up from both mem/standby, I can always see error message

"/dev/dsp: Input/output error".

 

For AD1836 wake up from mem, I can always see error message "/dev/dsp:

Input/output error". Test result of standby mode is OK.

But I once see bellow error when wake up from standby and hard to reproduce

it.

--

root:/> rtcwake -s 15 -m standby

wakeup from "standby" at Thu Jun 22 17:42:51 1972

PM: Syncing filesystems ... done.

Freezing user space processes ... (elapsed 0.00 seconds) done.

Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.

Suspending console(s) (use no_console_suspend to debug)

Restarting tasks ... done.

root:/> PHY: 0:01 - Link is Down

PHY: 0:01 - Link is Up - 100/Full

 

root:/> vrec -w -S -b 16 -s 48000 -t 5|vplay

Recording WAVE : 16 bit, Speed 48000 Hz Stereo ...

Playing WAVE : 16 bit, Speed 48000 Hz Stereo ...

tx dma is already stopped

sport status error: TUVF

sport status error: TUVF

root:/>

--

 

--- Barry Song                                               2009-11-10 23:55:54

This maybe be a hardware depending issue. soc-core resumes codec earlier than

CPU interface. If I make sport resume earlier than codec in TDM mode, then all

things get ok.

 

Index: sound/soc/soc-core.c

===================================================================

--- sound/soc/soc-core.c        (revision 7773)

+++ sound/soc/soc-core.c        (working copy)

@@ -726,6 +726,14 @@

                if (cpu_dai->resume && cpu_dai->ac97_control)

                        cpu_dai->resume(cpu_dai);

        }

+

+       for (i = 0; i < card->num_links; i++) {

+               struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;

+               if (cpu_dai->resume && !cpu_dai->ac97_control)

+                       cpu_dai->resume(cpu_dai);

+               if (platform->resume)

+                       platform->resume(cpu_dai);

+       }

 

        if (codec_dev->resume)

                codec_dev->resume(pdev);

@@ -747,15 +755,7 @@

                if (dai->ops->digital_mute &&

dai->playback.active)

                        dai->ops->digital_mute(dai, 0);

        }

-

-       for (i = 0; i < card->num_links; i++) {

-               struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;

-               if (cpu_dai->resume && !cpu_dai->ac97_control)

-                       cpu_dai->resume(cpu_dai);

-               if (platform->resume)

-                       platform->resume(cpu_dai);

-       }

-

+

        if (card->resume_post)

                card->resume_post(pdev);

 

I will check with the maintainer for a normal fix.

 

--- Barry Song                                               2009-11-12 01:12:35

upstream has a plan about pm_link, which can help to define suspend/resume

order. Locally, isolate sync/clock signals from sport when it resumes.

 

--- Vivi Li                                                  2009-11-15 23:40:58

The bug still exists on regression.

 

--- Barry Song                                               2009-11-16 02:25:23

Yes. It happens again.

My checkin 7789 fixed this bug, but my checkin 7795&7796 which plan to fix

another soc-core bug fires this bug again.

 

 

--- Barry Song                                               2009-11-16 23:03:12

Duplicate with [#5687].

I made a mistake before. The ad1836/ad1938 suspend bugs come from spi

suspend/resume bug in fact.

 

--- Vivi Li                                                  2009-11-27 03:44:10

OK now.

Close it.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

config.power.audio_tdm    application/octet-stream    35000    Vivi Li

Outcomes