[Galaxy S I9000 Android Development] magurin:
Connect USB devices to your Nexus One

Required hardware

- Rooted Nexus One (threads from others @ xda-developers for the G1/Desire/Incredible) with QSD8250 SoC

- USB OTG cable with Micro B plug (e.g., advantage: ID pin connected to ground for future auto detection) or Micro USB cable and adapter

- Powered USB 2.0 hub. Hubs known to provide their power to the upstream port:

TiVECO TM-UH710

- Trust HU-5870V

If your hub doesn't provide its power to the upstream port (the Nexus One isn't charged): USB Dual Power Cable (e.g.), since the Nexus One doesn't provide bus power to the hub chip

For mobile use: battery (e.g.) (measurements)

Software based on Android version: 2.2.1; Kernel version: 2.6.32.9-27240-gbca5320; Build number: FRG83D

Download binaries…

boot.img or zImage

Kernel modules (Mind /system/lib/modules/bcm4329.ko !)

…or build from source

git clone h t t p:// github.com/sonic74/kernel_msm.git

cd kernel_msm

make -j2 ARCH=arm CROSS_COMPILE=/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-

Install kernel

Boot from RAM (till next reset)…

/android-sdk-linux_86/tools/fastboot boot arch/arm/boot/zImage

…or write to flash (extract ramdisk.img from your nandroid backup)

/getramdisk.py /boot.img

From PC…

/android-sdk-linux_86/tools/fastboot -b 0x20000000 flash:raw boot arch/arm/boot/zImage /ramdisk.img

…or on the phone

/mydroid/out/host/linux-x86/bin/mkbootimg --kernel arch/arm/boot/zImage --ramdisk /ramdisk.img --base 0x20000000 -o boot.img

adb push boot.img /sdcard

adb shell

flash_image boot /sdcard/boot.img

reboot

Start ConnectBot, enable full screen and connect to Local

su

insmod drivers/usb/core/usbcore.ko

# Ignore the Unbalanced enabled for IRQ 58 stack trace for now

insmod drivers/usb/host/ehci-hcd.ko

Substitute device mode over TCP/IP (or port Andrew de Quincey's work)

adb

adb connect IP_address:5555

Filesystem access

Nexus One's

On Air (Vista/7 WebDAV registry patch, ro)

nandroid

PC's

insmod fs/cifs/cifs.ko

mount -t cifs -o username=username //IP_address/share /mnt/sdcard/cifs

HID input devices

insmod drivers/hid/usbhid/usbhid.ko

X11

/etc/X11/xorg.conf

apt-get install lxde

startx

USB storage

insmod drivers/usb/storage/usb-storage.ko

# Wait for device enumeration

mount -t vfat /dev/block/sda1 /mnt/sdcard/usb-storage

Ethernet

insmod drivers/net/usb/usbnet.ko

insmod drivers/net/usb/asix.ko

dhcpcd eth1

setprop net.dns1 IP_address

External displays

Hardware

DisplayLink device

Software

SlugTerm DL

mount -t usbfs none /proc/bus/usb

/data/local/bin/slugterm -k /dev/input/event8 -p 0377 -i 00cfa43c4e5573712b7152ffffeeca0640e257fffffff904b00402907e -f /mnt/sdcard/usr/local/share/fonts/FON2FNT/dosapp_18.FNT -c /system/bin/sh

Framebuffer

insmod drivers/video/syscopyarea.ko

insmod drivers/video/sysfillrect.ko

insmod drivers/video/sysimgblt.ko

insmod drivers/video/fb_sys_fops.ko

# Source; delete select FB_DEFERRED_IO in Kconfig

insmod drivers/staging/udlfb/udlfb.ko

# Wait for device enumeration

Android framework

chmod 666 /dev/graphics/fb1

/system/build.prop:

dalvik.vm.heapsize=42m

Framebuffer fb=new Framebuffer(1);

Bitmap bm=fb.createBitmap();

fb.tranfer(bm, true);

Also included: Display images on a DisplayLink device from all Android apps through SEND Intent:

Console (Warning: once it scrolled, Nexus One won't shutdown completely)

insmod drivers/video/console/font.ko

insmod drivers/video/console/softcursor.ko

insmod drivers/video/console/bitblit.ko

insmod drivers/video/console/fbcon.ko

Android framework

chmod 666 /dev/console

PrintWriter pw=new PrintWriter("/dev/console");

pw.println("Hello Android!");

X11

Lenny

/etc/X11/xorg.conf

/usr/local/lib/xorg/modules/drivers/displaylink_drv.so (Source)

Squeeze

/etc/X11/xorg.conf

/usr/local/lib/xorg/modules/drivers/fbdev_drv.so (Source)

As primary display (BeagleBoard)

Audio/MIDI devices

insmod sound/soundcore.ko

insmod sound/core/snd.ko

insmod sound/core/snd-timer.ko

insmod sound/core/snd-hrtimer.ko

insmod sound/core/snd-page-alloc.ko

insmod sound/core/snd-pcm.ko

insmod sound/core/snd-rawmidi.ko

insmod sound/core/snd-hwdep.ko

insmod sound/usb/snd-usb-lib.ko

insmod sound/usb/snd-usb-audio.ko

Android framework

insmod sound/core/oss/snd-mixer-oss.ko

insmod sound/core/oss/snd-pcm-oss.ko

chmod 666 /dev/snd/dsp

FileInput/OutputStream("/dev/snd/dsp")

TV Receivers

Hardware

Receiver (e.g. DVB-T)

ALSA Audio device

Software

mplayer scripts (720×480: ~25 FPS)

Refresh DisplayLink device periodically (Source) (720×288: some FPS)

Ideas to enable deinterlacing and scaling

MSM/QSD X-Window Enablement Project including XVideo

OpenMAX (seems to be supported by VLC 1.1)

Android native SurfaceFlinger output plugin

MORE INFO: h t t p : //sven.killig.de/android/N1/2.2/usb_host/[/QUOTE]