ADB (android debug bridge) access to MiniX media player

I’ve recently purchased a tiny, Android-based “MiniX” clone media player from DX.com. Primarily for my own records, this post summarises how I established an ADB link over the MiniX’s OTG USB port via my FreeBSD 8.3-PRERELEASE home server.  It might be of interest to you if you’re reading this and you’re not me.

Before we get too excited, I’m not running ADB natively from inside FreeBSD. Instead, I’m running Windows XP inside a VirtualBox virtual machine (VM) on my FreeBSD server, and passing through the MiniX’s USB connection through VirtualBox to the WinXP VM.

How the MiniX OTG USB interface initially appears under FreeBSD

I’ve documented here what the MiniX’s OTG USB port looks like when plugged into a FreeBSD 8.x system. Superficially it appears as one or more /dev/daX drives (where /dev/da0 is a 2GB drive from one half of the MiniX’s internal 4GB Flash storage).

Making the MiniX visible inside my WinXP VM

I am currently running VirtualBox 4.1.18_OSE under FreeBSD 8.3-PRELEASE. The first step is to add the MiniX as a recognised USB device within VirtualBox’s USB filter section for my WinXP VM.

First I plug the MiniX OTG USB port into my FreeBSD host. Within VirtualBox (in the context of my WinXP VM) I go to “Add USB filter from device” and select the option “USB Developer Android”. In my case this adds a new device with Vendor ID 0x18d1, Product ID 0x0003 and Serial Number 20080411. My WinXP VM was running at the time, but did not immediately ‘see’ the new device. However, unplugging and re-plugging in the USB cable to the MiniX was sufficient for the WinXP VM to now ‘see’ the MiniX.

Initially the WinXP VM sees only a collection of new external removable drives appear (equivalent to the da0 – da7 drives seen under FreeBSD). To go any further we need to install the Google USB drivers from the Android SDK.

Installing the Google USB drivers for ADB access

To get the Google USB drivers (and ADB itself) I installed the latest Windows Android SDK into my WinXP VM (in particular, http://dl.google.com/android/installer_r20.0.3-windows.exe linked off http://developer.android.com/sdk/index.html). Ensure “Extras -> Google USB Driver” is selected inside the SDK Manager as one of the components to download and install. This provides the driver code and configuration files required for ADB to talk to the MiniX.

Once the SDK and “Google USB Driver” is installed, you need to edit C:\Program Files\Android\android-sdk\extras\google\usb_driver\android_winusb.inf to include a new entry using the MiniX vendor ID and USB product ID’s:

;Google MiniX
%SingleAdbInterface% = USB_Install, USB\VID_18D1&PID_0003&MI_01

This entry goes under the [Google.NTx86] section, since I’m running a 32-bit copy of WinXP.  (At this stage I’m unsure if the above line is sufficient for all ADB requirements, but so far it has worked well enough that I can launch an ADB shell on the MiniX from my WinXP VM.)

At this stage the WinXP Device Manager shows the MiniX as an Android device with no driver. With android_winusb.inf updated, I direct WinXP to look for driver(s) under C:\Program Files\Android\android-sdk\extras\google\usb_driver. It successfully ‘finds’ my MiniX device and installs a driver — we are good to move on to the final step, using ADB!

Running ADB from inside WinXP

The adb.exe program is found under C:\Documents and Settings\gja\Local Settings\Application Data\Android\android-sdk\platform-tools, so I cd to this folder and try some basic experiments. First, get a list of the Android devices attached to this WinXP instance:

C:\Documents and Settings\gja\Local Settings\Application Data\Android\android-sdk\platform-tools>adb.exe devices
List of devices attached
20080411 device
C:\Documents and Settings\gja\Local Settings\Application Data\Android\android-sdk\platform-tools>

Not surprisingly, only my MiniX is detected (serial number “20080411”). Subsequent adb.exe commands will default to using this device. (Small tangent — although my PCB’s date suggests this might be a MiniX Plus clone, the device name “20080411” suggests an early MiniX Plus. According to this blog post, more recent MiniX Plus firmware is Android 4.0.4 and identifies itself as “Mini_Xplus” to ADB.)

So now try “adb shell” and gather some internal information on the MiniX:

C:\Documents and Settings\gja\Local Settings\Application Data\Android\android-sdk\platform-tools>adb.exe shell
root@android:/ #
root@android:/ # df
df
Filesystem             Size   Used   Free   Blksize
/dev                   406M    44K   406M   4096
/mnt/asec              406M     0K   406M   4096
/mnt/obb               406M     0K   406M   4096
/system                384M   384M   172K   4096
/data                    1G   166M     1G   4096
/cache                 125M     4M   121M   4096
/mnt/private           988K     4K   984K   4096
root@android:/ #

Very cool — we get a root shell! (Apparently the version of Android shipped with this particular MiniX clone comes already rooted.)

The dmesg command retrieves some more interesting information:

root@android:/ # dmesg
dmesg
<5>[    0.000000] Linux version 3.0.8 (zhj@zhj-laptop) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50) ) #3 PREEMPT Sat Jul 21 12:09:19 CST 2012
<7>[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
<7>[    0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
<7>[    0.000000] Machine: sun4i
<6>[    0.000000] Total Detected Memory: 1024MB with 2 banks
<6>[    0.000000] Memory Reserved(in bytes):
<6>[    0.000000]       LCD: 0x5a000000, 0x02000000
<6>[    0.000000]       SYS: 0x43000000, 0x00010000
<6>[    0.000000]       G2D: 0x58000000, 0x01000000
<6>[    0.000000]       VE : 0x44000000, 0x05000000
<6>[    0.000000]       VE : 0x49000000, 0x01000000
<7>[    0.000000] Memory policy: ECC disabled, Data cache writeback
<7>[    0.000000] On node 0 totalpages: 245760
<7>[    0.000000] free_area_init_node: node 0, pgdat c0803298, node_mem_map c1030000
<7>[    0.000000]   Normal zone: 1280 pages used for memmap
<7>[    0.000000]   Normal zone: 0 pages reserved
<7>[    0.000000]   Normal zone: 146176 pages, LIFO batch:31
<7>[    0.000000]   HighMem zone: 768 pages used for memmap
<7>[    0.000000]   HighMem zone: 97536 pages, LIFO batch:31
<7>[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
<7>[    0.000000] pcpu-alloc: [0] 0
<7>[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 243712
<5>[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/nandd init=/init loglevel=8 mac_addr=00:00:00:00:00:00
<7>[    0.000000] MAC_ADDRESS: 00:00:00:00:00:00
<6>[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
<6>[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
<6>[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
<6>[    0.000000] Memory: 448MB 512MB = 960MB total
<5>[    0.000000] Memory: 833164k/833164k available, 149876k reserved, 393216K highmem
<5>[    0.000000] Virtual kernel memory layout:
<5>[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
<5>[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
<5>[    0.000000]     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
<5>[    0.000000]     vmalloc : 0xe8800000 - 0xf0000000   ( 120 MB)
<5>[    0.000000]     lowmem  : 0xc0000000 - 0xe8000000   ( 640 MB)
<5>[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
<5>[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
<5>[    0.000000]       .init : 0xc0008000 - 0xc0031000   ( 164 kB)
<5>[    0.000000]       .text : 0xc0031000 - 0xc07b70e0   (7705 kB)
<5>[    0.000000]       .data : 0xc07b8000 - 0xc080d5a0   ( 342 kB)
<5>[    0.000000]        .bss : 0xc080d5c4 - 0xc09c9eb8   (1779 kB)
<6>[    0.000000] SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
<6>[    0.000000] NR_IRQS:96 nr_irqs:96 96
<6>[    0.000000] timer0: Periodic Mode
<7>[    0.000000] sw_timer_init,line:397
<6>[    0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
<7>[    0.000000] aw_clksrc_init, line:338
<6>[    0.000000] Console: colour dummy device 80x30
<6>[    0.000090] Calibrating delay loop... 1001.88 BogoMIPS (lpj=5009408)
     [..... and so forth....]

Okay, so my ADB access appears at least sufficient for shell access, yay! The dmesg output confirms I appear to have a MiniX clone with 1GB of  RAM (in two banks).

More experimentation to come!

Advertisements

4 comments

  1. Tell me, please, where to get the usb-cable for this gadget

  2. Thank you very much, but I have made a this cable from old unneeded cables.
    for free 🙂

  3. […] thread on a Russian forum Some say MiniX comes rooted, but some say newer ones don’t. But there seems to be a way to root them still. If the device […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: