Libdvdread.plus: Difference between revisions

From Lundman Wiki
No edit summary
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
Documentation for FXP.One API commands and protocol. This documentation file is maintained at
=== MeLE A2000 ===
http://www.lundman.net/wiki/index.php?title=Protocol and exported to other formats. This documentation is purposly maintained rigorously as to aid all client developers of FXP.One.


=== Mele file storage ===


== Connecting ==
http://www.lundman.net/ftp/mele/




=== WELCOME ===
=== Status ===


When you connect to the FXP.One server, you should receive a greeting
Current status with the Mele A2000, Allwinner A10.
string, similar to:


>> WELCOME|name=FXP.Oned|version=0.1|build=18|SSL=optional
Official release: Android 4 ICS, 4.0.8.
Kernel: 3.0.31+


Pay special attention to the SSL flag here, since if it is enforced,
'''Positive:'''
and you attempt plain text authentication (which will fail) you are
* Video playback 1080p
exposing the user and password.
* MKV playback
* TS playback
* YouTube
* Android market and Games (Angry Birds etc)


The "version" is the server version and build
'''Negative:'''
The "protocol" is the protocol version, which you can check to be of
* <s>Network Streaming</s> Fixed. NIC has been patched to allow smooth 1080p steaming
the same Major type as your application knows.
* Audio. The settings; '''CODEC''' no sound, but probably on RCA. '''HDMI''' choppy sound, unusable. If made to work, only '''stereo''' on HDMI. '''SPDIF''' not working, does not turn on. (No red light)
* Bitstreaming; Unconfirmed since SPDIF is not functional. But can the hardware bitstream TrueHD, and DTS-MA ?
* 10bit video does not play (not supported by hardware, CPU too slow for software)
* AVI/XviD does not play (not supported by hardware, CPU too slow for software)


The "SSL" field can be "disabled", "optional", and "forced".
Currently, it is no good for mediaplayer. But if all you want is a toy to play youtube, some android games, and only stereo sound, it is definitely capable.




=== SSL ===
=== Android 4 ICS wired NIC patch ===


Initiate SSL challenge. This is sent by clients requesting the
I have been working on trying to improve the '''wemac''' NIC driver in the Mele A2000 Allwinner A10 hardware, which will stutter when playing 720p/1080p over network. The current patch makes it much better, such that I think it is usable now. There is a '''mynewerimage.img''' image in the storage area, that you can '''dd''' to the '''nandc''' device. I will work on submitting the patch upstream.
remainder of the session to be in SSL. This requires that FXP.One
engine's WELCOME message is either "forced" or "optional".


For example, if you boot miniand image:


  [ Minimal Required Fields]
  # modprobe nand    # nand.ko on my storage area too
# wget http://lundman.net/ftp/mele/mynewerimage.img
# dd if=/dev/nandc of=mele_nandc_backup.bin bs=65536
# dd if=mynewerimage.img of=/dev/nandc bs=65536
# sync
# reboot -f


[ Optional Arguments ]
And take out the SD card to boot Android again. If you do this using Android, the device node is /dev/block/nandc


[ Returns ]
=== Android 4 ICS official Mele image ===
>> CODE=<int>      - Command return status CODE.
>> OK              - Initiation request accepted, start SSL phase.
>> MSG              - Human-readable message string


[ Example ]
The official Mele Android ICS image is out, called '''Mele_HTPC_Android_4.0_V1.rar''' which you need to use PhoenixCard to "burn". Once installed, you can use '''audiopatch1.3.apk''' to enable some sound features. Otherwise it seems quite similar to A10 firmware.  
<< SSL 
>> SSL|CODE=0|Msg=Attempting SSL negotiations.


For those not using Windows, I also made a '''dd''' image: '''Mele_HTPC_Android_4.0_V1.ddimg.bin.bz2''' [http://lundman.net/ftp/mele/Mele_HTPC_Android_4.0_V1.ddimg.bin.bz2] Just dd the whole thing to your raw device.


=== AUTH ===
=== Android 4 IceCreamSandwich ===


Send USER and PASS for authentication. This requires a valid user and
'''Update: the non-beta release of ICS4 came out (for the A10, not Mele's release), which has settings/display, and lets you chose resolution '''
password pair already registered on FXP.One. If FXP.One was started
with no user database files, it will create one with the account user
"admin" and password "admin".


For Unix and clones:
wget http://www.lundman.net/ftp/mele/homlet_4.0_v1.0_20120609_dd.img.lzma
7z x homlet_4.0_v1.0_20120609_dd.img.lzma
sudo dd if=homlet_4.0_v1.0_20120609_dd.img of=/dev/sdX bs=1M
sync


[ Minimal Required Fields]
Where you need to replace X in /dev/sdX by the correct letter for your SD card reader.
Now insert the SD card in your Mele, and wait until the LED stops blinking, remove the SD card and restart the device. Et voila!
>> USER=<str>      - USER name
(Read more: [http://www.cnx-software.com/2012/06/18/mele-a1000a2000-android-4-0-image-released/#ixzz1ylfoeKQc]) See I kept the paste URL cos I'm nice! :)
>> PASS=<str>      - PASSWORD


[ Optional Arguments ]


[ Returns ]
>> CODE=<int>      - Failure code.
>> MSG=<str>        - Human readable string message.


[ Example ]
There is also an audiopatch for the ICS4 image to get sound to work. Copy over '''audiopatch1.2.apk''' (adb, or physical media) to your ICS4, install and run.
<< AUTH|USER=admin|PASS=admin
>> AUTH|CODE=0|MSG=Successful
>> AUTH|CODE=502|MSG=Login incorrect
>> AUTH|CODE=503|MSG=Secure channel enforced.


Not convinced it makes any difference for me. Audio appears not to work still.


== SITES ==
It appears the contents on audiopatch1.2 is pretty much just libswa.so. Not entirely sure what it thinks to do with it, but if I do a '''find''' from root, there is no such library, before and after running patch.


For SITE structure definition, see [[Site_Definition]]
I copied the file by hand:
http://www.lundman.net/wiki/index.php/Site_Definition


=== SITEADD ===
busybox cp /data/data/com.android.audiopatch/files/libswa.so /system/lib/


Add a new site to the system.
and I get sound playing videos with some audio formats now. Like, TV MKV releases.


[ Minimal required fields ]
=== Mele A2000 ===
>> NAME=<str>      - Name of site. Not used by engine, need not be unique. 
>> HOST=<str>      - Hostname of remote FTP server
>> USER=<str>      - User name for authentication on remote FTP server
>> PASS=<str>      - and password


[ Optional Arguments ]
I purchased a MeLE A2000 from Tom over at [http://www.aliexpress.com/product-fm/546571245-Mele-A2000-TV-box-Allwinner-A10-hackable-device-wholesalers.html aliexpress], and been playing around with it as well. First I wanted to install ICS4, to do that I downloaded the '''android_4.0.img''' file from the 'net. Alas, there is a large volume of confusing information on what to do with this.
>> PORT=<int>      - Optional PORT of remote FTP server. Default 21.
>> PASSIVE=<yna>  - Use passive for directory listings? [See YNA type]
>> FXP_PASSIVE=yna - Can this remote FTP only take PASV, or PORT?
>> CONTROL_TLS=yna - Attempt SSL/TLS on Control channel?
>> DATA_TLS=<yna>  - Attempt SSL/TLS on Data channel? Site needs CCSN feat
>> IFACE=<ip>      - Optional IP to bind() to.
>> IPORT=<int>    - Optional PORT to bind() to.
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [See YNA type]
                    - AUTO and engine will set Binary for transfers.
>> RESUME=<yna>    - Attempt to Resume before Overwrite.  
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue.
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> FSKIPLIST=<str> - File skip list [2]
>> DSKIPLIST=<str> - Directory skip list [2]
>> FPASSLIST=<str> - File pass list [3]
>> DPASSLIST=<str> - Directory pass list [3]
>> FSKIPEMPTY=<yna>- Skip empty files
>> DSKIPEMPTY=<yna>- Skip empty directories
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top


[1] AUTO means it will use this feature if it is reported by the
[http://www.lundman.net/ftp/mele/ http://www.lundman.net/ftp/mele/]  
remote FTPD in the FEAT/features command reply.
[https://www.wuala.com/zercosz/Mele%20A2000/Firmware/?key=ThisIsFC2012 https://www.wuala.com/zercosz/Mele%20A2000/Firmware/?key=ThisIsFC2012]


[2] Uses fnmatch(3) syntax pattern matching. Most file globbal you can
For the MeLE A2000, I also downloaded '''PhoenixCardV303(win7)''' and installed that in my VirtualBox Win7 system, forwarded the OSX USB drive and told it to install '''android_4.0.img'''.
do on the command line, including "*?[]", but excluding "{}". String
consists of slash separated patterns. eg "*.dat/*readme.txt*".


All skiplists, passlists and movefirst are processed on the DESTINATION site.
[https://www.wuala.com/zercosz/Mele%20A2000/Utilidades%20Mele/?key=ThisIsFC2012 https://www.wuala.com/zercosz/Mele%20A2000/Utilidades%20Mele/?key=ThisIsFC2012]
[http://www.lundman.net/ftp/mele/ http://www.lundman.net/ftp/mele/]


[3] Opposite to skiplist. The default is for passlist to be empty,
After that, I inserted the SD card into Mele, and rebooted.
which is the equivalent of "*". A syntax like "*ENGLISH*" would ensure
only entries which matched string would be queued, and others are
dropped. Uses same pattern syntax as skiplist.


[ Extended Optional Arguments ]
The power LED will blink RED + BLUE for a while, then power LED will turn off.
As a special feature to the clients connecting to the FXP.One engine,
we also allow for storing of own, arbitrary, key/value pairs. As long
as the "key" is not the same as any of the above keys, or that of the
predefined reserved keys. (eg. "TYPE", "END")
>> <str>=<str>    - Store extra client information.


For example:
Take out SDcard, and reboot MeLE. It will now boot ICS, but only on HDMI@720p.


"...|extrafield=somestuff|OS=Unix"
I can confirm BubbleUPNP + 2160pPlayer will play 1080p MKVs over network. Nice!


[ Returns ]
>> SITEID=<int>    - Site ID of created site.
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message.


[ Example ]
=== Google Market/Play ===
>> SITEADD|NAME=local|host=localhost|port=56688|user=mp3|pass=mp3|passive=1|fxp_passive=2|control_TLS=2|data_TLS=2|extrafield=somestuff|OS=Unix
<< SITEADD|CODE=0|SITEID=12|Msg=Added successfully.
 
[ Caveat ]
It is recommended that all clients that wish to store information
in the site database, to prefix their key values with a unique string,
perhaps the name of the application. For example:
lundfxp_sitecmd_1=SITE WHO
lundfxp_lastlogin=015368281


=== SITELIST ===
I installed one of the Terminal programs, and told adb to use TCP (haven't bothered to open my mele yet). Using adb and the instructions found [http://www.slatedroid.com/topic/30855-scripts-allwinner-a10-tablets-google-play-script/ allwinner a10 scripts] I loaded Google Market/Play to the mele.
 
Lists all defined sites.
 
[ Minimal Required Fields]
 
[ Optional Arguments ]
>> SHORT          - Send only short list (siteid + name)
>> SITEID=<int>    - Send only specified siteid. Sends no BEGIN/END keys.
 
[ Returns ]
>> SITEID=<int>    - Site ID being displayed.
>> NAME=<str>      - Name of site. Not used by engine, need not be unique. 
>> HOST=<str>      - Hostname of remote FTP server
>> USER=<str>      - User name for authentication on remote FTP server
>> PASS=<str>      - and password
>> PORT=<int>      - Optional PORT of remote FTP server. [1]
>> PASSIVE=<yna>  - Use passive for directory listings? [See YNA type]
>> FXP_PASSIVE=yna - Can this remote FTP only take PASV, or PORT?
>> CONTROL_TLS=yna - Attempt SSL/TLS on Control channel?
>> DATA_TLS=<yna>  - Attempt SSL/TLS on Data channel? Site needs CCSN feat
>> IFACE=<ip>      - Optional IP to bind() to. [1]
>> IPORT=<int>    - Optional PORT to bind() to. [1]
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [1]
>> RESUME=<yna>    - Attempt to Resume before Overwrite. [1]
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue. [1]
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> FSKIPLIST=<str> - File skip list [1]
>> DSKIPLIST=<str> - Directory skip list [1]
>> FPASSLIST=<str> - File pass list [1]
>> DPASSLIST=<str> - Directory pass list [1]
>> FSKIPEMPTY=<yna>- Skip empty files [1]
>> DSKIPEMPTY=<yna>- Skip empty directories [1]
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top [1]
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top [1]
>> BEGIN          - First item sent,  start of list.
>> END            - Final item was sent, end of list.
 
[1] This information is only sent if the current value differs from
the default "AUTO" type. Or, in the case of strings, where the string
is defined (not-empty).
 
[ Example ]
<< SITELIST|BEGIN
>> SITELIST|SITEID=2|NAME=localhost|HOST=127.0.0.1|PORT=21|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2|optional_variable=roger moore
>> SITELIST|SITEID=1|NAME=localhost2|HOST=127.0.0.1|PORT=56688|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2
>> SITELIST|END
 
<< SITELIST|SHORT
>> SITELIST|BEGIN
>> SITELIST|SITEID=1|NAME=localhost
>> SITELIST|END
 
<< SITELIST|SITEID=2
>> SITELIST|SITEID=2|NAME=localhost|HOST=127.0.0.1|PORT=21|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2|optional_variable=roger moore
 
=== SITEMOD ===
 
Modify an existing site's key/value pairs.  Specify as many items as
desired to be changed. Items not specified in the command are left as
they are. To delete a key/pair, send the key with an empty value
field. For example "key=".
 
[ Minimal required fields ]
>> SITEID=<int>    - Site ID of created site.
 
[ Optional Arguments ]
>> NAME=<str>      - Name of site. Not used by engine, need not be unique. 
>> HOST=<str>      - Hostname of remote FTP server
>> USER=<str>      - User name for authentication on remote FTP server
>> PASS=<str>      - and password
>> PORT=<int>      - Optional PORT of remote FTP server. Default 21.
>> IFACE=<ip>      - Optional IP to bind() to.
>> IPORT=<int>    - Optional PORT to bind() to.
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [See YNA type]
                    - AUTO and engine will set Binary for transfers.
>> RESUME=<yna>    - Attempt to Resume before Overwrite.
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue.
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> FSKIPLIST=<str> - File skip list [2]
>> DSKIPLIST=<str> - Directory skip list [2]
>> FPASSLIST=<str> - File pass list [3]
>> DPASSLIST=<str> - Directory pass list [3]
>> FSKIPEMPTY=<yna>- Skip empty files
>> DSKIPEMPTY=<yna>- Skip empty directories
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top
 
[1] AUTO means it will use this feature if it is reported by the
remote FTPD in the FEAT/features command reply.
 
[2] Uses fnmatch(3) syntax pattern matching. Most file globbal you can
do on the command line, including "*?[]", but excluding "{}". String
consists of slash separated patterns. eg "*.dat/*readme.txt*".
 
[3] Opposite to skiplist. The default is for passlist to be empty,
which is the equivalent of "*". A syntax like "*ENGLISH*" would ensure
only entries which matched string would be queued, and others are
dropped. Uses same pattern syntax as skiplist.
 
[ Extended Optional Arguments ]
As a special feature to the clients connecting to the FXP.One engine,
we also allow for storing of own, arbitrary, key/value pairs. As long
as the "key" is not the same as any of the above keys, or that of the
predefined reserved keys. (eg. "TYPE", "END")
>> <str>=<str>    - Store extra client information.
 
For example:
"...|extrafield=somestuff|OS=Unix"
 
[ Returns ]
>> SITEID=<int>    - Site ID of created site.
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>      - Command return message.
 
[ Example ]
>> SITEMOD|SITEID=1|fskiplist=*ENGLISH*,*COMPLETE*|fskipempty=YES
<< SITEMOD|CODE=0|SITEID=1|Msg=Modified successfully.


[ Caveat ]
It is recommended that all clients that wish to store information
in the site database, to prefix their key values with a unique string,
perhaps the name of the application. For example:
lundfxp_sitecmd_1=SITE WHO
lundfxp_lastlogin=015368281


=== SITEDEL ===


Delete an existing site.
=== Changing resolution ===


[ Minimal required fields ]
This refers to the Beta ICS4. Probably is not useful any more, but I will leave it here for reference.
>> SITEID=<int>    - Site ID of created site.


[ Optional Arguments ]
Changing resolution can be done by modifying the boot time scripts that the A10 uses. Usually done on a separate boot partition. For example, the Mele image has the files:


  [ Extended Optional Arguments ]
  mount /dev/mmcblk0p1 /mnt
ls -l /mnt/
evb.bin


  [ Returns ]
  git clone https://github.com/amery/sunxi-tools
   
  cd sunxi-tools
  >> SITEID=<int>    - Site ID of created site.
  make
  >> CODE=<int>      - Command return status CODE.
  ./bin2fex /mnt/evb.bin > evb.fex   
>> MSG=<str>      - Command return message.


[ Example ]
Edit the file any odd way you want, changing '''screen0_output_type''' and '''screen0_output_mode'''. See modes here: [https://github.com/amery/linux-allwinner/blob/allwinner-v3.0-android-v2/include/linux/drv_display_sun4i.h#L132]
>> SITEDEL|SITEID=12
<< SITEDEL|CODE=0|MSG=Site deleted.


  [ Caveat ]
  ./fex2bin evb.fex > /mnt/evb.bin
Sites aren't actually deleted, just not saved to disk. This means
active sessions using said siteid created before the SITEDEL command
was issued will continue to work.




If you are running the Android 4 (ICS) Beta that was released, to change the resolution to HDMI 1080p, you can do this. Using either a terminal program on Android (ConnectionBot for example) or the USB Console (if connected).


== SESSIONS ==
On the mele root shell
setprop service.adb.tcp.port 5555
stop adbd
start adbd
netstat -na      # Check that it is listening on port 5555


A session refer to a site connection. The API will ask for a new
On remote adb machine
session to a specific site (specified with SITEID) and a session will
adb connect 192.168.xxx.xxx    # Put in the Mele's IP
be created. If the connection is lost or closed, _the session is
adb shell
closed_. The API will have to request a new session if so desired.
adb> mount -t vfat /dev/block/nanda /mnt/obb
adb> exit
adb push script-HDMI-1080p60.bin /mnt/obb/
adb shell
adb> cd /mnt/obb
adb> busybox cp script-HDMI-1080p60.bin script.bin


=== SESSIONNEW ===
If you don't want to edit the script file yourself, you can download my prepared one:
[http://www.lundman.net/ftp/mele/script-HDMI-1080p60.bin script-HDMI-1080p60.bin]


Request a new session to site, returning a SID to session.
=== U-boot ===


[ Minimal Required Fields]
Since I added ZFS to u-boot for CuBox, and also patched in Samsungs EXT4 patches, I built hno's u-boot to test.
>> SITEID=<int>    - Which remote server to connect to, from SITELIST.


  [ Optional Arguments ]
  https://github.com/lundman/uboot-allwinner/tree/zfs
>> LOG            - Normal login is silent. With LOG the API received
                      all verbose messages.


  [ Returns ]
  wget http://lundman.net/ftp/mele/sunxi-spl.bin
dd if=sunxi-spl.bin of=/dev/sdc bs=1024 seek=8        # Obviously, '''sdc''' is my SDcard, change device to applicable.
   
   
  >> SID=<int>      - Value of the new SID for all future commands with
  wget http://lundman.net/ftp/mele/u-boot.bin
                    sessions
  dd if=u-boot.bin of=/dev/sdc bs=1024 seek=32          # Obviously, '''sdc''' is my SDcard, change device to applicable.
  >> CODE=<int>      - Command return status CODE.
>> MSG=<str>      - Command return message.


  [ Example ]
  U-Boot 2012.04.01-g39085db-dirty (May 29 2012 - 02:29:31) Allwinner Technology
   
   
  >> sessionnew|siteid=0
  CPU:  SUNXI Family
  << SESSIONNEW|SITEID=0|SID=1
  Board: A10-EVB
  << IDLE|SID=1
  DRAM:  512 MiB
 
MMC:  SUNXI SD/MMC: 0
=== SESSIONFREE ===
*** Warning - bad CRC, using default environment
 
Release a session, and disconnect from remote host.
 
[ Minimal Required Fields]
   
   
  >> SID=<int>        - SID of the session to close.
  sun4i#zfsload
zfsload - load binary file from a ZFS filesystem


  [ Optional Arguments ]
  sun4i#zfsload mmc 0:2 0x48000000 /boot/@/uImage
 
Loading file "/boot/@/uImage" from mmc device 0:2 xxa2
  [ Returns ]
zfs fsname = '/boot/' snapname='<NULL>' filename = '/uImage'
  4230340 bytes read
   
   
  >> SID=<int>        - SID of the session closed.
  sun4i#bootm 0x48000000
>> CODE=<int>        - Command return status CODE.
## Booting kernel from Legacy Image at 48000000 ...
  >> MSG=<str>        - Command return message.
  Image Name:  Linux-3.0.8+
 
  Image Type:  ARM Linux Kernel Image (uncompressed)
  [ Example ]
  Data Size:    4230276 Bytes = 4 MiB
  Load Address: 40008000
  Entry Point: 40008000
  Verifying Checksum ... OK
  Loading Kernel Image ... OK
  OK
   
   
  >> SESSIONFREE|SID=1
  Starting kernel ...
<< SESSIONFREE|CODE=0|SID=1|MSG=Success
 
=== ASYNC ===
 
Is not a command but client need to be aware that there are messages that
come in at any time.
 
<< CONNECT|SID=1
   
   
  Send once a session has successfully logged in and is ready to answer
  DRAM: 512[    0.000000] Initializing cgroup subsys cpuset
queries. Initially it was thought that IDLE would be enough, but
clients will generally want to auto-trigger some commands upon
connection establish, so we provide this event.


<< IDLE|SID=1       
Site is idle, ready for more commands. Informative only as you can
always issue commands, they will be queued.


<< DISCONNECT|SID=1|CODE=429|MSG=Undefined error: 0
=== Android Kernel ===
The session was disconnected. Any further references to the SID (in
this case "1") will result in an error.


<< LOG|SID=1|MSG=
I wanted to replace the ICS4 kernel with my own, for the nic fixes. These are the steps I took:
You can request a SESSIONNEW to be logged (LOG), or, most of the
commands take an option "LOG" to specify that logging is desired
during the execution of said command. This means the engine will
forward all messages from the remote FTPD to the client. For example:


  >> CWD|SID=2|path=/requests
  git clone https://github.com/amery/linux-allwinner
  << CWD|SID=2|CODE=0|MSG=250 CWD command successful.
  git branch lichee-3.0.8-sun4i
make sun4i_crane_defconfig
   
   
>> CWD|SID=2|path=requests|LOG
Check that .config has
<< CWD|SID=2|CODE=-1|MSG=250-REQUESTS ADMIN: roger
  CONFIG_MODVERSIONS=y
<< CWD|SID=2|CODE=-1|MSG=250-
  # CONFIG_MODULE_SRCVERSION_ALL is not set
  << CWD|SID=2|CODE=-1|MSG=250-RULES: Please use format of REQ- and FILLED- 
  << CWD|SID=2|CODE=-1|MSG=250-      and please do not dump single files into 
<< CWD|SID=2|CODE=-1|MSG=250-    root as it just make the folder look untidy!
<< CWD|SID=2|CODE=-1|MSG=250-Available space: 14676.22 MB.
<< CWD|SID=2|CODE=0|MSG=250 CWD command successful.


The wemac nic was panicing on boot everytime, until I changed this:


drivers/net/sun4i/sun4i_wemac.c
#define PHY_POWER 0  /* was 1 */


== FTP COMMANDS ==
make uImage


=== DIRLIST ===
From android, I used ConnectBot to make a copy of the 'boot' partition, nandc.


Request a directory listing from remote server/session.
adb shell
adb> dd if=/dev/block/nandc of=/mnt/sdcard/nandc bs=65536
adb pull /mnt/sdcard/nandc


[ Minimal Required Fields]
Then split it up into kernel and ramfs, you can find split_bootimg.pl my storage area (url above)
>> SID=<int>        - SID of the session


  [ Optional Arguments ]
  # ./split_bootimg.pl nandc
   
  Page size: 2048 (0x00000800)
  // Optional: PATH, ARGS, RAW, CACHEOK, LOG
Kernel size: 8410564 (0x008055c4)
  >> PATH=<str>        - Additional path element [1]
  Ramdisk size: 975609 (0x000ee2f9)
  >> ARGS=<str>        - Additional list options [2]
  Second size: 0 (0x00000000)
  >> RAW=<int>        - Include entire list line in FID reply.(unparsed)
  Board name:
  >> CACHEOK          - If cache is populated, avoid remote server
  Command line:
  >> LOG              - Send all strings with dirlist, like SESSIONNEW
  Writing nandc-kernel ... complete.
  Writing nandc-ramdisk.gz ... complete.


[1] Warning. It is not recommended that you use this to supply
The idea is to make a new kernel, that looks roughly the same as nandc-kernel, and re-use the nandc-ramdisk.gz
different paths as the internal cache engine will get mighty confused.
[2] Some "ls"/LIST options will break the internal parser. For
example, "-1" would remove the long listing style.


[ Returns ]
Once the compile has finished, we make a new image. According to the nandc ANDROID! header, the base address for Mele is 0x40000000
>> SID=<int>        - SID the dirlist reply is from.
>> FID=<int>        - File ID of this item. For QADD.
>> NAME=<str>        - Name of Directory OR File
>> DATE=<time>      - FID's date/time stamp. In seconds since 1970.
>> SIZE=<int>        - Size of Directory OR File
>> USER=<str>        - Owner of entry
>> GROUP=<str>      - Group of entry
>> PERM=<str>        - Permissions string. TODO - add octal as well.
>> FTYPE=<str>      - Type. "Directory", "File".
>> ITEMS=<int>      - Number of items in the list.
>> BEGIN            - First item sent,   start of list.
>> END              - Final item was sent, end of list.


  [ Example ]
  # mkbootimg --base 40000000 --kernel arch/arm/boot/Image --ramdisk ../nandc-ramdisk.gz -o ../mynewimage.img
>> dirlist|sid=1
<< DIRLIST|SID=1|BEGIN|items=2
<<  DIRLIST|SID=1|FID=0|NAME=giana_sounds|DATE=1057590000|SIZE=512|USER=nobody|GROUP=nobody|PERM=drwxrwxrwx|type=directory
<< DIRLIST|SID=1|FID=1|NAME=debug_main.gba|DATE=1057590000|SIZE=417520|USER=nobody|GROUP=nobody|PERM=-rwxr-xr-x|type=file
<< DIRLIST|SID=1|END
<< IDLE|SID=1
>> dirlist|sid=1|RAW
<< DIRLIST|SID=1|BEGIN|items=1
<< DIRLIST|SID=1|FID=0|NAME=giana_sounds|DATE=1057590000|SIZE=512|USER=nobody|GROUP=nobody|PERM=drwxrwxrwx|type=directory|RAW=drwxrwxrwx++1+nobody++nobody+++++512+Jul++8++2003+giana_sounds
<< DIRLIST|SID=1|END
<< IDLE|SID=1


=== QUOTE ===
Now I boot into Miniand image on SD card, use my nand.ko to load the device for /dev/nand*. You can find my Miniand kernel '''uImage''' and '''nand.ko''' in the storage area too. The default Miniand kernel did not come with nand driver.


Send RAW FTP commands to the remote server without FXP.One's
# modprobe nand.ko
involvement. Typically used for SITE commands.
# dd if=mynewimage.img of=/dev/nandc bs=2048
# sync
# reboot


[ Minimal Required Fields]
and remove the SD card to boot Android. If you want to undo, and go back to ICS4, put '''nandc''' file instead of '''mynewimage.img''' in the '''dd''' line above.
>> SID=<int>        - SID of the session
>> MSG=<str>        - RAW Command to execute.


[ Optional Arguments ]
=== Mele's Wired Network Interface ===
>> LOG              - Send all strings with command, like SESSIONNEW


[ Returns ]
The wired nic in the Mele is a '''wemac''' from Davidcom. It is unfortunately quite poor. You will get decent 100MB speeds from it, but it uses the CPU. If you do any transfers while trying to watch video (including watching video over network) it will stutter for 1080p. Interestingly if you use SD, or USB while watching, it has no problem.
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE. (If FTP reply < 300) code=0
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
The WIFI driver sits on the USB bus and is not affected by this.
>> QUOTE|SID=1|MSG=SITE uptime
<< QUOTE|SID=1|CODE=0|MSG=200 Uptime: 2d, 1h, 52m, 50s.
<< IDLE|SID=1
>> QUOTE|SID=1|LOG|MSG=SITE WHO
<< QUOTE|SID=1|CODE=-1|OK|MSG=200- [ WHO ]
<< QUOTE|SID=1|CODE=-1|OK|MSG=Total users online:  1              Total active data:  0   
<< QUOTE|SID=1|CODE=0|MSG=200 WHO command successful.


=== CWD ===
Using a USBEthernet dongle (I tried an Apple brand) also works without issues.


Change the Current Working Directory of the remote server.
ie. "cd files/"


[ Minimal Required Fields]
=== ZFS on Android ===
>> SID=<int>        - SID of the session
>> PATH=<str>      - New desired directory. or:
>> FID=<int>        - or: FID of directory.


[ Optional Arguments ]
I have already ported ZFS to ARM, so that should just work if you compile ZFS with your kernel. But I also wanted to see if I can get ZFS to work with Android. The modules do load ok, but execution does not work:
>> LOG              - Send all strings with command, like SESSIONNEW


  [ Returns ]
  # cd /mnt/sdcard/
   
  # insmod spl.ko && insmod zavl.ko&&insmod znvpair.ko&&insmod zunicode.ko&&insmod zcommon.ko&&insmod zfs.ko&&insmod zpios.ko&&cp zpool /mnt/obb/&&chmod 755 /mnt/obb/zpool
  >> SID=<int>        - SID of the session
  # cd /mnt/obb
  >> CODE=<int>      - Command return status CODE.
# strace -f ./zpool create melepool /dev/block/sda1   
  >> MSG=<str>        - Command return message. (Only final message
  open("/dev/block/sda1", O_WRONLY|O_EXCL|O_LARGEFILE) = 6
                      unless you issue LOG)
write(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
fdatasync(6)                            = 0
  close(6)                                = 0
open("/melepool", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = -1 ENOENT (No such file or directory)
ioctl(3, ITE_GPIO_IN


[ Example ]
and it hangs.
>> CWD|SID=1|PATH=Giana_Sisters_GBA
<< CWD|SID=1|CODE=0|MSG=250 CWD command successful.


=== PWD ===


Return the Current Working Directory path.
=== djmount for Android ===


[ Minimal Required Fields]
So one option is to have a mediaplayer with UPNP ability, like that of BubbleUPNP or PlugPlayer. However, both of these do poorly with Mele's remote control. With Bubble you can not click on Directories to enter them, but have to Mouse-Mode in/out to do so.
>> SID=<int>        - SID of the session


[ Optional Arguments ]
So one option is to mount all UPNP devices as a directory. Since Mele's kernel already comes with FUSE, I compiled '''djmount''' for it (patched version with >2GB size fixed).
>> LOG              - Send all strings with command, like SESSIONNEW


  [ Returns ]
  % adb push djmount /mnt/obb
% adb shell
# cd /mnt/obb
# chmod 755 djmount
# ./djmount  -o allow_other /mnt/sdcard/Pictures                # No reason to pick "Pictures" I just wanted an existing directory
# ls -l Pictures/                               
-r--r--r-- root    root          49 2000-01-01 20:00 devices
dr-xr-xr-x root    root              2000-01-01 20:00 llink-daemon UPNP Media Server (MediaServer) : 1
   
   
  >> SID=<int>        - SID of the session
  # ls -l Pictures/llink-daemon\ UPNP\ Media\ Server\ \ \(MediaServer\)\ \:\ 1/
  >> CODE=<int>      - Command return status CODE.
dr-xr-xr-x root    root              2000-01-01 20:00 DVD
  >> PATH=<str>      - The parsed current PATH.    [1]
dr-xr-xr-x root    root              2000-01-01 20:00 Game of Thrones
  >> MSG=<str>        - Command return message. (Only final message
  dr-xr-xr-x root    root              2000-01-01 20:00 Music
                      unless you issue LOG)
  dr-xr-xr-x root    root              2000-01-01 20:00 Video
  -r--r--r-- root    root    14010368 2000-01-01 20:00 movie.m4v


[1] Warning, PATH is only returned if FXP.One successfully managed to
And indeed, if you use the File browser in ICS4, you can just enter that directory, and play any video. Note that '''djmount''' is pretty slow on listing directories, and I think we might want to look at speeding that up if we are to use it long term. Also, increase the cache timeout from 60s to something much higher, like 10 minutes.
parse out the path from the reply. Some FTPD send non-standard
replies. If you find one of these, send me an example output string
and I can fix the parser.


[ Example ]
>> PWD|SID=1
<< PWD|SID=1|CODE=0|PATH=/Giana_Sisters_GBA/|MSG=257 "/Giana_Sisters_GBA/" is current directory.


=== SIZE ===


Return the size of a file on the remote server. Not this will give
=== PS3EYE WebCam ===
errors on directories on most FTPDs.


[ Minimal Required Fields]
I wanted to see if the PS3 Eye would work with Mele, and Skype.
>> SID=<int>        - SID of the session
>> PATH=<str>      - Name of File.  or:
>> FID=<int>        - or: FID of file.


[ Optional Arguments ]
Video:
>> LOG              - Send all strings with command, like SESSIONNEW


  [ Returns ]
  # insmod gspca_main.ko                               
  # insmod gspca_ov534.ko videomode=13        
>> SID=<int>        - SID of the session
  >> CODE=<int>      - Command return status CODE.
>> SIZE=<int>       - The size of the file.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
That makes the camera work with Skype and '''Zoom Camera''' app. When I tried one of the 640x480 modes it just hangs, so currently it is 320x240@60.
>> SIZE|SID=1|PATH=giana2k.xm.zip
<< SIZE|SID=1|CODE=0|SIZE=287688|MSG=213 287688


=== DELE ===
Audio:


Delete a single file on the remote server. You can either issue by
No idea. The device shows:
name (relative path, or absolute path), or optionally use FID as
returned by DIRLIST.


  [ Minimal Required Fields]
  # cat /proc/asound/cards                             
   
0 [sun4icodec    ]: sun4i-CODEC - sun4i-CODEC
  >> SID=<int>        - SID of the session
                      sun4i-CODEC Audio Codec
  >> PATH=<str>      - Name of Fileor:
  1 [sun4isndhdmi  ]:  - sun4i-sndhdmi
>> FID=<int>        - or: FID of file.
                      sun4i-sndhdmi
2 [CameraB409241 ]: USB-Audio - USB Camera-B4.09.24.1
                      OmniVision Technologies, Inc. USB Camera-B4.09.24.1 at usb-sw-ehci-1.3, high sp
  3 [sun4isndspdif  ]: - sun4i-sndspdif
                      sun4i-sndspdif


[ Optional Arguments ]
And we get the device nodes:
>> LOG              - Send all strings with command, like SESSIONNEW


  [ Returns ]
  # ls -l /dev/snd/
   
  crw-rw---- system  audio    116,  0 2012-07-03 14:12 controlC0
  >> SID=<int>        - SID of the session
  crw-rw---- system  audio    116,  32 2012-07-03 14:12 controlC1
  >> CODE=<int>      - Command return status CODE.
  crw-rw---- system  audio    116,  64 2012-07-03 14:12 controlC2
  >> MSG=<str>        - Command return message. (Only final message
  crw-rw---- system  audio    116,  96 2012-07-03 14:12 controlC3
                      unless you issue LOG)
crwxrwxrwx system  system  116,  24 2012-07-03 14:12 pcmC0D0c
crwxrwxrwx system  system  116,  16 2012-07-03 14:12 pcmC0D0p
crw-rw---- system  audio    116,  48 2012-07-03 14:12 pcmC1D0p
crw-rw---- system  audio    116,  88 2012-07-03 14:12 pcmC2D0c
crw-rw---- system  audio    116, 112 2012-07-03 14:12 pcmC3D0p
crw-rw---- system  audio    116,  33 2012-07-03 14:12 timer


[ Example ]
But no idea how to tell Android to use the USB device as the main microphone.
>> DELE|SID=1|PATH=delete_this.bin
<< DELE|SID=1|CODE=0|MSG=213 DELE command successful.


=== MKD ===
# setprop usb.audio.cap.device pcmC0D0c
# setprop media.audio.in.mode usb


Create a new directory on the remote server.
Neither of those work.
 
[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> PATH=<str>      - Name of Directory.
 
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW
 
[ Returns ]
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
[ Example ]
>> MKD|SID=1|PATH=New Folder
<< MKD|SID=1|CODE=0|MSG=213 MKD command successful.
 
=== RMD ===
 
Delete a single directory on the remote server. You can either issue by
name (relative path, or absolute path), or optionally use FID as
returned by DIRLIST.
 
[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> PATH=<str>      - Name of Directory.  or:
>> FID=<int>        - or: FID of directory.
 
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW
 
[ Returns ]
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
[ Example ]
>> RMD|SID=1|PATH=delete_this_dir
<< RMD|SID=1|CODE=0|MSG=213 RMD command successful.
 
=== SITE ===
 
Send a SITE command to the remote server.
 
[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> CMD=<str>        - Command and arguments to send.
 
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW
 
[ Returns ]
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
[ Example ]
>> SITE|SID=1|CMD=WHO
<< SITE|SID=1|CODE=0|MSG=200 Command Successful.
 
=== REN ===
 
Rename a file or directory. Supply the originating name by either
passing FROM or a valid FID, as well as the resulting TO name.
 
[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> FROM=<str>      - Source name. or:
>> FID=<int>        - or: FID of entry.
>> TO=<str>        - Destination name.
 
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW
 
[ Returns ]
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
[ Example ]
>> REN|SID=1|FROM=oldfilename.bin|TO=newfilename.bin
<< REN|SID=1|CODE=0|MSG=250 RNTO command successful.
 
=== MDTM ===
 
Return the date and time of a file. (But not directories, according to
FTP RFC). The return data is in the format of yyyyMMddHHmmSS. For
example, "213 19970205115719". You can either issue by name (relative
path, or absolute path), or optionally use FID as returned by DIRLIST.
 
[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> PATH=<str>      - Name of Directory.  or:
>> FID=<int>        - or: FID of directory.
 
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW
 
[ Returns ]
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
[ Example ]
>> MDTM|SID=1|PATH=somefile.bin
<< MDTM|SID=1|CODE=0|MSG=213 19970205115719
 
 
 
== QUEUES ==
 
=== QUEUENEW ===
 
Create a new QUEUE by associating two SIDs with it. These are
currently named NORTH and SOUTH as a means to refer to either one
uniquely without implying direction of transfer. (source and
destination does not work)
 
[ Minimal Required Fields]
>> NORTH_SID=<int>  - SID of the session, out of two.
>> SOUTH_SID=<int>  - SID of the session, out of two.
 
[ Optional Arguments ]
[ Returns ]
>> QID=<int>        - Queue ID for queue operations.
 
[ Example ]
>> queuenew|north_sid=1|south_sid=2
<< QUEUENEW|CODE=0|QID=1|MSG=Queue created.
 
=== QADD ===
 
Add a new items to a specified queue. This is quite a versatile
command which looks to take many arguments. As a command it has four
parts to it. Except for special QTYPE values, see below.
 
# The source information. The easiest way here is to use the FID option, if you have previously done a DIRLIST command. This will take the required source information from the directory cache. If FID is not used, or you wish to override information from the FID, you can specify the source information manually. The name of the item can either be specified by SRCDIR+SRCNAME OR SRCPATH. (SRCPATH = SRCDIR/SRCNAME). The extra SRC options, like SRCSIZE, and SRCREST are optional. Both are used for Resume purposes, as well as finally CPS calculations.
# The destination information. This is copied from the source. However, you can optionally override any of this. For example specifying a different DSTNAME would transfer and rename the file at the same time. The PATH is made up the same way as source, specify one of the two in: (DSTPATH = DSTDIR/DSTNAME)
# Queue position. This can be omitted for default queue positioning. However if the specific position is desired, you can use @=<int|FIRST|LAST> to specify Nth position, FIRST position or LAST position in the queue.
# Optional modifiers. The default behaviour of a SITE is to always RESUME unless specified otherwise using the "resume" option to the site definition. The default for a queue item is also to resume. You can override this default for THIS queue item by specifying "OVERWRITE" or "RESUME". The latter is useful if the site's default has been changed to OVERWRITE. You can also specify QTYPE for this addition, either due to manual queuing, or to override the FID type. If you get it wrong, the queue processing will also get it wrong.
 
Alternatively, you can use QTYPE to set non transfer type items. At
this time, there is only type "STOP". If you issue QTYPE=STOP there is
no need to send information for 1), 2) or 4). Part 3) is optional.
There is currently a bug where you have to specify SRC= field with the
STOP item. It makes no difference as to which SRC you pick.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
>> SRC=<str>        - Specify which SID is the source. Either "NORTH"
                      or "SOUTH".
EITHER:
>> FID=<int>        - File ID to use as source
OR:
>> SRCPATH=<str>    - Full path of the source file
OR:
>> SRCNAME=<str>    - Name of source file.
>> SRCDIR=<str>    - Directory path containing source file.
OR:
>> QTYPE=STOP      - Insert a soft stop item
 
[ Optional Arguments ]
>> SRCNAME=<str>    - Name of source file
>> SRCDIR=<str>    - Directory path containing source file
>> SRCPATH=<str>    - Full path, ie, SRCDIR/SRCNAME in one.
>> SRCSIZE=<int>    - Size of the queue item.
>> SRCREST=<int>    - Restart point of queue item (files only).
>> DSTNAME=<str>    - Name of destination file, OR obtained from source
>> DSTDIR=<str>    - Directory path containing destination file, OR
                      obtained from source
>> DSTPATH=<str>    - Full path, ie, DSTDIR/DSTNAME in one. OR
                      obtained from source.
>> DSTSIZE=<int>    - Size of the queue item.
>> DSTREST=<int>    - Restart point of queue item (files only).
>> QTYPE=<str>      - Type of queue item. Either "directory",
                      "file" or "stop". [1]
>> RESUME          - Resume file if possible.
>> OVERWRITE        - Do not resume, overwrite destination
>> @=<int|str>      - Queue position, int or FIRST/LAST strings.
 
[1] More types will come. The default type is "file".
 
[ Returns ]
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position in the queue item was inserted.
>> SRCPATH=<str>    - Original source path used (to identify QADD reply, and use "@")
>> DSTPATH=<str>    - Original destination path used (to identify QADD reply, and use "@")
>> FID=<int>        - If QADD was called with FID=, the QADD reply will also contain FID.
 
[ Example ]
>> qadd|qid=1|src=north|fid=2
<< QADD|CODE=0|QID=1|ITEMS=1|@=0|SRCPATH=/test/srcfile.bin|DSTPATH=/dump/srcfile.bin|FID=2|Msg=Added successfully.
>> QADD|QID=123|SRC=SOUTH|SRCPATH=/archive/thesis/bilingual.pdf|DSTPATH=/old/ducoments/obsolete.pdf|SRCSIZE=43523|OVERWRITE|QTYPE=file
<< QADD|CODE=0|QID=123|ITEMS=906|@=55|SRCPATH=/archive/thesis/bilingual.pdf|DSTPATH=/old/ducoments/obsolete.pdf|Msg=Added successfully.
 
What is the default queue position when QADD is called, or during file
transfers? When the API queues items, they will always be placed LAST
unless otherwise specified.
 
As a default, files are added after all the (top) files, but before
the first directory. Directories are added after all files, but before
the first directory. (yes, it's the same). Which the exception of if
the name matches "fmovefirst" or "dmovefirst", then it is inserted
with "FIRST" position.
 
This means, when it is expanding a directory, the queue ends up like:
 
FIRST
    files that match fmovefirst
    all other files
    directories.
LAST
 
=== QLIST ===
 
List all queues on the engine, and their current states.
 
[ Minimal Required Fields]
 
[ Optional Arguments ]
 
[ Returns ]
>> QID=<int>        - Queue ID
>> NORTH=<str>      - Name of the North site
>> SOUTH=<str>      - Name of the South site
>> ITEMS=<int>      - Number of queue items
>> STATUS=<str>    - Current processing state
>> ERRORS=<int>    - Number of items in the error queue.
>> KB/s=<int>      - Transfer speed of last completed transfer.
>> SUBSCRIBED      - Sent if client is subscribed to events from this queue.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.
 
[ Example ]
>> qlist
<< QLIST|BEGIN
<< QLIST|QID=20|NORTH=ftp1|SOUTH=ds|ITEMS=1|STATUS=PROCESSING|ERRORS=0|SUBSCRIBED|KB/s=0.00
<< QLIST|END
 
=== QGET ===
 
Get the contents of a specific queue, all its queue items.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
 
[ Optional Arguments ]
 
[ Returns ]
>> QID=<int>        - Queue ID
>> @=<int>          - Position in the queue of item.
>> FTYPE=<str>      - Item type, directory/file.
>> SRC=<str>        - Source SID is "NORTH" or "SOUTH".
>> SRCPATH=<str>    - Full path of source
>> SRCSIZE=<int>    - Source size, if known.
>> SRCREST=<int>    - Source restart point.
>> DSTPATH=<str>    - Full path of destination
>> DSTSIZE=<int>    - Destination size, if known.
>> DSTREST=<int>    - Destination restart point.
>> ITEMS=<int>      - Number of items in the list.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.
 
[ Example ]
>> qget|qid=1
<< QGET|QID=1|ITEMS=1|BEGIN
<< QGET|QID=1|@=0|FTYPE=FILE|SRC=NORTH|SRCPATH=/Giana_Sisters_GBA//gfx_blocks.txt|
        SRCSIZE=9328|SRCREST=0|DSTPATH=/tmp//gfx_blocks.txt|DSTSIZE=0|DSTREST=0
<< QGET|QID=1|END
 
=== QERR ===
 
Get the contents of a specific error queue, all its queue items.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
 
[ Optional Arguments ]
 
[ Returns ]
>> QID=<int>        - Queue ID
>> QTYPE=<str>      - Item type, directory/file.
>> SRC=<NORTH|SOUTH>- This item's source site is North or South.
>> SRCPATH=<str>    - Full path of source
>> DSTPATH=<str>    - Full path of destination
>> SERR_<int>=<str> - Source errors, incrementing, and the reason string
>> DERR_<int>=<str> - Destination errors, incrementing, and the reason string
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.
 
[ Example ]
>> QERR|QID=1|BEGIN|ITEMS=1
<< QERR|QID=1|QTYPE=FILE|SRC=NORTH|SRCPATH=/Giana_Sisters_GBA//gfx_blocks.txt|DSTPATH=/tmp/tmp//gfx_blocks.txt|DERR_0=553 gfx_blocks.txt: Can't open for writing
<< QERR|QID=1|END
 
=== QDEL ===
 
Delete an item in the queue. If a client wishes to delete multiple
items, it is advised that the client pre-sorts the items list, and
send it with highest queue position first, in descending order. It is
an error to attempt to delete queue item at first position (@=0) if
the queue is active.
 
Please be aware that since deleting a queue item early in the list,
will affect queue items in a later position. That is to say, if you
intend to delete items 1,4,8 from the queue, and you issue 3 QDEL
commands "blindly" in the same order (1,4,8), the net effect will be
that queue items 1,5,10 are actually deleted. When queue item 1 is
deleted, item at position 4 is now 3, and item 5 is at position 4.
 
Either the clients need to be aware of the re-numbering and compensate
for later commands,
OR,
much easier is to sort the list in descending order before issuing the
QDEL commands. Ie, send QDEL commands in the order 8,4,1.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
>> @=<int>          - Queue position of item to delete.
 
[ Optional Arguments ]
 
[ Returns ]
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position in the queue of item.
 
[ Example ]
>> qdel|qid=1|@=53
<< QDEL|QID=1|CODE=0|@=53|ITEMS=0
 
=== QMOVE ===
 
Move an item in the queue from one position to a new position. It is
an error to move a queue item from, or to, the first position (@=0)
when a queue is active.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
>> FROM=<int>      - Queue position of item to move
>> TO=<str|int>    - New position, either <int> Nth place, or string
                      placement like in QADD. ("FIRST"/"LAST")
 
[ Optional Arguments ]
 
[ Returns ]
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position where item was inserted.
>> FROM=<int>      - Position where item was originally from.
 
[ Example ]
>> qmove|qid=1|from=0|to=last
<< QMOVE|QID=1|@=23|FROM=0|CODE=0|ITEMS=3|MSG=Moved
 
=== QGRAB ===
 
QGRAB lets a client take control of an idle queue, and the queue's
sessions, if any. This is currently the only way to gain access to
sessions given away with the "GO" command. If the queue had any
connected sessions, the client should receive appropriate CONNECT
messages.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue id in question
 
[ Optional Arguments ]
 
[ Returns ]
>> QID=<int>        - Queue id
>> ITEMS=<int>      - Current number of items in queue
>> NORTH_SID=<int>  - Session ID of North site, if connected.
>> SOUTH_SID=<int>  - Session ID of South site, if connected.
>> NORTH_SITEID=int - Site ID of North site, for future SESSIONNEW
>> SOUTH_SITEID=int - Site ID of South site, for future SESSIONNEW
>> NORTH_NAME=<str> - Site name of North site
>> SOUTH_NAME=<str> - Site name of South site
>> CODE=<int>      - Command return status CODE.
 
As well as potential async commands.
 
[ Example ]
 
>> qgrab|qid=1
<< CONNECT|SID=34
<< IDLE|SID=34
<< CONNECT|SID=35
<< IDLE|SID=35
<< QGRAB|QID=1|CODE=0|ITEMS=0|NORTH_SID=34|SOUTH_SID=35|NORTH_SITEID=0|SOUTH_SITEID=4|NORTH_NAME=localhost|SOUTH_NAME=distro_site
 
=== QCOMPARE ===
 
Compare the two directories in the session cache against each other,
sending back list of FIDs that would be queued by FXP.One. This gives
GUIs an easy way to show which items would be queued, and processed in
a given set of directories. The compare function uses all the logic,
including skiplists, passlists, movefirst and skipempty. It compares
file sizes to ignore those of the same size, but highlights the side
with the smaller size should they differ.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
 
[ Optional Arguments ]
 
[ Returns ]
>> QID=<int>        - Queue ID
>> NORTH_FID=<int,> - Comma separated list of FIDs for the NORTH site.
>> SOUTH_FID=<int,> - Comma separated list of FIDs for the NORTH site.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.
 
[ Example ]
>> qcompare|qid=1
<< QCOMPARE|QID=1|BEGIN
<< QCOMPARE|QID=1|NORTH_FID=1,3,4,5,6,7,8,10,13,15,16,17,18,19,21,22,23,24,25,26,28,29,31,33,35,36,37,38
,39,40,41,42,43,44,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,69,70,71,72,73,
74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,104,105,
107,108,109,110,111,112,113,115,116,117,118
<< QCOMPARE|QID=1|NORTH_FID=119,120,121,122,123,124,125,126,127,128,129,130,132,133,134,135,136,137,
138,139,140,141,142,144,145,146,147,148,149
<< QCOMPARE|QID=1|SOUTH_FID=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,
29,30,31,32,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,
64,65,66,67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,84,85,87,88,89,90,91,92,93,95,96,97,98,99,100,
101,102,104,105,106,107,109
<< QCOMPARE|QID=1|SOUTH_FID=110,113,114,115
<< QCOMPARE|QID=1|END|MSG=Completed comparison.
 
=== QUEUEFREE ===
 
Release an existing queue, release its sessions, and queue items.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
 
[ Optional Arguments ]
 
[ Returns ]
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message.
 
[ Example ]
>> QUEUEFREE|QID=1
<< QUEUEFREE|CODE=0|QID=1|Msg=Queue released.
 
=== GO ===
 
Issue "GO" to a queue. Request FXP.One engine to start processing the
queue and its items. The client loses ownership of the two SIDS at the
issue of the "GO" command.  You may no longer issue commands directory
to the SIDs. Once a queue is idle, either from the QC|EMPTY message,
or after issuing the STOP command, the client can issue the "QGRAB"
command to receive controls of the SIDs, if still existing.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
 
[ Optional Arguments ]
>> SUBSCRIBE        - Subscribe to queue status (QS) and queue changes (QC) 
 
[ Returns ]
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE if failed.
>> MSG=<str>        - Command return message.
 
[ Example ]
>> GO|QID=1
<< GO|QID=1|CODE=0|MSG=Queue processing started.
 
 
=== STOP ===
 
Issue "STOP" to a queue. Request FXP.One engine to attempt to stop processing the
queue and its items. There are currently three types on STOP levels, the default is
"SOFT", which will stop once the current transfer is complete. "HARD" which will attempt to send the FTP command 'ABOR' to both FTPDs to gracefully interrupt the current transfer. (local client might need ABOR support added) Finally, the "DROP" method which will log out of both FTPDs and hence forcing the transfer to stop. Once the queue processing has stopped, the FXP.One engine will issue a "QC|IDLE" command, after which the client can issue QGRAB.
 
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
 
[ Optional Arguments ]
>> HARD            - Send FTP 'ABOR' to FTP daemons
>> DROP            - Drop connections to FTP daemons to cancel transfers. 
 
[ Returns ]
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE if failed.
>> MSG=<str>        - Command return message.
 
[ Example ]
>> STOP|QID=1
<< STOP|QID=1|CODE=0|MSG=Stop initiated, please wait..
<< QC|QID=1|IDLE|MSG=Stop command successful.
 
=== QC ===
 
This is a receive-only command, sent by the FXP.One engine when there
is a Queue-Change. It is only sent if the client requested to
SUBSCRIBE to a queue, either using the "GO" command, or the "QGET"
 
[ Minimal Required Fields]
 
[ Optional Arguments ]
 
[ Returns ]
>> MOVE            - Item has moved to a new position. Comes with
                      FROM= and TO= keys.
>> REMOVE          - Remove items from queue. All items with higher
                      position are decremented by one. Uses @.
>> INSERT          - New item inserted into queue. Uses @, SRCPATH,
  DSTPATH, QTYPE, SRCSIZE.
>> EMPTY            - Empty queue, processing stops.
>> IDLE            - Queue moved into IDLE state, either from QTYPE=STOP or
                      in response to a STOP command.
 
[ Example ]
<< QC|QID=1|REMOVE|@=0
<< QC|QID=1|MOVE|FROM=0|TO=18
<< QC|QID=1|INSERT|@=0|SRCPATH=/testfile.dat|DSTPATH=/tmp/testing.bin|QTYPE=FILE|SRCSIZE=29734
 
=== QS ===
 
This is a receive-only command, sent by the FXP.One engine when there
is Queue-Status information to relay. Client can safely ignore this
command as it does not reflect on any queue changes. It is merely
meant as a way for clients to be able to track progress of a queue
being processed. It is only sent if the client requested to
SUBSCRIBE to a queue, either using the "GO" command, or the "QGET"
(Not yet implemented).
All QS messages are related to the item at the top of the queue. So
"@=0" is implied.
 
[ Minimal Required Fields]
 
[ Optional Arguments ]
 
[ Returns ]
>> START            - Started processing the item at the top of queue.
      SRCNAME=<str>  - Included for human readability.
>> SRCCWD=<str>    - Changed to new directory on source
>> DSTCWD=<str>    - Changed to new directory on destination
>> MKD=<str>        - Created new directory on destination
>> XFRACT          - File transfer has started (received 150)
      SECURE=<yes/no>- Was Secure Data negotiations successful.
      REST=<int>    - Are we resuming this file
      SIZE=<int>    - Final source size (from SIZE command)
>> XFREND          - File transfer finished (successfully, 226).
      TIME=<int>    - Duration of transfer [1]
      KB/s=<int>    - Estimated speed of transfer [1]
>> FAILED          - Attempted transfer failed
      SERR=<str>    - Error reasons (source failed)
      DERR=<str>    - Error reasons (destination failed)
      COUNT=<int>    - This failure count.
 
[1] Please be aware that we can only measure the time difference
between the 150 FTP message, and the 226 FTP message as received by
FXP.One. This may not reflect the actual time taken for the transfer,
subsequently the KB/s computation is based on said time, and will most
likely only be an estimate. The shorter the duration of a file
transfer is, the more inaccurate the speed computation will be.
 
[ Example ]
<< QS|QID=1|MSG=Processing directory|SRCPATH=/Giana_Sisters_GBA//giana_sounds|DSTPATH=/tmp/tmp//giana_sounds
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/
<< QS|QID=1|START|@=0|SRCNAME=might_be_game_sounds.pcm
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/giana_sounds/
<< QS|QID=1|DSTMKD=/tmp/tmp//giana_sounds
<< QS|QID=1|MSG=Transfer started|SECURE=YES|REST=0|SIZE=29734
<< QS|QID=1|MSG=Transfer complete|TIME=0.00|KB/s=0.00
 
[ Log of a complete session ]
>> GO|QID=1|SUBSCRIBE
<< QS|QID=1|MSG=Processing directory|SRCPATH=/Giana_Sisters_GBA//giana_sounds|DSTPATH=/tmp/tmp//giana_sounds
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/
<< QC|QID=1|REMOVE|@=0
<< QC|QID=1|INSERT|@=0|SRCPATH=/Giana_Sisters_GBA/giana_sounds//might_be_game_sounds.pcm|DSTPATH=/tmp/tmp//giana_sounds/might_be_game_sounds.pcm|QTYPE=FILE|SRCSIZE=29734
<< QS|QID=1|START|@=0|SRCNAME=might_be_game_sounds.pcm
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/giana_sounds/
<< QS|QID=1|MKD=/tmp/tmp//giana_sounds
<< QS|QID=1|MSG=Transfer started|SECURE=YES|REST=0|SIZE=29734
<< QS|QID=1|MSG=Transfer complete|TIME=0.00|KB/s=0.00
<< QC|QID=1|REMOVE|@=0
 
=== SUBSCRIBE ===
 
Request to receive the QS and QC commands from a processing queue. A
client may subscribe to as many queues as it wants, including those
not started by itself.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
 
[ Optional Arguments ]
>> TOGGLE          - If already subscribed, issue un-subscribe instead.
 
[ Returns ]
>> QID=<int>        - Queue ID
>> MSG=<str>        - Command return message.
>> UNSUBSCRIBED    - If issued TOGGLE the result was to be un-subscribed.
 
[ Example ]
>> SUBSCRIBE|QID=1|TOGGLE
<< SUBSCRIBE|QID=1|CODE=0|MSG=Subscribed
 
=== UNSUBSCRIBE ===
 
Stop being subscribed to a queue.
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
 
[ Optional Arguments ]
 
[ Returns ]
>> QID=<int>        - Queue ID
>> MSG=<str>        - Command return message.
 
[ Example ]
>> UNSUBSCRIBE|QID=1
<< UNSUBSCRIBE|QID=1|CODE=0|MSG=Unsubscribed
 
 
=== QCLONE (v1.7) ===
 
Take a created queue (idle or active) and make an exact copy of the queue. If source queue is active, connect both sides and start processing. Some clients refer to this as "add another thread".
 
[ Minimal Required Fields]
>> QID=<int>        - Queue ID
 
[ Optional Arguments ]
>> START=<yna>      - Start processing (Y), do not start processing (N), or copy source (A). Default is (A).
>> SUBSCRIBE        - Also subscribe to queue processing notices.
 
[ Returns ]
>> QID=<int>        - Source Queue ID, same as given.
>> NEWQID=<int>        - Newly created clone Queue ID
>> MSG=<str>        - Command return message.
 
[ Example ]
>> QCLONE|QID=123
<< QCLONE|QID=123|NEWQID=124|CODE=0|MSG=Queue 124 processing started.
 
In reality, it is a little more verbose, here is an actual example:
>> QCLONE|QID=1
<< SESSIONNEW|SITEID=15|CODE=0|SID=3
<< SESSIONNEW|SITEID=16|CODE=0|SID=4
<< QUEUENEW|CODE=0|QID=2|NORTH_SID=3|SOUTH_SID=4|MSG=Queue created.
<< QCLONE|CODE=0|QID=1|NEW_QID=2|Msg=Cloned and created queue
<< CONNECT|SID=3|SSL
<< IDLE|SID=3
<< CONNECT|SID=4|SSL
<< IDLE|SID=4
<< GO|QID=2|CODE=0|MSG=Queue processing started.
 
== ADMINISTRATIVE COMMANDS ==
 
=== QUIT ===
 
Disconnect from the FXP.One engine. The client can also just close the connection without worry.
 
[ Minimal Required Fields]
 
[ Optional Arguments ]
 
[ Returns ]
>> Will disconnect on you, how rude.
 
[ Example ]
>> QUIT
<< Connection closed by remote host.
 
=== HELP ===
 
Display available commands at this privilege level.
 
[ Minimal Required Fields]
 
[ Optional Arguments ]
 
[ Returns ]
>> MSG=<str>        - Command return message.
>> CODE=<int>      - Command return status CODE.
 
[ Example ]
>> HELP
<< HELP|CODE=0|Msg= QUIT HELP WHO SHUTDOWN SITEADD SITELIST SITEMOD SITEDEL SESSIONNEW SESSIONFREE
        DIRLIST QUEUENEW QADD QLIST QGET QERR QGRAB QDEL QMOVE QCOMPARE QUEUEFREE GO STOP CWD PWD
        SIZE DELE MKD RMD SITE REN MDTM QUOTE SUBSCRIBE UNSUBSCRIBE.
 
=== WHO ===
 
Display a list of users connected to this FXP.One engine.
 
[ Minimal Required Fields]
 
[ Optional Arguments ]
 
[ Returns ]
>> NAME=<str>      - User name of login session
>> HOST=<ip>        - IP address of login session
>> PORT=<port>      - Remote port number
>> SSL=<yes|no>    - Is connection encrypted
>> CLIENTS=<int>    - Number of items in the queue
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.
 
[ Example ]
>> WHO
<< WHO|BEGIN|CLIENTS=3
<< WHO|NAME=admin|HOST=127.0.0.1|PORT=58597|SSL=yes
<< WHO|NAME=admin|HOST=220.150.239.57|PORT=1135|SSL=yes
<< WHO|NAME=admin|HOST=127.0.0.1|PORT=58540|SSL=no
<< WHO|END|Msg=Command Completed.
 
=== SETPASS ===
 
Change the login password on the FXP.One engine. This is strongly encouraged.
 
[ Minimal Required Fields]
>> OLD=<str>        - Old/current password of this login session.
>> NEW=<str>        - New/future password for this login session.
 
[ Optional Arguments ]
 
[ Returns ]
>> MSG=<str>        - Command return message.
>> CODE=<int>      - Command return status CODE.
 
[ Example ]
>> SETPASS|OLD=admin|NEW=newpass
<< SETPASS|CODE=0|MSG=New password has been set.
<< SETPASS|CODE=1502|MSG=Login incorrect
 
=== SHUTDOWN ===
 
Shutdown the FXP.One engine have it completely exit.
 
[ Minimal Required Fields]
 
[ Optional Arguments ]
>> LASTCLIENT      - Only shutdown if THIS client is the last one.
 
[ Returns ]
>> Might disconnect on you, how rude.
 
[ Example ]
>> SHUTDOWN
<< SHUTDOWN|CODE=0
<< Connection closed by remote host.

Latest revision as of 13:11, 21 July 2012

MeLE A2000

Mele file storage

http://www.lundman.net/ftp/mele/


Status

Current status with the Mele A2000, Allwinner A10.

Official release: Android 4 ICS, 4.0.8. Kernel: 3.0.31+

Positive:

  • Video playback 1080p
  • MKV playback
  • TS playback
  • YouTube
  • Android market and Games (Angry Birds etc)

Negative:

  • Network Streaming Fixed. NIC has been patched to allow smooth 1080p steaming
  • Audio. The settings; CODEC no sound, but probably on RCA. HDMI choppy sound, unusable. If made to work, only stereo on HDMI. SPDIF not working, does not turn on. (No red light)
  • Bitstreaming; Unconfirmed since SPDIF is not functional. But can the hardware bitstream TrueHD, and DTS-MA ?
  • 10bit video does not play (not supported by hardware, CPU too slow for software)
  • AVI/XviD does not play (not supported by hardware, CPU too slow for software)

Currently, it is no good for mediaplayer. But if all you want is a toy to play youtube, some android games, and only stereo sound, it is definitely capable.


Android 4 ICS wired NIC patch

I have been working on trying to improve the wemac NIC driver in the Mele A2000 Allwinner A10 hardware, which will stutter when playing 720p/1080p over network. The current patch makes it much better, such that I think it is usable now. There is a mynewerimage.img image in the storage area, that you can dd to the nandc device. I will work on submitting the patch upstream.

For example, if you boot miniand image:

# modprobe nand     # nand.ko on my storage area too
# wget http://lundman.net/ftp/mele/mynewerimage.img
# dd if=/dev/nandc of=mele_nandc_backup.bin bs=65536
# dd if=mynewerimage.img of=/dev/nandc bs=65536
# sync
# reboot -f

And take out the SD card to boot Android again. If you do this using Android, the device node is /dev/block/nandc

Android 4 ICS official Mele image

The official Mele Android ICS image is out, called Mele_HTPC_Android_4.0_V1.rar which you need to use PhoenixCard to "burn". Once installed, you can use audiopatch1.3.apk to enable some sound features. Otherwise it seems quite similar to A10 firmware.

For those not using Windows, I also made a dd image: Mele_HTPC_Android_4.0_V1.ddimg.bin.bz2 [1] Just dd the whole thing to your raw device.

Android 4 IceCreamSandwich

Update: the non-beta release of ICS4 came out (for the A10, not Mele's release), which has settings/display, and lets you chose resolution

For Unix and clones:

wget http://www.lundman.net/ftp/mele/homlet_4.0_v1.0_20120609_dd.img.lzma
7z x homlet_4.0_v1.0_20120609_dd.img.lzma
sudo dd if=homlet_4.0_v1.0_20120609_dd.img of=/dev/sdX bs=1M
sync

Where you need to replace X in /dev/sdX by the correct letter for your SD card reader. Now insert the SD card in your Mele, and wait until the LED stops blinking, remove the SD card and restart the device. Et voila! (Read more: [2]) See I kept the paste URL cos I'm nice! :)


There is also an audiopatch for the ICS4 image to get sound to work. Copy over audiopatch1.2.apk (adb, or physical media) to your ICS4, install and run.

Not convinced it makes any difference for me. Audio appears not to work still.

It appears the contents on audiopatch1.2 is pretty much just libswa.so. Not entirely sure what it thinks to do with it, but if I do a find from root, there is no such library, before and after running patch.

I copied the file by hand:

busybox cp /data/data/com.android.audiopatch/files/libswa.so /system/lib/

and I get sound playing videos with some audio formats now. Like, TV MKV releases.

Mele A2000

I purchased a MeLE A2000 from Tom over at aliexpress, and been playing around with it as well. First I wanted to install ICS4, to do that I downloaded the android_4.0.img file from the 'net. Alas, there is a large volume of confusing information on what to do with this.

http://www.lundman.net/ftp/mele/ 
https://www.wuala.com/zercosz/Mele%20A2000/Firmware/?key=ThisIsFC2012

For the MeLE A2000, I also downloaded PhoenixCardV303(win7) and installed that in my VirtualBox Win7 system, forwarded the OSX USB drive and told it to install android_4.0.img.

https://www.wuala.com/zercosz/Mele%20A2000/Utilidades%20Mele/?key=ThisIsFC2012
http://www.lundman.net/ftp/mele/ 

After that, I inserted the SD card into Mele, and rebooted.

The power LED will blink RED + BLUE for a while, then power LED will turn off.

Take out SDcard, and reboot MeLE. It will now boot ICS, but only on HDMI@720p.

I can confirm BubbleUPNP + 2160pPlayer will play 1080p MKVs over network. Nice!


Google Market/Play

I installed one of the Terminal programs, and told adb to use TCP (haven't bothered to open my mele yet). Using adb and the instructions found allwinner a10 scripts I loaded Google Market/Play to the mele.


Changing resolution

This refers to the Beta ICS4. Probably is not useful any more, but I will leave it here for reference.

Changing resolution can be done by modifying the boot time scripts that the A10 uses. Usually done on a separate boot partition. For example, the Mele image has the files:

mount /dev/mmcblk0p1 /mnt
ls -l /mnt/
evb.bin
git clone https://github.com/amery/sunxi-tools
cd sunxi-tools
make
./bin2fex /mnt/evb.bin > evb.fex    

Edit the file any odd way you want, changing screen0_output_type and screen0_output_mode. See modes here: [3]

./fex2bin evb.fex > /mnt/evb.bin


If you are running the Android 4 (ICS) Beta that was released, to change the resolution to HDMI 1080p, you can do this. Using either a terminal program on Android (ConnectionBot for example) or the USB Console (if connected).

On the mele root shell

setprop service.adb.tcp.port 5555
stop adbd
start adbd
netstat -na       # Check that it is listening on port 5555

On remote adb machine

adb connect 192.168.xxx.xxx    # Put in the Mele's IP
adb shell
adb> mount -t vfat /dev/block/nanda /mnt/obb
adb> exit
adb push script-HDMI-1080p60.bin /mnt/obb/
adb shell
adb> cd /mnt/obb
adb> busybox cp script-HDMI-1080p60.bin script.bin

If you don't want to edit the script file yourself, you can download my prepared one: script-HDMI-1080p60.bin

U-boot

Since I added ZFS to u-boot for CuBox, and also patched in Samsungs EXT4 patches, I built hno's u-boot to test.

https://github.com/lundman/uboot-allwinner/tree/zfs
wget http://lundman.net/ftp/mele/sunxi-spl.bin
dd if=sunxi-spl.bin of=/dev/sdc bs=1024 seek=8        # Obviously, sdc is my SDcard, change device to applicable.

wget http://lundman.net/ftp/mele/u-boot.bin
dd if=u-boot.bin of=/dev/sdc bs=1024 seek=32          # Obviously, sdc is my SDcard, change device to applicable.
U-Boot 2012.04.01-g39085db-dirty (May 29 2012 - 02:29:31) Allwinner Technology 

CPU:   SUNXI Family
Board: A10-EVB
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

sun4i#zfsload
zfsload - load binary file from a ZFS filesystem
sun4i#zfsload mmc 0:2 0x48000000 /boot/@/uImage
Loading file "/boot/@/uImage" from mmc device 0:2 xxa2
zfs fsname = '/boot/' snapname='<NULL>' filename = '/uImage'
4230340 bytes read

sun4i#bootm 0x48000000
## Booting kernel from Legacy Image at 48000000 ...
  Image Name:   Linux-3.0.8+
  Image Type:   ARM Linux Kernel Image (uncompressed)
  Data Size:    4230276 Bytes = 4 MiB
  Load Address: 40008000
  Entry Point:  40008000
  Verifying Checksum ... OK
  Loading Kernel Image ... OK
OK

Starting kernel ...

DRAM: 512[    0.000000] Initializing cgroup subsys cpuset


Android Kernel

I wanted to replace the ICS4 kernel with my own, for the nic fixes. These are the steps I took:

git clone https://github.com/amery/linux-allwinner
git branch lichee-3.0.8-sun4i
make sun4i_crane_defconfig

Check that .config has

CONFIG_MODVERSIONS=y
# CONFIG_MODULE_SRCVERSION_ALL is not set

The wemac nic was panicing on boot everytime, until I changed this:

drivers/net/sun4i/sun4i_wemac.c
#define PHY_POWER 0   /* was 1 */
make uImage

From android, I used ConnectBot to make a copy of the 'boot' partition, nandc.

adb shell
adb> dd if=/dev/block/nandc of=/mnt/sdcard/nandc bs=65536
adb pull /mnt/sdcard/nandc

Then split it up into kernel and ramfs, you can find split_bootimg.pl my storage area (url above)

# ./split_bootimg.pl nandc
Page size: 2048 (0x00000800)
Kernel size: 8410564 (0x008055c4)
Ramdisk size: 975609 (0x000ee2f9)
Second size: 0 (0x00000000)
Board name: 
Command line: 
Writing nandc-kernel ... complete.
Writing nandc-ramdisk.gz ... complete.

The idea is to make a new kernel, that looks roughly the same as nandc-kernel, and re-use the nandc-ramdisk.gz

Once the compile has finished, we make a new image. According to the nandc ANDROID! header, the base address for Mele is 0x40000000

# mkbootimg --base 40000000 --kernel arch/arm/boot/Image --ramdisk ../nandc-ramdisk.gz -o ../mynewimage.img

Now I boot into Miniand image on SD card, use my nand.ko to load the device for /dev/nand*. You can find my Miniand kernel uImage and nand.ko in the storage area too. The default Miniand kernel did not come with nand driver.

# modprobe nand.ko
# dd if=mynewimage.img of=/dev/nandc bs=2048
# sync
# reboot

and remove the SD card to boot Android. If you want to undo, and go back to ICS4, put nandc file instead of mynewimage.img in the dd line above.

Mele's Wired Network Interface

The wired nic in the Mele is a wemac from Davidcom. It is unfortunately quite poor. You will get decent 100MB speeds from it, but it uses the CPU. If you do any transfers while trying to watch video (including watching video over network) it will stutter for 1080p. Interestingly if you use SD, or USB while watching, it has no problem.

The WIFI driver sits on the USB bus and is not affected by this.

Using a USBEthernet dongle (I tried an Apple brand) also works without issues.


ZFS on Android

I have already ported ZFS to ARM, so that should just work if you compile ZFS with your kernel. But I also wanted to see if I can get ZFS to work with Android. The modules do load ok, but execution does not work:

# cd /mnt/sdcard/
# insmod spl.ko && insmod zavl.ko&&insmod znvpair.ko&&insmod zunicode.ko&&insmod zcommon.ko&&insmod zfs.ko&&insmod zpios.ko&&cp zpool /mnt/obb/&&chmod 755 /mnt/obb/zpool
# cd /mnt/obb
# strace -f ./zpool create melepool /dev/block/sda1    
open("/dev/block/sda1", O_WRONLY|O_EXCL|O_LARGEFILE) = 6
write(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
fdatasync(6)                            = 0
close(6)                                = 0
open("/melepool", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = -1 ENOENT (No such file or directory)
ioctl(3, ITE_GPIO_IN

and it hangs.


djmount for Android

So one option is to have a mediaplayer with UPNP ability, like that of BubbleUPNP or PlugPlayer. However, both of these do poorly with Mele's remote control. With Bubble you can not click on Directories to enter them, but have to Mouse-Mode in/out to do so.

So one option is to mount all UPNP devices as a directory. Since Mele's kernel already comes with FUSE, I compiled djmount for it (patched version with >2GB size fixed).

% adb push djmount /mnt/obb
% adb shell
# cd /mnt/obb
# chmod 755 djmount
# ./djmount  -o allow_other /mnt/sdcard/Pictures                # No reason to pick "Pictures" I just wanted an existing directory
# ls -l Pictures/                                 
-r--r--r-- root     root           49 2000-01-01 20:00 devices
dr-xr-xr-x root     root              2000-01-01 20:00 llink-daemon UPNP Media Server (MediaServer) : 1

# ls -l Pictures/llink-daemon\ UPNP\ Media\ Server\ \ \(MediaServer\)\ \:\ 1/
dr-xr-xr-x root     root              2000-01-01 20:00 DVD
dr-xr-xr-x root     root              2000-01-01 20:00 Game of Thrones
dr-xr-xr-x root     root              2000-01-01 20:00 Music
dr-xr-xr-x root     root              2000-01-01 20:00 Video
-r--r--r-- root     root     14010368 2000-01-01 20:00 movie.m4v

And indeed, if you use the File browser in ICS4, you can just enter that directory, and play any video. Note that djmount is pretty slow on listing directories, and I think we might want to look at speeding that up if we are to use it long term. Also, increase the cache timeout from 60s to something much higher, like 10 minutes.


PS3EYE WebCam

I wanted to see if the PS3 Eye would work with Mele, and Skype.

Video:

# insmod gspca_main.ko                                
# insmod gspca_ov534.ko videomode=13       

That makes the camera work with Skype and Zoom Camera app. When I tried one of the 640x480 modes it just hangs, so currently it is 320x240@60.

Audio:

No idea. The device shows:

# cat /proc/asound/cards                              
0 [sun4icodec     ]: sun4i-CODEC - sun4i-CODEC
                     sun4i-CODEC  Audio Codec
1 [sun4isndhdmi   ]:  - sun4i-sndhdmi
                     sun4i-sndhdmi
2 [CameraB409241  ]: USB-Audio - USB Camera-B4.09.24.1
                     OmniVision Technologies, Inc. USB Camera-B4.09.24.1 at usb-sw-ehci-1.3, high sp
3 [sun4isndspdif  ]:  - sun4i-sndspdif
                     sun4i-sndspdif

And we get the device nodes:

# ls -l /dev/snd/
crw-rw---- system   audio    116,   0 2012-07-03 14:12 controlC0
crw-rw---- system   audio    116,  32 2012-07-03 14:12 controlC1
crw-rw---- system   audio    116,  64 2012-07-03 14:12 controlC2
crw-rw---- system   audio    116,  96 2012-07-03 14:12 controlC3
crwxrwxrwx system   system   116,  24 2012-07-03 14:12 pcmC0D0c
crwxrwxrwx system   system   116,  16 2012-07-03 14:12 pcmC0D0p
crw-rw---- system   audio    116,  48 2012-07-03 14:12 pcmC1D0p
crw-rw---- system   audio    116,  88 2012-07-03 14:12 pcmC2D0c
crw-rw---- system   audio    116, 112 2012-07-03 14:12 pcmC3D0p
crw-rw---- system   audio    116,  33 2012-07-03 14:12 timer

But no idea how to tell Android to use the USB device as the main microphone.

# setprop usb.audio.cap.device pcmC0D0c
# setprop media.audio.in.mode usb

Neither of those work.