Skip to content

Commit 59ea586

Browse files
hillstiwai
authored andcommitted
ALSA: usb-audio: Trust fields given in the quirk
The maxpacksize field is given in some quirks, but it gets ignored (in favour of wMaxPacketSize from the first endpoint.) This patch favours the one in the quirk. Digidesign Mbox and Mbox 2 are the only affected quirks and the devices are assumed to be working without this patch. So for safety against the values in the quirk being incorrect, remove them. The datainterval is also ignored but there are not currently any quirks which choose to override this. Cc: Damien Zammit <damien@zamaudio.com> Cc: Chris J Arges <christopherarges@gmail.com> Signed-off-by: Mark Hills <mark@xwax.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 5e21233 commit 59ea586

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎sound/usb/quirks-table.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3036,7 +3036,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
30363036
.attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
30373037
.endpoint = 0x02,
30383038
.ep_attr = 0x01,
3039-
.maxpacksize = 0x130,
30403039
.rates = SNDRV_PCM_RATE_44100 |
30413040
SNDRV_PCM_RATE_48000,
30423041
.rate_min = 44100,
@@ -3084,7 +3083,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
30843083
.attributes = 0x00,
30853084
.endpoint = 0x03,
30863085
.ep_attr = USB_ENDPOINT_SYNC_ASYNC,
3087-
.maxpacksize = 0x128,
30883086
.rates = SNDRV_PCM_RATE_48000,
30893087
.rate_min = 48000,
30903088
.rate_max = 48000,
@@ -3110,7 +3108,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
31103108
.attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
31113109
.endpoint = 0x85,
31123110
.ep_attr = USB_ENDPOINT_SYNC_SYNC,
3113-
.maxpacksize = 0x128,
31143111
.rates = SNDRV_PCM_RATE_48000,
31153112
.rate_min = 48000,
31163113
.rate_max = 48000,

‎sound/usb/quirks.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
165165
return -EINVAL;
166166
}
167167
alts = &iface->altsetting[fp->altset_idx];
168-
fp->datainterval = snd_usb_parse_datainterval(chip, alts);
169-
fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
168+
if (fp->datainterval == 0)
169+
fp->datainterval = snd_usb_parse_datainterval(chip, alts);
170+
if (fp->maxpacksize == 0)
171+
fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
170172
usb_set_interface(chip->dev, fp->iface, 0);
171173
snd_usb_init_pitch(chip, fp->iface, alts, fp);
172174
snd_usb_init_sample_rate(chip, fp->iface, alts, fp, fp->rate_max);

0 commit comments

Comments
 (0)