Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiple configurations problem



Title: Multiple configurations problem
Hi again,

I've got working firmware that returns the correct descriptors for two different configurations.  One configuration (the first) has 5 interfaces (one audio control, one audio midi, 3 audio streaming), and the other (the second) has 6 interfaces (one audio control, one audio midi, and 4 audio streaming).

Why do I get this message when I turn on my device (bus powered):

   38.747 [5]    AppleUSBOHCI: CreateDevice: addr=5, speed=full, power=500
   42.260 [5]    AppleUSBComposite[0x1cd3400](foobar) ConfigureDevice Config 0 with MaxPower 100
   42.260 [5]    AppleUSBComposite[0x1cd3400](foobar) ConfigureDevice Config 1 with MaxPower 100 cannot be used (available: 250, previous 100)

Both of the configs specify the same amount of power required.  Is that a problem?  Is the second message for real?  Telling me that I can’t use the second config?  Because if so, perhaps that’s the source of my problem...  Anyway, here’s what I’m trying.

I do a IOUSBDevice::SetConfiguration(1) to get the second interface (because the parameter is an index, not a value -- important safety tip), but then calls to IOUSBDevice::FindNextInterface() fail to find the last interface.

I'm wondering if FindNextInterface is somehow checking with the first config instead of the active config.  Or could I be using the call incorrectly?

I’m looking at the code from IOUSBFamily 217.4.4, in particular at SetConfiguration in IOUSBDevice.cpp.

I get this log from the call to SetConfiguration:

   42.260 [5]    foobar[0x1800200]::SetConfiguration to 1
   42.261 [5]    foobar[0x1800200]::SetConfiguration  Found an interface (0x17b5209)
   42.262 [5]    foobar[0x1800200]::SetConfiguration  Attaching an interface (0x1d1c500)
   42.264 [5]    foobar[0x1800200]::SetConfiguration  Found an interface (0x17b525d)
   42.264 [5]    foobar[0x1800200]::SetConfiguration  Attaching an interface (0x1d4be00)
   42.267 [5]    foobar[0x1800200]::SetConfiguration  Found an interface (0x17b52a7)
   42.267 [5]    foobar[0x1800200]::SetConfiguration  Attaching an interface (0x1d4bf00)
   42.268 [5]    foobar[0x1800200]::SetConfiguration  Found an interface (0x17b52b0)
   42.268 [5]    foobar[0x1800200]::SetConfiguration  Attaching an interface (0x1d1c000)
   42.268 [5]    foobar[0x1800200]::SetConfiguration  Found an interface (0x17b52e7)
   42.268 [5]    foobar[0x1800200]::SetConfiguration  Attaching an interface (0x1d4bd00)
   42.268 [5]    foobar[0x1800200]::SetConfiguration  matching to interfaces (0)
   42.283 [5]    foobar[0x1800200]::SetConfiguration  matching to interfaces (1)
   42.298 [5]    foobar[0x1800200]::SetConfiguration  matching to interfaces (2)
   42.312 [5]    foobar[0x1800200]::SetConfiguration  matching to interfaces (3)
   42.327 [5]    foobar[0x1800200]::SetConfiguration  matching to interfaces (4)
   42.342 [5]    foobar[0x1800200]::SetConfiguration  returning success

My descriptor begins with:

 9  2 4b  4  6  2  0 80 64

which clearly says that there are 6 interfaces in this config.  However, there are only 5 interfaces in the first config (index 0).

 9  2 4c  1  5  1  0 80 64

Unfortunately, SetConfiguration doesn’t print out how many interfaces it finds, but from the loop one can infer that it went through it only 5 times since there isn’t a path through the loop that doesn’t print out something.

This would imply that _numInterfaces = confDesc->bNumInterfaces; is getting the wrong value, but looking at FindConfig() (which is what returned confDesc), it’s not obvious how it could be returning the wrong number (or config).  Likewise, looking at GetFullConfigurationDescriptor() looks like it’s doing the right thing.  The logs of it show that it is, in fact, getting the second config descriptor, and it is reported as being the proper length.

At this point, I’m thinking I want to add some more logging to IOUSBDevice.cpp to try to track this down (unless someone can easily point out the error of my ways).  How do I build a debug version of IOUSBFamily in 10.3.9 and install it (having done it wrong and killed my system once before, I need a little instruction this time around).

Thanks,
Mark
--
Mark Cookson
M-Audio, a part of Avid
225 Locust St.
Hudson, WI 54016

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.