Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[PATCH] usb-audio: fix combine_word problem

 
   Soft32 Home -> Linux -> Kernel RSS
Next:  Accepted libapp-daemon-perl 0.08-1 (source all)  
Author Message
Julian Anastasov

External


Since: Nov 06, 2009
Posts: 1



(Msg. 1) Posted: Fri Nov 06, 2009 5:20 pm
Post subject: [PATCH] usb-audio: fix combine_word problem
Archived from groups: linux>kernel (more info?)

Fix combine_word problem where first octet is not
read properly. The only affected place seems to be the
INPUT_TERMINAL type. Before now, sound controls can be created
with the output terminal's name which is a fallback mechanism
used only for unknown input terminal types. For example,
Line can wrongly appear as Speaker. After the change it
should appear as Line.

The side effect of this change can be that users
can expect the wrong control name in their scripts or
programs while now we return the correct one.

Probably, these defines should use get_unaligned_le16 and
friends.

Signed-off-by: Julian Anastasov <ja DeleteThis @ssi.bg>
---

diff -urp v2.6.31/linux/sound/usb/usbaudio.h linux/sound/usb/usbaudio.h
--- v2.6.31/linux/sound/usb/usbaudio.h 2009-06-13 10:53:59.000000000 +0300
+++ linux/sound/usb/usbaudio.h 2009-11-06 22:38:00.000000000 +0200
@@ -210,7 +210,7 @@ struct snd_usb_midi_endpoint_info {
/*
*/

-#define combine_word(s) ((*s) | ((unsigned int)(s)[1] << Cool)
+#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << Cool)
#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))
#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Takashi Iwai

External


Since: Jun 28, 2007
Posts: 198



(Msg. 2) Posted: Sat Nov 07, 2009 5:20 am
Post subject: Re: [PATCH] usb-audio: fix combine_word problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

At Fri, 6 Nov 2009 23:44:53 +0200 (EET),
Julian Anastasov wrote:
>
>
> Fix combine_word problem where first octet is not
> read properly. The only affected place seems to be the
> INPUT_TERMINAL type. Before now, sound controls can be created
> with the output terminal's name which is a fallback mechanism
> used only for unknown input terminal types. For example,
> Line can wrongly appear as Speaker. After the change it
> should appear as Line.

Wow, this is really an old bug. I wonder no one noticed it, so far...

> The side effect of this change can be that users
> can expect the wrong control name in their scripts or
> programs while now we return the correct one.

Yes, but it's a right "fix", so let it be.

> Probably, these defines should use get_unaligned_le16 and
> friends.

Sounds like a good idea. But 24bit version is still missing Smile

> Signed-off-by: Julian Anastasov <ja DeleteThis @ssi.bg>

Applied now, and added Cc to stable kernel.

Thanks!


Takashi

> ---
>
> diff -urp v2.6.31/linux/sound/usb/usbaudio.h linux/sound/usb/usbaudio.h
> --- v2.6.31/linux/sound/usb/usbaudio.h 2009-06-13 10:53:59.000000000 +0300
> +++ linux/sound/usb/usbaudio.h 2009-11-06 22:38:00.000000000 +0200
> @@ -210,7 +210,7 @@ struct snd_usb_midi_endpoint_info {
> /*
> */
>
> -#define combine_word(s) ((*s) | ((unsigned int)(s)[1] << Cool)
> +#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << Cool)
> #define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))
> #define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[PATCH 2.6.19-rc6] hda_intel: ALSA HD Audio patch for Inte.. - This patch adds the Intel ICH9 HD Audio controller DID's for ALSA. Signed-off-by: Jason Gaston..

[PATCH 2.6.19-rc6][RESEND] hda_intel: ALSA HD Audio patch .. - This patch adds the Intel ICH9 HD Audio controller DID's for ALSA. Signed-off-by: Jason Gaston..

[PATCH 4/8] UML - audio driver formatting - Whitespace and style fixes. Signed-off-by: Jeff Dike <jdike@addtoit.com> -- arch/um/drivers/hostaudio_kern.c | ...

[PATCH 3/8] UML - audio driver locking - Comment the lack of locking and make a couple of variables static. Signed-off-by: Jeff Dike <jdike@addtoit.com> ...

[PATCH] video4linux: Fix audio input for AverTv Go 007 - from Damian Minkov Fix audio input source for capturing(playing) audio on AverTv Go 007 cards. Signed-off-by: Damian....

[PATCH] Hardware MPEG audio fix for SAA7134 based "KNC One.. - With previous patch card is generating MPEG audio stream too. Unfortunatly I2S audio output is muted. Unmute it. ..
       Soft32 Home -> Linux -> Kernel All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]