From: Colin Guthrie <gmane@colin.guthr.ie>
To: alsa-devel@alsa-project.org
Subject: Re: hw_ptr_interrupt removal broke interrupt pointer updates
Date: Mon, 01 Feb 2010 15:33:24 +0000 [thread overview]
Message-ID: <hk6s83$f5k$1@ger.gmane.org> (raw)
In-Reply-To: <alpine.LNX.2.00.1001271541380.6542@eeebox2.perex-int.cz>
'Twas brillig, and Jaroslav Kysela at 27/01/10 17:21 did gyre and gimble:
> On Wed, 27 Jan 2010, Clemens Ladisch wrote:
>
>> Jaroslav Kysela wrote:
>>> On Wed, 27 Jan 2010, Clemens Ladisch wrote:
>>>> A somewhat unrelated issue: Both old and new code assume that
>>>> hw_ptr==0 is a period boundary, but that is not true if the boundary
>>>> is not an integer multiple of the period size, and the pointer wraps.
>>>> I'm not sure what happens then.
>>>
>>> I'm not exactly sure what you're talking about. Where is the
>>> hw_ptr==0 assumption?
>>
>> This code, which tries to align hw_ptr_interrupt to a period boundary:
>>
>> runtime->hw_ptr_interrupt = new_hw_ptr -
>> (new_hw_ptr % runtime->period_size);
>
> I see. It is really problem, because if hw_ptr_interrupt shifts, then the
> condition
> delta = runtime->hw_ptr_interrupt + runtime->period_size;
> if (delta > new_hw_ptr) {
>
> is not accurate and might cause unwanted issues.
>
> The simple fix for 64-bit archs is to use "boundary = buffer_size *
> period_size" expression to setup the boundary variable properly.
>
> I added code to find the lowest common multiple for 32-bit archs.
>
> The patch is:
>
> http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=7910b4a1db63fefc3d291853d33c34c5b6352e8e
FWIW, this patch seems to have finally solved:
https://qa.mandriva.com/show_bug.cgi?id=57010
which we used to track this issue.
Had two users confirm it as fixed which is good enough for me :)
Take care and thanks.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
prev parent reply other threads:[~2010-02-01 15:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-26 13:39 hw_ptr_interrupt removal broke interrupt pointer updates Clemens Ladisch
2010-01-26 16:16 ` Jaroslav Kysela
2010-01-27 3:09 ` Raymond Yau
2010-01-27 7:06 ` Jaroslav Kysela
2010-01-27 9:49 ` Clemens Ladisch
2010-01-27 10:11 ` Jaroslav Kysela
2010-01-27 14:12 ` Clemens Ladisch
2010-01-27 17:21 ` Jaroslav Kysela
2010-02-01 15:33 ` Colin Guthrie [this message]
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='hk6s83$f5k$1@ger.gmane.org' \
--to=gmane@colin.guthr.ie \
--cc=alsa-devel@alsa-project.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).