Re: Timer instability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
 }
 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux