Re: [PATCH 3/4] ALSA: usb-audio: parse UAC2 endpoint descriptors correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 27, 2010 at 10:10:12AM +0200, Takashi Iwai wrote:
> At Wed, 26 May 2010 13:46:57 -0700,
> Greg KH wrote:
> > 
> > On Wed, May 26, 2010 at 06:17:46PM +0200, Daniel Mack wrote:
> > > On Wed, May 26, 2010 at 06:11:38PM +0200, Daniel Mack wrote:
> > > > UAC2 devices have their information about pitch control stored in a
> > > > different field. Parse it, and emulate the bits for a v1 device.
> > > > 
> > > > A new struct uac2_iso_endpoint_descriptor is added.
> > > 
> > > > 
> > > > Signed-off-by: Daniel Mack <daniel@xxxxxxxx>
> > > > ---
> > > >  include/linux/usb/audio-v2.h |   16 ++++++++++++
> > > 
> > > Greg, I copied you because of this patch, just to let you know we're
> > > having fun in your area of responsibility again :)
> > 
> > Heh, no problem at all.
> > 
> > Takashi, feel free to add an:
> > 	Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
> > to this patch when you take it.
> 
> OK, I put this to my tree.  Will be included in the next pull request
> in this week.

Thanks Takashi!

Here's another small one that needs attention.

Daniel

>From 3beee40982b98314f8d58c775cc8b40a8e25ce18 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@xxxxxxxx>
Date: Thu, 27 May 2010 18:28:25 +0200
Subject: [PATCH] ALSA: usb-audio: fix feature unit parser for UAC2

Fix a small off-by-one bug which causes the feature unit to announce a
wrong number of channels. This leads to illegal requests sent to the
firmware eventually.

Signed-off-by: Daniel Mack <daniel@xxxxxxxx>
---
 sound/usb/mixer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 97dd176..03ce971 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1126,7 +1126,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
 	} else {
 		struct uac2_feature_unit_descriptor *ftr = _ftr;
 		csize = 4;
-		channels = (hdr->bLength - 6) / 4;
+		channels = (hdr->bLength - 6) / 4 - 1;
 		bmaControls = ftr->bmaControls;
 	}
 
-- 
1.7.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux