All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: Zhang wei <zhangwei@vimicro.com>
Cc: ALSA development <alsa-devel@alsa-project.org>
Subject: Re: Could you help me about the ALSA?
Date: Fri, 14 Dec 2012 12:01:59 +0100	[thread overview]
Message-ID: <50CB0727.1030706@perex.cz> (raw)
In-Reply-To: <6B947C8AC4195040A8C6876A496C644A07BAB7A7@BJ-MAIL-04.vimicro.com>

Date 14.12.2012 11:46, Zhang wei wrote:
> Date 14.12.2012 09:55, Zhang wei wrote:
> 
>> Thank you very much.
> 
>> 
> 
>> But if the OS lost or delayed some interrupt(s) the variable
> 
>> hw_ptr_interrupt will smaller than it should be,because delayed update
> 
>> it from last time enter the interrupt.so the
> 
>> 
> 
>> delta = runtime->hw_ptr_interrupt + runtime->period_size;
> 
>> 
> 
>> should be smaller than new_hw_ptr.
> 
>  
> 
> The current 'pos' value from the driver can be smaller (buffer_size
> 
> wrap) than last one. The new_hw_ptr can be lower than delta in this case.
> 
>  
> 
>                        Jaroslav
> 
>  
> 
> Yes,when buffer_size wraped the 'pos' is smallar than last one.If we
> want to confirm the hw_base need to adjust there must be consider
> another confidition:
> 
> hdelta = jiffies - runtime->hw_ptr_jiffies;
> 
>               if (hdelta > runtime->hw_ptr_buffer_jiffies/2)
> 
> how to connect this code with checking unnormal interrupt(lost or delayed)?

This condition is for the double interrupt acknowledge problems (see
comment). It makes sure, that the DMA buffer position was wrapped using
another external timing source. Indeed, it's mostly a lowlevel driver
fault to call this pointer update routine with the in_interrupt flag
when the period was not really elapsed.

> Why we can prove need to adjust the ‘hw_base’when ‘hdelta’>
> hw_ptr_buffer_jiffies/2 ? the former represent the jiffier error between
> this moment and last be here(maybe called from non-interrupt elpased()).
> 
> The later means the time spend on fill the buffer.Then compare them and
> we will find if ‘delta’is bigger means the DMA already fininshed a
> period at least without notice the OS?
> 
> The compariation confused me.I can not get the relationship from the
> result and what the information or clue is ignored by me? Please give me
> some tips. Thank you.

Please, study the comments again.

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2012-12-14 11:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6B947C8AC4195040A8C6876A496C644A07BAB641@BJ-MAIL-04.vimicro.com>
2012-12-14  8:36 ` Could you help me about the ALSA? Jaroslav Kysela
2012-12-14  8:55   ` 答复: " Zhang wei
2012-12-14  9:46     ` Jaroslav Kysela
2012-12-14 10:46       ` Zhang wei
2012-12-14 11:01         ` Jaroslav Kysela [this message]
2012-12-16 14:13           ` l9jj
2012-12-17  2:09           ` Zhang wei
2012-12-17  9:43 Zhang wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50CB0727.1030706@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=zhangwei@vimicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.