Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Clive Messer <clive@vacuumtube.org.uk>
Cc: alsa-devel@alsa-project.org
Subject: Re: Timer instability
Date: Wed, 25 Feb 2009 16:51:33 +0100	[thread overview]
Message-ID: <s5hbpsqo6pm.wl%tiwai@suse.de> (raw)
In-Reply-To: <200902251511.44049.clive@vacuumtube.org.uk>

At Wed, 25 Feb 2009 15:11:44 +0000,
Clive Messer wrote:
> 36192	36191	100068	3	0	0	1	2
> 36195	36194	100090	2	0	0	1	2
> 36198	36198	100113	1	0	0	1	2
> 36207	36206	63854	2816	1600	0	1	3
> 36212	36211	63854	2815	1601	4	1	3
> 36216	36216	63854	2814	1602	4	1	3
> 36221	36220	63854	2813	1603	4	1	3
> 36225	36225	101224	4460	-44	4	1	3

This is pretty weird.  Is this behavior always reproducible?
What shows with the patch below to alsa-lib?

Also, any change if you play with position_fix parameter, such as,
position_fix=1?


Takashi

---
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index e9ce092..9b91a13 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -539,6 +539,10 @@ static int snd_pcm_hw_hwsync(snd_pcm_t *pcm)
 {
 	snd_pcm_hw_t *hw = pcm->private_data;
 	int fd = hw->fd, err;
+	long old_hwptr, new_hwptr;
+	long old_applptr, new_applptr;
+	old_hwptr = *pcm->hw.ptr;
+	old_applptr = *pcm->appl.ptr;
 	if (SNDRV_PROTOCOL_VERSION(2, 0, 3) <= hw->version) {
 		if (hw->sync_ptr) {
 			err = sync_ptr1(hw, SNDRV_PCM_SYNC_PTR_HWSYNC);
@@ -564,6 +568,11 @@ static int snd_pcm_hw_hwsync(snd_pcm_t *pcm)
 			}
 		}
 	}
+	new_hwptr = *pcm->hw.ptr;
+	new_applptr = *pcm->appl.ptr;
+	printf("hwsync: %ld(%ld), %ld(%ld)\n",
+	       new_hwptr, new_hwptr - old_hwptr,
+	       new_applptr, new_applptr - old_applptr);
 	return 0;
 }

  reply	other threads:[~2009-02-25 15:51 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19  2:46 Timer instability Lennart Poettering
2009-02-19  6:52 ` Takashi Iwai
2009-02-20  1:22   ` Lennart Poettering
2009-02-20  1:26     ` Lennart Poettering
2009-02-20  1:50     ` Lennart Poettering
2009-02-20  7:26     ` Takashi Iwai
2009-02-20 20:34       ` Lennart Poettering
2009-02-21 16:36         ` Takashi Iwai
2009-02-22  3:14           ` Lennart Poettering
2009-02-23  2:42             ` Lennart Poettering
2009-02-23  2:56               ` Lennart Poettering
2009-02-23 19:20                 ` Lennart Poettering
2009-02-23 19:24                   ` Colin Guthrie
2009-02-24  3:21                   ` Lennart Poettering
2009-02-23  7:47             ` Takashi Iwai
2009-02-24 16:27             ` Takashi Iwai
2009-02-24 18:46               ` Lennart Poettering
2009-02-24 18:59                 ` Takashi Iwai
2009-02-24 19:04                   ` Jaroslav Kysela
2009-02-24 19:26                   ` Lennart Poettering
2009-02-24 20:37                     ` Takashi Iwai
2009-02-25 10:08                       ` Takashi Iwai
2009-02-25 10:22                         ` Takashi Iwai
2009-02-25 12:34                           ` Clive Messer
2009-02-25 13:36                             ` Takashi Iwai
2009-02-25 15:11                               ` Clive Messer
2009-02-25 15:51                                 ` Takashi Iwai [this message]
2009-02-25 16:24                                   ` Clive Messer
2009-02-25 16:39                                     ` Takashi Iwai
     [not found]                                       ` <200902251656.47813.clive@vacuumtube.org.uk>
2009-02-25 16:59                                         ` Takashi Iwai
2009-02-25 17:36                                           ` Clive Messer
2009-02-25 18:13                                             ` Takashi Iwai
2009-02-25 18:16                                               ` Clive Messer
2009-02-25 18:34                                               ` Clive Messer
2009-03-03 16:05                                                 ` Takashi Iwai
2009-03-03 17:41                                                   ` Takashi Iwai
2009-03-09 11:13                                                     ` Clive Messer
2009-03-09 11:20                                                       ` Takashi Iwai
2009-03-09 13:09                                                         ` Takashi Iwai
2009-02-25 15:04                             ` Takashi Iwai
2009-02-25 10:44                         ` Lennart Poettering
2009-02-24 21:16                     ` Lennart Poettering
2009-02-25 10:48                       ` Takashi Iwai
2009-02-25 10:57                         ` Jaroslav Kysela
2009-02-25 11:04                           ` Takashi Iwai
2009-02-25 11:10                             ` Jaroslav Kysela
2009-02-25 11:17                               ` Takashi Iwai

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=s5hbpsqo6pm.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clive@vacuumtube.org.uk \
    /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