All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <shuahkh@osg.samsung.com>
To: Devin Heitmueller <dheitmueller@kernellabs.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Takashi Iwai <tiwai@suse.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: alsa-devel@alsa-project.org,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Prabhakar Lad <prabhakar.csengg@gmail.com>,
	Antti Palosaari <crope@iki.fi>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tim Gardner <tim.gardner@canonical.com>,
	"olebowle@gmx.com" <olebowle@gmx.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api
Date: Fri, 24 Oct 2014 08:44:46 -0600	[thread overview]
Message-ID: <544A65DE.40108@osg.samsung.com> (raw)
In-Reply-To: <CAGoCfiyQVY6Ss2qcp3aQijq3cP3BAM8X4yaCXRtx63dNNm-QKA@mail.gmail.com>

On 10/22/2014 01:45 PM, Devin Heitmueller wrote:
>> this seems like a feature, not a bug. PulseAudio starts streaming before
>> clients push any data and likewise keeps sources active even after for some
>> time after clients stop recording. Closing VLC in your example doesn't
>> immediately close the ALSA device. look for module-suspend-on-idle in your
>> default.pa config file.
> 
> The ALSA userland emulation in PulseAudio is supposed to faithfully emulate
> the behavior of the ALSA kernel ABI... except when it doesn't, then it's not
> a bug but rather a feature.  :-)
> 
>> I also agree that the open/close of the alsa device is the only way to
>> control exclusion.
> 
> I was also a proponent that we should have fairly coarse locking done
> at open/close for the various device nodes (ALSA/V4L/DVB).  The challenge here
> is that we have a large installed based of existing applications that
> rely on kernel
> behavior that isn't formally specified in any specification.  Hence
> we're forced to try
> to come up with a solution that minimizes the risk of ABI breakage.
> 
> If we were doing this from scratch then we could lay down some hard/fast rules
> about things apps aren't supposed to do and how apps are supposed to respond
> to those exception cases.  Unfortunately we don't have that luxury here.
> 

Sounds like we don't have a clear direction on open/close or capture
start/stop. What I am hearing is open/close isn't acceptable for
media maintainers and capture trigger start/stop isn't acceptable
to sound maintainers. :) Fork in the road, which way do we go?

Implementation wise, supporting capture trigger start/stop approach
will be harder to maintain in longterm. It adds more variables to
the mix. Applications open sounds device from the main thread and
then create a new thread to handle streams. I can see that based
on the token hold requests that come in. So the token hold logic
will have to take that into account, leading into potential
unbalanced lock/unlock scenarios. It is not impossible to solve,
that's what I did in this patch series, but it does get complex.

What I am looking for is some consensus on let's go with an approach
and try. Doesn't matter which way we go, and how much testing I do,
I am bound to miss something and this work needs to soak for a bit in
the media experimental branch.

thanks,
-- Shuah



-- 
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

  reply	other threads:[~2014-10-24 14:44 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14 14:58 [PATCH v2 0/6] media token resource framework Shuah Khan
2014-10-14 14:58 ` [PATCH v2 1/6] media: add media token device " Shuah Khan
2014-10-15 17:05   ` Takashi Iwai
2014-10-16  0:53     ` Shuah Khan
2014-10-16 14:00       ` Takashi Iwai
2014-10-16 14:39         ` Shuah Khan
2014-10-21 10:46   ` Hans Verkuil
2014-10-21 11:51     ` Takashi Iwai
2014-10-21 11:58       ` Hans Verkuil
2014-10-21 13:07         ` Takashi Iwai
2014-11-18 21:33   ` Sakari Ailus
2014-10-14 14:58 ` [PATCH v2 2/6] media: v4l2-core changes to use media token api Shuah Khan
2014-10-14 14:58 ` [PATCH v2 3/6] media: au0828-video " Shuah Khan
2014-10-14 14:58 ` [PATCH v2 4/6] media: dvb-core " Shuah Khan
2014-10-14 14:58 ` [PATCH v2 5/6] sound/usb: pcm " Shuah Khan
2014-10-16 12:00   ` Lars-Peter Clausen
2014-10-16 12:00     ` [alsa-devel] " Lars-Peter Clausen
2014-10-16 13:10     ` Shuah Khan
2014-10-16 14:01       ` Takashi Iwai
2014-10-16 14:10         ` Shuah Khan
2014-10-16 14:16           ` Takashi Iwai
2014-10-16 14:39             ` Shuah Khan
2014-10-16 14:48               ` Takashi Iwai
2014-10-16 14:59                 ` Shuah Khan
2014-10-16 14:59                   ` [alsa-devel] " Shuah Khan
2014-10-18 18:49                   ` Mauro Carvalho Chehab
2014-10-19  9:00                     ` Takashi Iwai
2014-10-19  9:00                       ` [alsa-devel] " Takashi Iwai
2014-10-21 15:42                 ` Hans Verkuil
2014-10-21 16:05                   ` Takashi Iwai
2014-10-21 16:08                     ` Devin Heitmueller
2014-10-21 16:14                       ` Takashi Iwai
2014-10-22 19:26                       ` Pierre-Louis Bossart
2014-10-22 19:45                         ` Devin Heitmueller
2014-10-24 14:44                           ` Shuah Khan [this message]
2014-10-25 12:44                         ` Mauro Carvalho Chehab
2014-10-25 12:44                           ` [alsa-devel] " Mauro Carvalho Chehab
2014-10-25 13:20                         ` Mauro Carvalho Chehab
2014-10-25 13:41                         ` Mauro Carvalho Chehab
2014-10-25 13:41                           ` [alsa-devel] " Mauro Carvalho Chehab
2014-10-26  8:27                           ` Takashi Iwai
2014-10-27 12:52                             ` Mauro Carvalho Chehab
2014-10-28 21:15                               ` Shuah Khan
2014-10-28 23:42                                 ` [RFCv1] Media Token API needs - Was: " Mauro Carvalho Chehab
2014-10-29  0:00                                   ` Mauro Carvalho Chehab
2014-10-29 11:19                                     ` Mauro Carvalho Chehab
2014-10-29 16:06                                   ` Shuah Khan
2014-10-29 17:56                                     ` Mauro Carvalho Chehab
2014-11-04 23:08                                       ` [RFCv2] Media Token API Spec Shuah Khan
2014-11-10 14:15                                         ` Hans Verkuil
2014-11-10 14:15                                           ` Hans Verkuil
2014-11-18 21:15                                         ` Sakari Ailus
2014-11-18 21:27                                           ` Shuah Khan
2014-10-21 17:32                     ` [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api Shuah Khan
2014-10-22 15:24                       ` Hans Verkuil
2014-10-25 10:57                       ` Mauro Carvalho Chehab
2014-10-27 15:47                         ` [alsa-devel] " Shuah Khan
2014-10-14 14:58 ` [PATCH v2 6/6] media: au0828-core changes to create and destroy media Shuah Khan
2014-10-15 16:48 ` [PATCH v2 0/6] media token resource framework Takashi Iwai
2014-10-15 20:21   ` Shuah Khan
2014-10-16 14:02     ` Takashi Iwai
2014-10-29  9:17 ` Sakari Ailus
2014-10-29  9:33   ` Mauro Carvalho Chehab
2014-10-29  9:33     ` Mauro Carvalho Chehab

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=544A65DE.40108@osg.samsung.com \
    --to=shuahkh@osg.samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=crope@iki.fi \
    --cc=dheitmueller@kernellabs.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=lars@metafoo.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@eikelenboom.it \
    --cc=m.chehab@samsung.com \
    --cc=olebowle@gmx.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tim.gardner@canonical.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 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.