Oh cool! Someone else that knows how to hack :)

I've been reading the Intel HDA Programmers Reference Manual
(http://www.intel.com/design/chipsets/hdaudio.htm) and from what I've
learned so far the problem appears to be with the handling of the output
buffers. Here's the description of what should be happening:

ICH6 HDA/AC'97 Programmers Reference Manual

1.2.6.3 Resume Context Recovery
        When the system is placed in a power-down state (S3 or greater) power 
is removed from the ICH6
        AC '97 controller. In this state, DMA registers lose information 
regarding current position and
        pointer values. The device driver must be able to save the context of 
all DMA engines before
        acknowledging a D3 state. Device drivers must assume that D3 state 
request precedes a total
        system power lost therefore context for DMA engines. Upon system power 
resume, the device
        driver must restore the DMA Engine register accordingly to saved values 
prior the suspend event.


4.6.6 Stream Steady State Operation
      Once the stream has been started, the hardware will continue fetching 
data from the Cyclic Buffer
      described by the Buffer Descriptor List. For an output stream, software 
is responsible for making
      sure that valid data is present in the buffers before it is fetched by 
the hardware. For an input
      stream, data must be removed from the buffers before being overwritten by 
hardware.

     *** When the hardware has reached the end of the Cyclic Buffer, it will 
automatically wrap back around to the
      beginning of the buffer and continue to process the stream data until the 
stream is stopped by the
      software by clearing the RUN bit. ***

      Software can either use interrupts at the end of selected buffers by 
setting the IOC bit in the BDL
      entry or can poll the stream position to determine when to process the 
stream data.

So it seems to me we should focus our attention on how the BDL and
memory allocation is handled, and specifically what is setup prior to a
suspend (even when no output is active) that is subsequently used when
outputting sound. I suspect what we will discover is that during
suspend/resume one or more structures and/or memory relating to Buffer
Descriptor Lists or page memory buffers is not being restored, or else
the IOC bit isn't being restored or acted upon. Note the text I've
highlighted above with *** ... *** which would on the face of it
describe the symptoms we are hearing (is the ISR countdow.

We should try to divide our labours: can I suggest that you continue
hacking at the kernel, focusing in on the buffer code whilst I continue
reading up on HDA and analysing the source-code? For various reasons I'm
not keen to be disturbing the kernel right now because of other things
I'm working on.

-- 
snd-hda-intel: distorted sound after resume, until the module is reloaded
https://bugs.launchpad.net/bugs/100114
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to