]> git.alsa-project.org Git - alsa-lib.git/commit
dsnoop: The delay presented to snd_pcm_status_delay() was incorrect
authorMark Hills <mark@xwax.org>
Mon, 22 Jun 2020 13:15:10 +0000 (14:15 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 23 Jun 2020 10:57:08 +0000 (12:57 +0200)
commit1a169c21af80d1cc6abb923548e939cef8ba5b66
tree02ab4c6b05a48f4a958dd0c4370bec4fa5787e42
parenta510754af245357f58d7c942168b8a89ad273fdd
dsnoop: The delay presented to snd_pcm_status_delay() was incorrect

This was the original bug that caused me to start looking at the
ring buffer functions.

In the API this is documented as:

  "Delay is distance between current application frame position and
   sound frame position. It's positive and less than buffer size in
   normal situation, negative on playback underrun and greater than
   buffer size on capture overrun. "

Because dsnoop was returning the buffer space available to the hardware
the return value was always quite large, and moved in the wrong
direction.

With this patch, dsnoop now gives results which are comparable to using
the "hw" device directly. My test case was with snd-echo3g (Layla3G).

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_local.h