All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: usb-audio: Assume first control interface is for audio
@ 2010-09-02  9:13 Daniel Mack
  2010-09-02  9:59 ` Takashi Iwai
  2010-09-10 17:15 ` Felix Homann
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Mack @ 2010-09-02  9:13 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai

For devices with more than one control interface, let's assume the first
one contains the audio controls. Unfortunately, there is no field in any
of the descriptors to tell us whether a control interface is for audio
or MIDI controls, so a better check is not easy to implement.

On a composite device with audio and MIDI functions, for example, the
code currently overwrites chip->ctrl_intf, causing operations on the
control interface to fail if they are issued after the device probe.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
---
 sound/usb/card.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/sound/usb/card.c b/sound/usb/card.c
index 9feb00c..b443a33 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -465,7 +465,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
 			goto __error;
 	}
 
-	chip->ctrl_intf = alts;
+	/*
+	 * For devices with more than one control interface, we assume the
+	 * first contains the audio controls. We might need a more specific
+	 * check here in the future.
+	 */
+	if (!chip->ctrl_intf)
+		chip->ctrl_intf = alts;
 
 	if (err > 0) {
 		/* create normal USB audio interfaces */
-- 
1.7.0.4

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

* Re: [PATCH] ALSA: usb-audio: Assume first control interface is for audio
  2010-09-02  9:13 [PATCH] ALSA: usb-audio: Assume first control interface is for audio Daniel Mack
@ 2010-09-02  9:59 ` Takashi Iwai
  2010-09-10 16:15   ` Daniel Mack
  2010-09-10 17:15 ` Felix Homann
  1 sibling, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2010-09-02  9:59 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel

At Thu,  2 Sep 2010 17:13:15 +0800,
Daniel Mack wrote:
> 
> For devices with more than one control interface, let's assume the first
> one contains the audio controls. Unfortunately, there is no field in any
> of the descriptors to tell us whether a control interface is for audio
> or MIDI controls, so a better check is not easy to implement.
> 
> On a composite device with audio and MIDI functions, for example, the
> code currently overwrites chip->ctrl_intf, causing operations on the
> control interface to fail if they are issued after the device probe.
> 
> Signed-off-by: Daniel Mack <daniel@caiaq.de>

Applied now.  Thanks.


Takashi

> ---
>  sound/usb/card.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/usb/card.c b/sound/usb/card.c
> index 9feb00c..b443a33 100644
> --- a/sound/usb/card.c
> +++ b/sound/usb/card.c
> @@ -465,7 +465,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
>  			goto __error;
>  	}
>  
> -	chip->ctrl_intf = alts;
> +	/*
> +	 * For devices with more than one control interface, we assume the
> +	 * first contains the audio controls. We might need a more specific
> +	 * check here in the future.
> +	 */
> +	if (!chip->ctrl_intf)
> +		chip->ctrl_intf = alts;
>  
>  	if (err > 0) {
>  		/* create normal USB audio interfaces */
> -- 
> 1.7.0.4
> 

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

* Re: [PATCH] ALSA: usb-audio: Assume first control interface is for audio
  2010-09-02  9:59 ` Takashi Iwai
@ 2010-09-10 16:15   ` Daniel Mack
  2010-09-10 17:06     ` [stable] " Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Mack @ 2010-09-10 16:15 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Greg KH, stable

On Thu, Sep 02, 2010 at 11:59:18AM +0200, Takashi Iwai wrote:
> At Thu,  2 Sep 2010 17:13:15 +0800,
> Daniel Mack wrote:
> > 
> > For devices with more than one control interface, let's assume the first
> > one contains the audio controls. Unfortunately, there is no field in any
> > of the descriptors to tell us whether a control interface is for audio
> > or MIDI controls, so a better check is not easy to implement.
> > 
> > On a composite device with audio and MIDI functions, for example, the
> > code currently overwrites chip->ctrl_intf, causing operations on the
> > control interface to fail if they are issued after the device probe.
> > 
> > Signed-off-by: Daniel Mack <daniel@caiaq.de>
> 
> Applied now.  Thanks.

This went upstream now, thanks. However, I forgot to mention in my
commit log that we also need this backported to 2.6.35.

Greg, can you queue it up manually? Upstream commit is 7b6717e.

Thanks,
Daniel


> > ---
> >  sound/usb/card.c |    8 +++++++-
> >  1 files changed, 7 insertions(+), 1 deletions(-)
> > 
> > diff --git a/sound/usb/card.c b/sound/usb/card.c
> > index 9feb00c..b443a33 100644
> > --- a/sound/usb/card.c
> > +++ b/sound/usb/card.c
> > @@ -465,7 +465,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
> >  			goto __error;
> >  	}
> >  
> > -	chip->ctrl_intf = alts;
> > +	/*
> > +	 * For devices with more than one control interface, we assume the
> > +	 * first contains the audio controls. We might need a more specific
> > +	 * check here in the future.
> > +	 */
> > +	if (!chip->ctrl_intf)
> > +		chip->ctrl_intf = alts;
> >  
> >  	if (err > 0) {
> >  		/* create normal USB audio interfaces */
> > -- 
> > 1.7.0.4
> > 

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

* Re: [stable] [PATCH] ALSA: usb-audio: Assume first control interface is for audio
  2010-09-10 16:15   ` Daniel Mack
@ 2010-09-10 17:06     ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2010-09-10 17:06 UTC (permalink / raw)
  To: Daniel Mack; +Cc: Takashi Iwai, alsa-devel, Greg KH, stable

On Fri, Sep 10, 2010 at 06:15:44PM +0200, Daniel Mack wrote:
> On Thu, Sep 02, 2010 at 11:59:18AM +0200, Takashi Iwai wrote:
> > At Thu,  2 Sep 2010 17:13:15 +0800,
> > Daniel Mack wrote:
> > > 
> > > For devices with more than one control interface, let's assume the first
> > > one contains the audio controls. Unfortunately, there is no field in any
> > > of the descriptors to tell us whether a control interface is for audio
> > > or MIDI controls, so a better check is not easy to implement.
> > > 
> > > On a composite device with audio and MIDI functions, for example, the
> > > code currently overwrites chip->ctrl_intf, causing operations on the
> > > control interface to fail if they are issued after the device probe.
> > > 
> > > Signed-off-by: Daniel Mack <daniel@caiaq.de>
> > 
> > Applied now.  Thanks.
> 
> This went upstream now, thanks. However, I forgot to mention in my
> commit log that we also need this backported to 2.6.35.
> 
> Greg, can you queue it up manually? Upstream commit is 7b6717e.

Yes, I will do so, thanks for letting me know.

greg k-h

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

* Re: [PATCH] ALSA: usb-audio: Assume first control interface is for audio
  2010-09-02  9:13 [PATCH] ALSA: usb-audio: Assume first control interface is for audio Daniel Mack
  2010-09-02  9:59 ` Takashi Iwai
@ 2010-09-10 17:15 ` Felix Homann
  1 sibling, 0 replies; 5+ messages in thread
From: Felix Homann @ 2010-09-10 17:15 UTC (permalink / raw)
  To: alsa-devel

Thanks,

that's very useful for the mixer in the Fast Track Ultra!

Am 02.09.2010 11:13, schrieb Daniel Mack:
> +	/*
> +	 * For devices with more than one control interface, we assume the
> +	 * first contains the audio controls. We might need a more specific
> +	 * check here in the future.
> +	 */
> +	if (!chip->ctrl_intf)
> +		chip->ctrl_intf = alts;
>
>   	if (err>  0) {
>   		/* create normal USB audio interfaces */
>

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

end of thread, other threads:[~2010-09-10 17:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-02  9:13 [PATCH] ALSA: usb-audio: Assume first control interface is for audio Daniel Mack
2010-09-02  9:59 ` Takashi Iwai
2010-09-10 16:15   ` Daniel Mack
2010-09-10 17:06     ` [stable] " Greg KH
2010-09-10 17:15 ` Felix Homann

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.