GO7007のEZ-USB

昨年秋葉原で入手した[GO7007](https://qiita.com/yamori813/items/8d21d9d021cfd8724f09)のEZ-USBにfirmwareをダウンロードしてみました。

ダウンロードする前はEEPROMのVID,PIDはセットされてますが、素のEZ-USB FX2と思います。

<details><summary>ダウンロード前</summary><div>

```
High Speed device @ 5 (0xFD110000): .............................................   Vendor-specific device from Plextor LLC
    Port Information:   0x0018
           Not Captive
           External Device
           Connected
           Enabled
    Device Descriptor   
        Descriptor Version Number:   0x0200
        Device Class:   255   (Vendor-specific)
        Device Subclass:   255   (Vendor-specific)
        Device Protocol:   255
        Device MaxPacketSize:   64
        Device VendorID/ProductID:   0x093B/0xA004   (Plextor LLC)
        Device Version Number:   0x0001
        Number of Configurations:   1
        Manufacturer String:   0 (none)
        Product String:   0 (none)
        Serial Number String:   0 (none)
    Configuration Descriptor   
        Length (and contents):   171
            Raw Descriptor (hex)    0000: 09 02 AB 00 01 01 00 80  32 09 04 00 00 00 FF FF  
            Raw Descriptor (hex)    0010: FF 00 09 04 00 01 06 FF  FF FF 00 07 05 01 02 00  
            Raw Descriptor (hex)    0020: 02 00 07 05 81 02 00 02  00 07 05 02 02 00 02 00  
            Raw Descriptor (hex)    0030: 07 05 04 02 00 02 00 07  05 86 02 00 02 00 07 05  
            Raw Descriptor (hex)    0040: 88 02 00 02 00 09 04 00  02 06 FF FF FF 00 07 05  
            Raw Descriptor (hex)    0050: 01 03 40 00 01 07 05 81  03 40 00 01 07 05 02 03  
            Raw Descriptor (hex)    0060: 00 02 01 07 05 04 02 00  02 00 07 05 86 03 00 02  
            Raw Descriptor (hex)    0070: 01 07 05 88 02 00 02 00  09 04 00 03 06 FF FF FF  
            Raw Descriptor (hex)    0080: 00 07 05 01 03 40 00 01  07 05 81 03 40 00 01 07  
            Raw Descriptor (hex)    0090: 05 02 01 00 02 01 07 05  04 02 00 02 00 07 05 86  
            Raw Descriptor (hex)    00a0: 01 00 02 01 07 05 88 02  00 02 00 
        Number of Interfaces:   1
        Configuration Value:   1
        Attributes:   0x80 (bus-powered)
        MaxPower:   100 ma
        Interface #0 - Vendor-specific   
            Alternate Setting   0
            Number of Endpoints   0
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   255   (Vendor-specific)
            Interface Protocol:   255
        Interface #0 - Vendor-specific (#1)   
            Alternate Setting   1
            Number of Endpoints   6
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   255   (Vendor-specific)
            Interface Protocol:   255
            Endpoint 0x01 - Bulk Output   
                Address:   0x01  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x81 - Bulk Input   
                Address:   0x81  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x02 - Bulk Output   
                Address:   0x02  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x04 - Bulk Output   
                Address:   0x04  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x86 - Bulk Input   
                Address:   0x86  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x88 - Bulk Input   
                Address:   0x88  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
        Interface #0 - Vendor-specific (#2)   
            Alternate Setting   2
            Number of Endpoints   6
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   255   (Vendor-specific)
            Interface Protocol:   255
            Endpoint 0x01 - Interrupt Output   
                Address:   0x01  (OUT)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64  (64 x 1  transactions opportunities per microframe)
                Polling Interval:   1 (1 microframe (125 microsecs) )
            Endpoint 0x81 - Interrupt Input   
                Address:   0x81  (IN)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64  (64 x 1  transactions opportunities per microframe)
                Polling Interval:   1 (1 microframe (125 microsecs) )
            Endpoint 0x02 - Interrupt Output   
                Address:   0x02  (OUT)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   512  (512 x 1  transactions opportunities per microframe)
                Polling Interval:   1 (1 microframe (125 microsecs) )
            Endpoint 0x04 - Bulk Output   
                Address:   0x04  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x86 - Interrupt Input   
                Address:   0x86  (IN)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   512  (512 x 1  transactions opportunities per microframe)
                Polling Interval:   1 (1 microframe (125 microsecs) )
            Endpoint 0x88 - Bulk Input   
                Address:   0x88  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
        Interface #0 - Vendor-specific (#3)   
            Alternate Setting   3
            Number of Endpoints   6
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   255   (Vendor-specific)
            Interface Protocol:   255
            Endpoint 0x01 - Interrupt Output   
                Address:   0x01  (OUT)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64  (64 x 1  transactions opportunities per microframe)
                Polling Interval:   1 (1 microframe (125 microsecs) )
            Endpoint 0x81 - Interrupt Input   
                Address:   0x81  (IN)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64  (64 x 1  transactions opportunities per microframe)
                Polling Interval:   1 (1 microframe (125 microsecs) )
            Endpoint 0x02 - Isochronous Output   
                Address:   0x02  (OUT)
                Attributes:   0x01  (Isochronous no synchronization data endpoint)
                Max Packet Size:   512  (512 x 1  transactions opportunities per microframe)
                Polling Interval:   1 (1 microframe (125 microsecs) )
            Endpoint 0x04 - Bulk Output   
                Address:   0x04  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x86 - Isochronous Input   
                Address:   0x86  (IN)
                Attributes:   0x01  (Isochronous no synchronization data endpoint)
                Max Packet Size:   512  (512 x 1  transactions opportunities per microframe)
                Polling Interval:   1 (1 microframe (125 microsecs) )
            Endpoint 0x88 - Bulk Input   
                Address:   0x88  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
    Device Qualifier Descriptor   
        Descriptor Version Number:   0x0200
        Device Class   255   (Vendor-specific)
        Device Subclass   255   (Vendor-specific)
        Device Protocol   255
        Device MaxPacketSize:   64
        Number of Configurations:   1
        bReserved:   0
    Other Speed Configuration Descriptor   
        Length (and contents):   171
            Raw Descriptor (hex)    0000: 09 07 AB 00 01 01 00 80  32 09 04 00 00 00 FF FF  
            Raw Descriptor (hex)    0010: FF 00 09 04 00 01 06 FF  FF FF 00 07 05 01 02 40  
            Raw Descriptor (hex)    0020: 00 00 07 05 81 02 40 00  00 07 05 02 02 40 00 00  
            Raw Descriptor (hex)    0030: 07 05 04 02 40 00 00 07  05 86 02 40 00 00 07 05  
            Raw Descriptor (hex)    0040: 88 02 40 00 00 09 04 00  02 06 FF FF FF 00 07 05  
            Raw Descriptor (hex)    0050: 01 03 40 00 0A 07 05 81  03 40 00 0A 07 05 02 03  
            Raw Descriptor (hex)    0060: 40 00 0A 07 05 04 02 40  00 00 07 05 86 03 40 00  
            Raw Descriptor (hex)    0070: 0A 07 05 88 02 40 00 00  09 04 00 03 06 FF FF FF  
            Raw Descriptor (hex)    0080: 00 07 05 01 03 40 00 0A  07 05 81 03 40 00 0A 07  
            Raw Descriptor (hex)    0090: 05 02 01 40 00 01 07 05  04 02 40 00 00 07 05 86  
            Raw Descriptor (hex)    00a0: 01 40 00 01 07 05 88 02  40 00 00 
        Number of Interfaces:   1
        Configuration Value:   1
        Attributes:   0x80 (bus-powered)
        MaxPower:   100 ma
        Interface #0 - Vendor-specific   
            Alternate Setting   0
            Number of Endpoints   0
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   255   (Vendor-specific)
            Interface Protocol:   255
        Interface #0 - Vendor-specific (#1)   
            Alternate Setting   1
            Number of Endpoints   6
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   255   (Vendor-specific)
            Interface Protocol:   255
            Endpoint 0x01 - Bulk Output   
                Address:   0x01  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x81 - Bulk Input   
                Address:   0x81  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x02 - Bulk Output   
                Address:   0x02  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x04 - Bulk Output   
                Address:   0x04  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x86 - Bulk Input   
                Address:   0x86  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x88 - Bulk Input   
                Address:   0x88  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
        Interface #0 - Vendor-specific (#2)   
            Alternate Setting   2
            Number of Endpoints   6
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   255   (Vendor-specific)
            Interface Protocol:   255
            Endpoint 0x01 - Interrupt Output   
                Address:   0x01  (OUT)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   10 ms
            Endpoint 0x81 - Interrupt Input   
                Address:   0x81  (IN)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   10 ms
            Endpoint 0x02 - Interrupt Output   
                Address:   0x02  (OUT)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   10 ms
            Endpoint 0x04 - Bulk Output   
                Address:   0x04  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x86 - Interrupt Input   
                Address:   0x86  (IN)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   10 ms
            Endpoint 0x88 - Bulk Input   
                Address:   0x88  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
        Interface #0 - Vendor-specific (#3)   
            Alternate Setting   3
            Number of Endpoints   6
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   255   (Vendor-specific)
            Interface Protocol:   255
            Endpoint 0x01 - Interrupt Output   
                Address:   0x01  (OUT)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   10 ms
            Endpoint 0x81 - Interrupt Input   
                Address:   0x81  (IN)
                Attributes:   0x03  (Interrupt no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   10 ms
            Endpoint 0x02 - Isochronous Output   
                Address:   0x02  (OUT)
                Attributes:   0x01  (Isochronous no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   1 ms
            Endpoint 0x04 - Bulk Output   
                Address:   0x04  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x86 - Isochronous Input   
                Address:   0x86  (IN)
                Attributes:   0x01  (Isochronous no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   1 ms
            Endpoint 0x88 - Bulk Input   
                Address:   0x88  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
```

</div></details>

忘れるのでスクリプトにしておきました。

```
#!/bin/sh

FW="wis-go7007-linux-0.9.8-2/firmware/ezusb/hpi_PX-TV402U.hex"

../Ezloader_OSX/build/Release/Ezload -v 0x093b -p 0xa004 -n -F -f ${FW}
```

ダウンロード後

```
High Speed device @ 5 (0xFD110000): .............................................   Vendor-specific device: "Plextor ConvertX TV402U"
    Port Information:   0x0018
           Not Captive
           External Device
           Connected
           Enabled
    Device Descriptor   
        Descriptor Version Number:   0x0200
        Device Class:   255   (Vendor-specific)
        Device Subclass:   0   (Vendor-specific)
        Device Protocol:   255
        Device MaxPacketSize:   64
        Device VendorID/ProductID:   0x093B/0xA104   (Plextor LLC)
        Device Version Number:   0x0001
        Number of Configurations:   1
        Manufacturer String:   1 "PLEXTOR"
        Product String:   2 "Plextor ConvertX TV402U"
        Serial Number String:   0 (none)
    Configuration Descriptor   
        Length (and contents):   46
            Raw Descriptor (hex)    0000: 09 02 2E 00 01 01 00 C0  32 09 04 00 00 04 FF 00  
            Raw Descriptor (hex)    0010: 00 00 07 05 02 02 00 02  00 07 05 84 02 00 02 00  
            Raw Descriptor (hex)    0020: 07 05 86 02 00 02 00 07  05 88 02 00 02 00 
        Number of Interfaces:   1
        Configuration Value:   1
        Attributes:   0xC0 (self-powered)
        MaxPower:   100 ma
        Interface #0 - Vendor-specific   
            Alternate Setting   0
            Number of Endpoints   4
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   0   (Vendor-specific)
            Interface Protocol:   0
            Endpoint 0x02 - Bulk Output   
                Address:   0x02  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x84 - Bulk Input   
                Address:   0x84  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x86 - Bulk Input   
                Address:   0x86  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
            Endpoint 0x88 - Bulk Input   
                Address:   0x88  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   512
                Polling Interval:   0 ( Endpoint never NAKs)
    Device Qualifier Descriptor   
        Descriptor Version Number:   0x0200
        Device Class   0   (Composite)
        Device Subclass   0
        Device Protocol   0
        Device MaxPacketSize:   64
        Number of Configurations:   1
        bReserved:   0
    Other Speed Configuration Descriptor   
        Length (and contents):   46
            Raw Descriptor (hex)    0000: 09 07 2E 00 01 01 00 C0  32 09 04 00 00 04 FF 00  
            Raw Descriptor (hex)    0010: 00 00 07 05 02 02 40 00  00 07 05 84 02 40 00 00  
            Raw Descriptor (hex)    0020: 07 05 86 02 40 00 00 07  05 88 02 40 00 00 
        Number of Interfaces:   1
        Configuration Value:   1
        Attributes:   0xC0 (self-powered)
        MaxPower:   100 ma
        Interface #0 - Vendor-specific   
            Alternate Setting   0
            Number of Endpoints   4
            Interface Class:   255   (Vendor-specific)
            Interface Subclass;   0   (Vendor-specific)
            Interface Protocol:   0
            Endpoint 0x02 - Bulk Output   
                Address:   0x02  (OUT)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x84 - Bulk Input   
                Address:   0x84  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x86 - Bulk Input   
                Address:   0x86  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
            Endpoint 0x88 - Bulk Input   
                Address:   0x88  (IN)
                Attributes:   0x02  (Bulk no synchronization data endpoint)
                Max Packet Size:   64
                Polling Interval:   0 ms
```

ディスクリプタが替わっているので、正しくダウンロードされたものと思われます。

GO7007自体のファームウエアは2つ必要なようです。

コードを長めていたらパイプは以下のような構成のようです。

```
/*
 * Pipes on EZ-USB interface:
 *      0 snd - Control
 *      0 rcv - Control
 *      2 snd - Download firmware (control)
 *      4 rcv - Read Interrupt (interrupt)
 *      6 rcv - Read Video (bulk)
 *      8 rcv - Read Audio (bulk)
 */
```

GO7007はビデオとオーディオが別々に流れてくるようだ。そのまま保存したらmpegファイルになるCX23416などとは違うみたい。

audioとvideoのストリームを交互に書き込むとaviファイルが作れるようです。