Archive

Posts Tagged ‘tutorial’

ps_mem Shows Programs RAM Usage in Linux

August 10th, 2015 6 comments

There are several ways to see how much RAM is used in a Linux system with tools like free, vmstat, top, etc…, but today I’ve come across ps_mem which displays the RAM used for each program in a neat way.

ps_memThe post on lintut.com explains how to install it on Centos / Fedora:

yum install ps_mem -y

As a Ubuntu user, I immediately tried apt-get install ps_mem, but there isn’t such package. After running apt-file search, I found it in w3af-console package:

sudo apt-get install w3af-console
sudo chmod +x /usr/share/w3af/core/controllers/profiling/ps_mem.py
sudo ln -s /usr/share/w3af/core/controllers/profiling/ps_mem.py /usr/sbin/ps_mem

Another way to install the script is to simply get it from Github.

Running the command without options will list of programs with RAM usage from the smallest to the largest:

sudo ps_mem
 Private  +   Shared  =  RAM used	Program 

  4.0 KiB +  33.0 KiB =  37.0 KiB	inetutils-inetd
  4.0 KiB +  35.0 KiB =  39.0 KiB	rpc.idmapd
  4.0 KiB +  39.5 KiB =  43.5 KiB	rpc.mountd
  4.0 KiB +  48.5 KiB =  52.5 KiB	rpc.statd
  8.0 KiB +  62.0 KiB =  70.0 KiB	atieventsd
 44.0 KiB +  46.5 KiB =  90.5 KiB	rtkit-daemon
 96.0 KiB +  18.5 KiB = 114.5 KiB	cat
............
150.5 MiB +   5.1 MiB = 155.6 MiB	gimp-2.8
186.5 MiB +   9.5 MiB = 196.0 MiB	plugin-container
270.8 MiB +  12.1 MiB = 282.9 MiB	compiz
348.5 MiB +  19.0 MiB = 367.5 MiB	nautilus
409.3 MiB +   3.4 MiB = 412.7 MiB	thunderbird
393.8 MiB +  28.0 MiB = 421.8 MiB	Xorg
  2.1 GiB +  11.0 MiB =   2.1 GiB	firefox
---------------------------------
                          5.0 GiB
=================================

You can also check the full command line for the programs:

sudo ps_mem -s
Private + Shared = RAM used Program

4.0 KiB + 31.5 KiB = 35.5 KiB /sbin/getty -8 38400 tty5
4.0 KiB + 32.0 KiB = 36.0 KiB /sbin/getty -8 38400 tty3
4.0 KiB + 32.0 KiB = 36.0 KiB /sbin/getty -8 38400 tty1
4.0 KiB + 32.5 KiB = 36.5 KiB /sbin/getty -8 38400 tty2
4.0 KiB + 33.0 KiB = 37.0 KiB /sbin/getty -8 38400 tty6
4.0 KiB + 33.0 KiB = 37.0 KiB /sbin/getty -8 38400 tty4
4.0 KiB + 33.0 KiB = 37.0 KiB /usr/sbin/inetutils-inetd
............
155.9 MiB + 4.3 MiB = 160.2 MiB gimp-2.8
186.3 MiB + 9.3 MiB = 195.6 MiB /usr/lib/firefox/plugin-container /usr/lib/flashplugin-installer/libflashplayer.so -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 3746 true plugin
265.0 MiB + 9.4 MiB = 274.4 MiB compiz
343.2 MiB + 2.8 MiB = 346.0 MiB /usr/lib/thunderbird/thunderbird
352.5 MiB + 28.0 MiB = 380.5 MiB /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
366.7 MiB + 18.6 MiB = 385.3 MiB nautilus -n
2.2 GiB + 9.3 MiB = 2.3 GiB /usr/lib/firefox/firefox
---------------------------------
4.9 GiB
=================================

If you are only interested in one or more program, add the PID list to the command line:

sudo ps_mem -s -p 3746,3665
 Private  +   Shared  =  RAM used	Program 

344.0 MiB +   2.8 MiB = 346.8 MiB	/usr/lib/thunderbird/thunderbird
  2.2 GiB +   9.3 MiB =   2.2 GiB	/usr/lib/firefox/firefox
---------------------------------
                          2.6 GiB
=================================

Finally, if you want to update the memory usage values every X seconds run:

sudo ps_mem -w X

You can also combine it with a PID list, if you only want to track one or more programs.

Via Radenko Bogdanovic

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Install and Run Linux on Zidoo X1 TV Box

August 6th, 2015 6 comments

Now that I’ve completed Zidoo X1 review, I’ve decided to try out Ubuntu on the mini PC following a tip from one reader that Orange Pi 2 images can run on the platform since it’s based on the same Allwinner H3 processor, but with some limitations such as WiFi not working.

Zidoo_X1_Linux_Ubuntu

There are three Linux firmware images for Orange Pi 2 on the download page: Lubuntu, Raspbian, and Debian server. I decided to go with Lubuntu image.

First you need to download Lubuntu_1404_For_OrangePi2-mini2_v0_8_0_.img.xz image from Google Drive or Baidu, uncompress it, and then flash the image to a Class 10 micro SD card in Windows or Linux. I ran the following command line in a computer running Ubuntu 14.04:

sudo dd if=Lubuntu_1404_For_OrangePi2-mini2_v0_8_0_.img | pv | sudo dd of=/dev/sdX bs=16M

Where X in sdX is the letter of your micro SD card, which you can find with lsblk. In some platforms, it might be /dev/mmcblkX instead of /dev/sdX.

Once it’s done, insert the micro SD into Zidoo X1, connect a mouse and keyboard, an Ethernet cable, and power up the device. Boot is relatively fast as I got to LXDE login within 25 seconds, then inputted the password “orangepi” for orangepi user, and could use the system straightaway.

Zidoo_X1_Ubuntu

Lubuntu Running on Zidoo X1 (Click for Full Size – 1280×720)

I browsed the web with Chromium Web Browser (pre-installed), although without flash, but it should be easy to install Google Pepper. Allwinner H3 is a low end platform, so you can’t expect miracles in terms of performance but this is usable. Beside the lack of flash support, YouTube can’t be played smoothly as with most other ARM platforms, and there’s no audio via HDMI either. I could play a 1080p video from a USB drive with GNOME player (also pre-installed), but CPU usage was high with tearing from time to time.

I could also see lots of errors in the kernel log, about failing to set the CPU frequency:

[  530.836314] [cpu_freq] ERR:set cpu frequency to 1200MHz failed!

So the good is that it’s very easy to run Linux on Zidoo X1, and since it runs from micro SD card it does not affect your Android firmware. However, if you need a fully working image with WiFi and audio (and maybe other issues I missed),  you’d still need to do a bit of work. I also don’t think the GPU and VPU are currently supported in Orange Pi 2 images.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Unbrick MeegoPad T01 (Intel Atom Z3735F) HDMI TV Stick

May 21st, 2015 6 comments

When you use one of the Intel Atom Z3735F mini PCs, there’s very little chance to brick it as long as you use the pre-installed operating systems. But if you play around with the BIOS, or use one of the recent dual boot firmware that re-flash the BIOS when you switch OS, there’s a real possibility to completely brick your device. Ian Morrison (Linuxium) and Deadhp1 posted separate instructions to flash the BIOS and recover their devices.

MeegoPad T01 Connected to Flash Writer

MeegoPad T01 Connected to Flash Writer

Both bricked MeegoPad T01, and deadhp1 used CH341a USB programmer which only supports 3.3V/5V, while the SPI flash on T01 only support 1.8V. It worked for him, but it could potentially fry the flash. So it’s probably better to with Ian’s solution involving EZP_XPro USB Programmer and some SOIC8 Test Clips.

Once you get the hardware, you’ll need to download on install EZP XPro Flash 1.4 on a Windows PC. Now follow the steps below:

  1. Ttake out MeegoPad T01 out of its casing, and disconnect the battery.
  2. Assemble the test clips with the socket adapter and plug into the programmer
  3. Connect the programmer’s USB cable to your PC and attach the test clips to the BIOS chip (pin 1 must be correctly aligned)
  4. Run “EZ” program which should automatically detect the BIOS (flash) chip
  5. Load the BIOS (for example that one for MeegoPad T01) using the “brower” button
  6. Finally click on “Erase”, “Program”, and “Verify”

Ian made a video with the steps to follow with EZ software.

Once all is done, simply disconnect the test clips, re-plug the battery and put back the board in the casing, connect Meegopad T01 and check it can boot again. Good luck!

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

lowRISC Open Source SoC Project Announces its First Release with Tutorials for Simulators and Zedboard

April 14th, 2015 4 comments

lowRISC project aims to produce a completely open-source SoC (System-on-Chip) based on the 64-bit RISC-V instruction set architecture, as well as a corresponding development board, thus eventually producing a fully open hardware systems. The project has now announced its first release “tagged memory preview release” with a tutorial explaining how this has all been designed, and how to run simulations with software tools, or FPGA boards such as Zedboard.

lowRISC_Rocket_Chip

Rocket Chip Block Diagram

 

The project is based on Rocket core, written in Chisel language by the RISC-V team at UC Berkeley. Chisel can generate code to produce a cycle-accurate C++ emulator, Verilog optimised for FPGAs or Verilog for use in an ASIC flow.If you want to try it out, you’ll need a Linux machine, preferably running Ubuntu 14.04 64-bit, with GNU GCC 4.8 installed, and follow the tutorial in order to get the source code, and build tools such as riscv64-unknown-elf-gcc compiler, and Spike simulator, as well as a RISC-V Linux kernel. Finally, they’ll show you how to run various simulations using Spike, the C++ emulator, or an FPGA board.

This is only a first step, and much more work is needed, with the organization expecting to provide more features in the next releases including “tag support in the Spike simulator and support for the L2 cache, as well as a better ISA and core support for tags”, and later on, the development of an “untethered version of the SoC with the necessary peripherals”.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Program STMicro STM8S $1 Board in Linux

April 13th, 2015 10 comments

In January, I discovered there was such thing as a one dollar development board based on STMicro STM8S103F3P6 8-bit MCU with 1KB SRAM, 8KB flash, and 640 bytes EEPROM, some GPIOs as well as I2C, UART, SPI, ADC, and PWM signals. Links to documentation and source code were provided, but development tools were only Windows based. However, one of my reader informed me SDCC (Small Devices C Compiler) supported STM8, and development in Linux should be feasible. So I decided to buy the board on eBay for $1.62, as well as an ST_link V2 programmer for STM8 / STM32 for $4.52 in order to flash the firmware.

The board came pretty quickly, i.e. within 2 to 3 weeks.

STM8S103F3_BoardBut due to a lost package, the programmer took nearly 3 months to reach me, as the seller had to re-send after I failed to receive it within 2 months.

ST-Link_V2_ProgrammerIt comes with 4 wires that need to be connected to RST/NRST, 3.3V, SWIM, and GND. To do so, I had to solder a 4-pin header on the side of the board.

To get started with STM8 on Linux, I found some information on ColeVision website where they explained how to run Drystone on STM8/128-EVAL board using SDCC as the compiler, and stm8flash to program the board.

So I’ve given it a try on Ubuntu 14.04 with the simple goal of blinking the TEST LED on the board. sdcc is an Ubuntu package, so it’s pretty easy to install:

sudo apt-get install sdcc

Let’s check the version and some more information:

sdcc --version
SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.3.0 #8604 (Dec 30 2013) (Linux)

That’s version 3.3.0 released in December 2013 and it lacks STM8 supports, but the latest version (sdcc v3.4.0) has been released in April 2014, and we can get it with a PPA, so let’s use that one instead:

sudo add-apt-repository ppa:laczik/ppa
sudo apt-get update
sudo apt-get remove sdcc sdcc-libraries
sudo apt-get install sdcc

If you are using Ubuntu 14.10 or greater, you’ll already get the latest version.

Let’s double check stm8 is indeed supported:

sdcc --version
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.4.0 #8981 (Jan 10 2015) (Linux)
published under GNU General Public License (GPL)

Great! stm8 is now present in the list of supported MCUs.

For the next step was to install stm8flash tool to program the device:

git clone https://github.com/vdudouyt/stm8flash.git
cd stm8flash
make
sudo make install

Now I had to find some code samples to blink the LED. I started but checking the samples for ST Visual Programmer and IAR tools, combine with a modified version of Drystone source code, but I always had some issues with the header files, and it seems a bit more work than expected. But then I discovered that Valentin Dudouyt, stm8flash developer, also provided code samples in his github account, including a blinky sample:

git clone https://github.com/vdudouyt/sdcc-examples-stm8.git
cd sdcc-examples-stm8

First, I tried to compile the samples, and they failed because sp_test.c was missing, so I edited the Makefile to remove sp_test.ihx, and build was successful. The LED on the board is connected to B5 GPIO, so at that point I had to check out STM8S103F3 datasheet to find out more about the registers used in the sample. The register map is in section 6.2 of the document, and I need to use three registers:

  • PB_ODR – Port B data output latch register (Sets pin HIGH or LOW)
  • PB_DDR – Port B data direction register (Sets direction to INPUT or OUTPUT)
  • PB_CR1 – Port B control register 1

Since pin 5 correspond to 00100000 (0x20) I updated blinky.c sample as follows:

#include "stm8l.h"

int main() {
        int d;
        // Configure pins
        PB_DDR = 0x20;
        PB_CR1 = 0x20;
        // Loop
        do {
                PB_ODR ^= 0x20;
                for(d = 0; d < 29000; d++) { }
        } while(1);
}

I typed make again to generate an updated firmware (blinky.ihx), and flash it as follows:

stm8flash -c stlinkv2 -p stm8s103 -w blinky.ihx
Determine FLASH area
Writing Intel hex file 189 bytes at 0x8000... OK
Bytes written: 189

All good and the LED started blinking…
STM8S_Blink_LED

So now you should be able to write simple program to control other GPIOs, I2C, SPI, UART with the board. But if your program is a little more complex a debugger could be useful, and there’s Texane STLink working on Windows, Mac, and Linux, that can run gdbserver for STM32… But I tried it for STM8.

git clone https://github.com/texane/stlink
cd stlink
./autogen.sh
make -j8

Then I ran st-link:

./st-util
2015-04-13T16:44:34 INFO src/stlink-usb.c: -- exit_dfu_mode
2015-04-13T16:44:34 INFO src/stlink-common.c: Loading device parameters....
2015-04-13T16:44:34 WARN src/stlink-common.c: unknown chip id! 0xe0042000

Hmmm, it does not look good, and sadly there’s no support for STM8 yet, as STM32 and STM8 use different interfaces (SWD vs SWIM).

So if you have troubles debugging your program, you may have to revert to Windows based tools, at least for now, unless you’re up for the task and want to add STM8 support to Texane.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Easily Install Popular Add-ons in Kodi

April 8th, 2015 14 comments

You can use Kodi to watch videos locally, but various add-ons can be installed to also access videos online, but finding and installing add-ons might be a pain if you don’t know where to start. TVaddons.ag, previously known as XBMCHUB, is providing add-ons allowing to do just that, more or less legally [Update: You may want to read comments for details about the legality of these add-ons], as well as a method to install a bunch of popular add-ons in a few clicks. These add-ons are completely unrelated to Kodi project, and have been developed and maintained by third parties.

The installation requires Fusion Installer and Config Wizard with detailed instructions available here and there with every screenshot, which makes it more complicated than it really is, but it can be summarized as follows:

  1. Go to System->File Manager, and click Add source
  2. You’ll get the following pop-up window, where you need to enter the source “http://fusion.tvaddons.ag” and a name such as “fusion”, and press OK.
    Kodi_Fusion_Installer
  3. Go back to the main menu, and select System->Setttings.
  4. Navigate the Add-ons sub menu, and click on Install from zip
  5. Select fusion (or any other name you choose in step 2), and start-here
  6. Click on “plugin.video.hubwizard-1.1.5.zip”. I will feel like nothing happens on that step, that’s normal
  7. Go back to the main menu, and select Programs->Config Wizard
  8. You’ll get the following screen to select your platform. I’m using Kodi 14.2 in Ubuntu 15.04, so I selected “Linux“, and clicked on Yes.
    TVaddons_config_wizard
  9. Now be patient as the wizard downloads and installs adds-ons. It took about 30 minutes on my mini PC.
  10. Once completed, you’ll automatically be back in the main menu. Exit and restart Kodi to complete the installation
  11. Done!
Kodi 14 with TVaddons Installed (Click for Original Size)

Kodi 14 with TVaddons Installed (Click for Original Size)

You should now have 5 new add-ons showing on the main page: 1Channel, Genesis, Project Free TV, Icefilms, and Phoenix.

I’ve given it try, and the results were mixed, but it might be partially due to my location. Project Free TV will simply not work due to a script error. 1Channel, Icefilms, and Phoenix would let me access to various movies and TV channels, and popular ones included recent movie like Big Hero 6 or Interstellar, and TV series like Games of Thrones, The Big Bang Theory and so on, but most of them would not play, and in some case I was even asked to input an annoying captcha. I mostly got luck with Genesis add-on, where I could start playing a few movies, but still I had to arm myself with patience while browsing the list, and the initial buffering.

You can watch a short demo below. There’s no audio in the video because I used MeLE PCG03 which does not support HDMI audio (yet) in Linux, and I recorded the demo with Zidoo X9 HDMI recorder.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Categories: Linux Tags: how-to, kodi, tutorial

Xiaomi Mi Box Mini Review

April 4th, 2015 37 comments

After showing pictures of Xiami Mi Box Mini, it’s now time for a “review”, but a bit different from my other reviews, or Xiaomi tiny media player is much different. First the firmware is in Chinese only, and there’s only one external port HDMI output. So first I’ll show the user interface is Chinese, then explain how you can install your own Android apps, and finally run some benchmark to evaluates Mediatek MT8568, Wi-Fi and storage performance.

Xiaomi Mi Box Mini Setup and Chinese User Interface

The device is super small, but in my case it was almost too big, as it takes enough space to potentially cause problems with the adjacent plug.

Mibox_mini_power_extension

This little issue will of course depend on your power extension.  You then need to connect the 1.5 meter HDMI cable, which should be long enough for most setups, and you’ll see some guide asking you to remove the plastic sheet under the battery on the Bluetooth remote, and showing how to use the remote (I guess).

Xiaomi_Mi_Box_Mini_SetupAfter that you need to configure Wi-Fi, which should be relatively straightforward even you can’t read a word a Chinese, and then you get to the user interface.Xiaomi_Mi_Box_Mini_User_InterfaceWe are told the box runs Android, but all visual traces of that are gone including the setup.

I’ve recorded a video of the user interface with Zidoo X9 recorder to show what you’d get.

So if you can’t read Chinese, you’ll be up for a struggle, and the only think you may be able to use is Miracast function, although I had mixed luck making it work with my mobile phone (M6752). Alternatively, there’s a QR code in the user manual linking to an app that will allow you to display your mobile’s photos and videos on the big screen.

If you are an oversea Chinese you may have though it could have been a nice option to watch Chinese shows and movie online, but unfortunately most of the content is only copyrighted for China viewing, or you’d need to setup a VPN.

Xiaomi_Movie_Copyright_China_OnlyI’ve been told the two lines in the picture above translated into “Your current region does not support the playback of this channel” and “Downloading source information” so no Fast and Furious 7 for me…

There’s an option to enable adb.

Xiaomi_Mi_Box_Mini_adb

But I had no luck connecting to the box with adb over Wi-Fi, and whatever setting I choose adb port is not open.

sudo nmap -sS 192.168.0.109

Starting Nmap 6.40 ( http://nmap.org ) at 2015-04-03 16:27 ICT
Nmap scan report for 192.168.0.109
Host is up (0.0065s latency).
Not shown: 994 closed ports
PORT     STATE SERVICE
1080/tcp open  socks
5000/tcp open  upnp
7000/tcp open  afs3-fileserver
7100/tcp open  font-service
9003/tcp open  unknown
9876/tcp open  sd
MAC Address: 10:48:B1:95:5D:86 (Beijing Duokan Technology Limited)

Nmap done: 1 IP address (1 host up) scanned in 28.07 seconds

Finally, as I tried the box, I got a pop-up for a new firmware that I happily installed. Unfortunately, I turned out to be a bad idea since this also removed the menu required to side-load apks to the board. So I had to downgrade the firmware, something that’s very easy to do since there’s an option for that.

Xiaomi_Mi_Box_Mini_Firmware_DowngradeSimply go to the firmware upgrade menu, and click on the right button, a window will pop-up asking if you really want to downgrade from MIUI TV 1.3.72 to MIUI TV 1.3.76. Accept by selecting the left button.

Changing Xiaomi Mi Box Mini Language and Side-loading Apps

A shop posted video instructions to help users change the language and load apps, including Google Play. To do so, click on the third icon from the left in the launcher, and select the fifth option on the top menu.

Xiaomi_Mi_Box_Mini_Remote_Connection

If the third Blue option is missing, then your firmware may have removed the option to side-load apps, and should you try to downgrade the firmware as mentioned above. If you can’t do that, I don’t know other solutions to change to English and install apps.

Xiaomi_Mi_Box_Mini_Side-load_appsUpon entering the third options, you’ll ne shown an address, in my case http://192.168.0.109:6095/443 that you need to type in your mobile or computer’s browser, and will allow you copy files to the device over Wi-Fi.

Xiaomi Mi Box Mini File Uploader (Click to Enlarge)

Xiaomi Mi Box Mini File Uploader (Click to Enlarge)

A bunch of apk have been provided, including Google services, Google Play, and YouTube, but unfortunately, so the only one you really need to download is Shafaguanjia.apk, as it will allow you to access Android settings, and change the language and input method, as well as upload more apk, which may fail with the Xiaomi uploader. Once the file is transfered to Mi Box Mini, you’ll get the usual installation prompt asking to review permissions before installation, and installation is complete, you should see “Shafa Market” app (in Chinese) shown in the right of the main screen.

Start the app, select the Setup icon to enter the “standard” Android settings, scroll down until your the the options for Language (“A” icon), select the first options, and you should be able to select English, simplified Chinese, or traditional Chinese as shown in the picture below.

Xiaomi_Mi_Box_Mini_English

Now get a bunch of apk you want to install, for example with APK Downloader, and since the default web uploader does not seem to work for all apk, instead go to the last option to the right of the top menu in Shafa market, and click on the bottom right icon (Computer + Smartphone) in order to get another address to upload, for example http://192.168.0.109:8899.

Shafa_Market_Apk_installation

Upload Option in Shafa Market

The webpage is similar to the Xiaomi one, with a single green button to browse your local storage and install apps.

Shafa_Market_Apk_DownloaderI’ve installed a bunch of application include ES File Explorer, Antutu, Vellamo, CPU-Z, Google Play, Chrome (there’s no web browser by default), Amazon appstore, Kodi 14.2, and so on. For some unknown reasons, Firefox Android browser was transfer to Xiaomi box but the installation window did not show up. Once you have installed Shafa Market, you can safely upgrade your Xiaomi Mi Box Mini firmware.

Xiami_Mi_Box_Mini_App_InstallationThe Bluetooth is a standard remote, e.g. not a magic remote with pointer, so many android apps won’t work. You should be able to work around this by using a Bluetooth mouse and keyboard, but I don’t happen to have any, and since the device is not rooted it might not be possible to install a server (e.g. DroidMote) to be used with a smartphone remote app. So I had to give up on using Amazon Appstore, 3Dmark benchmark, and iperf, and I did not even bother side-loading any games for that reason. Chrome browser is working, but you may have to select “Request desktop site” with the menu key in order to be able to click on links…

If you want to see I’ve shot another video with the user interface in English and a few extra apps.

Since I forgot to include Kodi in the video above, and I’m sure some people would ask, I’ve also tried to play a few samples including Sintel Blu-ray in Kodi 14.2 from a SAMBA share. It sort of work for some videos, but in many cases the system struggle to have a decent framerate, or there are massive artifacts.

Xiami Mi Box Mini Benchmarks

Mediatek MT8685 is a completely new processor to me, so I had to run CPU-Z first.

Xiaomi_Mi_Box_Mini_CPU-ZThe processor indeed features  four Cortex A7 cores @ 598MHz to 1.51 GHz with a Mali-450 MP GPU.

Xiaomi_Mi_Box_Mini_Forrestgump_CPU-ZThe board is called forrestgump, the screen resolution is 1920×1080, and there’s just 968 MB RAM, and 2.13 GB storage available from the internal flash.

The box gets 21,091 points in Antutu 5.6.1, but the score is probably higher than it should because it was only performed on part of the screen (830×1080 instead of 1920×1080), hence affecting 2D and 3D graphics scores positively.

Antutu 5.6.2 on Mi Box Mini (Click to Enlarge)

Antutu 5.6.2 on Mi Box Mini (Click to Enlarge)

I’ve also run Vellamo 3.1 which in most cases places Xiaomi Mi Box Mini close LG Nexus 4 smartphone powered by Qualcomm Snapdragon S4 Pro quad core processor (APQ8064).

Xiaomi_Mi_Box_Mini_Vellamo_3.1You can get the comparison charts for Multicore, Metal, and Browser.

I’ve also tried to run 3DMark, but I could not download Ice Storm package due to input issues.

I can’t report about Wi-Fi performance either since ES File Explorer failed to copy a file from SAMBA to flash, and I could not use iperf, again due to input issues as the software keyboard would not show up when needed…

I still managed to run A1SD bench to evaluate internal storage performance, but there’s no little storage, that the utility detected Cache reads. The reported read speed is 57.11 MB/s, and write speed is 12.41 MB/s.

Mibox_mini_storage_performance

Read & Write Speed in MB/s

Conclusion

If you live in China, Xiao Mi Box Mini may be a nice little device giving you access to lots of content. If you can read Chinese, and live overseas, be prepared to setup a VPN to China, and you may access the many online videos and movies, but if you don’t read a word of Chinese, switching to English will require some efforts, and many apps won’t work as expected, unless possibly if you get a Bluetooth air mouse or Bluetooth keyboard and mouse. Provided the latter work, you could get a decent little box for web browsing, some casual gaming, watching videos and so on. Just don’t expect Google Play, YouTube. etc… to work.

In case you’d still like to give it a try, GearBest, who kindly provided a sample for review, sells it  for $42.98 with coupon MIBOX, but you can also purchase on other websites such as GeekBuying, Aliexpress, or eBay for around $50.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Cubieboard 4 Ubuntu Review – Setup, Usability, and Performance

April 1st, 2015 6 comments

Cubieboard4 is a development board powered by Allwinner A80 octa-core processor with 2GB RAM and 16GB eMMC. I’ve already shown how to get started with the board using the pre-installed Android 4.4 image, and run some benchmarks in Android, so now it’s time to check out the Ubuntu Linaro 14.04 image provided by CubieTech. I’ll show how to install and setup Ubuntu 14.04 on the board using a micro SD card, run desktop applications like Chromium, Libre Office, and son on on the board, and complete the review with some Linux benchmarks.

Setting up Ubuntu on Cubieboard4

Firmware images for Cubiebord4 can be downloaded @ http://dl.cubieboard.org/model/cc-a80/Image/. Currently Android 4.4, Debian server, Ubuntu Linaro server, and Ubuntu Linaro desktop with LXDE desktop environment. That’s the latter I’ll use for the experiment, and two images are available:

  • linaro-desktop-cb4-card-hdmi-v0.4.img.7z – Bootable image from micro SD card
  • linaro-desktop-cb4-emmc-hdmi-v0.4.img.7z – Installation image to eMMC to be written to micro SD card (and not via PhoenixSuite).

I’ve just downloaded and flash the “card” image to a 32GB Class 10 micro SD card in a terminal windows in a Linux computer:

wget http://dl.cubieboard.org/model/cc-a80/Image/ubuntu-linaro/ubuntu-linaro-v0.4/linaro-desktop-cb4-card-hdmi-v0.4.img.7z
7z x linaro-desktop-cb4-card-hdmi-v0.4.img.7z
sudo dd if=linaro-desktop-cb4-card-hdmi-v0.4.img | pv | sudo dd of=/dev/sdX bs=16M

where X is the letter of your SD card, which you can check with lsblk. Be very careful as using the wrong letter may wipe out your hard drive, and you may consider using a virtual machine to be extra safe. This step also be done in a Windows computer with 7-zip and Win32DiskImager utilities.

Now insert the micro SD card into the board, connect the necessary cable, and power it on. After around 35 seconds, maybe a little more the first time, I get a usable desktop. Your own boot time will obviously be impacted by your micro SD card performance.

Cubieboard4_Ubuntu_LXDE

Lubuntu Desktop (Click for Original Size)

Firefox and Nautilus are not part of the default image, but I’ve installed them with apt-get, and added shortcuts to the desktop.

Usually, you need to run gparted or resize2fs to make full use if your SD card capacity, but this is automatically taken care of by the image, and my root partition was automatically extended to 30GB:

linaro@cubieboard4:~$ df -h
Filesystem       Size  Used Avail Use% Mounted on
/dev/root         30G  4.2G   25G  15% /
devtmpfs         814M  4.0K  814M   1% /dev
none             4.0K     0  4.0K   0% /sys/fs/cgroup
none             163M  476K  163M   1% /run
none             5.0M     0  5.0M   0% /run/lock
none             814M     0  814M   0% /run/shm
none             100M  4.0K  100M   1% /run/user
/dev/mmcblk1p2   128M  5.6M  123M   5% /media/mmcblk1p2
/dev/mmcblk1p7   756M  587M  170M  78% /media/linaro/57f8f4bc-abf4-655f-bf67-946fc0f9f25b
/dev/mmcblk1p10  630M   11M  620M   2% /media/linaro/57f8f4bc-abf4-655f-bf67-946fc0f9f25b1
/dev/mmcblk1p1   5.7G  3.4G  2.4G  59% /media/linaro/57f8f4bc-abf4-655f-bf67-946fc0f9f25b2
/dev/mmcblk0p1    12M  6.1M  5.9M  51% /media/linaro/29BC-6723

Since I’m connected to Internet via an Ethernet connection I did not have to configure anything else, except the timezone set with:

sudo dpkg-reconfigure tzdata

At this stage, you’ve got a fully workable ARM Linux computer, although if you want to use Wi-Fi, Bluetooth, and/or a printer more configuration work is required, but I haven’t tried any of these.

Cubieboard4 Usability as a Desktop Computer

The image is quite minimal, and beside Pacman file manager and a few other small programs, only Chromium browser is already installed. So I installed Firefox, Libre Office, Nautilis and Gimp with apt-get:

sudo apt-get install libreoffice nautilus firefox gimp

The system is quite responsive, although programs don’t quite load as fast as from an SSD or eMMC, and you need to wait a few seconds for Chromium or Libre Office to load.

Since the font looked quite poor in Chromium, I installed Firefox, but I had the same results. So finally I installed Ubuntu fonts:

sudo apt-get install ttf-ubuntu-font-family

and configured the web browsers accordingly leading to much better font rendering.

I’ve run the following tests in Cubieboard4 to show the performance, and what is working or not:

  1. 30 seconds boot
  2. List of installed applications
  3. LibreOffice (Writer)
  4. Chromium – Multi-tabs, YouTube (embedded / full screen; VP9), and Candy Crush Saga (Flash game) in Facebook
  5. 3D hardware acceleration with es2gears and glmark2-es2
  6. 1080p video playback with VideoLAN
  7. Power off

I also ran htop in a terminal to show the eight cores CPU usage. Sorry the video is not quite straight and audio is poor with SJ1000 camera.

The system is working quite well, except with YouTube videos which are not so smooth, because YouTube has now mostly switched to VP9 codec, and 3D support failed with “DRI2: failed to authenticate”. Candy Crush Saga worked fine, although not amazingly smooth, but performance is not that much different from my regular Ubuntu PC for that game. 2D hardware acceleration is supposed to be implemented (a80-xf86-video-fbturbo), but I’m not quite sure how to formally test this. H.264 and MPEG4 video could be played in VideoLAN with only one CPU core use confirming hardware video decoding support, but MPEG2, VC1 and H.265 codecs all failed.

Click for Original Size

Click for Original Size

In the screenshot above, I play Big Buck Bunny in VideoLAN on the top left corner, but since hardware video decoding is activated, the video won’t show in the screenshot, which is perfectly normal.

Even though Cubieboard4 Ubuntu support is not too bad right now, I still think ODROID-XU3 Lite delivers a better Linux experience, especially when using an eMMC module, as programs load faster, 3D acceleration is working, as well as Kodi with hardware video decoding. The only downside is that flash (Chromium + pepperflash) did not work when I tried on XU3 Lite, but this may have been fixed by now.

Cubieboard4 Performance Testing in Linux

Phoronix Suite Benchmarks

I’ve installed the latest version of Phoronix Test Suite to run a few benchmarks in Linux:

sudo apt-get install php5-cli php5-gd 
wget http://phoronix-test-suite.com/releases/repo/pts.debian/files/phoronix-test-suite_5.4.1_all.deb
sudo dpkg -i phoronix-test-suite_5.4.1_all.deb

After configure the test suite for batch benchmark with

phoronix-test-suite batch-setup

I decide to run the same three tests as on ODROID-XU3 Lite, encoding MP3, compressing files, and performing some HTTP server tasks:

phoronix-test-suite batch-benchmark pts/encode-mp3 pts/compress-7zip pts/apache

Unfortunately, apache failed to compiled, so only the MP3 and 7-zip test completed.

Cubieboard4_vs_ODROID-XU3-Lite_MP3So the only direct comparison with the test I’ve done between ODROID-XU3 Lite and Cubieboard4 is for MP3 encoding, and in this test the Exynos platform is faster, but the Allwinner A80 board still compares favorably to slower or/and older ARM board like Radxa Rock, ODROID-C1, or PCDuino (cpu test) in 7-Zip test, especially this test runs on all available cores.

7-Zip_Cubieboard4_Radxa_Rock_ODROID-C1

 Mainline kernel compilation

Now let’s see how fast the board build Linux 3.19.

sudo apt-get install libncurses5-dev gcc make git exuberant-ctags
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
cd linux-stable
git checkout -b stable v3.19

Mainline kernel requires gcc 4.9 to build, but Ubuntu 14.04 only comes with gcc 4.8.2, so let’s install the new compiler. Since add-apt-repository is missing, we have to install the relevant package first:

sudo apt-get install software-properties-common

We’ll also need to edit /etc/lsb-release to replace DISTRIB_ID=Linaro by DISTRIB_ID=Ubuntu temporarly, as the toolchain repo has never heard about a Linaro distribution, and then we can complete gcc 4.9 installation.

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9

Allwinner enginners themselves are not directly involved in mainline kernel develompent, but they are usually in the loop when members of linux-sunxi community send patchsets to the ARM Linux kernel mailing list, which mean Allwinner processor are supported in mainline kernel, albeit with limitation. Allwinner A80 codename is sun9i, and we can see a device tree file for A80 OptimusBoard:

linaro@cubieboard4:~/linux-stable$ ls -l arch/arm/boot/dts/ | grep sun9
-rw-rw-r-- 1 linaro linaro   3561 Apr  1 13:23 sun9i-a80-optimus.dts
-rw-rw-r-- 1 linaro linaro  12608 Apr  1 13:23 sun9i-a80.dtsi

Nevertheless, I’ve built the kernel using sunxi default config used for all Allwinner platforms:

make sunxi_defconfig
time make -j8 CC=gcc-4.9
...
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready

real    6m36.198s
user    34m6.070s
sys    4m32.100s

So Cubieboard4 took 6 minutes on 36 seconds to build Linux 3.19, while ODROID-XU3 Lite took 5 minutes 43 seconds to build Linux 3.18, not too bad, but this is show some performance advantage for the Exynos processor.

Video Transcoding with avconv

Ideally video transcoding should not be done by software, since most ARM processors can handle MPEG2 to H.264 transcoding using the VPU, but this can still be useful to evaluate a processor performance, so just like for ODROID-XU3 Lite, I’ve converted a short MPEG2 into H.264 with avconc:

sudo apt-get install libav-tools
time avconv -i big_buck_bunny_1080p_MPEG2_MP2_25fps_6600K.MPG \
-vcodec libx264 -minrate 300k -maxrate 300k -bufsize 1835k bbb-h.264.avi
avconv version 9.11-6:9.11-2ubuntu2, Copyright (c) 2000-2013 the Libav developers
 built on Mar 24 2014 06:21:10 with gcc 4.8 (Ubuntu/Linaro 4.8.2-17ubuntu1)
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mpeg, from 'big_buck_bunny_1080p_MPEG2_MP2_25fps_6600K.MPG':
 Duration: 00:00:44.74, start: 0.240000, bitrate: 7159 kb/s
 Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 9792 kb/s, 24.75 fps, 25 tbr, 90k tbn, 50 tbc
 Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16p, 160 kb/s
[libx264 @ 0x6c9c0] using SAR=1/1
[libx264 @ 0x6c9c0] MB rate (734400000) > level limit (2073600)
[libx264 @ 0x6c9c0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x6c9c0] profile High, level 5.2
Output #0, avi, to 'bbb-h.264.avi':
 Metadata:
 ISFT : Lavf54.20.3
 Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=-1--1, 90k tbn, 90k tbc
 Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, s16p
Stream mapping:
 Stream #0:0 -> #0:0 (mpeg2video -> libx264)
 Stream #0:1 -> #0:1 (mp2 -> libmp3lame)
Press ctrl-c to stop encoding
frame= 1037 fps= 6 q=56.0 size= 30759kB time=40.60 bitrate=6205.9kbits/s

It took  3 minutes 3 seconds to convert the 44 seconds video, so just like with the Exynos board it’s not possible to transcode a 1080p video @ 25 fps in real-time by software, at least with avconv, and the parameters I used. ODROID-XU3 Lite was a bit faster however, managing to convert the same video in 2 minutes and 33 seconds.

Cubieboard4 can be purchased for $125 + shipping on R0ck.me, Eleduino, Seeed Studio, or others, and it’s also listed on Amazon US for $138.99 including shipping.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter