[alsa-devel] Assorted usb-audio patches
Hi,
here are some patches I collected for the usb-audio driver. Most of them have been discussed on this list already, and all are rather small and shouldn't cause any problems.
FWIW, they can also be pulled from
git://github.com/zonque/linux-2.6.git usb-audio
Daniel
Daniel Mack (8): MAINTAINERS: Add entry for Native Instruments sound driver ALSA: usb-audio: make hwc_debug a noop in case HW_CONST_DEBUG is not set ALSA: usb-audio: include format.h in format.c ALSA: usb-audio: remove invalid extra mixers for Komplete Audio 6 ALSA: usb-audio: Add quirk for KORG PANDORA PX5D MIDI interface ALSA: usb-audio: add quirks for Roland GR-55 ALSA: usb-audio: assume valid clock ALSA: usb-audio: handle "Fast Track Ultra" with USB_DEVICE_VENDOR_SPEC()
MAINTAINERS | 7 +++++++ sound/usb/clock.c | 11 ++++++++++- sound/usb/debug.h | 2 +- sound/usb/format.c | 1 + sound/usb/mixer_quirks.c | 17 ----------------- sound/usb/quirks-table.h | 43 ++++++++++++++++++++++++++++++++++++++++--- sound/usb/quirks.c | 2 +- 7 files changed, 60 insertions(+), 23 deletions(-)
Signed-off-by: Daniel Mack zonque@gmail.com --- MAINTAINERS | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS index 69f19f1..07d064d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4271,6 +4271,13 @@ M: Tim Hockin thockin@hockin.org S: Maintained F: drivers/net/natsemi.c
+NATIVE INSTRUMENTS USB SOUND INTERFACE DRIVER +M: Daniel Mack zonque@gmail.com +S: Maintained +L: alsa-devel@alsa-project.org +W: http://www.native-instruments.com +F: sound/usb/caiaq/ + NCP FILESYSTEM M: Petr Vandrovec petr@vandrovec.name S: Odd Fixes
Just defining it to nothing is dangerous as it can alter the code execution flow, for example when used in as only function in a conditional code block.
Signed-off-by: Daniel Mack zonque@gmail.com --- sound/usb/debug.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/usb/debug.h b/sound/usb/debug.h index 343ec2d..5803017 100644 --- a/sound/usb/debug.h +++ b/sound/usb/debug.h @@ -8,7 +8,7 @@ #ifdef HW_CONST_DEBUG #define hwc_debug(fmt, args...) printk(KERN_DEBUG fmt, ##args) #else -#define hwc_debug(fmt, args...) /**/ +#define hwc_debug(fmt, args...) do { } while(0) #endif
#endif /* __USBAUDIO_DEBUG_H */
Just in case a prototype changes, we'll be warned. This also fixes a sparse warning.
Signed-off-by: Daniel Mack zonque@gmail.com --- sound/usb/format.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/usb/format.c b/sound/usb/format.c index f079b5e..8d042dc 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c @@ -30,6 +30,7 @@ #include "helper.h" #include "debug.h" #include "clock.h" +#include "format.h"
/* * parse the audio format type I descriptor
This was a flaw in the reading of the spec tables - Native Instrument's "Komplete Audio 6" device has no such extra controls.
This patch also fixes the device name in two comments.
Signed-off-by: Daniel Mack zonque@gmail.com --- sound/usb/mixer_quirks.c | 17 ----------------- sound/usb/quirks-table.h | 2 +- sound/usb/quirks.c | 2 +- 3 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 4a7ad7e..73dcc82 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -398,17 +398,6 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol, return 0; }
-static struct snd_kcontrol_new snd_nativeinstruments_ak6_mixers[] = { - { - .name = "Direct Monitor Channel 1+2", - .private_value = _MAKE_NI_CONTROL(0x03, 0x03), - }, - { - .name = "Direct Monitor Channel 3+4", - .private_value = _MAKE_NI_CONTROL(0x03, 0x05), - }, -}; - static struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = { { .name = "Direct Thru Channel A", @@ -537,12 +526,6 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) err = snd_xonar_u1_controls_create(mixer); break;
- case USB_ID(0x17cc, 0x1001): /* Audio Kontrol 6 */ - err = snd_nativeinstruments_create_mixer(mixer, - snd_nativeinstruments_ak6_mixers, - ARRAY_SIZE(snd_nativeinstruments_ak6_mixers)); - break; - case USB_ID(0x17cc, 0x1011): /* Traktor Audio 6 */ err = snd_nativeinstruments_create_mixer(mixer, snd_nativeinstruments_ta6_mixers, diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 54e18c1..5c1a176 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -2332,7 +2332,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
/* Native Instruments MK2 series */ { - /* Audio Kontrol 6 */ + /* Komplete Audio 6 */ .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = 0x17cc, .idProduct = 0x1000, diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index de50eea..bd13d72 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -540,7 +540,7 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev, /* Access Music VirusTI Desktop */ return snd_usb_accessmusic_boot_quirk(dev);
- case USB_ID(0x17cc, 0x1000): /* Audio Kontrol 6 */ + case USB_ID(0x17cc, 0x1000): /* Komplete Audio 6 */ case USB_ID(0x17cc, 0x1010): /* Traktor Audio 6 */ case USB_ID(0x17cc, 0x1020): /* Traktor Audio 10 */ return snd_usb_nativeinstruments_boot_quirk(dev);
Signed-off-by: Daniel Mack zonque@gmail.com Reported-and-tested-by: Frédéric Jaume frederic.jaume@gmail.com --- sound/usb/quirks-table.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 5c1a176..78c3e8d 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -2179,6 +2179,17 @@ YAMAHA_DEVICE(0x7010, "UB99"), } },
+/* KORG devices */ +{ + USB_DEVICE_VENDOR_SPEC(0x0944, 0x0200), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "KORG, Inc.", + /* .product_name = "PANDORA PX5D", */ + .ifnum = 3, + .type = QUIRK_MIDI_STANDARD_INTERFACE, + } +}, + /* AKAI devices */ { USB_DEVICE(0x09e8, 0x0062),
Signed-off-by: Daniel Mack zonque@gmail.com Reported-by: Jeffrey Scott Flesher jeffrey.scott.flesher@gmail.com --- sound/usb/quirks-table.h | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 78c3e8d..690767c 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -1651,6 +1651,32 @@ YAMAHA_DEVICE(0x7010, "UB99"), } } }, +{ + USB_DEVICE(0x0582, 0x0127), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + /* .vendor_name = "Roland", */ + /* .product_name = "GR-55", */ + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = (const struct snd_usb_audio_quirk[]) { + { + .ifnum = 0, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 1, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 2, + .type = QUIRK_MIDI_STANDARD_INTERFACE + }, + { + .ifnum = -1 + } + } + } +},
/* Guillemot devices */ {
If the interface can't report a clock's validity, assume that it's valid.
Signed-off-by: Daniel Mack zonque@gmail.com Reported-by: Vicente Joel vicentejoel@gmail.com --- sound/usb/clock.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/sound/usb/clock.c b/sound/usb/clock.c index 7754a10..075195e 100644 --- a/sound/usb/clock.c +++ b/sound/usb/clock.c @@ -104,6 +104,15 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id) int err; unsigned char data; struct usb_device *dev = chip->dev; + struct uac_clock_source_descriptor *cs_desc = + snd_usb_find_clock_source(chip->ctrl_intf, source_id); + + if (!cs_desc) + return 0; + + /* If a clock source can't tell us whether it's valid, we assume it is */ + if (!uac2_control_is_readable(cs_desc->bmControls, UAC2_CS_CONTROL_CLOCK_VALID)) + return 1;
err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, @@ -114,7 +123,7 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id) if (err < 0) { snd_printk(KERN_WARNING "%s(): cannot get clock validity for id %d\n", __func__, source_id); - return err; + return 0; }
return !!data;
That way, the class compliant MIDI interface is also handled.
Signed-off-by: Daniel Mack zonque@gmail.com Reported-and-tested-by: Grant Diffey gdiffey@gmail.com --- sound/usb/quirks-table.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 690767c..78792a8 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -1979,7 +1979,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, { - USB_DEVICE(0x0763, 0x2080), + USB_DEVICE_VENDOR_SPEC(0x0763, 0x2080), .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { /* .vendor_name = "M-Audio", */ /* .product_name = "Fast Track Ultra", */ @@ -2046,7 +2046,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, { - USB_DEVICE(0x0763, 0x2081), + USB_DEVICE_VENDOR_SPEC(0x0763, 0x2081), .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { /* .vendor_name = "M-Audio", */ /* .product_name = "Fast Track Ultra 8R", */
At Wed, 18 May 2011 11:28:37 +0200, Daniel Mack wrote:
Hi,
here are some patches I collected for the usb-audio driver. Most of them have been discussed on this list already, and all are rather small and shouldn't cause any problems.
Thanks! I applied all patches now.
Takashi
FWIW, they can also be pulled from
git://github.com/zonque/linux-2.6.git usb-audio
Daniel
Daniel Mack (8): MAINTAINERS: Add entry for Native Instruments sound driver ALSA: usb-audio: make hwc_debug a noop in case HW_CONST_DEBUG is not set ALSA: usb-audio: include format.h in format.c ALSA: usb-audio: remove invalid extra mixers for Komplete Audio 6 ALSA: usb-audio: Add quirk for KORG PANDORA PX5D MIDI interface ALSA: usb-audio: add quirks for Roland GR-55 ALSA: usb-audio: assume valid clock ALSA: usb-audio: handle "Fast Track Ultra" with USB_DEVICE_VENDOR_SPEC()
MAINTAINERS | 7 +++++++ sound/usb/clock.c | 11 ++++++++++- sound/usb/debug.h | 2 +- sound/usb/format.c | 1 + sound/usb/mixer_quirks.c | 17 ----------------- sound/usb/quirks-table.h | 43 ++++++++++++++++++++++++++++++++++++++++--- sound/usb/quirks.c | 2 +- 7 files changed, 60 insertions(+), 23 deletions(-)
participants (2)
-
Daniel Mack
-
Takashi Iwai