Trying combined USB audio in and out on LPC1857

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trying combined USB audio in and out on LPC1857

1,522 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Skyle on Thu Jun 20 03:59:08 MST 2013

I am trying to create an example with both a Mic and a speaker, using tje LPC open (1.03) USB lib. Using the support for the built in USB drivers. I have succeeded in geting microphone axample to work, and the speaker example works. But i am now trying to merge them into a combined device. The enumeration fails when I try to connect to a PC.


 


I am unsure if I just do something wrong with the descripotrs, or if there is something more "devious" with the code. I am unsure about how to handle the structure: USB class info. In the mic example it cintains the In endpoint number, in the speaker example it contains the out endpoint number (same?) and by looking at the initi code where the structure is referenced, it seems not to be possible to finn in both endpoint variables.


 


Hope someone has an example to share.


 


/Skyle

Labels (1)
0 Kudos
Reply
5 Replies

1,360 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by davyarm on Thu May 21 13:59:27 MST 2015
Have you guys been able to make it work?

Can you please provide the descriptors file?

Thanx!
0 Kudos
Reply

1,360 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Mon Jun 24 09:37:10 MST 2013

Assign different endpoint number to the endpoints, each other.


LPCOpen (and nxpUSBlib) has specific restriction on the endpoints assignment: just one endpoint, IN or OUT, on single endpoint number. Neither USB on-chip driver nor hardware have such a restriction.


Anyway, why do you need LPCOpen over the USB on-chip driver?


Tsuneo

0 Kudos
Reply

1,360 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Skyle on Mon Jun 24 07:21:34 MST 2013

This suggestion is close to what I was already testing, I have now managed to get it enumerated as a combined device with speaker and mic.


But the transfer does not work, if i look at the function UsbdAdc_Init it seems to be made to work with either one out endpoint or one in endpoint, the same goes for several of the other functions that are being used from the usbd_adcuser.c file. 


Maybe I should try with the non rommed version of the stack?

0 Kudos
Reply

1,360 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Fri Jun 21 05:44:02 MST 2013


Quote:
combined USB audio in and out



Of course, you may have a composite device of two pairs of audio interfaces, bound by IAD

Configuration descriptor
- IAD
-- Audio Control interface / headaer / input-feature-output terminal
-- Audio Streaming interface (zero bandwidth) / interface / CS inteface / Format type / endpoint / CS endpoint
- IAD
-- Audio Control interface / headaer / input-output terminal
-- Audio Streaming interface (zero bandwidth) / interface / CS inteface / Format type / endpoint / CS endpoint

But more popular method is,
You may have additional streaming interface under single audio control interface.

Configuration descriptor
- Audio Control interface / headaer / input-feature-output terminal (OUT) / input-output terminal (IN)
- Audio out Streaming interface (zero bandwidth) / interface / CS inteface / Format type / endpoint / CS endpoint
- Audio in Streaming interface (zero bandwidth) / interface / CS inteface / Format type / endpoint / CS endpoint

1) Start with the descriptor set of the speaker example.
2) Drag in these descriptors from the microphone example,
- Copy the input and output terminal descriptors of microphone, to the end of Audio Control interface
- Append entire Audio IN Streaming interface set at the end.

3) Tune these descriptor fields
- Configuration: wTotalLenth (sum up the size of all of descriptors), bNumInterfaces (3)
- AC header: wTotalLength (add the size of input and output terminal descriptors)
- input terminal (copied): bTerminalID (4)
- output terminal (copied): bTerminalID (5), bSourceID (4)
- Interface (straming in, zero-bandwidth): bInterfaceNumber (2)
- Interface (straming in, alternate): bInterfaceNumber (2)
- CS interface (straming in): bTerminalLink (5)
- Endpoint (straming in): bEndpointAddress

On Windows, you would be better to assign another VID/PID to the device,
or if you wouldn't change the VID/PID, delete (uninstall) existing device instances of this VID/PID,
to make your new configuration recognized.

Tsuneo
0 Kudos
Reply

1,360 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Thu Jun 20 07:52:32 MST 2013

Skyle
You will need to create descriptors defining your product as a composite device.  You will find an app note on this subject at: <a href="http://www.lpcware.com/content/nxpfile/an11018-usb-composite-device-lpc134x-software-v20">http://www.lpcware.com/content/nxpfile/an11018-usb-composite-device-lpc134x-software-v20</a>
Although the app note is written for a different device, and different classes, the process is the same.
If you do a search for composite devices on the LPCware forum, and other places on web, you will find lots of information about composite USB devices.


-Paul

0 Kudos
Reply