All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Changing the Multi Track Peak control from MIXER to PCM type
@ 2009-10-06 12:51 pavel.hofman
  2009-10-06 12:58 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: pavel.hofman @ 2009-10-06 12:51 UTC (permalink / raw)
  To: patch; +Cc: Pavel Hofman, alsa-devel

From: Pavel Hofman <pavel.hofman@ivitera.com>

* The "Multi Track Peak" control is now of PCM type, to avoid
  confusing users in other alsa mixers.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>

diff --git a/envy24control/levelmeters.c b/envy24control/levelmeters.c
index 3bf1a94..9bdaace 100644
--- a/envy24control/levelmeters.c
+++ b/envy24control/levelmeters.c
@@ -262,7 +262,7 @@ void level_meters_reset_peaks(GtkButton *button, gpointer data)
 void level_meters_init(void)
 {
 	snd_ctl_elem_value_malloc(&peaks);
-	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_MIXER);
+	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_PCM);
 	snd_ctl_elem_value_set_name(peaks, "Multi Track Peak");
 }
 
-- 
1.5.4.3

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

* Re: [PATCH 1/1] Changing the Multi Track Peak control from MIXER to PCM type
  2009-10-06 12:51 [PATCH 1/1] Changing the Multi Track Peak control from MIXER to PCM type pavel.hofman
@ 2009-10-06 12:58 ` Takashi Iwai
  2009-10-06 13:38   ` Pavel Hofman
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2009-10-06 12:58 UTC (permalink / raw)
  To: pavel.hofman; +Cc: alsa-devel

At Tue,  6 Oct 2009 14:51:06 +0200,
pavel.hofman@ivitera.com wrote:
> 
> From: Pavel Hofman <pavel.hofman@ivitera.com>
> 
> * The "Multi Track Peak" control is now of PCM type, to avoid
>   confusing users in other alsa mixers.

We still need to handle the older kernels, so it has to retry with
IFACE_MIXER as fallback.

Could you fix and repost?


Takashi

> 
> Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
> 
> diff --git a/envy24control/levelmeters.c b/envy24control/levelmeters.c
> index 3bf1a94..9bdaace 100644
> --- a/envy24control/levelmeters.c
> +++ b/envy24control/levelmeters.c
> @@ -262,7 +262,7 @@ void level_meters_reset_peaks(GtkButton *button, gpointer data)
>  void level_meters_init(void)
>  {
>  	snd_ctl_elem_value_malloc(&peaks);
> -	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_MIXER);
> +	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_PCM);
>  	snd_ctl_elem_value_set_name(peaks, "Multi Track Peak");
>  }
>  
> -- 
> 1.5.4.3
> 

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

* Re: [PATCH 1/1] Changing the Multi Track Peak control from MIXER to PCM type
  2009-10-06 12:58 ` Takashi Iwai
@ 2009-10-06 13:38   ` Pavel Hofman
  2009-10-06 13:41     ` Jaroslav Kysela
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Hofman @ 2009-10-06 13:38 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Takashi Iwai wrote:
> At Tue,  6 Oct 2009 14:51:06 +0200,
> pavel.hofman@ivitera.com wrote:
>> From: Pavel Hofman <pavel.hofman@ivitera.com>
>>
>> * The "Multi Track Peak" control is now of PCM type, to avoid
>>   confusing users in other alsa mixers.
> 
> We still need to handle the older kernels, so it has to retry with
> IFACE_MIXER as fallback.
> 
> Could you fix and repost?

Sure, just would you please tell me which snd_ctl_elem method to use to
check for existence of the control? I have no experience with alsa-lib

Thanks a lot.

Pavel.

> 
> 
> Takashi
> 
>> Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
>>
>> diff --git a/envy24control/levelmeters.c b/envy24control/levelmeters.c
>> index 3bf1a94..9bdaace 100644
>> --- a/envy24control/levelmeters.c
>> +++ b/envy24control/levelmeters.c
>> @@ -262,7 +262,7 @@ void level_meters_reset_peaks(GtkButton *button, gpointer data)
>>  void level_meters_init(void)
>>  {
>>  	snd_ctl_elem_value_malloc(&peaks);
>> -	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_MIXER);
>> +	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_PCM);
>>  	snd_ctl_elem_value_set_name(peaks, "Multi Track Peak");
>>  }
>>  
>> -- 
>> 1.5.4.3
>>

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

* Re: [PATCH 1/1] Changing the Multi Track Peak control from MIXER to PCM type
  2009-10-06 13:38   ` Pavel Hofman
@ 2009-10-06 13:41     ` Jaroslav Kysela
  0 siblings, 0 replies; 5+ messages in thread
From: Jaroslav Kysela @ 2009-10-06 13:41 UTC (permalink / raw)
  To: Pavel Hofman; +Cc: Takashi Iwai, alsa-devel

On Tue, 6 Oct 2009, Pavel Hofman wrote:

> Takashi Iwai wrote:
>> At Tue,  6 Oct 2009 14:51:06 +0200,
>> pavel.hofman@ivitera.com wrote:
>>> From: Pavel Hofman <pavel.hofman@ivitera.com>
>>>
>>> * The "Multi Track Peak" control is now of PCM type, to avoid
>>>   confusing users in other alsa mixers.
>>
>> We still need to handle the older kernels, so it has to retry with
>> IFACE_MIXER as fallback.
>>
>> Could you fix and repost?
>
> Sure, just would you please tell me which snd_ctl_elem method to use to
> check for existence of the control? I have no experience with alsa-lib

Just use snd_ctl_elem_read() as in update_peak_switch(). If an error is 
returned, control is not present.

 						Jaroslav


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

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

* [PATCH 1/1] Changing the Multi Track Peak control from MIXER to PCM type
@ 2009-10-06 14:00 pavel.hofman
  0 siblings, 0 replies; 5+ messages in thread
From: pavel.hofman @ 2009-10-06 14:00 UTC (permalink / raw)
  To: patch; +Cc: Pavel Hofman, alsa-devel

From: Pavel Hofman <pavel.hofman@ivitera.com>

* The "Multi Track Peak" control is now of PCM type, to avoid
  confusing users in other alsa mixers.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>

diff --git a/envy24control/levelmeters.c b/envy24control/levelmeters.c
index 3bf1a94..fa44979 100644
--- a/envy24control/levelmeters.c
+++ b/envy24control/levelmeters.c
@@ -261,9 +261,15 @@ void level_meters_reset_peaks(GtkButton *button, gpointer data)
 
 void level_meters_init(void)
 {
+	int err;
+
 	snd_ctl_elem_value_malloc(&peaks);
-	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_MIXER);
+	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_PCM);
 	snd_ctl_elem_value_set_name(peaks, "Multi Track Peak");
+	if ((err = snd_ctl_elem_read(ctl, peaks)) < 0)
+		/* older ALSA driver, using MIXER type */
+		snd_ctl_elem_value_set_interface(peaks,
+			SND_CTL_ELEM_IFACE_MIXER);
 }
 
 void level_meters_postinit(void)
-- 
1.5.4.3

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

end of thread, other threads:[~2009-10-06 14:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-06 12:51 [PATCH 1/1] Changing the Multi Track Peak control from MIXER to PCM type pavel.hofman
2009-10-06 12:58 ` Takashi Iwai
2009-10-06 13:38   ` Pavel Hofman
2009-10-06 13:41     ` Jaroslav Kysela
2009-10-06 14:00 pavel.hofman

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.