Top question: Does the Isochronous IN endpoint have to work perfectly
before a new USB Audio Class Device will appear in Audio MIDI Setup?
I have not been able to test my ISO endpoint because my Descriptors
don't seem to make CoreAudio happy. I've been laboring under the
assumption that I can start by getting the Descriptors correct, see
my Device in AMS, then start debugging my ISO IN transfers (hopefully
without too many serious errors, otherwise CoreAudio could get really
unhappy). I also assume that my ISO IN endpoints will not be
activated until some CoreAudio client opens my microphone device for
recording, but I'm guessing that it's possible CoreAudio might run a
quick test (for 20 seconds?) that my device firmware fails.
More below...
On Nov 27, 2011, at 14:45, Andy Peters wrote:
On Nov 27, 2011, at 2:41 AM, Brian Willoughby wrote:
I am developing firmware for a USB Audio Class 1.0 input device
which is marked as a Microphone. It has 4 channels of 12-bit (16-
bit) audio at 125 kHz. USB Prober seems happy to display my
device when attached (after about 20-seconds of delay), but it
does not appear in Audio MIDI Setup. I assume that I may need to
add a Feature or other Unit before AMS will display my device.
Is there any documentation as to what I need to support in order
to allow my device to be used for audio input?
So far, I have tested on 10.4.11 since I hope to maintain maximum
compatibility across Mac platforms. This also explains why I am
starting with USB Audio Class 1.0 instead of 2.0 (my device is
Full Speed).
Note: For the channel count, bit depth, and sample rate of my
device, the maximum packet size turns out to be 1008 bytes, which
seems within the capabilities of the system. I also tried 1000
bytes with no difference.
You need to have all of the various Feature Units and Terminals set
up (Mic Input Terminal, Feature Unit for gain if hardware supports
it, USB In terminal). These are necessary for all input channels.
My two-input device has these and it shows up in AMS fine. My
device also enumerates as Audio Class 1.0 because a) it doesn't
need High Speed and b) it can't support the various other things
required by 2.0.
The documentation I used was the USB Audio Class reference and a
couple of TI's examples.
Thank you for the reply. Which TI examples did you reference? I
happen to be writing firmware for the TMS320VC5506, which does not
have any USB Audio Class examples. They do provide examples for the
High Speed members of this family, but not the Full Speed members.
I implemented the Descriptors from Appendix B of the Audio Class 1.0
document, changing only the channel counts, bit depth, and sample
rate. That example has only an Input Terminal (Mic) and Output
Terminal (USB) with no Feature Units. My hardware does not support
gain, so this seems appropriate.
I decided to try with mono instead of quad, so that my Descriptors
almost perfectly match the UAC1 appendix B example.
There may be something amiss because I grabbed a USB Audio interface
and it did not show up either, until I rebooted my Mac. Perhaps my
Descriptors confused the USB Audio driver. Now that I've rebooted,
the commercial USB Audio interface appears in AMS, but mine does
not. I can remove and insert the commercial device and AMS responds
appropriately, but my device gets no response except from USB Prober
(where it takes about 20 seconds for my device to appear instead of
the usual instantaneous response).
Here are the Descriptors from USB Prober:
Full Speed device @ 3
(0x0B110000): .............................................
Composite device: "Soundplane Audio"
Device Descriptor
Descriptor Version Number: 0x0100
Device Class: 0 (Composite)
Device Subclass: 0
Device Protocol: 0
Device MaxPacketSize: 8
Device VendorID/ProductID: 0x0451/0x9001 (Texas
Instruments)
Device Version Number: 0x0100
Number of Configurations: 1
Manufacturer String: 1 "Sound Consulting"
Product String: 2 "Soundplane Audio"
Serial Number String: 3 "0000 "
Configuration Descriptor
Length (and contents): 100
Raw Descriptor (hex) 0000: 09 02 00 64 02 01 00 80
BD 09 04 00 00 00 01 01
Raw Descriptor (hex) 0010: 00 00 09 24 01 00 01 1E
00 01 01 0C 24 02 01 01
Raw Descriptor (hex) 0020: 02 00 01 00 00 00 00 09
24 03 02 01 01 00 01 00
Raw Descriptor (hex) 0030: 09 04 01 00 00 01 02 00
00 09 04 01 01 01 01 02
Raw Descriptor (hex) 0040: 00 00 07 24 01 02 01 01
00 0B 24 02 01 01 02 10
Raw Descriptor (hex) 0050: 01 40 1F 00 09 05 81 05
12 00 01 00 00 07 25 01
Raw Descriptor (hex) 0060: 00 02 00 00
Number of Interfaces: 2
Configuration Value: 1
Attributes: 0x80 (bus-powered)
MaxPower: 378 ma
Interface #0 - Audio/Control
Alternate Setting 0
Number of Endpoints 0
Interface Class: 1 (Audio)
Interface Subclass; 1 (Control)
Interface Protocol: 0
Audio Control Class Specific Header
Descriptor Version Number: 01.00
Class Specific Size: 30
Number of Audio Interfaces: 1
Audio Interface Number: 1
Dump Contents (hex): 09 24 01 01 00 00 1E 01 01
Audio Class Specific Input Terminal
Terminal ID: 1
Input Terminal Type: 0x201 (Microphone)
OutTerminal ID: 0 [NONE]
Number of Channels: 1
Spatial config of channels: 0000000000000000
String index for first logical channel: 0
Terminal Name String Index: 0 [NONE]
Audio Class Specific Ouput Terminal
Terminal ID: 2
Output Terminal Type: 0x101 (USB Isochronous Stream)
InTerminal ID: 0 [NONE]
Source ID: 1
Terminal Name String Index: 0 [NONE]
Interface #1 - Audio/Streaming
Alternate Setting 0
Number of Endpoints 0
Interface Class: 1 (Audio)
Interface Subclass; 2 (Streaming)
Interface Protocol: 0
Interface #1 - Audio/Streaming (#1)
Alternate Setting 1
Number of Endpoints 1
Interface Class: 1 (Audio)
Interface Subclass; 2 (Streaming)
Interface Protocol: 0
Audio Control Class Specific Header
Audio Stream General
Endpoint Terminal ID: 2
Delay: 1 frames
Format Tag: 0x0001 (PCM)
Audio Class Specific Audio Data Format
Audio Stream Format Type Desc.
Format Type: 1 PCM
Number Of Channels: 1 MONO
Sub Frame Size: 2
Bit Resolution: 16
Sample Frequency Type: 0x01 (Discrete)
Sample Frequency: 8000 Hz
Endpoint 0x81 - Isochronous Input
Address: 0x81 (IN)
Attributes: 0x05 (Isochronous asynchronous data
endpoint)
Max Packet Size: 18
Polling Interval: 1 ms
Class-Specific AS Audio EndPoint - Control output
Attributes: 0x00
bLockDelayUnits: 0x02 (Decoded PCM Samples)
wLockDelay: 0 Decoded PCM Samples
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden