Replace Mac OS X firmware if loaded

Bug #386812 reported by Markus
52
This bug affects 8 people
Affects Status Importance Assigned to Milestone
iSight Firmware Tools
Confirmed
Undecided
Unassigned

Bug Description

Dear Étienne,

I have a first generation MacBook Pro running Gentoo Linux. My iSight Camera appears with product ID 8501 rather than product ID 0x8300. Therefore ift-load fails to detect the iSight camera and the firmware does not load.

I have attached a simple patch for isight-firmware-tools-1.4.1 which solves the problem for me.

Thank you for having made the iSight camera available for linux users!
Markus

Here the output of the lsusb program on my machine:

Bus 001 Device 016: ID 05ac:8501 Apple Computer, Inc. Built-in iSight [Micron]
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 2.00
  bDeviceClass 255 Vendor Specific Class
  bDeviceSubClass 255 Vendor Specific Subclass
  bDeviceProtocol 255 Vendor Specific Protocol
  bMaxPacketSize0 64
  idVendor 0x05ac Apple Computer, Inc.
  idProduct 0x8501 Built-in iSight [Micron]
  bcdDevice 1.84
  iManufacturer 1 Micron
  iProduct 2 Built-in iSight
  iSerial 0
  bNumConfigurations 1
  Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 267
    bNumInterfaces 2
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0x80
      (Bus Powered)
    MaxPower 100mA
    ** UNRECOGNIZED: 08 24 00 02 ff ff ff 00
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 1
      bInterfaceClass 14 Video
      bInterfaceSubClass 1 Video Control
      bInterfaceProtocol 0
      iInterface 0
      VideoControl Interface Descriptor:
        bLength 13
        bDescriptorType 36
        bDescriptorSubtype 1 (HEADER)
        bcdUVC 1.00
        wTotalLength 49
        dwClockFrequency 13.500000MHz
        bInCollection 1
        baInterfaceNr( 0) 1
      VideoControl Interface Descriptor:
        bLength 16
        bDescriptorType 36
        bDescriptorSubtype 2 (INPUT_TERMINAL)
        bTerminalID 1
        wTerminalType 0x0201 Camera Sensor
        bAssocTerminal 0
        iTerminal 0
        wObjectiveFocalLengthMin 0
        wObjectiveFocalLengthMax 0
        wOcularFocalLength 0
        bControlSize 1
        bmControls 0x00000000
      VideoControl Interface Descriptor:
        bLength 11
        bDescriptorType 36
        bDescriptorSubtype 5 (PROCESSING_UNIT)
      Warning: Descriptor too short
        bUnitID 2
        bSourceID 1
        wMaxMultiplier 0
        bControlSize 2
        bmControls 0x00000039
          Brightness
          Saturation
          Sharpness
          Gamma
        iProcessing 0
        bmVideoStandards 0x 9
          None
          SECAM - 625/50
      VideoControl Interface Descriptor:
        bLength 9
        bDescriptorType 36
        bDescriptorSubtype 3 (OUTPUT_TERMINAL)
        bTerminalID 3
        wTerminalType 0x0101 USB Streaming
        bAssocTerminal 0
        bSourceID 2
        iTerminal 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x81 EP 1 IN
        bmAttributes 3
          Transfer Type Interrupt
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0008 1x 8 bytes
        bInterval 10
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 1
      bAlternateSetting 0
      bNumEndpoints 0
      bInterfaceClass 14 Video
      bInterfaceSubClass 2 Video Streaming
      bInterfaceProtocol 0
      iInterface 0
      VideoStreaming Interface Descriptor:
        bLength 14
        bDescriptorType 36
        bDescriptorSubtype 1 (INPUT_HEADER)
        bNumFormats 1
        wTotalLength 155
        bEndPointAddress 130
        bmInfo 0
        bTerminalLink 3
        bStillCaptureMethod 0
        bTriggerSupport 0
        bTriggerUsage 0
        bControlSize 1
        bmaControls( 0) 27
      VideoStreaming Interface Descriptor:
        bLength 27
        bDescriptorType 36
        bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED)
        bFormatIndex 1
        bNumFrameDescriptors 3
        guidFormat {55595659-0000-1000-8000-00aa00389b71}
        bBitsPerPixel 16
        bDefaultFrameIndex 1
        bAspectRatioX 0
        bAspectRatioY 0
        bmInterlaceFlags 0x00
          Interlaced stream or variable: No
          Fields per frame: 1 fields
          Field 1 first: No
          Field pattern: Field 1 only
          bCopyProtect 0
      VideoStreaming Interface Descriptor:
        bLength 38
        bDescriptorType 36
        bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
        bFrameIndex 1
        bmCapabilities 0x00
          Still image unsupported
        wWidth 640
        wHeight 480
        dwMinBitRate 383976960
        dwMaxBitRate 383976960
        dwMaxVideoFrameBufferSize 614400
        dwDefaultFrameInterval 333333
        bFrameIntervalType 0
        dwMinFrameInterval 333333
        dwMaxFrameInterval 333333
        dwFrameIntervalStep 0
      VideoStreaming Interface Descriptor:
        bLength 38
        bDescriptorType 36
        bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
        bFrameIndex 2
        bmCapabilities 0x00
          Still image unsupported
        wWidth 352
        wHeight 288
        dwMinBitRate 383976960
        dwMaxBitRate 383976960
        dwMaxVideoFrameBufferSize 202752
        dwDefaultFrameInterval 333333
        bFrameIntervalType 0
        dwMinFrameInterval 333333
        dwMaxFrameInterval 333333
        dwFrameIntervalStep 0
      VideoStreaming Interface Descriptor:
        bLength 38
        bDescriptorType 36
        bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
        bFrameIndex 3
        bmCapabilities 0x00
          Still image unsupported
        wWidth 320
        wHeight 240
        dwMinBitRate 383976960
        dwMaxBitRate 383976960
        dwMaxVideoFrameBufferSize 153600
        dwDefaultFrameInterval 333333
        bFrameIntervalType 0
        dwMinFrameInterval 333333
        dwMaxFrameInterval 333333
        dwFrameIntervalStep 0
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 1
      bAlternateSetting 1
      bNumEndpoints 1
      bInterfaceClass 14 Video
      bInterfaceSubClass 2 Video Streaming
      bInterfaceProtocol 0
      iInterface 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x82 EP 2 IN
        bmAttributes 5
          Transfer Type Isochronous
          Synch Type Asynchronous
          Usage Type Data
        wMaxPacketSize 0x1400 3x 1024 bytes
        bInterval 1
Device Qualifier (for other device speed):
  bLength 10
  bDescriptorType 6
  bcdUSB 2.00
  bDeviceClass 14 Video
  bDeviceSubClass 2 Video Streaming
  bDeviceProtocol 0
  bMaxPacketSize0 8
  bNumConfigurations 1
Device Status: 0x0000
  (Bus Powered)

Revision history for this message
Markus (markus-meier74) wrote :
Revision history for this message
Étienne BERSAC (bersace) wrote :

Hi,

When iSight publish itself as 0x8501, it means it has already the firmware loaded. 0x8300 is the product id of the vanilla device while 0x8501 is exposed by the firmware itself. As you can see in lsusb -v, the video interfaces are exposed by the firmware.

Please confirm me that when you first boot your macbook (no reboot from Mac OS X) you get the 0x8501 and that without forcing ift-load to use the 0x8501 you can't have webcam.

Also, note there is a 1.4.2 release :)

Regards,
Étienne.

Changed in isight-firmware-tools:
status: New → Incomplete
Revision history for this message
Markus (markus-meier74) wrote :

Dear Étienne,

thanks a lot for the clarification. It took me a while to figure out when the problem actually occurs.

You are correct, of course:
a) Cold starting the machine directly into linux: iSight reports 05ac:8300, bus 1, device 4.
   The camera works after loading the firmware, isight then reports 05ac:8501, bus 1, device 15

b) Rebooting the machine (warm boot) back into linux: iSight then reports 05ac:8501, bus 1, device 4.
  The camera works without loading the firmware.

The problem occurs only when:
c) I cold start Mac OS X (happens mostly by mistake) until the login screen appears. I do not login and I do not use the iSight. I then do a warm reboot into linux and the iSight reports: 05ac:8501, bus 1, device 4
  However, the camera does *not* work unless I load the firmware with ift-load.

The lsusb -v output is different in case b) and c). I have attached the output of lsusb for all three cases in the attachment.

It seems that Mac OS (I still have 10.4) is doing something nasty to my camera.

With best regards,
Markus

P.S.: I will upgrade to 1.4.2 right away ;-)

Revision history for this message
Étienne BERSAC (bersace) wrote : Re: [Bug 386812] Re: different product ID for iSight on MacBook Pro

Hi,

> The problem occurs only when:
> c) I cold start Mac OS X (happens mostly by mistake) until the login screen appears. I do not login and I do not use the iSight. I then do a warm reboot into linux and the iSight reports: 05ac:8501, bus 1, device 4

That's actually an issue we should fix. Can you output the lsusb -v
with 0x8501 before and after ift-load once you rebooted from Mac OS X.
But the easiest solution would be to reupload the firmware each time.
I have a macbook with dual boot, i'll test it this week-end. That's
quite a bit strange since the firmware we upload *IS* from the apple
driver !

Regards,
Étienne.
--
E Ultreïa !

Revision history for this message
Markus (markus-meier74) wrote : Re: different product ID for iSight on MacBook Pro

Dear Étienne,

I have attached the lsusb -v output before and after loading the firmware after rebooting from Mac OS.

The lsusb -v output after loading the firmware coming from Mac OS is the same as loading the firmware after a cold boot.

With best regards,
Markus

Revision history for this message
Étienne BERSAC (bersace) wrote :

Hi,

Right, the firmware is patched. I would like to avoid unnecessary loading. We should check if the firmware needs to be reloaded.

Regards,
Étienne.

Revision history for this message
Markus (markus-meier74) wrote :

Device Qualifier->bInterfaceClass 255 Vendor Specific Class
changes to:
Device Qualifier->bInterfaceClass 14 Video

and
Device Descriptor->Configuration Descriptor->Interface Descriptor->bInterfaceClass 255 Vendor Specific Class
changes to
Device Descriptor->Configuration Descriptor->Interface Descriptor->bInterfaceClass 14 Video

Should we check for these values and reload the firmware if they are 255 instead of 14?

With best regards,
Markus

Revision history for this message
Étienne BERSAC (bersace) wrote : Re: [Bug 386812] Re: different product ID for iSight on MacBook Pro

2009/6/26 Markus <email address hidden>:
> Device Qualifier->bInterfaceClass       255 Vendor Specific Class
> changes to:
> Device Qualifier->bInterfaceClass        14 Video
>
> and
> Device Descriptor->Configuration Descriptor->Interface Descriptor->bInterfaceClass       255 Vendor Specific Class
> changes to
> Device Descriptor->Configuration Descriptor->Interface Descriptor->bInterfaceClass        14 Video
>
> Should we check for these values and reload the firmware if they are 255
> instead of 14?

Right. There is a set of "patches" in extract.c. There is a third one.
All the three 255 values are wrong.

Étienne.
--
E Ultreïa !

Revision history for this message
Nate Murray (nate-natemurray) wrote : Re: different product ID for iSight on MacBook Pro
Download full text (18.3 KiB)

I'm having a similar problem, however I'm using VMware Fusion inside of Mac OS X. The device id in this case is 8507. Below is lsusb -v . If I apply a patch similar ( #define ISIGHT_PRODUCT_ID2 0x8507 ) it then fails on usb_control_msg:

ift-load: Failed to init firmware loading
ift-load: Failed to upload firmware to 0x05AC:0x8507

Any thoughts?

$ lsusb -v

Bus 001 Device 002: ID 05ac:8507 Apple, Inc.
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 2.00
  bDeviceClass 239 Miscellaneous Device
  bDeviceSubClass 2 ?
  bDeviceProtocol 1 Interface Association
  bMaxPacketSize0 64
  idVendor 0x05ac Apple, Inc.
  idProduct 0x8507
  bcdDevice 4.18
  iManufacturer 1 Apple Inc.
  iProduct 2 Built-in iSight
  iSerial 3 8J8CQ1D5W40X3A00
  bNumConfigurations 1
  Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 642
    bNumInterfaces 3
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0x80
      (Bus Powered)
    MaxPower 500mA
    Interface Association:
      bLength 8
      bDescriptorType 11
      bFirstInterface 0
      bInterfaceCount 2
      bFunctionClass 14 Video
      bFunctionSubClass 3 Video Interface Collection
      bFunctionProtocol 0
      iFunction 2 Built-in iSight
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 1
      bInterfaceClass 14 Video
      bInterfaceSubClass 1 Video Control
      bInterfaceProtocol 0
      iInterface 2 Built-in iSight
      VideoControl Interface Descriptor:
        bLength 13
        bDescriptorType 36
        bDescriptorSubtype 1 (HEADER)
        bcdUVC 1.00
        wTotalLength 51
        dwClockFrequency 4.000000MHz
        bInCollection 1
        baInterfaceNr( 0) 1
      VideoControl Interface Descriptor:
        bLength 18
        bDescriptorType 36
        bDescriptorSubtype 2 (INPUT_TERMINAL)
        bTerminalID 1
        wTerminalType 0x0201 Camera Sensor
        bAssocTerminal 0
        iTerminal 0
        wObjectiveFocalLengthMin 0
        wObjectiveFocalLengthMax 0
        wOcularFocalLength 0
        bControlSize 3
        bmControls 0x0000000a
          Auto-Exposure Mode
          Exposure Time (Absolute)
      VideoControl Interface Descriptor:
        bLength 9
        bDescriptorType 36
        bDescriptorSubtype 3 (OUTPUT_TERMINAL)
        bTerminalID 2
        wTerminalType 0x0101 USB Streaming
        bAssocTerminal 0
        bSourceID 3
        iTerminal 0
      VideoControl Interface Descriptor:
      ...

Revision history for this message
Étienne BERSAC (bersace) wrote :

Nate, that should be a bug in VMWare.

Revision history for this message
Étienne BERSAC (bersace) wrote :

Hi,

1.5.92 does have 3 new patches for the firmware to better follow UVC specs. Markus, can you try it ?

Étienne

Revision history for this message
Markus (markus-meier74) wrote :

Hi Étienne,

I have just tested 1.5.92.

ift-load detects the iSight if the ID is 05ac:8300 and loads the firmware. After that the ID is ID 05ac:8501 and the iSight works perfectly.

However, I still have the issue when I cold boot into MacOS (without using the iSight) and the warm boot into linux. The ID of the iSight is now 05ac:8501 but the loaded firmware is corrupt. ift-load does reload the firmware in this case.

I have included three attachments with the output of lsusb -v
(1) iSight without firmware
(2) iSight with correct firmware
(3) iSight with broken firmware coming from MacOS

Cheers,
Markus

Revision history for this message
Markus (markus-meier74) wrote :

(2) iSight with correct firmware

Revision history for this message
Markus (markus-meier74) wrote :

(3) iSight with broken firmware coming from MacOS

Revision history for this message
Markus (markus-meier74) wrote :

Sorry, the sentence in #12 should have been
"ift-load does *not* reload the firmware in this case."

(I have worked too long on the computer screen today, my apologies...)

Revision history for this message
Étienne BERSAC (bersace) wrote :

Hi,

You're right. We need ift-load to check whether the firmware loaded is actually patched, if not, load the patched version. I'll fix that asap.

Étienne

summary: - different product ID for iSight on MacBook Pro
+ Replace Mac OS X firmware if loaded
Changed in isight-firmware-tools:
status: Incomplete → Confirmed
Revision history for this message
T-matsuu (t-matsuu) wrote :

When I use isight-firmware-tools-1.5.93 with attached patch on Fedora 13, 05ac:8501 isight is successfully detected. However the following message is continued with about 1 sec. frequency.

Jun 18 05:52:33 localhost kernel: usb 2-4: new high speed USB device using ehci_hcd and address 87
Jun 18 05:52:33 localhost kernel: usb 2-4: New USB device found, idVendor=05ac, idProduct=8501
Jun 18 05:52:33 localhost kernel: usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jun 18 05:52:33 localhost kernel: usb 2-4: Product: Built-in iSight
Jun 18 05:52:33 localhost kernel: usb 2-4: Manufacturer: Micron
Jun 18 05:52:33 localhost kernel: uvcvideo: Found UVC 1.00 device Built-in iSight (05ac:8501)
Jun 18 05:52:33 localhost kernel: uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
Jun 18 05:52:33 localhost ift-load: iSight firmware loaded successfully
Jun 18 05:52:33 localhost ift-load: iSight firmware loaded successfully
Jun 18 05:52:33 localhost ift-load: iSight firmware loaded successfully
Jun 18 05:52:33 localhost ift-load: iSight firmware loaded successfully
Jun 18 05:52:33 localhost kernel: usb 2-4: USB disconnect, address 87

Revision history for this message
Dan Shea (shea-dan) wrote :

Hello,

I am running Ubuntu 10.04 (Lucid Lynx) on a MBP 5,5 (not on VMware). I have the same issue as Nate above:

[code]
$ lsusb -d 05ac:
Bus 004 Device 003: ID 05ac:8213 Apple, Inc.
Bus 003 Device 003: ID 05ac:0236 Apple, Inc.
Bus 003 Device 002: ID 05ac:8242 Apple, Inc.
Bus 002 Device 003: ID 05ac:8403 Apple, Inc.
Bus 001 Device 002: ID 05ac:8507 Apple, Inc.
$ sudo $(locate ift-load) --firmware /lib/firmware/
ift-load: Failed to init firmware loading
ift-load: Failed to upload firmware to 0x05AC:0x8507
[/code]

I have also attempted to make the change that Nate described in the header file for ift-load:
[code]
#define ISIGHT_PRODUCT_ID2 0x8507
[/code]
instead of
[code]
#define ISIGHT_PRODUCT_ID2 0x8300
[/code]

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.