All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit
@ 2018-03-19  6:11 ` Kirill Marinushkin
  0 siblings, 0 replies; 8+ messages in thread
From: Kirill Marinushkin @ 2018-03-19  6:11 UTC (permalink / raw)
  To: Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: Kirill Marinushkin, Thomas Gleixner, Felipe Balbi,
	Philippe Ombredanne, Greg Kroah-Hartman, Ruslan Bilovol,
	linux-kernel, alsa-devel

Currently, the offsets in the UAC2 processing unit descriptor are
calculated incorrectly. It causes an issue when connecting the device which
provides such a feature:

~~~~
[84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18)
~~~~

After this patch is applied, the UAC2 processing unit inits w/o this error.

Fixes: 5e1ddb481776 ("UAPI: (Scripted) Disintegrate include/linux/usb")
Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org
---
 include/uapi/linux/usb/audio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/audio.h
index 17a022c5b414..da3315ed1bcd 100644
--- a/include/uapi/linux/usb/audio.h
+++ b/include/uapi/linux/usb/audio.h
@@ -370,7 +370,7 @@ static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_d
 {
 	return (protocol == UAC_VERSION_1) ?
 		desc->baSourceID[desc->bNrInPins + 4] :
-		desc->baSourceID[desc->bNrInPins + 6];
+		2; /* in UAC2, this value is constant */
 }
 
 static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
@@ -378,7 +378,7 @@ static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_de
 {
 	return (protocol == UAC_VERSION_1) ?
 		&desc->baSourceID[desc->bNrInPins + 5] :
-		&desc->baSourceID[desc->bNrInPins + 7];
+		&desc->baSourceID[desc->bNrInPins + 6];
 }
 
 static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit
@ 2018-03-19  6:11 ` Kirill Marinushkin
  0 siblings, 0 replies; 8+ messages in thread
From: Kirill Marinushkin @ 2018-03-19  6:11 UTC (permalink / raw)
  To: Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, Felipe Balbi, Greg Kroah-Hartman, linux-kernel,
	Ruslan Bilovol, Philippe Ombredanne, Thomas Gleixner,
	Kirill Marinushkin

Currently, the offsets in the UAC2 processing unit descriptor are
calculated incorrectly. It causes an issue when connecting the device which
provides such a feature:

~~~~
[84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18)
~~~~

After this patch is applied, the UAC2 processing unit inits w/o this error.

Fixes: 5e1ddb481776 ("UAPI: (Scripted) Disintegrate include/linux/usb")
Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org
---
 include/uapi/linux/usb/audio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/audio.h
index 17a022c5b414..da3315ed1bcd 100644
--- a/include/uapi/linux/usb/audio.h
+++ b/include/uapi/linux/usb/audio.h
@@ -370,7 +370,7 @@ static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_d
 {
 	return (protocol == UAC_VERSION_1) ?
 		desc->baSourceID[desc->bNrInPins + 4] :
-		desc->baSourceID[desc->bNrInPins + 6];
+		2; /* in UAC2, this value is constant */
 }
 
 static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
@@ -378,7 +378,7 @@ static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_de
 {
 	return (protocol == UAC_VERSION_1) ?
 		&desc->baSourceID[desc->bNrInPins + 5] :
-		&desc->baSourceID[desc->bNrInPins + 7];
+		&desc->baSourceID[desc->bNrInPins + 6];
 }
 
 static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit
  2018-03-19  6:11 ` Kirill Marinushkin
  (?)
@ 2018-03-19  7:40 ` Greg Kroah-Hartman
  2018-03-19  7:47     ` Takashi Iwai
  -1 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2018-03-19  7:40 UTC (permalink / raw)
  To: Kirill Marinushkin
  Cc: Mark Brown, Jaroslav Kysela, Takashi Iwai, Thomas Gleixner,
	Felipe Balbi, Philippe Ombredanne, Ruslan Bilovol, linux-kernel,
	alsa-devel

On Mon, Mar 19, 2018 at 07:11:08AM +0100, Kirill Marinushkin wrote:
> Currently, the offsets in the UAC2 processing unit descriptor are
> calculated incorrectly. It causes an issue when connecting the device which
> provides such a feature:
> 
> ~~~~
> [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18)
> ~~~~
> 
> After this patch is applied, the UAC2 processing unit inits w/o this error.
> 
> Fixes: 5e1ddb481776 ("UAPI: (Scripted) Disintegrate include/linux/usb")
> Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Cc: Philippe Ombredanne <pombredanne@nexb.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Ruslan Bilovol <ruslan.bilovol@gmail.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: alsa-devel@alsa-project.org
> ---
>  include/uapi/linux/usb/audio.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

	Cc: stable <stable@vger.kernel.org>
 perhaps?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit
  2018-03-19  7:40 ` Greg Kroah-Hartman
@ 2018-03-19  7:47     ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2018-03-19  7:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Kirill Marinushkin, alsa-devel, Ruslan Bilovol, Mark Brown,
	Thomas Gleixner, Felipe Balbi, Philippe Ombredanne,
	Jaroslav Kysela, linux-kernel

On Mon, 19 Mar 2018 08:40:19 +0100,
Greg Kroah-Hartman wrote:
> 
> On Mon, Mar 19, 2018 at 07:11:08AM +0100, Kirill Marinushkin wrote:
> > Currently, the offsets in the UAC2 processing unit descriptor are
> > calculated incorrectly. It causes an issue when connecting the device which
> > provides such a feature:
> > 
> > ~~~~
> > [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18)
> > ~~~~
> > 
> > After this patch is applied, the UAC2 processing unit inits w/o this error.
> > 
> > Fixes: 5e1ddb481776 ("UAPI: (Scripted) Disintegrate include/linux/usb")
> > Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
> > Cc: Mark Brown <broonie@kernel.org>
> > Cc: Jaroslav Kysela <perex@perex.cz>
> > Cc: Takashi Iwai <tiwai@suse.com>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> > Cc: Philippe Ombredanne <pombredanne@nexb.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Ruslan Bilovol <ruslan.bilovol@gmail.com>
> > Cc: linux-kernel@vger.kernel.org
> > Cc: alsa-devel@alsa-project.org
> > ---
> >  include/uapi/linux/usb/audio.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 	Cc: stable <stable@vger.kernel.org>
>  perhaps?

Yes, it deserves.  But I'd need to double-check the UAC2
specification.  It's interesting that such a basic thing hasn't hit
until now.  Maybe just because it's a fairly minor feature.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit
@ 2018-03-19  7:47     ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2018-03-19  7:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Kirill Marinushkin, alsa-devel, Ruslan Bilovol, Mark Brown,
	Thomas Gleixner, Felipe Balbi, Philippe Ombredanne,
	Jaroslav Kysela, linux-kernel

On Mon, 19 Mar 2018 08:40:19 +0100,
Greg Kroah-Hartman wrote:
> 
> On Mon, Mar 19, 2018 at 07:11:08AM +0100, Kirill Marinushkin wrote:
> > Currently, the offsets in the UAC2 processing unit descriptor are
> > calculated incorrectly. It causes an issue when connecting the device which
> > provides such a feature:
> > 
> > ~~~~
> > [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18)
> > ~~~~
> > 
> > After this patch is applied, the UAC2 processing unit inits w/o this error.
> > 
> > Fixes: 5e1ddb481776 ("UAPI: (Scripted) Disintegrate include/linux/usb")
> > Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
> > Cc: Mark Brown <broonie@kernel.org>
> > Cc: Jaroslav Kysela <perex@perex.cz>
> > Cc: Takashi Iwai <tiwai@suse.com>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> > Cc: Philippe Ombredanne <pombredanne@nexb.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Ruslan Bilovol <ruslan.bilovol@gmail.com>
> > Cc: linux-kernel@vger.kernel.org
> > Cc: alsa-devel@alsa-project.org
> > ---
> >  include/uapi/linux/usb/audio.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 	Cc: stable <stable@vger.kernel.org>
>  perhaps?

Yes, it deserves.  But I'd need to double-check the UAC2
specification.  It's interesting that such a basic thing hasn't hit
until now.  Maybe just because it's a fairly minor feature.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit
  2018-03-19  7:47     ` Takashi Iwai
@ 2018-03-19 15:45       ` Takashi Iwai
  -1 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2018-03-19 15:45 UTC (permalink / raw)
  To: Kirill Marinushkin
  Cc: Greg Kroah-Hartman, alsa-devel, Ruslan Bilovol, Mark Brown,
	Thomas Gleixner, Felipe Balbi, Philippe Ombredanne,
	Jaroslav Kysela, linux-kernel

On Mon, 19 Mar 2018 08:47:49 +0100,
Takashi Iwai wrote:
> 
> On Mon, 19 Mar 2018 08:40:19 +0100,
> Greg Kroah-Hartman wrote:
> > 
> > On Mon, Mar 19, 2018 at 07:11:08AM +0100, Kirill Marinushkin wrote:
> > > Currently, the offsets in the UAC2 processing unit descriptor are
> > > calculated incorrectly. It causes an issue when connecting the device which
> > > provides such a feature:
> > > 
> > > ~~~~
> > > [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18)
> > > ~~~~
> > > 
> > > After this patch is applied, the UAC2 processing unit inits w/o this error.
> > > 
> > > Fixes: 5e1ddb481776 ("UAPI: (Scripted) Disintegrate include/linux/usb")
> > > Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
> > > Cc: Mark Brown <broonie@kernel.org>
> > > Cc: Jaroslav Kysela <perex@perex.cz>
> > > Cc: Takashi Iwai <tiwai@suse.com>
> > > Cc: Thomas Gleixner <tglx@linutronix.de>
> > > Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> > > Cc: Philippe Ombredanne <pombredanne@nexb.com>
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Cc: Ruslan Bilovol <ruslan.bilovol@gmail.com>
> > > Cc: linux-kernel@vger.kernel.org
> > > Cc: alsa-devel@alsa-project.org
> > > ---
> > >  include/uapi/linux/usb/audio.h | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > 	Cc: stable <stable@vger.kernel.org>
> >  perhaps?
> 
> Yes, it deserves.  But I'd need to double-check the UAC2
> specification.  It's interesting that such a basic thing hasn't hit
> until now.  Maybe just because it's a fairly minor feature.

... and the patch looks correct, after confirming the UAC2 spec.
Now I applied it, with a minor correction of Fixes tag, which actually
was introduced by 23caaf19b11e ("ALSA: usb-mixer: Add support for
Audio Class v2.0"), and adding Cc to stable.

Thanks!


Takashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit
@ 2018-03-19 15:45       ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2018-03-19 15:45 UTC (permalink / raw)
  To: Kirill Marinushkin
  Cc: Greg Kroah-Hartman, alsa-devel, Ruslan Bilovol, Mark Brown,
	Thomas Gleixner, Felipe Balbi, Philippe Ombredanne,
	Jaroslav Kysela, linux-kernel

On Mon, 19 Mar 2018 08:47:49 +0100,
Takashi Iwai wrote:
> 
> On Mon, 19 Mar 2018 08:40:19 +0100,
> Greg Kroah-Hartman wrote:
> > 
> > On Mon, Mar 19, 2018 at 07:11:08AM +0100, Kirill Marinushkin wrote:
> > > Currently, the offsets in the UAC2 processing unit descriptor are
> > > calculated incorrectly. It causes an issue when connecting the device which
> > > provides such a feature:
> > > 
> > > ~~~~
> > > [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18)
> > > ~~~~
> > > 
> > > After this patch is applied, the UAC2 processing unit inits w/o this error.
> > > 
> > > Fixes: 5e1ddb481776 ("UAPI: (Scripted) Disintegrate include/linux/usb")
> > > Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
> > > Cc: Mark Brown <broonie@kernel.org>
> > > Cc: Jaroslav Kysela <perex@perex.cz>
> > > Cc: Takashi Iwai <tiwai@suse.com>
> > > Cc: Thomas Gleixner <tglx@linutronix.de>
> > > Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> > > Cc: Philippe Ombredanne <pombredanne@nexb.com>
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Cc: Ruslan Bilovol <ruslan.bilovol@gmail.com>
> > > Cc: linux-kernel@vger.kernel.org
> > > Cc: alsa-devel@alsa-project.org
> > > ---
> > >  include/uapi/linux/usb/audio.h | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > 	Cc: stable <stable@vger.kernel.org>
> >  perhaps?
> 
> Yes, it deserves.  But I'd need to double-check the UAC2
> specification.  It's interesting that such a basic thing hasn't hit
> until now.  Maybe just because it's a fairly minor feature.

... and the patch looks correct, after confirming the UAC2 spec.
Now I applied it, with a minor correction of Fixes tag, which actually
was introduced by 23caaf19b11e ("ALSA: usb-mixer: Add support for
Audio Class v2.0"), and adding Cc to stable.

Thanks!


Takashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit
  2018-03-19 15:45       ` Takashi Iwai
  (?)
@ 2018-03-19 23:32       ` Ruslan Bilovol
  -1 siblings, 0 replies; 8+ messages in thread
From: Ruslan Bilovol @ 2018-03-19 23:32 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Kirill Marinushkin, Greg Kroah-Hartman, alsa-devel, Mark Brown,
	Thomas Gleixner, Felipe Balbi, Philippe Ombredanne,
	Jaroslav Kysela, linux-kernel

On Mon, Mar 19, 2018 at 5:45 PM, Takashi Iwai <tiwai@suse.de> wrote:
> On Mon, 19 Mar 2018 08:47:49 +0100,
> Takashi Iwai wrote:
>>
>> On Mon, 19 Mar 2018 08:40:19 +0100,
>> Greg Kroah-Hartman wrote:
>> >
>> > On Mon, Mar 19, 2018 at 07:11:08AM +0100, Kirill Marinushkin wrote:
>> > > Currently, the offsets in the UAC2 processing unit descriptor are
>> > > calculated incorrectly. It causes an issue when connecting the device which
>> > > provides such a feature:
>> > >
>> > > ~~~~
>> > > [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18)
>> > > ~~~~
>> > >
>> > > After this patch is applied, the UAC2 processing unit inits w/o this error.
>> > >
>> > > Fixes: 5e1ddb481776 ("UAPI: (Scripted) Disintegrate include/linux/usb")
>> > > Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
>> > > Cc: Mark Brown <broonie@kernel.org>
>> > > Cc: Jaroslav Kysela <perex@perex.cz>
>> > > Cc: Takashi Iwai <tiwai@suse.com>
>> > > Cc: Thomas Gleixner <tglx@linutronix.de>
>> > > Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
>> > > Cc: Philippe Ombredanne <pombredanne@nexb.com>
>> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> > > Cc: Ruslan Bilovol <ruslan.bilovol@gmail.com>
>> > > Cc: linux-kernel@vger.kernel.org
>> > > Cc: alsa-devel@alsa-project.org
>> > > ---
>> > >  include/uapi/linux/usb/audio.h | 4 ++--
>> > >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> >     Cc: stable <stable@vger.kernel.org>
>> >  perhaps?
>>
>> Yes, it deserves.  But I'd need to double-check the UAC2
>> specification.  It's interesting that such a basic thing hasn't hit
>> until now.  Maybe just because it's a fairly minor feature.
>
> ... and the patch looks correct, after confirming the UAC2 spec.
> Now I applied it, with a minor correction of Fixes tag, which actually
> was introduced by 23caaf19b11e ("ALSA: usb-mixer: Add support for
> Audio Class v2.0"), and adding Cc to stable.
>

I also checked UAC1/UAC2 spec and the patch looks good.
What's interesting it seems nobody faced this issue (after searching
ower Internet can't find any mention) which was present from the
beginning of UAC2 driver implementation.

Thanks,
Ruslan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-03-19 23:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19  6:11 [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit Kirill Marinushkin
2018-03-19  6:11 ` Kirill Marinushkin
2018-03-19  7:40 ` Greg Kroah-Hartman
2018-03-19  7:47   ` Takashi Iwai
2018-03-19  7:47     ` Takashi Iwai
2018-03-19 15:45     ` Takashi Iwai
2018-03-19 15:45       ` Takashi Iwai
2018-03-19 23:32       ` Ruslan Bilovol

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.