All of lore.kernel.org
 help / color / mirror / Atom feed
* [v2,0/8] lsusb: Add initial support for USB Audio Class 3
@ 2017-12-08 14:44 Michael Drake
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Drake @ 2017-12-08 14:44 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb

On 08/12/17 14:27, Greg KH wrote:
> On Fri, Dec 08, 2017 at 10:30:43AM +0000, Michael Drake wrote:
>> On 07/12/17 20:04, Greg KH wrote:

>>> --- lsusb-v.orig	2017-12-07 21:01:26.153185002 +0100
>>> +++ lsusb-v.new	2017-12-07 21:01:32.806517978 +0100
>>> @@ -1110,9 +1110,9 @@
>>>            bDescriptorType        36
>>>            bDescriptorSubtype      1 (HEADER)
>>>            bcdADC               1.00
>>> -        wTotalLength       0x0028
>>> +        wTotalLength           40

[snip]

>> Anyway, since it's a 2 byte field the hex representation
>> is expected here, and the actual value is the same.
> 
> Yes, the value is the same, but all other wTotalLength fields exported
> by lsusb are in decimal.  Changing just this one feels odd to me.

Yes, that's a good reason for wanting to change the other ones.

[snip]

> I'll look at moving those other wFields to be also in 0x0000 mode to
> match up here.

If you like I can work up a patch for that.  I'd just be tweaking
the old printfs to dump wFields with "0x%04x".

I'm also thinking of porting more of the existing lsusb dumping
to use the desc_dump() function, but that would have to be piece
by piece, as I get time.

Cheers,

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

* [v2,0/8] lsusb: Add initial support for USB Audio Class 3
@ 2017-12-08 15:29 Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2017-12-08 15:29 UTC (permalink / raw)
  To: Michael Drake; +Cc: linux-usb

On Fri, Dec 08, 2017 at 03:57:30PM +0100, Greg KH wrote:
> On Fri, Dec 08, 2017 at 02:44:12PM +0000, Michael Drake wrote:
> > On 08/12/17 14:27, Greg KH wrote:
> > > On Fri, Dec 08, 2017 at 10:30:43AM +0000, Michael Drake wrote:
> > > > On 07/12/17 20:04, Greg KH wrote:
> > 
> > > > > --- lsusb-v.orig	2017-12-07 21:01:26.153185002 +0100
> > > > > +++ lsusb-v.new	2017-12-07 21:01:32.806517978 +0100
> > > > > @@ -1110,9 +1110,9 @@
> > > > >            bDescriptorType        36
> > > > >            bDescriptorSubtype      1 (HEADER)
> > > > >            bcdADC               1.00
> > > > > -        wTotalLength       0x0028
> > > > > +        wTotalLength           40
> > 
> > [snip]
> > 
> > > > Anyway, since it's a 2 byte field the hex representation
> > > > is expected here, and the actual value is the same.
> > > 
> > > Yes, the value is the same, but all other wTotalLength fields exported
> > > by lsusb are in decimal.  Changing just this one feels odd to me.
> > 
> > Yes, that's a good reason for wanting to change the other ones.
> > 
> > [snip]
> > 
> > > I'll look at moving those other wFields to be also in 0x0000 mode to
> > > match up here.
> > 
> > If you like I can work up a patch for that.  I'd just be tweaking
> > the old printfs to dump wFields with "0x%04x".
> > 
> > I'm also thinking of porting more of the existing lsusb dumping
> > to use the desc_dump() function, but that would have to be piece
> > by piece, as I get time.
> 
> I think moving more over to use desc_dump() is a better idea, let me see
> if I can do one now to see how hard/easy it is...

I've just fixed up the wTotalLength fields for now, I've run out of time
to work on this.  If you want to convert more of the descriptor fields,
that would be wonderful.

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [v2,0/8] lsusb: Add initial support for USB Audio Class 3
@ 2017-12-08 14:57 Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2017-12-08 14:57 UTC (permalink / raw)
  To: Michael Drake; +Cc: linux-usb

On Fri, Dec 08, 2017 at 02:44:12PM +0000, Michael Drake wrote:
> On 08/12/17 14:27, Greg KH wrote:
> > On Fri, Dec 08, 2017 at 10:30:43AM +0000, Michael Drake wrote:
> > > On 07/12/17 20:04, Greg KH wrote:
> 
> > > > --- lsusb-v.orig	2017-12-07 21:01:26.153185002 +0100
> > > > +++ lsusb-v.new	2017-12-07 21:01:32.806517978 +0100
> > > > @@ -1110,9 +1110,9 @@
> > > >            bDescriptorType        36
> > > >            bDescriptorSubtype      1 (HEADER)
> > > >            bcdADC               1.00
> > > > -        wTotalLength       0x0028
> > > > +        wTotalLength           40
> 
> [snip]
> 
> > > Anyway, since it's a 2 byte field the hex representation
> > > is expected here, and the actual value is the same.
> > 
> > Yes, the value is the same, but all other wTotalLength fields exported
> > by lsusb are in decimal.  Changing just this one feels odd to me.
> 
> Yes, that's a good reason for wanting to change the other ones.
> 
> [snip]
> 
> > I'll look at moving those other wFields to be also in 0x0000 mode to
> > match up here.
> 
> If you like I can work up a patch for that.  I'd just be tweaking
> the old printfs to dump wFields with "0x%04x".
> 
> I'm also thinking of porting more of the existing lsusb dumping
> to use the desc_dump() function, but that would have to be piece
> by piece, as I get time.

I think moving more over to use desc_dump() is a better idea, let me see
if I can do one now to see how hard/easy it is...

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [v2,0/8] lsusb: Add initial support for USB Audio Class 3
@ 2017-12-08 14:27 Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2017-12-08 14:27 UTC (permalink / raw)
  To: Michael Drake; +Cc: linux-usb

On Fri, Dec 08, 2017 at 10:30:43AM +0000, Michael Drake wrote:
> On 07/12/17 20:04, Greg KH wrote:
> > On Thu, Dec 07, 2017 at 07:24:35PM +0000, Michael Drake wrote:
> > > On 07/12/17 17:26, Greg KH wrote:
> > > > On Thu, Dec 07, 2017 at 05:14:10PM +0000, Michael Drake wrote:
> > > > > On 07/12/17 15:16, Greg KH wrote:
> > > > > > On Thu, Dec 07, 2017 at 04:01:23PM +0100, Greg KH wrote:
> > > > > > > Oops, I should have tested the code, it now crashes for me with the
> > > > > > > following error:
> > > > > > > 	Floating point exception (core dumped)
> > > > > > > 
> > > > > > > Do you see this as well?
> > > > > 
> > > > > No, I don't see that.
> > > > > 
> > > > > > And it's crashing on my USB audio device.  Here's the output of it from
> > > > > > the "old" lsusb output.
> > > > > 
> > > > > [snip]
> > > > > 
> > > > > Does it still crash with the warning fixes I posted?  If so I'll
> > > > > look in detail tomorrow.
> > > > 
> > > > I will check when I get home tonight, I don't have the USB device on me
> > > > at the moment.
> > > 
> > > Thank you.  I believe I've guessed the problem and sent a patch.
> > 
> > Ok, that now works.
> > 
> > But there is a difference in the "old" and "new" outputs, here's a diff
> > of a full -v output of my laptop and a bunch of USB devices plugged in,
> > showing the fields that now look different.
> > 
> > The big one is the change from "streaming" to "control", is that
> > correct?
> 
> Replied inline below.
> 
> > thanks,
> > 
> > greg k-h
> > 
> > 
> > --- lsusb-v.orig	2017-12-07 21:01:26.153185002 +0100
> > +++ lsusb-v.new	2017-12-07 21:01:32.806517978 +0100
> > @@ -1110,9 +1110,9 @@
> >           bDescriptorType        36
> >           bDescriptorSubtype      1 (HEADER)
> >           bcdADC               1.00
> > -        wTotalLength       0x0028
> > +        wTotalLength           40
> 
> I was a bit confused by this diff at first, because the
> "-" lines are my version and the "+" lines are the old
> version.

Oops, you are right, sorry for getting them backwards.

> Anyway, this is expected.  For NUMBER type fields, my
> code uses the heuristic that 1 byte fields are shown as
> decimal and >1 byte is shown as full hexadecimal, with
> leading zeros shown.  This is consistent with the way
> the old lsusb behaved in most cases, although it was
> slightly inconsistent about it, and this is an example
> of that inconsistency.
> 
> Anyway, since it's a 2 byte field the hex representation
> is expected here, and the actual value is the same.

Yes, the value is the same, but all other wTotalLength fields exported
by lsusb are in decimal.  Changing just this one feels odd to me.

> >           bInCollection           1
> > -        baInterfaceNr(0)        1
> > +        baInterfaceNr( 0)       1
> 
> Just a whitespace change.  My version's not using
> a fixed width for the array index, and only uses what's
> needed for the largest index to be represented.

Fair enough, I was worried things looked worse now :)

> >         AudioControl Interface Descriptor:
> >           bLength                12
> >           bDescriptorType        36
> > @@ -1142,10 +1142,10 @@
> >           bUnitID                13
> >           bSourceID               1
> >           bControlSize            1
> > -        bmaControls(0)       0x01
> > +        bmaControls( 0)      0x01
> >             Mute Control
> > -        bmaControls(1)       0x00
> > -        bmaControls(2)       0x00
> > +        bmaControls( 1)      0x00
> > +        bmaControls( 2)      0x00
> 
> Ditto for these.
> 
> >           iFeature                0
> >       Interface Descriptor:
> >         bLength                 9
> > @@ -1173,7 +1173,7 @@
> >           bDescriptorSubtype      1 (AS_GENERAL)
> >           bTerminalLink           1
> >           bDelay                  1 frames
> > -        wFormatTag         0x0001 PCM
> > +        wFormatTag              1 PCM
> 
> This is the >1 byte shown as hexadecimal thing.

Ok, consistancy is good, I can see that.

> >         AudioStreaming Interface Descriptor:
> >           bLength                20
> >           bDescriptorType        36
> > @@ -1199,14 +1199,14 @@
> >           bInterval               4
> >           bRefresh                0
> >           bSynchAddress         133
> > -        AudioStreaming Endpoint Descriptor:
> > +        AudioControl Endpoint Descriptor:
> 
> This is from the dump_audiostreaming_endpoint() function.
> The "AudioStreaming" string is correct.  Looks like a typo
> in the old lsusb output.

Hey, bugfixes, nice!  Best reason yet to take your patches :)

I'll look at moving those other wFields to be also in 0x0000 mode to
match up here.

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [v2,0/8] lsusb: Add initial support for USB Audio Class 3
@ 2017-12-08 10:30 Michael Drake
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Drake @ 2017-12-08 10:30 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb

On 07/12/17 20:04, Greg KH wrote:
> On Thu, Dec 07, 2017 at 07:24:35PM +0000, Michael Drake wrote:
>> On 07/12/17 17:26, Greg KH wrote:
>>> On Thu, Dec 07, 2017 at 05:14:10PM +0000, Michael Drake wrote:
>>>> On 07/12/17 15:16, Greg KH wrote:
>>>>> On Thu, Dec 07, 2017 at 04:01:23PM +0100, Greg KH wrote:
>>>>>> Oops, I should have tested the code, it now crashes for me with the
>>>>>> following error:
>>>>>> 	Floating point exception (core dumped)
>>>>>>
>>>>>> Do you see this as well?
>>>>
>>>> No, I don't see that.
>>>>
>>>>> And it's crashing on my USB audio device.  Here's the output of it from
>>>>> the "old" lsusb output.
>>>>
>>>> [snip]
>>>>
>>>> Does it still crash with the warning fixes I posted?  If so I'll
>>>> look in detail tomorrow.
>>>
>>> I will check when I get home tonight, I don't have the USB device on me
>>> at the moment.
>>
>> Thank you.  I believe I've guessed the problem and sent a patch.
> 
> Ok, that now works.
> 
> But there is a difference in the "old" and "new" outputs, here's a diff
> of a full -v output of my laptop and a bunch of USB devices plugged in,
> showing the fields that now look different.
> 
> The big one is the change from "streaming" to "control", is that
> correct?

Replied inline below.

> thanks,
> 
> greg k-h
> 
> 
> --- lsusb-v.orig	2017-12-07 21:01:26.153185002 +0100
> +++ lsusb-v.new	2017-12-07 21:01:32.806517978 +0100
> @@ -1110,9 +1110,9 @@
>           bDescriptorType        36
>           bDescriptorSubtype      1 (HEADER)
>           bcdADC               1.00
> -        wTotalLength       0x0028
> +        wTotalLength           40

I was a bit confused by this diff at first, because the
"-" lines are my version and the "+" lines are the old
version.

Anyway, this is expected.  For NUMBER type fields, my
code uses the heuristic that 1 byte fields are shown as
decimal and >1 byte is shown as full hexadecimal, with
leading zeros shown.  This is consistent with the way
the old lsusb behaved in most cases, although it was
slightly inconsistent about it, and this is an example
of that inconsistency.

Anyway, since it's a 2 byte field the hex representation
is expected here, and the actual value is the same.


>           bInCollection           1
> -        baInterfaceNr(0)        1
> +        baInterfaceNr( 0)       1

Just a whitespace change.  My version's not using
a fixed width for the array index, and only uses what's
needed for the largest index to be represented.

>         AudioControl Interface Descriptor:
>           bLength                12
>           bDescriptorType        36
> @@ -1142,10 +1142,10 @@
>           bUnitID                13
>           bSourceID               1
>           bControlSize            1
> -        bmaControls(0)       0x01
> +        bmaControls( 0)      0x01
>             Mute Control
> -        bmaControls(1)       0x00
> -        bmaControls(2)       0x00
> +        bmaControls( 1)      0x00
> +        bmaControls( 2)      0x00

Ditto for these.

>           iFeature                0
>       Interface Descriptor:
>         bLength                 9
> @@ -1173,7 +1173,7 @@
>           bDescriptorSubtype      1 (AS_GENERAL)
>           bTerminalLink           1
>           bDelay                  1 frames
> -        wFormatTag         0x0001 PCM
> +        wFormatTag              1 PCM

This is the >1 byte shown as hexadecimal thing.

>         AudioStreaming Interface Descriptor:
>           bLength                20
>           bDescriptorType        36
> @@ -1199,14 +1199,14 @@
>           bInterval               4
>           bRefresh                0
>           bSynchAddress         133
> -        AudioStreaming Endpoint Descriptor:
> +        AudioControl Endpoint Descriptor:

This is from the dump_audiostreaming_endpoint() function.
The "AudioStreaming" string is correct.  Looks like a typo
in the old lsusb output.

>             bLength                 7
>             bDescriptorType        37
>             bDescriptorSubtype      1 (EP_GENERAL)
>             bmAttributes         0x01
>               Sampling Frequency
>             bLockDelayUnits         0 Undefined
> -          wLockDelay         0x0000
> +          wLockDelay              0 Undefined

This and the remaining entries are similar to the above ones.

>         Endpoint Descriptor:
>           bLength                 9
>           bDescriptorType         5
> @@ -1235,7 +1235,7 @@
>           bDescriptorSubtype      1 (AS_GENERAL)
>           bTerminalLink           1
>           bDelay                  1 frames
> -        wFormatTag         0x0001 PCM
> +        wFormatTag              1 PCM
>         AudioStreaming Interface Descriptor:
>           bLength                20
>           bDescriptorType        36
> @@ -1261,14 +1261,14 @@
>           bInterval               4
>           bRefresh                0
>           bSynchAddress         133
> -        AudioStreaming Endpoint Descriptor:
> +        AudioControl Endpoint Descriptor:
>             bLength                 7
>             bDescriptorType        37
>             bDescriptorSubtype      1 (EP_GENERAL)
>             bmAttributes         0x01
>               Sampling Frequency
>             bLockDelayUnits         0 Undefined
> -          wLockDelay         0x0000
> +          wLockDelay              0 Undefined
>         Endpoint Descriptor:
>           bLength                 9
>           bDescriptorType         5
> 

Cheers,

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

* [v2,0/8] lsusb: Add initial support for USB Audio Class 3
@ 2017-12-07 20:04 Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2017-12-07 20:04 UTC (permalink / raw)
  To: Michael Drake; +Cc: linux-usb

On Thu, Dec 07, 2017 at 07:24:35PM +0000, Michael Drake wrote:
> On 07/12/17 17:26, Greg KH wrote:
> > On Thu, Dec 07, 2017 at 05:14:10PM +0000, Michael Drake wrote:
> > > On 07/12/17 15:16, Greg KH wrote:
> > > > On Thu, Dec 07, 2017 at 04:01:23PM +0100, Greg KH wrote:
> > > > > Oops, I should have tested the code, it now crashes for me with the
> > > > > following error:
> > > > > 	Floating point exception (core dumped)
> > > > > 
> > > > > Do you see this as well?
> > > 
> > > No, I don't see that.
> > > 
> > > > And it's crashing on my USB audio device.  Here's the output of it from
> > > > the "old" lsusb output.
> > > 
> > > [snip]
> > > 
> > > Does it still crash with the warning fixes I posted?  If so I'll
> > > look in detail tomorrow.
> > 
> > I will check when I get home tonight, I don't have the USB device on me
> > at the moment.
> 
> Thank you.  I believe I've guessed the problem and sent a patch.

Ok, that now works.

But there is a difference in the "old" and "new" outputs, here's a diff
of a full -v output of my laptop and a bunch of USB devices plugged in,
showing the fields that now look different.

The big one is the change from "streaming" to "control", is that
correct?

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- lsusb-v.orig	2017-12-07 21:01:26.153185002 +0100
+++ lsusb-v.new	2017-12-07 21:01:32.806517978 +0100
@@ -1110,9 +1110,9 @@
         bDescriptorType        36
         bDescriptorSubtype      1 (HEADER)
         bcdADC               1.00
-        wTotalLength       0x0028
+        wTotalLength           40
         bInCollection           1
-        baInterfaceNr(0)        1
+        baInterfaceNr( 0)       1
       AudioControl Interface Descriptor:
         bLength                12
         bDescriptorType        36
@@ -1142,10 +1142,10 @@
         bUnitID                13
         bSourceID               1
         bControlSize            1
-        bmaControls(0)       0x01
+        bmaControls( 0)      0x01
           Mute Control
-        bmaControls(1)       0x00
-        bmaControls(2)       0x00
+        bmaControls( 1)      0x00
+        bmaControls( 2)      0x00
         iFeature                0 
     Interface Descriptor:
       bLength                 9
@@ -1173,7 +1173,7 @@
         bDescriptorSubtype      1 (AS_GENERAL)
         bTerminalLink           1
         bDelay                  1 frames
-        wFormatTag         0x0001 PCM
+        wFormatTag              1 PCM
       AudioStreaming Interface Descriptor:
         bLength                20
         bDescriptorType        36
@@ -1199,14 +1199,14 @@
         bInterval               4
         bRefresh                0
         bSynchAddress         133
-        AudioStreaming Endpoint Descriptor:
+        AudioControl Endpoint Descriptor:
           bLength                 7
           bDescriptorType        37
           bDescriptorSubtype      1 (EP_GENERAL)
           bmAttributes         0x01
             Sampling Frequency
           bLockDelayUnits         0 Undefined
-          wLockDelay         0x0000
+          wLockDelay              0 Undefined
       Endpoint Descriptor:
         bLength                 9
         bDescriptorType         5
@@ -1235,7 +1235,7 @@
         bDescriptorSubtype      1 (AS_GENERAL)
         bTerminalLink           1
         bDelay                  1 frames
-        wFormatTag         0x0001 PCM
+        wFormatTag              1 PCM
       AudioStreaming Interface Descriptor:
         bLength                20
         bDescriptorType        36
@@ -1261,14 +1261,14 @@
         bInterval               4
         bRefresh                0
         bSynchAddress         133
-        AudioStreaming Endpoint Descriptor:
+        AudioControl Endpoint Descriptor:
           bLength                 7
           bDescriptorType        37
           bDescriptorSubtype      1 (EP_GENERAL)
           bmAttributes         0x01
             Sampling Frequency
           bLockDelayUnits         0 Undefined
-          wLockDelay         0x0000
+          wLockDelay              0 Undefined
       Endpoint Descriptor:
         bLength                 9
         bDescriptorType         5

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

end of thread, other threads:[~2017-12-08 15:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 14:44 [v2,0/8] lsusb: Add initial support for USB Audio Class 3 Michael Drake
  -- strict thread matches above, loose matches on Subject: below --
2017-12-08 15:29 Greg KH
2017-12-08 14:57 Greg KH
2017-12-08 14:27 Greg KH
2017-12-08 10:30 Michael Drake
2017-12-07 20:04 Greg KH

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.