alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: jeeja.kp@intel.com, alsa-devel@alsa-project.org,
	broonie@opensource.wolfsonmicro.com,
	Richard Fitzgerald <rf@opensource.wolfsonmicro.com>,
	liam.r.girdwood@intel.com
Subject: Re: [RFC] compress: add support for gapless playback
Date: Thu, 7 Feb 2013 08:34:18 -0800	[thread overview]
Message-ID: <20130207163418.GS3143@intel.com> (raw)
In-Reply-To: <s5ha9rg5x0e.wl%tiwai@suse.de>

On Thu, Feb 07, 2013 at 09:49:37AM +0100, Takashi Iwai wrote:
> At Wed, 6 Feb 2013 18:18:07 -0800,
> Vinod Koul wrote:
> > 
> > On Thu, Feb 07, 2013 at 01:15:54AM +0000, Richard Fitzgerald wrote:
> > > > +- partial drain
> > > > +This is called when end of file is reached. The userspace can inform DSP that
> > > > +EOF is reached and now DSP can start skipping padding delay. Also next write
> > > > +data would belong to next track
> > > 
> > > We're really doing two different tasks inside the "partial drain". The name,
> > > and the reason we are doing two tasks in one, comes from a particular higher-
> > > layer scenario, but there's no reason the driver API need use the same
> > > terminology as one particular application of the functionality.
> > > The two tasks are:
> > > 
> > > 1) Tell the DSP that we have sent all data for the current track and following
> > > data will be for the next track. This lets the DSP lay down a marker for where
> > > it should strip padding at the end of a track, and know it should be expecting
> > > more data for another track to follow gaplessly where it must strip the
> > > encoder delay from the start.
> > > 
> > > 2) Ask for notification when DSP has reached the changeover point between the
> > > playback of the two tracks
> > > 
> > > I think it would be more logical and less confusing not to combine the two into
> > > a single ioctl. Instead, add only one new ioctl specifically to provide the
> > > track changeover hint, something like SNDRV_COMPRESS_NEXT_TRACK (meaning DSP
> > > should expect data for next track to follow). Don't add a new drain, just use
> > > the existing SNDRV_COMPRESS_DRAIN - the driver/DSP can make a decision whether
> > > it needs to do something special with the drain if we have told it that we
> > > will be sending it some more data for a following track.
> > > 
> > > So the SNDRV_COMPRESS_PARTIAL_DRAIN in this patch would become
> > > 
> > > 1) Send SNDRV_COMPRESS_NEXT_TRACK
> > > 2) Send SNDRV_COMPRESS_DRAIN
> > The problem would be in that case the defination of SNDRV_COMPRESS_DRAIN which
> > expects the decoder to completely drain its buffers and come to complete halt.
> > This would also mean the framework will treat a drained stream as stopped and
> > needs a new start. Certainly we dont want that in this case. So we can't use
> > SNDRV_COMPRESS_DRAIN to indicate. Yes we can put conditional check but IMO that
> > would overtly complicate this. If we are not doing proper drian lets not
> > call it that.
> > 
> > But I think I like the idea of splitting the two up to do a cleaner interface.
> > Let me check this...
> 
> In the way above, NEXT_TRACK is no longer a trigger op, but it's
> rather an operational option.  This would set a flag something like
> 	compr->drain_mode = SND_COMPR_DRAIN_RESTART;
> while its default is SND_COMPR_DRAIN_STOP.
> (Or, set compr->next_track_after_drain = true, or whatever.)
So the basic difference would be that stream is never stopped in gapless case.
The stream should retain running state maybe trasition to intermediate one for
book keeping but then needs to go back to running.

But, should framework really care about that as DSP is doing handling!

--
~Vinod

  reply	other threads:[~2013-02-07 16:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-05 14:21 [RFC] compress: add support for gapless playback Vinod Koul
2013-02-06  2:44 ` Pierre-Louis Bossart
2013-02-06  7:54   ` Vinod Koul
2013-02-06 13:32     ` Mark Brown
2013-02-06 13:56       ` Vinod Koul
2013-02-06 13:59       ` Pierre-Louis Bossart
2013-02-06 14:00         ` Vinod Koul
2013-02-06 14:14   ` Takashi Iwai
2013-02-06 14:02     ` Vinod Koul
2013-02-06 14:33       ` Takashi Iwai
2013-02-06 14:11 ` Takashi Iwai
2013-02-06 14:09   ` Vinod Koul
2013-02-06 14:48     ` Takashi Iwai
2013-02-06 14:31       ` Vinod Koul
     [not found] ` <37A133201056E44A80888420ECA881BF1093DC5F68@EXCMB2.wolfsonmicro.main>
     [not found]   ` <20130207011518.GA30348@opensource.wolfsonmicro.com>
2013-02-07  2:18     ` Vinod Koul
2013-02-07  8:49       ` Takashi Iwai
2013-02-07 16:34         ` Vinod Koul [this message]
     [not found]         ` <20130207113738.GA15824@opensource.wolfsonmicro.com>
2013-02-07 11:49           ` Takashi Iwai
2013-02-07 16:51           ` Vinod Koul

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=20130207163418.GS3143@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jeeja.kp@intel.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=rf@opensource.wolfsonmicro.com \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).