All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Tim Cussins <timcussins@eml.cc>, alsa-devel@alsa-project.org
Subject: Re: [PATCH v3 kernel 2/3] Extend snd_pcm_ops and snd_pcm_runtime
Date: Fri, 06 Feb 2015 10:38:45 -0600	[thread overview]
Message-ID: <54D4EE15.1010704@linux.intel.com> (raw)
In-Reply-To: <1423239388-17745-2-git-send-email-timcussins@eml.cc>

On 02/06/2015 10:16 AM, Tim Cussins wrote:
> snd_pcm_ops picks up methods for:
> 
> - start_at
> - start_at_abort
> - start_at_gettime
> 
> For startat requests involving audio hardware clocks, ALSA core
> delegates to the driver using these methods, should they exist.
> 
> snd_pcm_runtime gains fields that contain the current state of
> the startat timer, if any. This allows cancellation and querying.
> 
> Signed-off-by: Tim Cussins <timcussins@eml.cc>
> 
> diff --git a/include/sound/pcm.h b/include/sound/pcm.h
> index 07299b2..a414fec 100644
> --- a/include/sound/pcm.h
> +++ b/include/sound/pcm.h
> @@ -73,6 +73,9 @@ struct snd_pcm_ops {
>  	snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream);
>  	int (*wall_clock)(struct snd_pcm_substream *substream,
>  			  struct timespec *audio_ts);
> +	int (*start_at)(struct snd_pcm_substream *substream, int startat_clock_type, const struct timespec *ts);
> +	int (*start_at_abort)(struct snd_pcm_substream *substream);
> +	int (*start_at_gettime)(struct snd_pcm_substream *substream, int startat_clock_type, struct timespec *current_time);

What is the purpose of this _gettime? If the app relies on regular system time then it doesn't need to use this and if it relies on the link then doesn't this routine duplicate the audio timestamp stuff i am still working on.

>  	int (*copy)(struct snd_pcm_substream *substream, int channel,
>  		    snd_pcm_uframes_t pos,
>  		    void __user *buf, snd_pcm_uframes_t count);
> @@ -368,6 +371,12 @@ struct snd_pcm_ runtime {
>  #ifdef CONFIG_SND_PCM_XRUN_DEBUG
>  	struct snd_pcm_hwptr_log *hwptr_log;
>  #endif
> +
> +	bool startat_timer_running;
> +	/* The following values are valid if startat_timer_running == true */
> +	int startat_clock_type;			/* startat clock type of current timer */
> +	struct timespec startat_start_time;	/* start time of current timer */
> +	void* startat_timer_data;		/* data associated with current timer */
>  };
>  
>  struct snd_pcm_group {		/* keep linked substreams */
> 

  reply	other threads:[~2015-02-06 16:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 16:16 [PATCH v3 kernel 1/3] snd_pcm_start_at and friends Tim Cussins
2015-02-06 16:16 ` [PATCH v3 kernel 2/3] Extend snd_pcm_ops and snd_pcm_runtime Tim Cussins
2015-02-06 16:38   ` Pierre-Louis Bossart [this message]
2015-02-06 17:25     ` Tim Cussins
2015-02-06 16:16 ` [PATCH v3 kernel 3/3] snd_pcm_start_at implementation Tim Cussins
2015-02-06 16:32 ` [PATCH v3 kernel 1/3] snd_pcm_start_at and friends Pierre-Louis Bossart
2015-02-06 17:08   ` Tim Cussins
2015-02-06 21:02     ` Pierre-Louis Bossart
2015-02-10 20:21       ` Nick Stoughton
2015-02-10 20:37         ` Pierre-Louis Bossart
2015-02-11  9:34           ` Tim Cussins

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=54D4EE15.1010704@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=timcussins@eml.cc \
    /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.