All of lore.kernel.org
 help / color / mirror / Atom feed
* Play jitter coming from dshare
       [not found] <1651159701066536903-webhooks-bot@alsa-project.org>
@ 2022-04-28 15:28 ` GitHub issues - opened
  0 siblings, 0 replies; 2+ messages in thread
From: GitHub issues - opened @ 2022-04-28 15:28 UTC (permalink / raw)
  To: alsa-devel

alsa-project/alsa-lib issue #221 was opened from davidboulangerlatour:

I have an application which plays a wav file (using dshare) at with a specific period (ie. every 720ms). This always worked well up to recently after upgrading alsa-lib from 1.1.7 to 1.2.4. With 1.2.4, the cycles look like this [750ms, 750ms, 750ms, 625ms], normally it would be [720ms, 720ms, ...].

When doing a bisect to find the issue, I found this commit to be the cause:
```
7265e603bf880a9ec2cd01c3cf2afbd7709e5af4 is the first bad commit
commit 7265e603bf880a9ec2cd01c3cf2afbd7709e5af4
Author: Vanitha Channaiah <vanitha.channaiah@in.bosch.com>
Date:   Wed May 15 11:56:33 2019 +0530

    pcm: dshare: Added "hw_ptr_alignment" option in configuration for alignment of slave pointers
    
    This change adapt the fix commit 6b058fda9dce
    ("pcm: dmix: Add option to allow alignment of slave pointers")
    for dshare plugin
    
    Issue is that snd_pcm_wait() goes back to waiting because the hw_ptr
    is not period aligned. Therefore snd_pcm_wait() will block for a longer
    time as required.
    
    With these rcar driver changes the exact position of the dma is returned.
    During snd_pcm_start they read hw_ptr as reference, and this hw_ptr
    is now not period aligned, and is a little ahead over the period while it
    is read. Therefore when the avail is calculated during snd_pcm_wait(),
    it is missing the avail_min by a few frames.
    
    An additional option hw_ptr_alignment is provided to dshare configuration,
    to allow the user to configure the slave application and hw pointer
    alignment at startup
    
    Signed-off-by: Vanitha Channaiah <vanitha.channaiah@in.bosch.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>

 src/pcm/pcm_dshare.c | 40 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 35 insertions(+), 5 deletions(-)
```

I tried the more recent 1.2.6 with the same issue. I also tried all the "hw_ptr_alignment" options with no success.

Issue URL     : https://github.com/alsa-project/alsa-lib/issues/221
Repository URL: https://github.com/alsa-project/alsa-lib

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Play jitter coming from dshare
       [not found] <1651160384067101955-webhooks-bot@alsa-project.org>
@ 2022-04-28 15:39 ` GitHub issues - edited
  0 siblings, 0 replies; 2+ messages in thread
From: GitHub issues - edited @ 2022-04-28 15:39 UTC (permalink / raw)
  To: alsa-devel

alsa-project/alsa-lib issue #221 was edited from davidboulangerlatour:

I have an application which plays a wav file (using dshare) at with a specific period (ie. every 720ms). This always worked well up to recently after upgrading alsa-lib from 1.1.7 to 1.2.4. With 1.2.4, the cycles look like this [750ms, 750ms, 750ms, 625ms], normally it would be [720ms, 720ms, ...].

When doing a bisect to find the issue, I found this commit to be the cause:
```
7265e603bf880a9ec2cd01c3cf2afbd7709e5af4 is the first bad commit
commit 7265e603bf880a9ec2cd01c3cf2afbd7709e5af4
Author: Vanitha Channaiah <vanitha.channaiah@in.bosch.com>
Date:   Wed May 15 11:56:33 2019 +0530

    pcm: dshare: Added "hw_ptr_alignment" option in configuration for alignment of slave pointers
    
    This change adapt the fix commit 6b058fda9dce
    ("pcm: dmix: Add option to allow alignment of slave pointers")
    for dshare plugin
    
    Issue is that snd_pcm_wait() goes back to waiting because the hw_ptr
    is not period aligned. Therefore snd_pcm_wait() will block for a longer
    time as required.
    
    With these rcar driver changes the exact position of the dma is returned.
    During snd_pcm_start they read hw_ptr as reference, and this hw_ptr
    is now not period aligned, and is a little ahead over the period while it
    is read. Therefore when the avail is calculated during snd_pcm_wait(),
    it is missing the avail_min by a few frames.
    
    An additional option hw_ptr_alignment is provided to dshare configuration,
    to allow the user to configure the slave application and hw pointer
    alignment at startup
    
    Signed-off-by: Vanitha Channaiah <vanitha.channaiah@in.bosch.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>

 src/pcm/pcm_dshare.c | 40 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 35 insertions(+), 5 deletions(-)
```

I tried the more recent 1.2.6 with the same issue. I also tried all the "hw_ptr_alignment" options with no success.

cc @VanithaChannaiah @tiwai

Issue URL     : https://github.com/alsa-project/alsa-lib/issues/221
Repository URL: https://github.com/alsa-project/alsa-lib

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-28 15:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1651159701066536903-webhooks-bot@alsa-project.org>
2022-04-28 15:28 ` Play jitter coming from dshare GitHub issues - opened
     [not found] <1651160384067101955-webhooks-bot@alsa-project.org>
2022-04-28 15:39 ` GitHub issues - edited

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.