|
From: Deron <de...@pa...> - 2012-05-07 18:59:19
|
On 5/7/12 10:48 AM, Peter Stuge wrote:
> Hi!
>
> Deron wrote:
>> What I don't have now is the audio stream. I'm not very familiar with
>> USB, so this is a really basic question, but what do I do to read that
>> data?
> This is highly device-specific. The process is to reverse-engineer
> how the device communicates with the PC. You may have to learn a fair
> bit of USB details.
>
>
>> if someone could just nudge me in the correct direction I would
>> appreciate it or even basic info on USB that would fluff out my
>> knowledge without have to read an encyclopedia on USB.
> If you send the output of lsusb -v for the device to this list, we
> may be able to help you find the correct process.
This is what I get:
Bus 004 Device 002: ID 12cf:7111
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x12cf
idProduct 0x7111
bcdDevice 1.00
iManufacturer 1 Axentia Technologies AB
iProduct 2 ALERT FM Radio
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 145
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 0
iInterface 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 1.00
wTotalLength 43
bInCollection 1
baInterfaceNr( 0) 1
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0710 Radio Receiver
bAssocTerminal 0
bNrChannels 2
wChannelConfig 0x0003
Left Front (L)
Right Front (R)
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 2
bSourceID 1
bControlSize 2
bmaControls( 0) 0x01
bmaControls( 0) 0x00
Mute
bmaControls( 1) 0x00
bmaControls( 1) 0x00
bmaControls( 2) 0x00
bmaControls( 2) 0x00
iFeature 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 3
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 2
iTerminal 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 0 frames
wFormatTag 1 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 96000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
bRefresh 0
bSynchAddress 0
AudioControl Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 2 Decoded PCM samples
wLockDelay 0 Decoded PCM samples
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 203
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 10
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Device Status: 0x0000
(Bus Powered)
> If you want, you can also check out my USB intro talk which goes into
> some light technical detail about the bus.
Thanks! Just what I'm looking for!
>
> Slides: http://events.ccc.de/congress/2010/Fahrplan/events/4234.en.html
> MPEG-4: http://mirror.fem-net.de/CCC/27C3/mp4-h264-HQ/27c3-4234-en-usb_and_libusb.mp4
> Flash: http://youtu.be/uBBE2gihv5I
>
> And feel free to stop by #libusb on freenode for some live
> discussion.
Once I get a little better grip on this where I can ask more intelligent
questions, will. Thanks! If any of the above output points to something
I should be reading up on, please let me know. Also, here is a little of
the output from USBlyzer demo. Since they just keep coming, I presume
this is the actual audio data.
URB 1294-1233 16:06:21.806 2.415316 s 118.542 ms Isoch Transfer
3844 bytes data 80 DA 80 D9 00 D9 C0 D7... in 01:01:83 8AC78030h
USBPDO-2 usbhub 8481B768h Success (Success)
00000000 80 DA 80 D9 00 D9 C0 D7 40 D7 80 D6 00 D7 80 D7 ........@.......
00000010 80 D7 C0 D6 00 D7 C0 D6 00 D7 C0 D6 40 D6 00 D6 ............@...
00000020 80 D6 80 D5 00 D5 80 D3 80 D3 80 D3 00 D4 80 D3 ................
00000030 00 D3 80 D2 80 D3 00 D4 C0 D4 40 D5 40 D6 40 D7 ..........@.@.@.
00000040 80 D8 80 D9 C0 DA 40 DB 00 DC C0 DC 80 DD C0 DD ......@.........
00000050 80 DE 00 DF 00 E0 80 E0 00 E1 80 E1 C0 E1 00 E3 ................
00000060 80 E3 C0 E3 C0 E3 C0 E4 40 E5 C0 E5 80 E6 80 E6 ........@.......
...
Thanks again!
Deron
|