alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@caiaq.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Greg KH <gregkh@suse.de>,
	clemens@ladisch.de
Subject: Re: [PATCH 3/4] ALSA: usb-audio: parse UAC2 endpoint descriptors correctly
Date: Thu, 27 May 2010 20:15:14 +0200	[thread overview]
Message-ID: <20100527181514.GL2695@buzzloop.caiaq.de> (raw)
In-Reply-To: <s5hfx1d4vff.wl%tiwai@suse.de>

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@caiaq.de>
> > > > ---
> > > >  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@suse.de>
> > 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@caiaq.de>
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@caiaq.de>
---
 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

  reply	other threads:[~2010-05-27 18:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-26 16:11 [PATCH 1/4] ALSA: usb-audio: parse more format descriptors with structs Daniel Mack
2010-05-26 16:11 ` [PATCH 2/4] ALSA: usb-audio: fix return values Daniel Mack
2010-05-26 16:11 ` [PATCH 3/4] ALSA: usb-audio: parse UAC2 endpoint descriptors correctly Daniel Mack
2010-05-26 16:17   ` Daniel Mack
     [not found]     ` <20100526204657.GB7343@suse.de>
2010-05-27  8:10       ` Takashi Iwai
2010-05-27 18:15         ` Daniel Mack [this message]
2010-05-28  5:48           ` Takashi Iwai
2010-05-26 16:11 ` [PATCH 4/4] ALSA: usb-audio: add support for UAC2 pitch control Daniel Mack
2010-05-27  8:09 ` [PATCH 1/4] ALSA: usb-audio: parse more format descriptors with structs Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100527181514.GL2695@buzzloop.caiaq.de \
    --to=daniel@caiaq.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=gregkh@suse.de \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).