alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* ALSA Mixer issue
@ 2010-07-30 13:23 sudarshan bisht
  2010-07-30 13:30 ` Jaroslav Kysela
  0 siblings, 1 reply; 5+ messages in thread
From: sudarshan bisht @ 2010-07-30 13:23 UTC (permalink / raw)
  To: alsa-devel

Hi ,

I wanted to know that can we use multiple handlers for the same ALSA mixer ?

My use case is something like this .

I have two modules and having two different handlers for ALSA mixer.  First
module does some volume change , and I try to read the latest volume using
my second handler ( of first second module) .

But I am not getting the most recent value in second handler ( the volume
set by the first module )  so I feel there is some inconsistency when I use
two handlers from two different modules in order to fetch volume information
from the ALSA mixer.




-- 
Regards,

Sudarshan Bisht

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ALSA Mixer issue
  2010-07-30 13:23 ALSA Mixer issue sudarshan bisht
@ 2010-07-30 13:30 ` Jaroslav Kysela
  2010-07-30 14:36   ` sudarshan bisht
  0 siblings, 1 reply; 5+ messages in thread
From: Jaroslav Kysela @ 2010-07-30 13:30 UTC (permalink / raw)
  To: sudarshan bisht; +Cc: alsa-devel

On Fri, 30 Jul 2010, sudarshan bisht wrote:

> Hi ,
>
> I wanted to know that can we use multiple handlers for the same ALSA mixer ?
>
> My use case is something like this .
>
> I have two modules and having two different handlers for ALSA mixer.  First
> module does some volume change , and I try to read the latest volume using
> my second handler ( of first second module) .
>
> But I am not getting the most recent value in second handler ( the volume
> set by the first module )  so I feel there is some inconsistency when I use
> two handlers from two different modules in order to fetch volume information
> from the ALSA mixer.

You must sync the cached information using poll() or select() on file 
descriptors returned by snd_mixer_poll_descriptors_*() functions and call 
snd_mixer_handle_events() if any events are waiting.

 					Jaroslav

-----
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ALSA Mixer issue
  2010-07-30 13:30 ` Jaroslav Kysela
@ 2010-07-30 14:36   ` sudarshan bisht
  2010-08-03  7:35     ` sudarshan bisht
  0 siblings, 1 reply; 5+ messages in thread
From: sudarshan bisht @ 2010-07-30 14:36 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel

Thanks for the reply , I will try the same soon .

On Fri, Jul 30, 2010 at 7:00 PM, Jaroslav Kysela <perex@perex.cz> wrote:

>  On Fri, 30 Jul 2010, sudarshan bisht wrote:
>
> Hi ,
>>
>> I wanted to know that can we use multiple handlers for the same ALSA mixer
>> ?
>>
>> My use case is something like this .
>>
>> I have two modules and having two different handlers for ALSA mixer.
>>  First
>> module does some volume change , and I try to read the latest volume using
>> my second handler ( of first second module) .
>>
>> But I am not getting the most recent value in second handler ( the volume
>> set by the first module )  so I feel there is some inconsistency when I
>> use
>> two handlers from two different modules in order to fetch volume
>> information
>> from the ALSA mixer.
>>
>
> You must sync the cached information using poll() or select() on file
> descriptors returned by snd_mixer_poll_descriptors_*() functions and call
> snd_mixer_handle_events() if any events are waiting.
>
>                                        Jaroslav
>
> -----
> Jaroslav Kysela <perex@perex.cz>
> Linux Kernel Sound Maintainer
> ALSA Project, Red Hat, Inc.
>
>


-- 
Regards,

Sudarshan Bisht

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ALSA Mixer issue
  2010-07-30 14:36   ` sudarshan bisht
@ 2010-08-03  7:35     ` sudarshan bisht
  2010-08-06  8:05       ` sudarshan bisht
  0 siblings, 1 reply; 5+ messages in thread
From: sudarshan bisht @ 2010-08-03  7:35 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel

Thanks Jaroslav ,

It works for me !!!


On Fri, Jul 30, 2010 at 5:36 PM, sudarshan bisht
<bisht.sudarshan@gmail.com>wrote:

> Thanks for the reply , I will try the same soon .
>
> On Fri, Jul 30, 2010 at 7:00 PM, Jaroslav Kysela <perex@perex.cz> wrote:
>
>>  On Fri, 30 Jul 2010, sudarshan bisht wrote:
>>
>> Hi ,
>>>
>>> I wanted to know that can we use multiple handlers for the same ALSA
>>> mixer ?
>>>
>>> My use case is something like this .
>>>
>>> I have two modules and having two different handlers for ALSA mixer.
>>>  First
>>> module does some volume change , and I try to read the latest volume
>>> using
>>> my second handler ( of first second module) .
>>>
>>> But I am not getting the most recent value in second handler ( the volume
>>> set by the first module )  so I feel there is some inconsistency when I
>>> use
>>> two handlers from two different modules in order to fetch volume
>>> information
>>> from the ALSA mixer.
>>>
>>
>> You must sync the cached information using poll() or select() on file
>> descriptors returned by snd_mixer_poll_descriptors_*() functions and call
>> snd_mixer_handle_events() if any events are waiting.
>>
>>                                        Jaroslav
>>
>> -----
>> Jaroslav Kysela <perex@perex.cz>
>> Linux Kernel Sound Maintainer
>> ALSA Project, Red Hat, Inc.
>>
>>
>
>
> --
> Regards,
>
> Sudarshan Bisht
>



-- 
Regards,

Sudarshan Bisht

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ALSA Mixer issue
  2010-08-03  7:35     ` sudarshan bisht
@ 2010-08-06  8:05       ` sudarshan bisht
  0 siblings, 0 replies; 5+ messages in thread
From: sudarshan bisht @ 2010-08-06  8:05 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel

Hi Jaroslav ,

                      It works fine in my Linux PC but when I try to run
same on my target device , it gets into infinite loop and never comes out of
poll function.
Any suggestion to make it work on target device ?

On Tue, Aug 3, 2010 at 10:35 AM, sudarshan bisht
<bisht.sudarshan@gmail.com>wrote:

> Thanks Jaroslav ,
>
> It works for me !!!
>
>
>
> On Fri, Jul 30, 2010 at 5:36 PM, sudarshan bisht <
> bisht.sudarshan@gmail.com> wrote:
>
>> Thanks for the reply , I will try the same soon .
>>
>> On Fri, Jul 30, 2010 at 7:00 PM, Jaroslav Kysela <perex@perex.cz> wrote:
>>
>>>  On Fri, 30 Jul 2010, sudarshan bisht wrote:
>>>
>>> Hi ,
>>>>
>>>> I wanted to know that can we use multiple handlers for the same ALSA
>>>> mixer ?
>>>>
>>>> My use case is something like this .
>>>>
>>>> I have two modules and having two different handlers for ALSA mixer.
>>>>  First
>>>> module does some volume change , and I try to read the latest volume
>>>> using
>>>> my second handler ( of first second module) .
>>>>
>>>> But I am not getting the most recent value in second handler ( the
>>>> volume
>>>> set by the first module )  so I feel there is some inconsistency when I
>>>> use
>>>> two handlers from two different modules in order to fetch volume
>>>> information
>>>> from the ALSA mixer.
>>>>
>>>
>>> You must sync the cached information using poll() or select() on file
>>> descriptors returned by snd_mixer_poll_descriptors_*() functions and call
>>> snd_mixer_handle_events() if any events are waiting.
>>>
>>>                                        Jaroslav
>>>
>>> -----
>>> Jaroslav Kysela <perex@perex.cz>
>>> Linux Kernel Sound Maintainer
>>> ALSA Project, Red Hat, Inc.
>>>
>>>
>>
>>
>> --
>> Regards,
>>
>> Sudarshan Bisht
>>
>
>
>
> --
> Regards,
>
> Sudarshan Bisht
>



-- 
Regards,

Sudarshan Bisht

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-06  8:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-30 13:23 ALSA Mixer issue sudarshan bisht
2010-07-30 13:30 ` Jaroslav Kysela
2010-07-30 14:36   ` sudarshan bisht
2010-08-03  7:35     ` sudarshan bisht
2010-08-06  8:05       ` sudarshan bisht

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).