Re: device emulator?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 08, 2011 at 08:29:05PM -0700, Chris Furlough wrote:
> >Wait, you want to emulate a USB device on the same host as the kernel is
> >running on in host mode, or to be a USB device and connect it to a host?
> 
> I want to emulate a device so that user mode applications can be
> developed in the absence of the hardware.
> (Since it's not ready yet, but the timeline is VERY compressed, so
> we need to get the developers up and going
> quickly, and a driver that emulates the hardware is the easiest way.)
> 
> ><snip>
> >
> >No, you can't do this at all, usbfs is to control a USB device from a
> >userspace program, which I think it not what you really want to do,
> >right?
> 
> That's EXACTLY what I want to do.  I want my driver to register
> itself with USBFS, and for their code (excerpted in the 1st e-mail),
> to be able to find, and interact with my driver as though I were the
> real hardware.

Then why not just act like the real hardware, as a USB gadget, and
connect to the host either virtually (through the dummy gadget
controller) or for real, with one of the PCI USB gadget devices?

As you are an audio device, you will want to be interacting with the
audio subsystem of the host system, which means you don't want to write
all new code for that as Linux already provides the needed class drivers
for that today (as do other operating systems).

Or, if you are a "special" device, then you need to write your own host
side driver for every operating system you want to run on, or use libusb
to write a userspace interface to the device which will work on all
operating systems.  But either way, your "testing" code needs to emulate
a USB gadget device, and not be a driver on the host side of the USB
connection.

good luck,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux