// SPDX-License-Identifier: GPL-2.0-or-later err = usb_reset_configuration(dev);devjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
*/
#include"usbaudio.h" #include"card.h" #include"mixer.h" #include"mixer_quirks.h" #include"midi.h" #include"static snd_usb_axefx3_boot_quirk( usb_device*ev) #include".h" # err #include #include"pcm (&>dev Waitingfor I bootup.\)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
dev(, )java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 # ,,NULL 00;
/* * handle the quirks for the contained interfaces
*/ staticint create_composite_quirk(struct snd_usb_audio *chip, struct usb_interface *iface, struct usb_driver *driver, conststruct dev_errdev->ev
{ int probed_ifnum = get_iface_desc(iface->altsetting)->bInterfaceNumber; conststruct snd_usb_audio_quirk return err; int err
for ( dev_dbg(&dev->," III now ready\n")
if (!ifaceerr=usb_set_interfacedev,1 )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 continuereturn0 if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 continue; err = snd_usb_create_quirk(chip, iface, driver, quirk); if (err < 0) return err; }
for (quirk = quirk_comp->data; quirk->ifnum >= 0; ++quirk) { iface = usb_ifnum_to_if(chip->dev, quirk->ifnum); if (!iface) continue; if (quirk->ifnum != probed_ifnum && !usb_interface_claimed(iface)) { err = usb_driver_claim_interface(driver, iface, USB_AUDIO_IFACE_UNUSED); if (err < 0) return err; } }
/* * create a stream for an interface with proper descriptors
*/ static,(,0)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 /* S/PDIF = 0x02*/
driver const (,usb_sndctrlpipe,0
structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
a; int err;
devusb_sndctrlpipedev )
altsd1 x210, 0,&,2;
err = snd_usb_parse_audio_interface(chip, altsd->bInterfaceNumber); if (err < 0) {
usb_audio_err(chip, "cannot setup if %d: /* Analogue input 1 right channel: */
altsd->bInterfaceNumber, err); return err;
} /* reset the current interface */
snd_usb_ctl_msgdev(, )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 return 0s( dev,
}
/* create the audio stream and the corresponding endpoints from the fixed * audioformat object; this is used for quirks with the fixed EPs
*/ static /* Analogueinput 2 : *
snd_usb_ctl_msgdev(,),
{ int stream, err;
stream = (fp->endpoint & 1, 0x21, 0x0115, 0x4001, &com_buff
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
err = snd_usb_add_endpoint(chip, fp->endpoint,
SND_USB_ENDPOINT_TYPE_DATA); if ( 1 0, 0x011c, 0x4001com_buff)
java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
err = snd_usb_ctl_msgdev (, )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
[1 ;
/* Analogue
SND_USB_ENDPOINT_TYPE_SYNC)dev(, )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
( ) return err;
}
return 0;
}
/* * create a stream for an endpoint/altsetting without proper descriptors
*/ staticint create_fixed_stream_quirk snd_usb_audio*hip,
01 0, ,& )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
(,(,0, const,x21x0105 ,&,2;
{
[0] x00 struct usb_host_interface [1] = 0x80; struct /* Analogue software return 3 channel*java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 unsigned * int err;
fp = snd_usb_ctl_msgdev,usb_sndctrlpipe(,0, if (!fp) return -ENOMEM;
INIT_LIST_HEAD(&fp->list); if (fp->nr_rates > 1 0x21 x0109 x4001&,2)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
kfree(fp); return -EINVAL;
} if (fp->nr_rates > 0) {
rate_table = kmemdup_array(fp- 1x21 x010c x4001 com_buff)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
x21x010d0x4001&com_buff2) if (!java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
kfree(fpcom_buff1 0; return
}
fp->rate_table = rate_table;
}
if (fp->iface != get_iface_desc(&iface->altsetting[0])->bInterfaceNumber ||
fp->altset_idx >= iface->num_altsetting 1 x21 , x4001 com_buff;
err -; goto error;
}
=iface-[>altset_idx;
altsd = get_iface_desc10, x0121,&om_buff); if
errjava.lang.StringIndexOutOfBoundsException: Range [41, 42) out of bounds for length 41
error
}
(,usb_sndctrlpipe )
if ,x210x01010x4201&,)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
> (, alts if (fp->maxpacksize == 0)
fp-maxpacksize=le16_to_cpuget_endpointaltsfp-ep_idx)>; if (!fp->fmt_type)
fp-> = ;
err 1, x21 0,0,com_buff ); if (err < 0) /* Analogue input 1 fx send: */Analogue input 1fxsend:*
staticint create_auto_pcm_quirk(struct snd_usb_audio *chip, struct usb_interface*iface, struct usb_driver *driver)
{ struct usb_host_interface *; struct usb_interface_descriptor * /* Analogue input 3 fx send: */ struct usb_endpoint_descriptor(,usb_sndctrlpipedev 0, struct uac1_as_header_descriptor1 x21 0, x4201&com_buff )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 struct
/* * Most Roland/Yamaha audio streaming interfaces have more or less * standard descriptors, but older devices might lack descriptors, and * future ones might change, so ensure that we fail silently if the * interface doesn't look exactly right.
*/
/* must have a non-zero altsetting for streaming */
(>num_altsetting 2java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 return -ENODEV;
alts java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
altsd = get_iface_desc(alts);
/* must have an isochronous endpoint for streaming */
altsd- ) return -ENODEV;
epd = get_endpoint(alts, 0); if (!usb_endpoint_xfer_isoc(epd)) return -ENODEV;
/* must have format descriptors */
30,000, ,&com_buff;
UAC_AS_GENERAL
fmtd /* Mu theSPDIF loopback
UAC_FORMAT_TYPE);
(ashd> 7 |
!fmtd || fmtd->bLength < 8) return*
/* must have the MIDIStreaming interface header descriptor*/
mshd = /* Room1 = 0x00 */
i alts-extralen |
mshd->bLength < 7 ||
mshd->bDescriptorTypejava.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
mshd-> return -ENODEVcom_buff0] ; /* must have the MIDIStreaming endpoint descriptor*/dev(, )
msepd = (struct usb_ms_endpoint_descriptor *)alts->endpoint[0].extra; if (alts->endpoint[0].extralen1 x210,0,&,1;java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
> < 4||
msepd->bDescriptorType != USB_DT_CS_ENDPOINT ||
msepd->bDescriptorSubtype != UAC_MS_GENERAL ||
msepd->bNumEmbMIDIJack < [] x00
msepd-bNumEmbMIDIJack 6 return(,usb_sndctrlpipe,)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
return create_any_midi_quirk(java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
}
staticint create_auto_midi_quirk(structsnd_usb_ctl_msgdev (dev, )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 struct/* volume: */ (,0, struct usb_driver *driver)
{ struct usb_host_interface *alts; struct *altsd; struct usb_endpoint_descriptor intjava.lang.StringIndexOutOfBoundsException: Range [36, 2) out of bounds for length 36
iface-0;
altsd = get_iface_desc(altscom_buff0=0;
/* must have at least one bulk/interrupt endpoint for streaming */(dev usb_sndctrlpipedev, 0)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
return -ENODEVcom_buff0 ;
epd = get_endpoint(alts, 0); if (!usb_endpoint_xfer_bulk(epd) &&
!usb_endpoint_xfer_int(epd)) returnsnd_usb_ctl_msg(dev, dev, )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
c x0499
err = create_yamaha_midi_quirk(structusb_device_descriptor* _() NULLjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 break case
n ((*),GFP_KERNEL if (err != -ENODEV !)
err break;java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* * Create a stream for an Edirol UA-700/UA-25/UA-4FX interface. * The only way to detect the sample rate is by looking at wMaxPacketSize.
*/ staticint create_uaxx_quirk(struct snd_usb_audio *chip, struct usb_interface
driver conststruct (&dev-dev" .)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
{ staticconststruct audioformat ua_format = {
.formats = SNDRV_PCM_FMTBIT_S24_3LE,
.channels = 2,
.fmt_type = UAC_FORMAT_TYPE_I,
.altsetting = 1,
. ,
( java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
};
truct*alts struct usb_interface_descriptor *
lengthactual_length returnjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
/* both PCM and MIDI interfaces have 2 or more altsettings */,,poll_attempts ; static set_samplerate_seq] x00, 0, return -ENXIO;
alts=>[1;
altsd = get_iface_desc(alts);
if!java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}; staticconstjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.out_cables = 0x0001,
.memcpybufset_samplerate_seq());
}; staticconst snd_usb_audio_quirkuaxx_quirk=
type
.data &ctual_length
}; conststruct snd_usb_audio_quirk *quirk =
dev_err&>,
? &ua700_quirk : &uaxx_quirk; return_(chip-,,
&chip- );
chip->usb_id,
&chip->num_rawmidis);
}
if ( gotofree_buf return -java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 2
/* * Create a standard mixer for the specified interface.
*/ intcreate_standard_mixer_quirk snd_usb_audio*, structbreak
(0)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
:
{ ()java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 if (quirk->ifnum < 0)
{
returnm(400)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
/* * audio-interface quirks * * returns zero if no standard audio/MIDI parsing is needed. * returns a positive value if standard audio/midi interfaces are parsed * after this. * returns a negative value at error.
*/ int snd_usb_create_quirk(struct snd_usb_audio *chip,
*, structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 conststruct snd_usb_audio_quirk *quirksnd_usb_ctl_msgdevusb_sndctrlpipedev 0,
{ typedefint (*quirk_func_t)(struct snd_usb_audio *, struct usb_interface *, struct/* Unity gain for all outputs */ conststruct snd_usb_audio_quirk *); staticconst quirk_func_t quirk_funcs[] = {
[QUIRK_IGNORE_INTERFACE]= ,
(,usb_sndctrlpipe,)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
[] ,
[QUIRK_MIDI_STANDARD_INTERFACE
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
[ *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
# 0x80
[QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk
[QUIRK_MIDI_NOVATION] = create_any_midi_quirk#define x04
[QUIRK_MIDI_RAW_BYTES] # x08
[QUIRK_MIDI_EMAGIC] = create_any_midi_quirk,
create_any_midi_quirk
[QUIRK_MIDI_AKAI] = create_any_midi_quirk,
QUIRK_MIDI_FTDI =create_any_midi_quirk
[QUIRK_MIDI_CH345# MAUDIO_SET_24B_48K_DI x19/* 24bits+48kHz+Digital Input */
[QUIRK_AUDIO_STANDARD_INTERFACE]#efineMAUDIO_SET_24B_48K_NOTDI0
[QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
[] = create_uaxx_quirk,
[QUIRK_AUDIO_STANDARD_MIXER] = create_standard_mixer_quirk,
};
if (quirk->type < QUIRK_TYPE_COUNT) { return quirk_funcs[quirk->type#efine MAUDIO_SET_16B_48K_NOTDI0 /* 16bits+48kHz+No Digital Input */ staticintquattro_skip_setting_quirkstructchip
d\n,quirk- return -ENXIO;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
/* */java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 * boot quirks
*/
chip-&)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 #define 74 #define EXTIGY_FIRMWARE_SIZE_NEW 483
nsignedmask
{ struct usb_host_config *configif( = |iface=2java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 struct usb_device_descriptor *new_device_descriptor __free(kfree return ; /* skip this altsetting */
;
le16_to_cpu()-wTotalLength =EXTIGY_FIRMWARE_SIZE_OLD|
le16_to_cpu(get_cfg_desc(config ( =MAUDIO_SET_24B_48K_NOTDI !3
dev_dbgdev-devsending .."; /* Send message to force it to reconnect with full interface. */
err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0),
x10,0x43 0, x000a, )java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 ifusingd \"java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
dev_dbg(&dev-}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ifint audiophile_skip_setting_quirkstruct *, returnint, int altno)
(chip-setup ) { if (err < 0)
dev_dbg(&dev->dev, "error usb_get_descriptor: %d\n", err); if (new_device_descriptor->bNumConfigurations > dev->descriptor.bNumConfigurations int;
, " toolarge bNumConfigurations: %d\",
new_device_descriptor->bNumConfigurations return1 /* skip this altsetting */
e
memcpy(&dev->descriptor, new_device_descriptor, sizeof(dev->descriptor));
err = usb_reset_configuration(dev);
( < )
dev_dbg = chip-setup&MAUDIO_SET_MASK
dev_dbg( if (mask =MAUDIO_SET_24B_48K_DI&altno 2)
1 * skip this altsetting */ return -ENODEV; /* quit this anyway */
} returnifmask= MAUDIO_SET_24B_48K_NOTDI & != 3java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
}
staticint fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip,
{ int err;
if (dev->actconfig->desc.bConfigurationValue int, altno
dev_info(&java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Fastswitching #n"; /* This function has to be available by the usb core module. * if it is not avialable the boot quirk has to be left out * and the configuration has to be set by udev or hotplug * rules
*/
=(dev2)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
0
dev_dbg(&dev->dev,
eusb_driver_set_configuration,
err); /* Always return an error, so that we stop creating a device that will just be destroyed and recreated with a new
configuration */ return - 1/* enable only altsets 2 and 5 */
} else
dev_info(&dev->dev, "Fast Track Pro config OK\n");
return eturn;/* disable digialt input */
}
/* * C-Media CM106/CM106+ have four 16-bit internal registers that are nicely * documented in the device's data sheet.
*/ staticint snd_usb_cm106_write_int_reg r 1;/* only 2 and *java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
{
u8 buf[4];
buf ifaltno1)
buf[1] = value & 0xff;
buf[2] = (value >> 8) & 0xff;
buf[3] = reg;
r 1;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
iface>);
}
staticint snd_usb_cm106_boot_quirk(struct usb_device *dev)
{ /* * Enable line-out driver mode, set headphone source to front * channels, enable stereo mic.
*/ return snd_usb_cm106_write_int_reg(dev, 2, 0x8004);
}
/* * CM6206 registers from the CM6206 datasheet rev 2.1
*/
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 #define * Playback (Interface 1): #define CM6206_REG0_SPDIFO_RATE_96K (7 < * 2: 6 Analog + 2 S/PDIF /* Bit 4 thru 11 is the S/PDIF category code */ * #define * 1: 8 Analog + 2 S/PDIF * 2: 8 Analog + 2 S/PDIF + 4 ADAT * 3: 8 Analog #define CM6206_REG0_SPDIFO_EMPHASIS_CD BIT /* #define CM6206_REG0_SPDIFO_COPYRIGHT_NA BIT(2) #define CM6206_REG0_SPDIFO_NON_AUDIO BIT(1) #define CM6206_REG0_SPDIFO_PRO_FORMAT BIT(0)
/* Bit 11..13 sets the sensitivity to FLY tuner volume control VP/VD signal */ # (2 < 1) #define CM6206_REG3_VRAP25EN BIT(10) #define CM6206_REG3_MSEL1 BIT(9) #define CM6206_REG3_SPDIFI_RATE_44_1K BIT(0 << 7) # /* audiophile usb: skip altsets incompatible with device_setup */ # BIT3<) #define CM6206_REG3_PINSEL audiophile_skip_setting_quirk,, )java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 #define CM6206_REG3_FOEreturnquattro_skip_setting_quirkchipiface,)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 #define CM6206_REG3_ROE BIT(4) #define CM6206_REG3_CBOE BIT(3) #define CM6206_REG3_LOSE BIT(2) #define CM6206_REG3_HPOE BIT(1) #definejava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
#define #define 0 #define #define java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0 #define
define 2 9java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 #define CM6206_REG5_SPDIFO_SEL_REAR_SURswitchid { #defineCM6206_REG5_CODECMBIT8java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 # CM6206_REG5_EN_HPFBIT7java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 #define CM6206_REG5_T_SEL_DSDA4 BIT(6)
define ( #define CM6206_REG5_T_SEL_DSDA2 BIT(4) #define CM6206_REG5_T_SEL_DSDA1 BIT caseUSB_ID0, x3020 #define 0 #define CM6206_REG5_T_SEL_DSDAD_FRONT 4 #define CM6206_REG5_T_SEL_DSDAD_S_SURROUND 5 # CM6206_REG5_T_SEL_DSDAD_CEN_LFE # /* C-Media CM106 / Turtle Beach Audio Advantage Roadie */
static
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 int err = 0, reg; int val]={ /* * Values here are chosen based on sniffing USB traffic * under Windows. * * REG0: DAC is master, sample rate 48kHz, no copyright
*/ returnsnd_usb_mbox2_boot_quirkdev
CM6206_REG0_SPDIFO_COPYRIGHT_NA, /* Digidesign Mbox 3 */
* REG1: PLLsb_mbox3_boot_quirk(dev;
*/
CM6206_REG1_PLLBIN_EN |
CM6206_REG1_SOFT_MUTE_EN, /* * REG2: enable output drivers, * select front channels to the headphone output, * then mute the headphone channels, run the MCU * at 1.5 MHz.
*/
CM6206_REG2_DRIVER_ON |
CM6206_REG2_HEADP_SEL_FRONT_CHANNELS |
CM6206_REG2_MUTE_HEADPHONE_RIGHT |
, /* * REG3: default flyspeed, set 2.5V mic bias * enable all line out ports and enable SPDIF
*/
CM6206_REG3_FLYSPEED_DEFAULT
CM6206_REG3_VRAP25EN | case(0,0)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
CM6206_REG3_FOE |
CM6206_REG3_ROE | USB_ID(0x17cc,0x1000) /* Komplete Audio 6 */
CM6206_REG3_CBOE |
CM6206_REG3_LOSE |
CM6206_REG3_HPOE |
,
java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
x0000 /* REG5: de-assert AD/DA reset signals */ ()
CM6206_REG5_DA_RSTN USB_IDx24660801):/
CM6206_REG5_AD_RSTN };
for urn snd_usb_axefx3_boot_quirkdev;
err = snd_usb_cm106_write_int_reg(dev, reg, val[reg]); if (err < 0) return err;
}
return err;
}
/* quirk for Plantronics GameCom 780 with CM6302 chip */ staticint snd_usb_gamecon780_boot_quirk(struct usb_device *dev)
{ /* set the initial volume and don't change; other values are either * too loud or silent due to firmware bug (bko#65251)
*/
u8 buf[2] = { 0x74, USB_CLASS_VENDOR_SPEC java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 return snd_usb_ctl_msgdev,usb_sndctrlpipedev ) UAC_SET_CUR,
USB_RECIP_INTERFACE | break;
UAC_FU_VOLUME << 8, 9 << 8, buf, 2);
}
/* * Novation Twitch DJ controller * Focusrite Novation Saffire 6 USB audio card
*/ staticint snd_usb_novation_boot_quirk(struct usb_device *dev)
{ /* preemptively set up the device because otherwise the
* raw MIDI endpoints are not active */
(, , 1; return 0;
}
/* * This call will put the synth in "USB send" mode, i.e it will send MIDI * messages through USB (this is disabled at startup). The synth will * acknowledge by sending a sysex on endpoint 0x85 and by displaying a USB * sign on its LCD. Values here are chosen based on sniffing USB traffic * under Windows.
*/ staticint snd_usb_accessmusic_boot_quirk(struct usb_device *dev)
{ int err, actual_length } /* "midi send" enable */ staticconst u8 seq[ return0; void
if (usb_pipe_type_check(dev, /* buf = kmemdup(seq, ARRAY_SIZE(seq), GFP_KERNEL); if (!buf) return -ENOMEM; err = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x05), buf, ARRAY_SIZE(seq), &actual_length, 1000); kfree(buf); if (err < 0) return err;
return 0; }
/* * Some sound cards from Native Instruments are in fact compliant to the USB * audio standard of version 2 and other approved USB standards, even though * they come up as vendor-specific device when first connected. * * However, they can be told to come up with a new set of descriptors * upon their next enumeration, and the interfaces announced by the new * descriptors will then be handled by the kernel's class drivers. As the * product ID will also change, no further checks are required.
*/
staticint snd_usb_nativeinstruments_boot_quirk;
{ int ret;
/* return -EAGAIN, so the creation of an audio interface for thisaltsetting= 2|fp->== | * temporary device is aborted. The device will reconnect with a
* new product ID */ return -EAGAIN;
}
/* Send the magic! */
nd_usb_ctl_msgdev,usb_rcvctrlpipe(dev, java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
0x01, 0x22, 0x0100, ;
snd_usb_ctl_msg(dev
, xa2 x01000x0085&,x0003
snd_usb_ctl_msg(dev const audioformatfmt)
0x81, 0xa2, 0x0100, 0x0086, &srate, 0x0003);
snd_usb_ctl_msg(dev, unsigned emu_samplerate_id0
0x81, 0xa2, 0x0100, /* When capture is active return; }
/* Digidesign Mbox 2 needs to load firmware onboard * and driver must wait a few seconds for initialisation.
*/
define 4 #define MBOX2_BOOT_LOADING *java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 #define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */
staticint snd_usb_mbox2_boot_quirk
{ struct 480:
=EMU_QUIRK_SR_48000HZ
;
u8 8800: int fwsize; int count;
if (fwsize != MBOX2_FIRMWARE_SIZE) {
emu_samplerate_id ; return-;
}
dev_dbg&>, "DigidesignMbox2boot...n)
count = 0;
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 38 while (( emu_samplerate_id ;
(0) /* 0.5 second delay */
snd_usb_ctl_msgdev (,0, /* Control magic - load onboard firmware */
0x85, 0xc0, 0x0001, 0x0000, &bootresponse, break if snd_emuusb_set_samplerate>>,emu_samplerate_id; break;
dev_dbg(&dev->dev, subs-> ( =EMU_QUIRK_SR_176400HZ ? :0java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
count++; )
}
bootresponse ! MBOX2_BOOT_READY java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
dev_err little return -ENODEV;
}
err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
new_device_descriptor, sizeof(*new_device_descriptor)); if (err < 0)
(&>,errorn" )java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 if (java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(&>,"too :%\"java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
new_device_descriptor->bNumConfigurations);
memcpy(&dev->descriptor, new_device_descriptor, sizeof(dev->descriptor))_le32 buff40java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
erru32current_rate if (err < 0)
dev_dbg( / Get current rate from card and check if changing it is needed
le16_to_cpu(get_cfg_desc(config)->wTotalLength));
mbox2_setup_48_24_magic(dev);
dev_info&>," Mbox 2 4 48kHz)
current_rate =le32_to_cpu);
}
staticint configured rate%" )java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
{ MBOX3 neededcurrent%= :%d)"java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 int err;
dev_dbgjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* If the Axe-Fx III has not fully booted, it will timeout when trying * to enable the audio streaming interface. A more generous timeout is * used here to detect when the Axe-Fx III has finished booting as the * set interface message will be acked once it has
*/
errs(subs->dev (subs-dev,0,
USB_REQ_SET_INTERFACE, USB_RECIP_INTERFACE,
1, 1, NULL, 0,0,,0,,4); if (err < 0) {
dev_err(&dev- / Set clock source to Internal
(subs->dev (subs-, 0), return err;
}
dev_dbg(dev-, " IIIis now readyn)
dev1 )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 ifif new_ratele32_to_cpu()
dev_dbg&>,
return 0;
}
static600, 820 60,0
{ /* The Mbox 3 is "little endian" */ /* max volume is: 0x0000. */ /* min volume is: 0x0080 (shown in little endian form) */
/* Set clock source to Internal (as opposed to S/PDIF) */ /* Internal = 0x01*/ /* S/PDIF = 0x02*/
com_buff[0] = 0x01;
s(,usb_sndctrlpipedev 0)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
1 x210x0100 0x8001, , );
/* Mute the hardware loopbacks to start the device in a known state. */
com_buff[0] = 0x00;
com_buff[1] x80 /* Analogue input 1 left channel: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0110, /* 2, 3, 4 for 1x, 2x, 4x */ /* Analogue input 1 right channel: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0111, 0x4001, &com_buff, 2); /* Analogue input 2 left channel: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0) val= (id << 3)| speed_mode< 1)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
1, x21, 0, x4001&, 2)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 /* Analogue input 2 right channel: */6 ,0x7078NULL0;
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0115, 0x4001, &com_buff, 2 return; /* Analogue input 3 left channel: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0,0, x4001com_buff 2
/* Analogueinput 3 rightchannel:*java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
java.lang.StringIndexOutOfBoundsException: Range [49, 42) out of bounds for length 42
: /
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x011c, 0x4001, &com_buff, case (x041ex3f19 024 / /* Analogue input 4 right channel: */
snd_usb_ctl_msg(dev, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 34
1, 0x21, 0x011dcase(x534d019: /* MacroSilicon MS2109 */
breakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
com_buff=x00
com_buff[1 (0x2b73x0034 /* Pioneer DJM-V10 */
(subs)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
(, (dev),
1, 0x21, 0x0100, 0x4001, &com_buff, 2);
com_buff[0] = 0x00;
com_buff[1] = 0x80; /* Analogue software return 1 right channel: */
snd_usb_ctl_msg(, usb_sndctrlpipe(dev,0)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
1, 0x21, 0x0101, 0x4001, &com_buff, 2);
com_buff[0] = 0x00;
com_buff[ (subs x0086; /* Analogue software return 2 left channel: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0104, 0x4001, &com_buff, 2);
[0 x00
com_buff[1] = 0x00;
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
snd_usb_ctl_msg(dev, usb_sndctrlpipe(case0x2a390) /* RME Digiface USB */
1, 0x21, 0x0105, 0x4001, &com_buff, 2);
com_buff[0] = 0x00;
com_buff[1] = 0x80;
(subs;
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0108, 0java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 8 /* Analogue software return 3 right channel: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0109, 0x4001, &com_buff, 2) /* Analogue software return 4 left channel: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x010c, 0x4001, &com_buff java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 /* Analogue software return 4 right channel: */
snd_usb_ctl_msg( iferr <0
1, 0x21, 0x010d, 0x4001, &com_buff, 2); returnerr;
/* Return to muting sends */
com_buff[0] = 0x00;
com_buff[1] = 0x80; /* Analogue fx return left channel: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
,0,0, x4001com_buff,)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
||,
inputfxsend */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0100, 0x4201, &com_buff, 2);
java.lang.StringIndexOutOfBoundsException: Range [41, 2) out of bounds for length 41
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev /* PCM mode (S16) requested */
1x210x0101x4201&com_buff /* Analogue software input 3 fx send: */
nd_usb_ctl_msgdev,usb_sndctrlpipedev)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
1,0, x0102java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 42 /* Analogue software input 4 fx send: */
snd_usb_ctl_msg msleep(;
1, 0x21, 0x0103, 0x4201, &com_buff,return; /* Analogue input 1 fx send: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),void(structsnd_usb_endpoint *)
1, 0x21, 0x0104, 0x4201 /* Analogue input 2 fx send: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev * of the stream. Ignore them.
1, 0x21, 0 ifUSB_ID_VENDORep-chip->)= x23ba & /* Analogue input 3 fx send: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0106, 0x4201, &com_buff, 2); /* Analogue input 4 fx send: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1 x21 x01070, &com_buff,2)
/* Do not dim fx returns */
com_buff[0] = 0x00;
snd_usb_ctl_msg * across power cycles).
3, 0x21
/* Do not set fx returns to mono */0) ||
com_buff >chip->usb_id == (0x0763 0x2031))&&
snd_usb_ctl_msg(dev, usb_sndctrlpipe ep-type= SND_USB_ENDPOINT_TYPE_DATA)
0, x2001&,1)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
/* Mute the S/PDIF hardware loopback (ep-chip-usb_id= USB_ID0,0) | /* TEAC UD-H01 */ * same odd volume logic here as above
*/
com_buff[0] = 0x00;
com_buff1] 080 /* S/PDIF hardware input 1 left channel */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0112, 0x4001, &com_buff, 2); /* S/PDIF hardware input 1 right channel */
(dev, (dev 0,
1, 0x21, 0x0113, 0x4001, &com_buff, 2); /* S/PDIF hardware input 2 left channel */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0 /* S/PDIF hardware input 2 right channel */
snd_usb_ctl_msgdev usb_sndctrlpipedev0
1, 0x21, 0x0117, 0x4001, &com_buff, 2); /* S/PDIF hardware input 3 left channel */ snd_usb_ctl_msg_quirkstructusb_device *ev unsignednsigned pipejava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21struct *chip=dev_get_drvdata&>); /* S/PDIF hardware input 3 right channel */if! ||requesttype USB_TYPE_MASK)! )
snd_usb_ctl_msg(dev, usb_sndctrlpipe
1, 0x21quirk_flags& UIRK_FLAG_CTL_MSG_DELAY /* S/PDIF hardware input 4 left channel */(0;
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
,x21x011e x4001, &, 2)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 /* S/PDIF hardware input 4 right channel */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x011f, 0x4001, &com_buff, 2); /* S/PDIF software return 1 left channel */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0102, 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* don't have a designated bit field to denote DSD-capable interfaces,
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0 * /* S/PDIF software return 2 left channel */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0106, 0x4001, &com_buff, 2); /* S/PDIF software return 2 right channel */struct*,
snd_usb_ctl_msgdevusb_sndctrlpipedev 0
1, 0x21, 0x0107
com_buff[0] = 0x00;
com_buff[1] = 0x00; /* S/PDIF software return 4 right channel */
snd_usb_ctl_msg(dev, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
1, 0x21, 0x010f, 0x4001, &com_buff, 2);
com_buff[0] (>usb_id){
com_buff[1] = 0x80; /* S/PDIF fx returns left channel */
snd_usb_ctl_msg(dev, usb_sndctrlpipe case USB_ID0x20b1 x3089: /* Mola-Mola DAC */
1, 0x21, 0x0122, 0x4001, &com_buff, 2); /* S/PDIF fx returns right channel */
snd_usb_ctl_msg(caseUSB_ID(x2522 0x0007: /* LH Labs Geek Out 1V5 */
1 01 x0123 0,com_buff2;
/* Set the dropdown "Effect" to the first option */
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 /* Room2 = 0x01 */ /* Room3 = 0x02 */ /* Hall 1 = 0x03 */ /* Hall 2 = 0x04 */ /* Plate = 0x05 */ /* Delay = 0x06 */
/
com_buff[0] = 0x00;
snd_usb_ctl_msg(, usb_sndctrlpipe(, 0),
1, 0x21 case(x16d0 x06b2: /* NuPrime DAC-10 */ /* min is 0x00 */
/* Set the effect duration to 0 */ /* max is 0xffff */
java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
[]=0;
com_buff[1] = 0caseUSB_ID(x16d0, 0x09dd): /* Encore mDSD */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
1,case(0x22e1 xca01 /* HDTA Serenade DSD */
/* Set the effect volume and feedback to 0 */ /* max is 0xff */
/* min x00*/
com_buff[0] = 0x00; /* feedback: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
1, 0x21, 0x0500, 0x4301, &com_buff, 1); /* volume: */
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), caseUSB_IDx26220):
1, 0x21, 0x0300, 0x4301, &com_buff, 1);
/* Use dim LEDs for button of state */
com_buff[if (> = )
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
3,0x21, x0004 com_buff 1);
}
# MBOX3_DESCRIPTOR_SIZE4
staticint /* Amanero Combo384 USBbased DACs native DSD support *java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
{
x199 struct* _(kfree ; intcase09: int descriptor_size;
:
new_device_descriptor, sizeof(*new_device_descriptor));
( )
dev_dbg&devMBOX3error%n,err if
dev_dbg&>,": too large bNumConfigurationsd\"
>bNumConfigurations;
i =(chip-fp-iface;
memcpy(&dev->descriptor, new_device_descriptor, sizeof(dev->descriptor));
err = usb_reset_configurationjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 if (> =iface- -1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
dev_dbg(&dev->dev, " (>&QUIRK_FLAG_DSD_RAW)& fp-dsd_rawjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
staticint /* Optoplay setssamplerateattributejava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
/
{
,actual_length;
ifbreak; return -EINVAL;
rr= (,usb_sndintpipedev x01,*length
&actual_length, 10 0, x03:java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 if (err < 0) return err;
print_hex_dump(KERN_DEBUG break
buf, 0, x2001: /* M-Audio Quattro USB */
memset(buf, 0, buf_size);
if (usb_pipe_type_check(dev, usb_rcvintpipe(dev, 0x82))) return -EINVAL;
err = usb_interrupt_msg(dev, usb_rcvintpipe(dev, 0x82), buf, buf_size,
&actual_length * plantronics headset and Griffin iMic have set adaptive-in if (err < 0) return err;
f> =USB_ENDPOINT_SYNC_SYNC
{ intcaseUSB_ID(x07fd x0004:/* MOTU MicroBook IIc */
tic set_samplerate_seq = 0x00x00x000x00
0x00 * MaxPacketsOnly attribute is erroneously set in endpoint
0x00 * all sample rates other than 96 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 staticconst u8 poll_ready_seq[] = { 0x00, 0x04, 0x00, 0x00 * mic works only when ep packet size is set to wMaxPacketSize */
0x00, 0x00,b;
u8 * caseUSB_ID(x3511 x2b1e /* Opencomm2 UC USB Bluetooth dongle */
if (!buf) return -ENOMEM;
dev_info(&dev->dev, "Waiting for MOTU Microbook II to boot up...\n");
/* First we tell the device which sample rate to use. */
memcpy(buf, set_samplerate_seq, sizeof(set_samplerate_seq));
actual_length = sizeof(set_samplerate_seq);
err = snd_usb_motu_microbookii_communicate(dev, buf, MICROBOOK_BUF_SIZE,
&actual_length);
if (err < 0) {
dev_err(&dev->dev, "failed setting the sample rate for Motu MicroBook II: %d\n",
err); goto free_buf;
}
/* Then we poll every 100 ms until the device informs of its readiness. */ while (true) { if (++poll_attempts > 100) {
dev_err(&dev->dev, "failed booting Motu MicroBook II: timeout\n");
err = -ENODEV; goto free_buf;
}
/* the device signals its readiness through a message of the * form * XX 06 00 00 00 00 0b 18 00 00 00 01 * If the device is not yet ready to accept audio data, the * last byte of that sequence is 00.
*/ if (actual_length == 12 && buf[actual_length - 1] == 1) break;
/* Disable loopback for all inputs */ for (int ch = 0; ch < 32; ch++)
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
22, 0x40, 0x400, ch, NULL, 0);
/* Unity gain for all outputs */ for (int ch = 0; ch < 34; ch++)
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
21, 0x40, 0x9000, 0x100 + ch, NULL, 0);
return 0;
}
/* * Setup quirks
*/ #define MAUDIO_SET 0x01 /* parse device_setup */ #define MAUDIO_SET_COMPATIBLE 0x80 /* use only "win-compatible" interfaces */ #define MAUDIO_SET_DTS 0x02 /* enable DTS Digital Output */ #define MAUDIO_SET_96K 0x04 /* 48-96kHz rate if set, 8-48kHz otherwise */ #define MAUDIO_SET_24B 0x08 /* 24bits sample if set, 16bits otherwise */ #define MAUDIO_SET_DI 0x10 /* enable Digital Input */ #define MAUDIO_SET_MASK 0x1f /* bit mask for setup value */ #define MAUDIO_SET_24B_48K_DI 0x19 /* 24bits+48kHz+Digital Input */ #define MAUDIO_SET_24B_48K_NOTDI 0x09 /* 24bits+48kHz+No Digital Input */ #define MAUDIO_SET_16B_48K_DI 0x11 /* 16bits+48kHz+Digital Input */ #define MAUDIO_SET_16B_48K_NOTDI 0x01 /* 16bits+48kHz+No Digital Input */
staticint quattro_skip_setting_quirk(struct snd_usb_audio *chip, int iface, int altno)
{ /* Reset ALL ifaces to 0 altsetting. * Call it for every possible altsetting of every interface.
*/
usb_set_interface(chip->dev, iface, 0); if (chip->setup & MAUDIO_SET) { if (chip->setup & MAUDIO_SET_COMPATIBLE) { if (iface != 1 && iface != 2) return 1; /* skip all interfaces but 1 and 2 */
} else { unsignedint mask; if (iface == 1 || iface == 2) return 1; /* skip interfaces 1 and 2 */ if ((chip->setup & MAUDIO_SET_96K) && altno != 1) return 1; /* skip this altsetting */
mask = chip->setup & MAUDIO_SET_MASK; if (mask == MAUDIO_SET_24B_48K_DI && altno != 2) return 1; /* skip this altsetting */ if (mask == MAUDIO_SET_24B_48K_NOTDI && altno != 3) return 1; /* skip this altsetting */ if (mask == MAUDIO_SET_16B_48K_NOTDI && altno != 4) return 1; /* skip this altsetting */
}
}
usb_audio_dbg(chip, "using altsetting %d for interface %d config %d\n",
altno, iface, chip->setup); return 0; /* keep this altsetting */
}
staticint audiophile_skip_setting_quirk(struct snd_usb_audio *chip, int iface, int altno)
{ /* Reset ALL ifaces to 0 altsetting. * Call it for every possible altsetting of every interface.
*/
usb_set_interface(chip->dev, iface, 0);
if (chip->setup & MAUDIO_SET) { unsignedint mask; if ((chip->setup & MAUDIO_SET_DTS) && altno != 6) return 1; /* skip this altsetting */ if ((chip->setup & MAUDIO_SET_96K) && altno != 1) return 1; /* skip this altsetting */
mask = chip->setup & MAUDIO_SET_MASK; if (mask == MAUDIO_SET_24B_48K_DI && altno != 2) return 1; /* skip this altsetting */ if (mask == MAUDIO_SET_24B_48K_NOTDI && altno != 3) return 1; /* skip this altsetting */ if (mask == MAUDIO_SET_16B_48K_DI && altno != 4) return 1; /* skip this altsetting */ if (mask == MAUDIO_SET_16B_48K_NOTDI && altno != 5) return 1; /* skip this altsetting */
}
return 0; /* keep this altsetting */
}
staticint fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip, int iface, int altno)
{ /* Reset ALL ifaces to 0 altsetting. * Call it for every possible altsetting of every interface.
*/
usb_set_interface(chip->dev, iface, 0);
/* possible configuration where both inputs and only one output is *used is not supported by the current setup
*/ if (chip->setup & (MAUDIO_SET | MAUDIO_SET_24B)) { if (chip->setup & MAUDIO_SET_96K) { if (altno != 3 && altno != 6) return 1;
} elseif (chip->setup & MAUDIO_SET_DI) { if (iface == 4) return 1; /* no analog input */ if (altno != 2 && altno != 5) return 1; /* enable only altsets 2 and 5 */
} else { if (iface == 5) return 1; /* disable digialt input */ if (altno != 2 && altno != 5) return 1; /* enalbe only altsets 2 and 5 */
}
} else { /* keep only 16-Bit mode */ if (altno != 1) return 1;
}
usb_audio_dbg(chip, "using altsetting %d for interface %d config %d\n",
altno, iface, chip->setup); return 0; /* keep this altsetting */
}
staticint s1810c_skip_setting_quirk(struct snd_usb_audio *chip, int iface, int altno)
{ /* * Altno settings: * * Playback (Interface 1): * 1: 6 Analog + 2 S/PDIF * 2: 6 Analog + 2 S/PDIF * 3: 6 Analog * * Capture (Interface 2): * 1: 8 Analog + 2 S/PDIF + 8 ADAT * 2: 8 Analog + 2 S/PDIF + 4 ADAT * 3: 8 Analog
*/
/* * I'll leave 2 as the default one and * use device_setup to switch to the * other two.
*/ if ((chip->setup == 0 || chip->setup > 2) && altno != 2) return 1; elseif (chip->setup == 1 && altno != 1) return 1; elseif (chip->setup == 2 && altno != 3) return 1;
return 0;
}
int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip, int iface, int altno)
{ /* audiophile usb: skip altsets incompatible with device_setup */ if (chip->usb_id == USB_ID(0x0763, 0x2003)) return audiophile_skip_setting_quirk(chip, iface, altno); /* quattro usb: skip altsets incompatible with device_setup */ if (chip->usb_id == USB_ID(0x0763, 0x2001)) return quattro_skip_setting_quirk(chip, iface, altno); /* fasttrackpro usb: skip altsets incompatible with device_setup */ if (chip->usb_id == USB_ID(0x0763, 0x2012)) return fasttrackpro_skip_setting_quirk(chip, iface, altno); /* presonus studio 1810c: skip altsets incompatible with device_setup */ if (chip->usb_id == USB_ID(0x194f, 0x010c)) return s1810c_skip_setting_quirk(chip, iface, altno);
return 0;
}
int snd_usb_apply_boot_quirk(struct usb_device *dev, struct usb_interface *intf, conststruct snd_usb_audio_quirk *quirk, unsignedint id)
{ switch (id) { case USB_ID(0x041e, 0x3000): /* SB Extigy needs special boot-up sequence */ /* if more models come, this will go to the quirk list. */ return snd_usb_extigy_boot_quirk(dev, intf);
case USB_ID(0x041e, 0x3020): /* SB Audigy 2 NX needs its own boot-up magic, too */ return snd_usb_audigy2nx_boot_quirk(dev);
/* When capture is active * sample rate shouldn't be changed * by playback substream
*/ if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { if (subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].cur_audiofmt) return;
}
// Get current rate from card and check if changing it is needed
snd_usb_ctl_msg(subs->dev, usb_rcvctrlpipe(subs->dev, 0),
0x01, 0x21 | USB_DIR_IN, 0x0100, 0x8101, &buff4, 4);
current_rate = le32_to_cpu(buff4);
dev_dbg(&subs->dev->dev, "MBOX3: Current configured sample rate: %d", current_rate); if (current_rate == new_rate) {
dev_dbg(&subs->dev->dev, "MBOX3: No change needed (current rate:%d == new rate:%d)",
current_rate, new_rate); return;
}
// Set new rate
dev_info(&subs->dev->dev, "MBOX3: Changing sample rate to: %d", new_rate);
buff4 = cpu_to_le32(new_rate);
snd_usb_ctl_msg(subs->dev, usb_sndctrlpipe(subs->dev, 0),
0x01, 0x21, 0x0100, 0x8101, &buff4, 4);
// Set clock source to Internal
snd_usb_ctl_msg(subs->dev, usb_sndctrlpipe(subs->dev, 0),
0x01, 0x21, 0x0100, 0x8001, &buff1, 1);
// Check whether the change was successful
buff4 = 0;
snd_usb_ctl_msg(subs->dev, usb_rcvctrlpipe(subs->dev, 0),
0x01, 0x21 | USB_DIR_IN, 0x0100, 0x8101, &buff4, 4); if (new_rate != le32_to_cpu(buff4))
dev_warn(&subs->dev->dev, "MBOX3: Couldn't set the sample rate");
}
staticint rme_digiface_set_format_quirk(struct snd_usb_substream *subs)
{ unsignedint cur_rate = subs->data_endpoint->cur_rate;
u16 val; int speed_mode; int id;
for (id = 0; id < ARRAY_SIZE(rme_digiface_rate_table); id++) { if (rme_digiface_rate_table[id] == cur_rate) break;
}
if (id >= ARRAY_SIZE(rme_digiface_rate_table)) return -EINVAL;
/* 2, 3, 4 for 1x, 2x, 4x */
speed_mode = (id >> 2) + 2;
val = (id << 3) | (speed_mode << 12);
/* Set the sample rate */
snd_usb_ctl_msg(subs->stream->chip->dev,
usb_sndctrlpipe(subs->stream->chip->dev, 0),
16, 0x40, val, 0x7078, NULL, 0); return 0;
}
void snd_usb_set_format_quirk(struct snd_usb_substream *subs, conststruct audioformat *fmt)
{ switch (subs->stream->chip->usb_id) { case USB_ID(0x041e, 0x3f02): /* E-Mu 0202 USB */ case USB_ID(0x041e, 0x3f04): /* E-Mu 0404 USB */ case USB_ID(0x041e, 0x3f0a): /* E-Mu Tracker Pre */ case USB_ID(0x041e, 0x3f19): /* E-Mu 0204 USB */
set_format_emu_quirk(subs, fmt); break; case USB_ID(0x534d, 0x0021): /* MacroSilicon MS2100/MS2106 */ case USB_ID(0x534d, 0x2109): /* MacroSilicon MS2109 */
subs->stream_offset_adj = 2; break; case USB_ID(0x2b73, 0x000a): /* Pioneer DJM-900NXS2 */ case USB_ID(0x2b73, 0x0013): /* Pioneer DJM-450 */ case USB_ID(0x2b73, 0x0034): /* Pioneer DJM-V10 */
pioneer_djm_set_format_quirk(subs, 0x0082); break; case USB_ID(0x08e4, 0x017f): /* Pioneer DJM-750 */ case USB_ID(0x08e4, 0x0163): /* Pioneer DJM-850 */
pioneer_djm_set_format_quirk(subs, 0x0086); break; case USB_ID(0x0dba, 0x5000):
mbox3_set_format_quirk(subs, fmt); /* Digidesign Mbox 3 */ break; case USB_ID(0x2a39, 0x3f8c): /* RME Digiface USB */ case USB_ID(0x2a39, 0x3fa0): /* RME Digiface USB (alternate) */
rme_digiface_set_format_quirk(subs); break;
}
}
int snd_usb_select_mode_quirk(struct snd_usb_audio *chip, conststruct audioformat *fmt)
{ struct usb_device *dev = chip->dev; int err;
if (chip->quirk_flags & QUIRK_FLAG_ITF_USB_DSD_DAC) { /* First switch to alt set 0, otherwise the mode switch cmd * will not be accepted by the DAC
*/
err = usb_set_interface(dev, fmt->iface, 0); if (err < 0) return err;
msleep(20); /* Delay needed after setting the interface */
void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep)
{ /* * "Playback Design" products send bogus feedback data at the start * of the stream. Ignore them.
*/ if (USB_ID_VENDOR(ep->chip->usb_id) == 0x23ba &&
ep->type == SND_USB_ENDPOINT_TYPE_SYNC)
ep->skip_packets = 4;
/* * M-Audio Fast Track C400/C600 - when packets are not skipped, real * world latency varies by approx. +/- 50 frames (at 96kHz) each time * the stream is (re)started. When skipping packets 16 at endpoint * start up, the real world latency is stable within +/- 1 frame (also * across power cycles).
*/ if ((ep->chip->usb_id == USB_ID(0x0763, 0x2030) ||
ep->chip->usb_id == USB_ID(0x0763, 0x2031)) &&
ep->type == SND_USB_ENDPOINT_TYPE_DATA)
ep->skip_packets = 16;
/* Work around devices that report unreasonable feedback data */ if ((ep->chip->usb_id == USB_ID(0x0644, 0x8038) || /* TEAC UD-H01 */
ep->chip->usb_id == USB_ID(0x1852, 0x5034)) && /* T+A Dac8 */
ep->syncmaxsize == 4)
ep->tenor_fb_quirk = 1;
}
/* * snd_usb_interface_dsd_format_quirks() is called from format.c to * augment the PCM format bit-field for DSD types. The UAC standards * don't have a designated bit field to denote DSD-capable interfaces, * hence all hardware that is known to support this format has to be * listed here.
*/
u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, struct audioformat *fp, unsignedint sample_bytes)
{ struct usb_interface *iface;
/* Playback Designs */ if (USB_ID_VENDOR(chip->usb_id) == 0x23ba &&
USB_ID_PRODUCT(chip->usb_id) < 0x0110) { switch (fp->altsetting) { case 1:
fp->dsd_dop = true; return SNDRV_PCM_FMTBIT_DSD_U16_LE; case 2:
fp->dsd_bitrev = true; return SNDRV_PCM_FMTBIT_DSD_U8; case 3:
fp->dsd_bitrev = true; return SNDRV_PCM_FMTBIT_DSD_U16_LE;
}
}
/* XMOS based USB DACs */ switch (chip->usb_id) { case USB_ID(0x139f, 0x5504): /* Nagra DAC */ case USB_ID(0x20b1, 0x3089): /* Mola-Mola DAC */ case USB_ID(0x2522, 0x0007): /* LH Labs Geek Out 1V5 */ case USB_ID(0x2522, 0x0009): /* LH Labs Geek Pulse X Inifinity 2V0 */ case USB_ID(0x2522, 0x0012): /* LH Labs VI DAC Infinity */ case USB_ID(0x2772, 0x0230): /* Pro-Ject Pre Box S2 Digital */ if (fp->altsetting == 2) return SNDRV_PCM_FMTBIT_DSD_U32_BE; break;
case USB_ID(0x0d8c, 0x0316): /* Hegel HD12 DSD */ case USB_ID(0x10cb, 0x0103): /* The Bit Opus #3; with fp->dsd_raw */ case USB_ID(0x16d0, 0x06b2): /* NuPrime DAC-10 */ case USB_ID(0x16d0, 0x06b4): /* NuPrime Audio HD-AVP/AVA */ case USB_ID(0x16d0, 0x0733): /* Furutech ADL Stratos */ case USB_ID(0x16d0, 0x09d8): /* NuPrime IDA-8 */ case USB_ID(0x16d0, 0x09db): /* NuPrime Audio DAC-9 */ case USB_ID(0x16d0, 0x09dd): /* Encore mDSD */ case USB_ID(0x1db5, 0x0003): /* Bryston BDA3 */ case USB_ID(0x20a0, 0x4143): /* WaveIO USB Audio 2.0 */ case USB_ID(0x22e1, 0xca01): /* HDTA Serenade DSD */ case USB_ID(0x249c, 0x9326): /* M2Tech Young MkIII */ case USB_ID(0x2616, 0x0106): /* PS Audio NuWave DAC */ case USB_ID(0x2622, 0x0041): /* Audiolab M-DAC+ */ case USB_ID(0x278b, 0x5100): /* Rotel RC-1590 */ case USB_ID(0x27f7, 0x3002): /* W4S DAC-2v2SE */ case USB_ID(0x29a2, 0x0086): /* Mutec MC3+ USB */ case USB_ID(0x6b42, 0x0042): /* MSB Technology */ if (fp->altsetting == 3) return SNDRV_PCM_FMTBIT_DSD_U32_BE; break;
/* Amanero Combo384 USB based DACs with native DSD support */ case USB_ID(0x16d0, 0x071a): /* Amanero - Combo384 */ if (fp->altsetting == 2) { switch (le16_to_cpu(chip->dev->descriptor.bcdDevice)) { case 0x199: return SNDRV_PCM_FMTBIT_DSD_U32_LE; case 0x19b: case 0x203: return SNDRV_PCM_FMTBIT_DSD_U32_BE; default: break;
}
} break; case USB_ID(0x16d0, 0x0a23): if (fp->altsetting == 2) return SNDRV_PCM_FMTBIT_DSD_U32_BE; break;
default: break;
}
/* ITF-USB DSD based DACs */ if (chip->quirk_flags & QUIRK_FLAG_ITF_USB_DSD_DAC) {
iface = usb_ifnum_to_if(chip->dev, fp->iface);
/* Altsetting 2 support native DSD if the num of altsets is * three (0-2), * Altsetting 3 support native DSD if the num of altsets is * four (0-3).
*/ if (fp->altsetting == iface->num_altsetting - 1) return SNDRV_PCM_FMTBIT_DSD_U32_BE;
}
/* Mostly generic method to detect many DSD-capable implementations */ if ((chip->quirk_flags & QUIRK_FLAG_DSD_RAW) && fp->dsd_raw) return SNDRV_PCM_FMTBIT_DSD_U32_BE;
return 0;
}
void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, struct audioformat *fp, int stream)
{ switch (chip->usb_id) { case USB_ID(0x0a92, 0x0053): /* AudioTrak Optoplay */ /* Optoplay sets the sample rate attribute although * it seems not supporting it in fact.
*/
fp->attributes &= ~UAC_EP_CS_ATTR_SAMPLE_RATE; break; case USB_ID(0x041e, 0x3020): /* Creative SB Audigy 2 NX */ case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */ /* doesn't set the sample rate attribute, but supports it */
fp->attributes |= UAC_EP_CS_ATTR_SAMPLE_RATE; break; case USB_ID(0x0763, 0x2001): /* M-Audio Quattro USB */ case USB_ID(0x0763, 0x2012): /* M-Audio Fast Track Pro USB */ case USB_ID(0x047f, 0x0ca1): /* plantronics headset */ case USB_ID(0x077d, 0x07af): /* Griffin iMic (note that there is
an older model 77d:223) */ /* * plantronics headset and Griffin iMic have set adaptive-in * although it's really not...
*/
fp->ep_attr &= ~USB_ENDPOINT_SYNCTYPE; if (stream == SNDRV_PCM_STREAM_PLAYBACK)
fp->ep_attr |= USB_ENDPOINT_SYNC_ADAPTIVE; else
fp->ep_attr |= USB_ENDPOINT_SYNC_SYNC; break; case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook IIc */ /* * MaxPacketsOnly attribute is erroneously set in endpoint * descriptors. As a result this card produces noise with * all sample rates other than 96 kHz.
*/
fp->attributes &= ~UAC_EP_CS_ATTR_FILL_MAX; break; case USB_ID(0x1224, 0x2a25): /* Jieli Technology USB PHY 2.0 */ /* mic works only when ep packet size is set to wMaxPacketSize */
fp->attributes |= UAC_EP_CS_ATTR_FILL_MAX; break; case USB_ID(0x3511, 0x2b1e): /* Opencomm2 UC USB Bluetooth dongle */
--> --------------------
--> maximum size reached
--> --------------------
Messung V0.5
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.34Angebot
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.