All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Subject: usb: offset in trigger_tstamp?
Date: Thu, 20 Nov 2014 10:56:29 -0600	[thread overview]
Message-ID: <546E1D3D.50500@linux.intel.com> (raw)
In-Reply-To: <CAAgF-BfwGsn6HbJWH8uE48F2VWAYnAkv8=kGPkqCEWKaBM6=GQ@mail.gmail.com>

I was trying to find a bug in the timestamping logic I am working on and after some time I realized the USB audio class driver seems to have an issue.
If I instrument the code in sound/usb/pcm.c, I see a offset of up to 6ms between the  snd_usb_substream_playback_trigger and prepare_playback_urb steps

[45053.102625] trigger_start  
[45053.108320] prepare_playback_urb

My understanding is that empty URBs are submitted in the prepare step to avoid underflows, which is fine. The problem with that is that the trigger_tstamp value is captured before audio transfers actually start and there is a constant offset when trying to track audio/system time drifts or do basic a/v sync.

Any suggestions on how to fix this? I can't figure out if this is an off-by-one error or another bug.
Feedback welcome.
-Pierre

  reply	other threads:[~2014-11-20 16:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20  9:49 [PATCH] ASoC: samsung: In the i2s_set_sysclk() callback we are currently clearing all bits of the IISMOD register in i2s_set_sysclk. It's due to an incorrect mask used for the AND operation which is introduced in commit a5a56871f804edac93a53b5e871c0e9818fb9033 (ASoC: samsung: add support for exynos7 I2S controller) and also adds the missing break statement Padmavathi Venna
2014-11-20  9:49 ` Padmavathi Venna
2014-11-20 10:08 ` [alsa-devel] " Padma Venkat
2014-11-20 10:08   ` Padma Venkat
2014-11-20 16:56   ` Pierre-Louis Bossart [this message]
2014-11-21 13:28     ` usb: offset in trigger_tstamp? Clemens Ladisch

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=546E1D3D.50500@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    /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 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.