[alsa-devel] Problem bringing up new alsa driver

Jon Smirl jonsmirl at gmail.com
Sun Apr 26 17:42:14 CEST 2009


On Sun, Apr 26, 2009 at 7:14 AM, Takashi Iwai <tiwai at suse.de> wrote:
> At Sat, 25 Apr 2009 17:28:55 -0400,
> Jon Smirl wrote:
>>
>> These new patches have broken audio support on the mpc5200....
>
> Then the lowlevel callbacks are likely wrong :)
>
>> They assume that the hardware is capable of telling where the DMA
>> engine is in the middle of an operation.
>
> Well, nothing new by these patches.  The original PCM core
> implementation has been designed in that way.  These changes may check
> some bogus value more strictly.
>
> If the hardware doesn't support it, it needs report at least some
> "sane" value; i.e. it must not be over the real position, but not
> below the previous pointer.



> In the worst case, the driver just needs to report the same position
> at the previous period boundary until the next
> snd_pcm_period_elapsed().

That's doesn't work anymore. The PCM code is using jiffies to estimate
where the pointer needs to be.
I used the same jiffies to fake up a hardware position.

>
>
> Takashi
>
>>  I'm still checking to see if
>> I can get that data out of the Bestcomm DMA engine.
>>
>> jonsmirl at terra:/home/linus/sound/core$ git log pcm_lib.c
>> commit bbf6ad1399e9516b0a95de3ad58ffbaed670e4cc
>> Author: Jaroslav Kysela <perex at perex.cz>
>> Date:   Fri Apr 10 12:28:58 2009 +0200
>>
>>     [ALSA] pcm-midlevel: Add more strict buffer position checks based on jiffies
>>
>>     Some drivers like Intel8x0 or Intel HDA are broken for some
>> hardware variants.
>>     This patch adds more strict buffer position checks based on jiffies when
>>     internal hw_ptr is updated. Enable xrun_debug to see mangling of wrong
>>     positions.
>>
>>     As a side effect, the hw_ptr interrupt update routine might do
>> slightly better
>>     job when many interrupts are lost.
>>
>>     Signed-off-by: Jaroslav Kysela <perex at perex.cz>
>>
>> commit 8b22d943c34b616eefbd6d2f8f197a53b1f29fd0
>> Author: Takashi Iwai <tiwai at suse.de>
>> Date:   Fri Mar 20 16:26:15 2009 +0100
>>
>>     ALSA: pcm - Safer boundary checks
>>
>>     Make the boundary checks a bit safer.
>>     These caese are rare or theoretically won't happen, but nothing
>>     bad to keep the checks safer...
>>
>>     Signed-off-by: Takashi Iwai <tiwai at suse.de>
>>
>> commit ded652f7024bc2d7b6118b561a44187af30841b0
>> Author: Takashi Iwai <tiwai at suse.de>
>> Date:   Thu Mar 19 10:08:49 2009 +0100
>>
>>     ALSA: pcm - Fix delta calculation at boundary overlap
>>
>>     When the hw_ptr_interrupt reaches the boundary, it must check whether
>>     the hw_base was already lapped and corret the delta value appropriately.
>>
>>     Also, rebasing the hw_ptr needs a correction because buffer_size isn't
>>     always aligned to period_size.
>>
>>     Signed-off-by: Takashi Iwai <tiwai at suse.de>
>>
>> commit 5f513e1197f27e9a0bcfec0feaac59f976f4a37e
>> Author: Takashi Iwai <tiwai at suse.de>
>> Date:   Thu Mar 19 10:01:47 2009 +0100
>>
>>     ALSA: pcm - Reset invalid position even without debug option
>>
>>     Always reset the invalind hw_ptr position returned by the pointer
>>     callback.  The behavior should be consitent independently from the
>>     debug option.
>>
>>     Also, add the printk_ratelimit() check to avoid flooding debug
>>     prints.
>>
>>     Signed-off-by: Takashi Iwai <tiwai at suse.de>
>>
>>
>>
>> --
>> Jon Smirl
>> jonsmirl at gmail.com
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel at alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
>



-- 
Jon Smirl
jonsmirl at gmail.com


More information about the Alsa-devel mailing list