Skip to contentSkip to conversation

ALSA: usb-audio: fix regression for fixed stream quirk

PATCH Applied Eldad Zack 2 participants 2 messages Jul 9, 2013 – Jul 10, 2013 Sound

lore
Share & tools
lore

Eldad Zack

author
#0 lore raw

PATCH 1/1 ALSA: usb-audio: fix regression for fixed stream quirk

Commit 8f898e92aea2c24c7f379ee265d178f69ebb9c07 removed the redundant reads of bInterfaceProtocol from the descriptors, but introduced a regression to devices with quirks of type QUIRK_AUDIO_FIXED_ENDPOINT, since fp->protocol is not set in setup process.

As a consequence, audio streams would not get initialized, as the following logs show:

[   48.923043] setting usb interface 3:1
[   48.923056] Creating new capture data endpoint #81
[   48.923484] 4:3:1: cannot set freq 48000 to ep 0x81

This patch sets fp->protocol in create_fixed_stream_quirk() and resolves the regression.

---
 sound/usb/quirks.c | 4 ++++
 1 file changed, 4 insertions(+)
sound/usb/quirks.c +4 -0
index 5b01330..1bc45e7 100644
@@ -129,6 +129,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
 {
 	struct audioformat *fp;
 	struct usb_host_interface *alts;
+	struct usb_interface_descriptor *altsd;
 	int stream, err;
 	unsigned *rate_table = NULL;
 
@@ -166,6 +167,9 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
 		return -EINVAL;
 	}
 	alts = &iface->altsetting[fp->altset_idx];
+	altsd = get_iface_desc(alts);
+	fp->protocol = altsd->bInterfaceProtocol;
+
 	if (fp->datainterval == 0)
 		fp->datainterval = snd_usb_parse_datainterval(chip, alts);
 	if (fp->maxpacksize == 0)
Signature · 1 line
1.8.1.5
Applied
#1 lore raw

At Tue, 9 Jul 2013 20:36:15 +0200,

Quoted 9 lines · Eldad Zack

Commit 8f898e92aea2c24c7f379ee265d178f69ebb9c07 removed the redundant reads of bInterfaceProtocol from the descriptors, but introduced a regression to devices with quirks of type QUIRK_AUDIO_FIXED_ENDPOINT, since fp->protocol is not set in setup process.

As a consequence, audio streams would not get initialized, as the following logs show:

Quoted 8 lines
[   48.923043] setting usb interface 3:1
[   48.923056] Creating new capture data endpoint #81
[   48.923484] 4:3:1: cannot set freq 48000 to ep 0x81

This patch sets fp->protocol in create_fixed_stream_quirk() and resolves the regression.

Thanks, applied now.

Takashi

Quoted 29 lines
---
 sound/usb/quirks.c | 4 ++++
 1 file changed, 4 insertions(+)
sound/usb/quirks.c +4 -0
index 5b01330..1bc45e7 100644
@@ -129,6 +129,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
 {
 	struct audioformat *fp;
 	struct usb_host_interface *alts;
+	struct usb_interface_descriptor *altsd;
 	int stream, err;
 	unsigned *rate_table = NULL;
 
@@ -166,6 +167,9 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
 		return -EINVAL;
 	}
 	alts = &iface->altsetting[fp->altset_idx];
+	altsd = get_iface_desc(alts);
+	fp->protocol = altsd->bInterfaceProtocol;
+
 	if (fp->datainterval == 0)
 		fp->datainterval = snd_usb_parse_datainterval(chip, alts);
 	if (fp->maxpacksize == 0)
Signature · 1 line
1.8.1.5