Re: [RFCv1] Media Token API needs - Was: Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-29 Thread Mauro Carvalho Chehab
Em Tue, 28 Oct 2014 22:00:51 -0200 Mauro Carvalho Chehab mche...@osg.samsung.com escreveu: Em Tue, 28 Oct 2014 21:42:50 -0200 Mauro Carvalho Chehab mche...@osg.samsung.com escreveu: Before starting with the description, this is the simplified diagram of a media device (without IR, eeprom

Re: [RFCv1] Media Token API needs - Was: Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-29 Thread Shuah Khan
On 10/28/2014 05:42 PM, Mauro Carvalho Chehab wrote: Hi Shuah, I'm understanding that you're collecting comments to write a RFC with the needs by the media token, right? I'm sending you my contributions to such text. See enclosed. I suggest to change the subject and submit this on a

Re: [RFCv1] Media Token API needs - Was: Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-29 Thread Mauro Carvalho Chehab
Em Wed, 29 Oct 2014 10:06:51 -0600 Shuah Khan shua...@osg.samsung.com escreveu: On 10/28/2014 05:42 PM, Mauro Carvalho Chehab wrote: Hi Shuah, I'm understanding that you're collecting comments to write a RFC with the needs by the media token, right? I'm sending you my contributions

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-28 Thread Shuah Khan
On 10/27/2014 06:52 AM, Mauro Carvalho Chehab wrote: Em Sun, 26 Oct 2014 09:27:40 +0100 Takashi Iwai ti...@suse.de escreveu: Hmm... this is actually more complex than that. V4L2 driver doesn't know if ALSA is streaming or not, or even if ALSA device node is opened while he is touching at

[RFCv1] Media Token API needs - Was: Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-28 Thread Mauro Carvalho Chehab
Hi Shuah, I'm understanding that you're collecting comments to write a RFC with the needs by the media token, right? I'm sending you my contributions to such text. See enclosed. I suggest to change the subject and submit this on a separate thread, after we finish the review of such document.

Re: [RFCv1] Media Token API needs - Was: Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-28 Thread Mauro Carvalho Chehab
Em Tue, 28 Oct 2014 21:42:50 -0200 Mauro Carvalho Chehab mche...@osg.samsung.com escreveu: Before starting with the description, this is the simplified diagram of a media device (without IR, eeprom and other beasts): As reference, a more complete diagram would be:

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-27 Thread Mauro Carvalho Chehab
Em Sun, 26 Oct 2014 09:27:40 +0100 Takashi Iwai ti...@suse.de escreveu: At Sat, 25 Oct 2014 11:41:15 -0200, Mauro Carvalho Chehab wrote: +---+ | start | +---+ | | v ++

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-27 Thread Shuah Khan
On 10/25/2014 04:57 AM, Mauro Carvalho Chehab wrote: Hi, Sorry to enter into this thread so late. Last week was a full week, due to the 4 conferences I paticiapated, and last week I needed to fill lots of trip reports. Also, I have another trip to give two speeches. Em Tue, 21 Oct 2014

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-26 Thread Takashi Iwai
At Sat, 25 Oct 2014 11:41:15 -0200, Mauro Carvalho Chehab wrote: (re-sending from my third e-mail - somehow, the two emails I have at Samsung didn't seem to be delivering to vger.kernel.org today) Em Wed, 22 Oct 2014 14:26:41 -0500 Pierre-Louis Bossart pierre-louis.boss...@linux.intel.com

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-25 Thread Mauro Carvalho Chehab
(re-sending from my third e-mail - somehow, the two emails I have at Samsung didn't seem to be delivering to vger.kernel.org today) Em Wed, 22 Oct 2014 14:26:41 -0500 Pierre-Louis Bossart pierre-louis.boss...@linux.intel.com escreveu: On 10/21/14, 11:08 AM, Devin Heitmueller wrote: Sorry,

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-25 Thread Mauro Carvalho Chehab
(re-sending from my other e-mail - somehow, the email I sent via m.che...@samsung.com doesn't seem to be delivered at vger.kernel.org) Em Wed, 22 Oct 2014 14:26:41 -0500 Pierre-Louis Bossart pierre-louis.boss...@linux.intel.com escreveu: On 10/21/14, 11:08 AM, Devin Heitmueller wrote: Sorry,

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-25 Thread Mauro Carvalho Chehab
Em Wed, 22 Oct 2014 14:26:41 -0500 Pierre-Louis Bossart pierre-louis.boss...@linux.intel.com escreveu: On 10/21/14, 11:08 AM, Devin Heitmueller wrote: Sorry, I'm not convinced by that. If the device has to be controlled exclusively, the right position is the open/close. Otherwise, the

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-24 Thread Shuah Khan
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

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-22 Thread Hans Verkuil
Hi Shuah, Some notes below... On 10/21/2014 07:32 PM, Shuah Khan wrote: On 10/21/2014 10:05 AM, Takashi Iwai wrote: At Tue, 21 Oct 2014 17:42:51 +0200, Hans Verkuil wrote: Quite often media apps open the alsa device at the start and then switch between TV, radio or DVB mode. If the alsa

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-22 Thread Pierre-Louis Bossart
On 10/21/14, 11:08 AM, Devin Heitmueller wrote: Sorry, I'm not convinced by that. If the device has to be controlled exclusively, the right position is the open/close. Otherwise, the program cannot know when it becomes inaccessible out of sudden during its operation. I can say that I've

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-22 Thread Devin Heitmueller
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

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-21 Thread Hans Verkuil
On 10/16/2014 04:48 PM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:39:14 -0600, Shuah Khan wrote: On 10/16/2014 08:16 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:10:52 -0600, Shuah Khan wrote: On 10/16/2014 08:01 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 07:10:37 -0600, Shuah Khan

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-21 Thread Takashi Iwai
At Tue, 21 Oct 2014 17:42:51 +0200, Hans Verkuil wrote: On 10/16/2014 04:48 PM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:39:14 -0600, Shuah Khan wrote: On 10/16/2014 08:16 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:10:52 -0600, Shuah Khan wrote: On 10/16/2014 08:01 AM,

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-21 Thread Devin Heitmueller
Sorry, I'm not convinced by that. If the device has to be controlled exclusively, the right position is the open/close. Otherwise, the program cannot know when it becomes inaccessible out of sudden during its operation. I can say that I've definitely seen cases where if you configure a

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-21 Thread Takashi Iwai
At Tue, 21 Oct 2014 12:08:59 -0400, Devin Heitmueller wrote: Sorry, I'm not convinced by that. If the device has to be controlled exclusively, the right position is the open/close. Otherwise, the program cannot know when it becomes inaccessible out of sudden during its operation. I

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-21 Thread Shuah Khan
On 10/21/2014 10:05 AM, Takashi Iwai wrote: At Tue, 21 Oct 2014 17:42:51 +0200, Hans Verkuil wrote: Quite often media apps open the alsa device at the start and then switch between TV, radio or DVB mode. If the alsa device would claim the tuner just by being opened (as opposed to actually

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-19 Thread Takashi Iwai
At Sat, 18 Oct 2014 20:49:58 +0200, Mauro Carvalho Chehab wrote: Em Thu, 16 Oct 2014 08:59:29 -0600 Shuah Khan shua...@osg.samsung.com escreveu: On 10/16/2014 08:48 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:39:14 -0600, Shuah Khan wrote: On 10/16/2014 08:16 AM, Takashi

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-18 Thread Mauro Carvalho Chehab
Em Thu, 16 Oct 2014 08:59:29 -0600 Shuah Khan shua...@osg.samsung.com escreveu: On 10/16/2014 08:48 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:39:14 -0600, Shuah Khan wrote: On 10/16/2014 08:16 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:10:52 -0600, Shuah Khan wrote: On

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-16 Thread Lars-Peter Clausen
On 10/14/2014 04:58 PM, Shuah Khan wrote: [...] switch (cmd) { case SNDRV_PCM_TRIGGER_START: + err = media_get_audio_tkn(subs-dev-dev); + if (err == -EBUSY) { + dev_info(subs-dev-dev, %s device is busy\n, +

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-16 Thread Shuah Khan
On 10/16/2014 06:00 AM, Lars-Peter Clausen wrote: On 10/14/2014 04:58 PM, Shuah Khan wrote: [...] switch (cmd) { case SNDRV_PCM_TRIGGER_START: +err = media_get_audio_tkn(subs-dev-dev); +if (err == -EBUSY) { +dev_info(subs-dev-dev, %s device is busy\n,

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-16 Thread Takashi Iwai
At Thu, 16 Oct 2014 07:10:37 -0600, Shuah Khan wrote: On 10/16/2014 06:00 AM, Lars-Peter Clausen wrote: On 10/14/2014 04:58 PM, Shuah Khan wrote: [...] switch (cmd) { case SNDRV_PCM_TRIGGER_START: +err = media_get_audio_tkn(subs-dev-dev); +if (err ==

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-16 Thread Shuah Khan
On 10/16/2014 08:01 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 07:10:37 -0600, Shuah Khan wrote: On 10/16/2014 06:00 AM, Lars-Peter Clausen wrote: On 10/14/2014 04:58 PM, Shuah Khan wrote: [...] switch (cmd) { case SNDRV_PCM_TRIGGER_START: +err =

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-16 Thread Takashi Iwai
At Thu, 16 Oct 2014 08:10:52 -0600, Shuah Khan wrote: On 10/16/2014 08:01 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 07:10:37 -0600, Shuah Khan wrote: On 10/16/2014 06:00 AM, Lars-Peter Clausen wrote: On 10/14/2014 04:58 PM, Shuah Khan wrote: [...] switch (cmd) {

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-16 Thread Shuah Khan
On 10/16/2014 08:16 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:10:52 -0600, Shuah Khan wrote: On 10/16/2014 08:01 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 07:10:37 -0600, Shuah Khan wrote: On 10/16/2014 06:00 AM, Lars-Peter Clausen wrote: On 10/14/2014 04:58 PM, Shuah Khan wrote:

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-16 Thread Takashi Iwai
At Thu, 16 Oct 2014 08:39:14 -0600, Shuah Khan wrote: On 10/16/2014 08:16 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:10:52 -0600, Shuah Khan wrote: On 10/16/2014 08:01 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 07:10:37 -0600, Shuah Khan wrote: On 10/16/2014 06:00 AM,

Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-16 Thread Shuah Khan
On 10/16/2014 08:48 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:39:14 -0600, Shuah Khan wrote: On 10/16/2014 08:16 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 08:10:52 -0600, Shuah Khan wrote: On 10/16/2014 08:01 AM, Takashi Iwai wrote: At Thu, 16 Oct 2014 07:10:37 -0600, Shuah Khan

[PATCH v2 5/6] sound/usb: pcm changes to use media token api

2014-10-14 Thread Shuah Khan
Change snd_usb_capture_ops trigger to hold audio token prior starting endpoints for SNDRV_PCM_TRIGGER_START request and release after stopping endpoints for SNDRV_PCM_TRIGGER_STOP request. Audio token is released from snd_usb_capture_ops close interface to cover the case where an application exits