Offline
Newbie
Karma: 0
Posts: 3
|
 |
« on: October 04, 2012, 06:49:01 pm » |
Hi all, my boss wants me to use an Arduino UNO r3 to emulate an "USB audio device" that has specific vendor id, vendor name, product id, product name, etc.. Is it possible with the Arduino UNO r3? And if so, how can I do that?
Thank you
|
|
|
|
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #1 on: October 05, 2012, 02:27:48 am » |
You'll have to re-program the Atmega16U2, used as the USB/Serial converter. Its code is in <arduino-dir>/hardware/arduino/firmwares/arduino-usbdfu.
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #2 on: October 06, 2012, 07:34:31 am » |
Assuming you get the Arduino to pretend to be this unknown "USB audio device", then what? What exactly do you intend to have the Arduino do? Generating audio data is not something that the Arduino is particularly good at. Using audio data is not something that the Arduino is particularly good at.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #3 on: October 06, 2012, 10:48:22 am » |
Well, I've been asked to use the Arduino UNO r3 to test a driver on a Linux machine. This driver is used to interact with an audio device that i don't have at the moment. However, I have the protocol used by this device to communicate with the driver. So, in order to test the driver, I have to emulate this device's vendor id, vendor name, product id, product name, etc. otherwise Linux will not load the driver.
As you may have already figured out, I don't have much experience with Arduino, so if you have any idea/tip/suggestion, please let me know. At the moment, I am going through the USB/Serial converter code looking for vendor id, vendor name, etc., but I am not really sure what to do once I find them.
Do you think it's easier to just buy an Arduino USB Host and use that to emulate my audio device?
|
|
|
|
« Last Edit: October 06, 2012, 10:49:56 am by dlxsf »
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #4 on: October 06, 2012, 12:48:45 pm » |
Do you think it's easier to just buy an Arduino USB Host and use that to emulate my audio device? Is the device you are trying to emulate a USB host device? If not, then you don't want to use a host shield.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #6 on: October 07, 2012, 05:32:00 am » |
Lots of posts that won't do you much good -what a pain they are Not sure what you mean by that. Reprogramming the Atmega16U2, using the supplied code (in <arduino-dir>/hardware/arduino/firmwares/arduino-usbdfu) will do what the OP asked for.
|
|
|
|
« Last Edit: October 07, 2012, 06:44:55 am by dxw00d »
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 3
Posts: 218
Arduino rocks
|
 |
« Reply #7 on: October 08, 2012, 03:17:26 pm » |
So can you tell us what this is . What does it do? Can we refer to any sites that will give us this info.
arduino-usbdfu does not mean very much on its own
How will it do what the OP wants?.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #8 on: October 09, 2012, 06:55:42 pm » |
Thank you april for the link to v-usb. This project looks really what I was looking for!
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 0
Posts: 592
|
 |
« Reply #9 on: October 09, 2012, 07:10:04 pm » |
LUFA features both AudioInput and AudioOutput demonstrations, this is EXACTLY what you are looking for, modify the makefile for the ATmega16U2 and you should be good to go
|
|
|
|
|
Logged
|
I'm an electrical engineering student. I designed the USnooBie (V-USB dev kit) which is sold at Seeed Studio 
|
|
|
|
0
Offline
Full Member
Karma: 3
Posts: 218
Arduino rocks
|
 |
« Reply #10 on: October 10, 2012, 05:14:22 am » |
I was interested to have a look at this also went here https://code.google.com/p/lufa-lib/downloads/detail?name=LUFA-120730.zipdownloaded ,installed doxygen and tried to compile . Mass of errors related to pin names I think -here is a small part-I'll go elsewhere and try it again In file included from ../../LUFA/../LUFA/Drivers/Peripheral/Serial.h:68:0, from Benito.h:48, from Benito.c:37: ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h: In function 'Serial_Init': ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:174:5: error: 'UBRR1' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:176:5: error: 'UCSR1C' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:176:21: error: 'UCSZ11' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:176:37: error: 'UCSZ10' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:177:5: error: 'UCSR1A' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:177:35: error: 'U2X1' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:178:5: error: 'UCSR1B' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:178:21: error: 'TXEN1' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:178:37: error: 'RXEN1' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:180:5: error: 'DDRD' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:181:5: error: 'PORTD' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h: In function 'Serial_Disable': ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:187:5: error: 'UCSR1B' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:188:5: error: 'UCSR1A' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:189:5: error: 'UCSR1C' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:191:5: error: 'UBRR1' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:193:5: error: 'DDRD' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:194:5: error: 'PORTD' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h: In function 'Serial_IsCharReceived': ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:204:14: error: 'UCSR1A' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:204:29: error: 'RXC1' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h: In function 'Serial_SendByte': ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:214:14: error: 'UCSR1A' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:214:29: error: 'UDRE1' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:215:5: error: 'UDR1' undeclared (first use in this function) ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h: In function 'Serial_ReceiveByte': ../../LUFA/../LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h:228:12: error: 'UDR1' undeclared (first use in this function) Benito.c: In function 'main': Benito.c:101:8: error: 'UCSR1A' undeclared (first use in this function) Benito.c:101:23: error: 'UDRE1' undeclared (first use in this function) Benito.c:103:4: error: 'UDR1' undeclared (first use in this function) Benito.c:110:7: error: 'TIFR0' undeclared (first use in this function) Benito.c:110:21: error: 'OCF0A' undeclared (first use in this function) Benito.c:113:19: error: 'TOV0' undeclared (first use in this function) Benito.c:119:5: error: 'DDRD' undeclared (first use in this function) Benito.c: In function 'SetupHardware': Benito.c:175:2: error: 'MCUSR' undeclared (first use in this function) Benito.c:175:18: error: 'WDRF' undeclared (first use in this function) Benito.c:176:2: error: 'WDTCR' undeclared (first use in this function) Benito.c:176:2: error: 'WDCE' undeclared (first use in this function) Benito.c:176:2: error: 'WDE' undeclared (first use in this function) Benito.c:183:2: error: 'OCR0A' undeclared (first use in this function) Benito.c:184:2: error: 'TCCR0A' undeclared (first use in this function) Benito.c:184:17: error: 'WGM01' undeclared (first use in this function) Benito.c:185:2: error: 'TCCR0B' undeclared (first use in this function) Benito.c:185:18: error: 'CS01' undeclared (first use in this function) Benito.c:185:32: error: 'CS00' undeclared (first use in this function) Benito.c:188:2: error: 'PORTD' undeclared (first use in this function) Benito.c:189:2: error: 'DDRD' undeclared (first use in this function) Benito.c: In function 'EVENT_CDC_Device_LineEncodingChanged': Benito.c:238:24: error: 'UPM11' undeclared (first use in this function) Benito.c:238:39: error: 'UPM10' undeclared (first use in this function) Benito.c:246:24: error: 'USBS1' undeclared (first use in this function) Benito.c:251:24: error: 'UCSZ10' undeclared (first use in this function) Benito.c:254:24: error: 'UCSZ11' undeclared (first use in this function) Benito.c:262:2: error: 'UCSR1B' undeclared (first use in this function) Benito.c:263:2: error: 'UCSR1A' undeclared (first use in this function) Benito.c:264:2: error: 'UCSR1C' undeclared (first use in this function) Benito.c:267:2: error: 'UBRR1' undeclared (first use in this function) Benito.c:271:17: error: 'U2X1' undeclared (first use in this function) Benito.c:272:18: error: 'RXCIE1' undeclared (first use in this function) Benito.c:272:34: error: 'TXEN1' undeclared (first use in this function)
|
|
|
|
« Last Edit: October 10, 2012, 05:16:29 am by april »
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #11 on: October 10, 2012, 05:22:01 am » |
Which Arduino or ATmega are you using? I believe UCSR1C is one of the additional USARTs on a Mega1280/2560.
|
|
|
|
|
Logged
|
|
|
|
|
|