ALSA: usb-audio: Assume first control interface is for audio
PATCH 1/1 ALSA: usb-audio: Assume first control interface is for audio
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.
--- sound/usb/card.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
sound/usb/card.c +7 -1
@@ -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 */
Signature · 1 line
1.7.0.4
At Thu, 2 Sep 2010 17:13:15 +0800,
Quoted 11 lines · Daniel Mack
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 <[email protected]>
Applied now. Thanks.
Takashi
Quoted 26 lines
--- sound/usb/card.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)sound/usb/card.c +7
-1@@ -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 */ Signature · 1 line
1.7.0.4
Quoted 8 lines · Takashi Iwai
At Thu, 2 Sep 2010 17:13:15 +0800,
Quoted 6 lines · Daniel Mack
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.
Quoted 7 lines
Quoted 5 lines
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 <[email protected]>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
Quoted 26 lines
Quoted 26 lines
--- sound/usb/card.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)sound/usb/card.c +7
-1@@ -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 */ Signature · 1 line
1.7.0.4
Quoted 13 lines · Daniel Mack
Quoted 12 lines · Takashi Iwai
At Thu, 2 Sep 2010 17:13:15 +0800,
Quoted 10 lines · Daniel Mack
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.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Daniel Mack <[email protected]>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
Thanks,
that's very useful for the mixer in the Fast Track Ultra!
Am 02.09.2010 11:13, schrieb Daniel Mack:
Quoted 11 lines
sound/usb/card.c +7
-0+/* +* 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 */