* [sound] mpd loops on current -next
@ 2009-06-06 15:46 Jiri Slaby
2009-06-06 15:52 ` Jaroslav Kysela
0 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2009-06-06 15:46 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: Takashi Iwai, LKML
Hi,
I found a regression in current -next caused by
c44941e05900fe85f6091456f9e313b446a97ae9
(PCM midlevel: Do not update hw_ptr_jiffies when hw_ptr is not changed)
When mpd is playing, it loops with a pattern such as:
16:05:02.762544 ioctl(14, 0x4122, 0x3) = 0
16:05:02.762565 ioctl(14, 0x4122, 0) = 0
16:05:02.762587 ioctl(14, 0x4122, 0x1) = 0
16:05:02.762609 ioctl(14, 0x4122, 0x3) = 0
16:05:02.762630 ioctl(14, 0x4122, 0) = 0
16:05:02.762652 ioctl(14, 0x4122, 0) = 0
16:05:02.762674 poll([{fd=13, events=POLLIN|POLLERR|POLLNVAL}], 1, -1) =
1 ([{fd=13, revents=POLLIN}])
16:05:02.762698 ioctl(14, 0x4122, 0x3) = 0
16:05:02.762720 ioctl(14, 0x4122, 0) = 0
16:05:02.762742 ioctl(14, 0x4122, 0x1) = 0
16:05:02.762765 ioctl(14, 0x4122, 0x3) = 0
16:05:02.762787 ioctl(14, 0x4122, 0) = 0
16:05:02.762809 ioctl(14, 0x4122, 0) = 0
Reverting the patch makes the problem disappear.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sound] mpd loops on current -next
2009-06-06 15:46 [sound] mpd loops on current -next Jiri Slaby
@ 2009-06-06 15:52 ` Jaroslav Kysela
2009-06-06 15:58 ` Jiri Slaby
2009-06-06 16:37 ` Takashi Iwai
0 siblings, 2 replies; 6+ messages in thread
From: Jaroslav Kysela @ 2009-06-06 15:52 UTC (permalink / raw)
To: Jiri Slaby; +Cc: Takashi Iwai, LKML
On Sat, 6 Jun 2009, Jiri Slaby wrote:
> Hi,
>
> I found a regression in current -next caused by
> c44941e05900fe85f6091456f9e313b446a97ae9
> (PCM midlevel: Do not update hw_ptr_jiffies when hw_ptr is not changed)
Oops. It seems like typo. Could you try this patch, please?
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index dd9126b..bf34603 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -371,7 +371,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
runtime->silence_size > 0)
snd_pcm_playback_silence(substream, new_hw_ptr);
- if (runtime->status->hw_ptr != new_hw_ptr)
+ if (runtime->status->hw_ptr == new_hw_ptr)
return 0;
runtime->hw_ptr_base = hw_base;
Thanks,
Jaroslav
-----
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [sound] mpd loops on current -next
2009-06-06 15:52 ` Jaroslav Kysela
@ 2009-06-06 15:58 ` Jiri Slaby
2009-06-06 16:37 ` Takashi Iwai
1 sibling, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2009-06-06 15:58 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: Takashi Iwai, LKML
On 06/06/2009 05:52 PM, Jaroslav Kysela wrote:
> On Sat, 6 Jun 2009, Jiri Slaby wrote:
>> I found a regression in current -next caused by
>> c44941e05900fe85f6091456f9e313b446a97ae9
>> (PCM midlevel: Do not update hw_ptr_jiffies when hw_ptr is not changed)
>
> Oops. It seems like typo. Could you try this patch, please?
Yup, looks like that did the job.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sound] mpd loops on current -next
2009-06-06 15:52 ` Jaroslav Kysela
2009-06-06 15:58 ` Jiri Slaby
@ 2009-06-06 16:37 ` Takashi Iwai
2009-06-06 16:56 ` Jiri Slaby
2009-06-07 10:28 ` Takashi Iwai
1 sibling, 2 replies; 6+ messages in thread
From: Takashi Iwai @ 2009-06-06 16:37 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: Jiri Slaby, LKML
At Sat, 6 Jun 2009 17:52:44 +0200 (CEST),
Jaroslav Kysela wrote:
>
> On Sat, 6 Jun 2009, Jiri Slaby wrote:
>
> > Hi,
> >
> > I found a regression in current -next caused by
> > c44941e05900fe85f6091456f9e313b446a97ae9
> > (PCM midlevel: Do not update hw_ptr_jiffies when hw_ptr is not changed)
>
> Oops. It seems like typo. Could you try this patch, please?
Ah, that's the cause of the bug with PA on the recent driver.
I didn't experience the problem because I myself don't use PA :)
Now merged to sound git tree.
thanks,
Takashi
>
> diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
> index dd9126b..bf34603 100644
> --- a/sound/core/pcm_lib.c
> +++ b/sound/core/pcm_lib.c
> @@ -371,7 +371,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
> runtime->silence_size > 0)
> snd_pcm_playback_silence(substream, new_hw_ptr);
>
> - if (runtime->status->hw_ptr != new_hw_ptr)
> + if (runtime->status->hw_ptr == new_hw_ptr)
> return 0;
>
> runtime->hw_ptr_base = hw_base;
>
> Thanks,
> Jaroslav
>
> -----
> Jaroslav Kysela <perex@perex.cz>
> Linux Kernel Sound Maintainer
> ALSA Project, Red Hat, Inc.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sound] mpd loops on current -next
2009-06-06 16:37 ` Takashi Iwai
@ 2009-06-06 16:56 ` Jiri Slaby
2009-06-07 10:28 ` Takashi Iwai
1 sibling, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2009-06-06 16:56 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Jaroslav Kysela, LKML
On 06/06/2009 06:37 PM, Takashi Iwai wrote:
>>> I found a regression in current -next caused by
>>> c44941e05900fe85f6091456f9e313b446a97ae9
>>> (PCM midlevel: Do not update hw_ptr_jiffies when hw_ptr is not changed)
>>
>> Oops. It seems like typo. Could you try this patch, please?
>
> Ah, that's the cause of the bug with PA on the recent driver.
> I didn't experience the problem because I myself don't use PA :)
FWIW me neither...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sound] mpd loops on current -next
2009-06-06 16:37 ` Takashi Iwai
2009-06-06 16:56 ` Jiri Slaby
@ 2009-06-07 10:28 ` Takashi Iwai
1 sibling, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2009-06-07 10:28 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: Jiri Slaby, LKML
At Sat, 06 Jun 2009 18:37:11 +0200,
I wrote:
>
> At Sat, 6 Jun 2009 17:52:44 +0200 (CEST),
> Jaroslav Kysela wrote:
> >
> > On Sat, 6 Jun 2009, Jiri Slaby wrote:
> >
> > > Hi,
> > >
> > > I found a regression in current -next caused by
> > > c44941e05900fe85f6091456f9e313b446a97ae9
> > > (PCM midlevel: Do not update hw_ptr_jiffies when hw_ptr is not changed)
> >
> > Oops. It seems like typo. Could you try this patch, please?
>
> Ah, that's the cause of the bug with PA on the recent driver.
> I didn't experience the problem because I myself don't use PA :)
I found another bug with that change. The fix is attached below.
Takashi
===
>From ab1863fc9bc18c806338564124b1e5e7e3ef53d1 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Sun, 7 Jun 2009 12:09:17 +0200
Subject: [PATCH] ALSA: pcm - Fix update of runtime->hw_ptr_interrupt
The commit 13f040f9e55d41e92e485389123654971e03b819 made another
regression, the missing update of runtime->hw_ptr_interrupt.
Since this field is only checked in snd_pcmupdate__hw_ptr_interrupt(),
not in snd_pcm_update_hw_ptr(), it must be updated before the hw_ptr
change check.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/core/pcm_lib.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index bf34603..adb306f 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -299,6 +299,8 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
hw_ptr_interrupt =
new_hw_ptr - new_hw_ptr % runtime->period_size;
}
+ runtime->hw_ptr_interrupt = hw_ptr_interrupt;
+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
runtime->silence_size > 0)
snd_pcm_playback_silence(substream, new_hw_ptr);
@@ -309,7 +311,6 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
runtime->hw_ptr_base = hw_base;
runtime->status->hw_ptr = new_hw_ptr;
runtime->hw_ptr_jiffies = jiffies;
- runtime->hw_ptr_interrupt = hw_ptr_interrupt;
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE)
snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);
--
1.6.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-06-07 10:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-06 15:46 [sound] mpd loops on current -next Jiri Slaby
2009-06-06 15:52 ` Jaroslav Kysela
2009-06-06 15:58 ` Jiri Slaby
2009-06-06 16:37 ` Takashi Iwai
2009-06-06 16:56 ` Jiri Slaby
2009-06-07 10:28 ` Takashi Iwai
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).