2009-06-19 15:44:41     Audio Problems

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

2009-06-19 15:44:41     Audio Problems

Cameron Barfield (UNITED STATES)

Message: 76059   

 

Hi, everyone. It's been a while.

 

We've been using 2008 kernel/distro/toolchain for a while and we are starting to look at 2009.

 

Running kernel commit 3348dc6bda184c7f79d2d54dbb53838adf07cd8c (git).

 

Running distro commit 1d5a305c38ed3f9668a0d05784e8bf7346d62081 (git)

 

Toolchain built with sources from commit 98fb812991acdc201e8f75c0048c17982b6c1dd7 (git).

 

We're using the same hardware we've always used (based on the BF537 STAMP reference design).

 

When running aplay in a loop, we stop getting audio out of the AD1981 within 20 minutes.

 

This is an identical symptom to several problems we had with 2008R1 that were fixed at some point.

 

I've attached my kernel and distro configs for reference.

 

Any ideas?

 

config

config

QuoteReplyEditDelete

 

 

2009-06-19 15:45:52     Re: Audio Problems

Cameron Barfield (UNITED STATES)

Message: 76060   

 

I forgot to mention that there are no errors on the console when the audio stops playing.

QuoteReplyEditDelete

 

 

2009-06-19 16:03:20     Re: Audio Problems

Cameron Barfield (UNITED STATES)

Message: 76062   

 

At some point in the past, Cliff made a modification to bf5xx-pcm.c designed to restore the AD1981's registers in the event of a warm reset because of a SPORT bus error. I modified it further to restore more of the registers.

 

 

 

void bf5xx_reset_codec(struct sport_device *sport)

{

    u16 *cache = sport->codec_reg_cache;

    bf5xx_ac97_write(NULL, 0, 0);

    udelay(100);

    bf5xx_ac97_write(NULL, 0x74, 0x9900);

    bf5xx_ac97_write(NULL, 0x02, (u16)cache[0x02 >> 1]);    // Cliff's fix to restore master volume

    bf5xx_ac97_write(NULL, 0x04, (u16)cache[0x04 >> 1]);    // Cameron's fix to restore headphone volume

    bf5xx_ac97_write(NULL, 0x06, (u16)cache[0x06 >> 1]);    // Cameron's fix to restore mono volume

    bf5xx_ac97_write(NULL, 0x0c, (u16)cache[0x0c >> 1]);    // Cameron's fix to restore phone volume

    bf5xx_ac97_write(NULL, 0x0e, (u16)cache[0x0e >> 1]);    // Cliff's fix to restore mic volume

    bf5xx_ac97_write(NULL, 0x10, (u16)cache[0x10 >> 1]);    // Cameron's fix to line-in volume

    bf5xx_ac97_write(NULL, 0x12, (u16)cache[0x12 >> 1]);    // Cameron's fix to CD volume

    bf5xx_ac97_write(NULL, 0x16, (u16)cache[0x16 >> 1]);    // Cameron's fix to AUX volume

    bf5xx_ac97_write(NULL, 0x18, (u16)cache[0x18 >> 1]);    // Cliff's fix to restore PCM out volume

    bf5xx_ac97_write(NULL, 0x1a, (u16)cache[0x1a >> 1]);    // Cameron's fix to restore PCM capture source

    bf5xx_ac97_write(NULL, 0x1c, (u16)cache[0x1c >> 1]);    // Cliff's fix to restore record gain

    udelay(100);

}

 

 

 

It doesn't appear that this exists in the 2009 branch, but I can't be sure because I'm still going over the differences.

QuoteReplyEditDelete

 

 

2009-06-21 23:05:56     Re: Audio Problems

Cliff Cai (CHINA)

Message: 76098   

 

Hi Cameron,

 

Nice to see you !

 

Because  at that time ,we didn't find out the root cause of the problems,So those fixes were only the temporary solutions that why I didn't put them in to  the source tree.

 

Recently,it seems that we've figured out the root cause,that is,there are remaining data in the TX FIFO,when stops the SPORT.This will cause ac97 frame to be incorrect next time we play.

 

Please try the attached patch,to see if it works .

 

 

 

Cliff

 

bf5xx-sport.patch

QuoteReplyEditDelete

 

 

2009-06-22 17:00:21     Re: Audio Problems

Cameron Barfield (UNITED STATES)

Message: 76152   

 

Awesome, Cliff.

 

The patch is looking good. I've been running aplay in a loop for 6 hours. I'll leave it running over night and let you know how it goes.

QuoteReplyEditDelete

 

 

2009-06-24 15:11:10     Re: Audio Problems

Cameron Barfield (UNITED STATES)

Message: 76272   

 

I ran the patched code for 60+ hours with no problems. I'd call that a fix.

 

Thanks, Cliff.

QuoteReplyEditDelete

 

 

2009-08-27 13:46:45     Re: Audio Problems

Cameron Barfield (UNITED STATES)

Message: 79313   

 

Cliff --

 

Did this patch make it into the 2009R1 branch? I'm trying to merge my working branch with ADI's branch with git and it's failing on this file.

QuoteReplyEditDelete

 

 

2009-08-27 16:29:34     Re: Audio Problems

Cameron Barfield (UNITED STATES)

Message: 79322   

 

Never mind. Git just didn't like some of the formatting/spacing changes and made me merge the file manually. It looks like everything's square.

QuoteReplyEditDelete

 

 

2009-08-28 00:03:32     Re: Audio Problems

Cliff Cai (CHINA)

Message: 79335   

 

Hi Cameron,

 

This patch has been merged into 2009r1.

 

 

 

Cliff

Attachments

Outcomes