Wednesday 29 June 2016

Docking Station for Mini PC Sticks

Dosupara have released an interesting docking station for their brand of mini PC sticks.




The mini PC stick simply plugs into the docking station and is then connected by the two integrated USB cables.

The standard power supply's USB is then connected to the docking station together with an HDMI cable for output. The dock then provides in addition:

  • a wired LAN port (100BASE-TX)
  • three (3) full-size USB ports



The station itself is relatively compact at 57mm (width) × 60mm (depth) × 128mm (height), weighs 157g and is priced at 3980 Yen (around USD 38).

Whilst it may not work with every mini PC stick (given the length and positioning of the USB connectors) it should work with at least some non-Dosupara Diginnos sticks. It is somewhat surprising that other manufacturers haven't released a similar product. (Update: Apparently Measy have - see below).

Links (in Japanese):
http://www.dospara.co.jp/5press/2016/0624d
http://www.dospara.co.jp/5shopping/detail_parts.php?ic=437327&lf=0

Alternatively if a full-sized SD/MMC slot is more important than an Ethernet port then Measy's U2C-D Mini PC Holder may be more suitable:


With a slightly larger footprint of 125mm (length) × 90mm (width) × 60mm (height) and weighing 230g, it is a lot cheaper at around USD 15.99.

Links:
http://measy.cn/product/product_en_140.html
https://www.amazon.com/dp/B00CRBDJOE/

Review: (in Spanish)
http://androidpc.es/blog/2013/04/30/analisis-dock-measy-u2c-d-mas-puertos-para-tu-tv-stick/

Credit:
Richard Ames via Liliputing comment (http://liliputing.com/2016/06/dospara-launches-docking-station-pc-sticks.html)

Monday 13 June 2016

Running Ubuntu on the Intel Compute Stick

UpdateThis work is superseded by my 'isorespin.sh' script which can respin an official ISO suitable for use on Intel Atom devices.



The Intel Compute Stick has formalised a new standard for computing devices. Plugged into any HDMI TV or monitor and with a keyboard and mouse connected either wirelessly, via Bluetooth or by USB it becomes a fully functional mini PC. While the first ARM SOC 'sticks' that appeared were to facilitate the conversion to a smart TV, the re-purposing as a mini PC was hampered by the restrictive shortfall of lack of HD graphics due to closed source drivers. With Intel SOC 'sticks' and the availability of open-source software, a 'stick' mini PC is finally achievable. And because Intel fully support the Compute Stick with updated drivers and most importantly updated BIOS which are all available as downloads from the Intel website, it is my chosen device for development.

When Intel released their first Compute Stick with Ubuntu, an open-source operating system based on Debian, it was the restrictive hardware specification that impacted the performance needed to run productivity applications, stream media or play games. Trying to install Ubuntu on the more powerful Windows model resulted in the loss of HDMI audio, WiFi and Bluetooth. Fortunately the latest Core M Intel Compute Sticks address all of these issues and perform exceptionally well although they come at a cost.
The challenge now became how to use a lower cost Intel Compute Stick with fully working hardware and Ubuntu or a recognised flavour that uses Ubuntu as its foundation. Because having the option of running a fast but lightweight operating system can take advantage of the lesser hardware specifications.

The difference between Ubuntu flavours is the set of packages included within the release and I've concentrated on the following:
  • Ubuntu uses Unity (a graphical shell for the GNOME desktop environment)
  • Lubuntu uses LXDE (the Lightweight X11 Desktop Environment)
  • Xubuntu uses the Xfce desktop environment
  • Kubuntu uses KDE's Plasma desktop environment
  • Ubuntu GNOME uses the GNOME desktop environment
  • Ubuntu MATE uses the MATE desktop environment
Officially supported releases are provided as ISO images which are single files that represent an entire CD/DVD of software. An ISO image can be written to a USB to create a 'live' USB drive that containing a full operating system that can be booted or used as installation media.

I've created ISO images specifically to work on the Intel Compute Stick with the latest 16.04 release by combining recent patches and source code and ported them with Canonical's kernel source to fully support HDMI audio, WiFi and Bluetooth. I've also included patches that try to reduce the random freezes that have been known to occur. But because the ISOs include a patched kernel to provide the missing functionality it means no automatic kernel updates from Canonical although other application packages will update as standard. Consequently I've also developed a manual patching process where a script can be downloaded and then executed to update the kernel to match those provided by Canonical.

All ISOs work on all of the Intel Compute Stick models including the Core M models which are supported for the sake of completeness. Lubuntu being a lightweight Ubuntu is highly suitable for the minimalist STCK1A8LFC model especially as I've configured it to use ZRAM both in the ISO and once installed. I've also configured them all to both run and install using either a 32-bit or 64-bit bootloader to provide the ability to easily dual-boot without needing to modify the BIOS. The BIOS settings can be accessed by powering-on the Intel Compute Stick and pressing the 'F2' option. On the Atom models in the 'Configuration' page the 'Select Operating System' option can be toggled between 'Ubuntu 64-bit'/'Windows 64-bit' and 'Windows 32-bit'. Finally each ISO can be written it to a USB using either 'Rufus' in Windows or 'dd' in Linux. The USB can then be used to boot from by pressing the 'F10' option immediately after powering-on the device. For installation to the device's internal storage simply run the installer and follow the on-screen instructions.

Some cautionary advice: The initial menu screen takes slightly longer to appear than with the official ISOs. Depending on the speed of the USB drive used it can be anything from fifteen to forty-five seconds before anything appears on the screen. After installing with a 32-bit bootloader booting sometimes results just in a blank/coloured (e.g. purple) screen. To prevent this and to ensure a successful boot it is best go through the BIOS using the F10 option followed by selecting the Ubuntu option. Also the ISOs only work on Intel Compute Sticks but they can be used with any model (STCK1A8LFC, STCK1A32WFC, STK1AW32SC, STK1A32SC, STK2M3W64CC, STK2M364CC and STK2MV64CC). Occasionally the Baytrail systems (STCK1A8LFC and STCK1A32WFC) have been observed to sometimes hang or freeze randomly. Further details are posted below.

To try an ISO download it from one of the links below and write it to a USB using either 'Rufus' in Windows or 'dd' in Linux.

Update: These ISOs may now fail if installation is attempted whilst connected to the internet due to a newly updated package. As the first point-release for Ubuntu 16.04 LTS (versioned 16.04.1) has now been released I will be respinning have respun the ISOs and posting updated links. Likewise for Lubuntu Yakkety Yak (16.10) Alpha 2 below.


Ubuntu
Ubuntu comes with everything. All the essential applications, like an office suite, browsers, email and media apps come pre-installed and thousands more games and applications are available in the Ubuntu Software Centre.


Lubuntu
Lubuntu is a fast, energy saving and lightweight variant of Ubuntu using LXDE. It is popular with PC and laptop users running on low-spec hardware.


Xubuntu
Xubuntu is an elegant and easy to use operating system. Xubuntu comes with Xfce, which is a stable, light and configurable desktop environment.


Kubuntu
Kubuntu offers the KDE Plasma Workspace experience, a good-looking system for home and office use.


Ubuntu GNOME
Ubuntu GNOME uses GNOME Shell along with a plethora of applications from the GNOME Desktop Environment.


Ubuntu MATE
Ubuntu MATE expresses the simplicity of a classic desktop environment. MATE is the continuation of the GNOME 2 desktop which was Ubuntu's default desktop.


To upgrade the kernel to match a version released for Ubuntu 16.04 first download the upgrade script, make it is executable (use 'chmod 755 <script>') and then run as 'root' ('./<script>'). Once the script has finished executing the device will need to be rebooted to use the updated (patched) kernel.


4.4.0-21.37

4.4.0-22.40

4.4.0-24.43

4.4.0-28-47

4.4.0-31-50 (current latest)


One issue that has been reported with Linux kernel versions newer than 3.16 on Baytrail processors (i.e. not specific to just on the Intel Compute Stick or with the Z3735F SOC) is a random freeze where the whole system hangs. Unfortunately no known fix or work-around currently exists. Consensus seems to have settled on limiting the processor (CPU) to a certain power state, or 'C-state', in order to reduce the frequency of such freezes and improve the stability of the system.

I incorporate this solution along with disabling IPv6 system wide (which may or may not of use) through editing the boot options on STCK1A8LFC and STCK1A32WFC devices.

Open a terminal session and enter the following command (on a single line):

sudo sed -i 's/\(GRUB_CMDLINE_LINUX=\)""/\1"ipv6.disable=1 intel_idle.max_cstate=1"/' /etc/default/grub

To implement the change enter:

sudo update-grub

and then reboot the system by entering:

sudo reboot

The above change only needs to be made once, typically following installation to eMMC storage.


There have been reports that later kernels may not be affected by the freeze issue. So I've compiled the latest stable 4.6.x kernels with configs based on Ubuntu together with the HDMI and WiFi patches and provide an update script for anyone who wants a bleeding edge kernel:

4.6.2-040602

4.6.3-040603

4.6.4-040604 (current latest)


Finally Lubuntu Yakkety Yak Alpha 1 (soon to be 16.10) has just been released:


So I've also created a version suitable for Intel Compute Sticks. It can be downloaded from https://goo.gl/2m1CJh and used as LiveUSB or it can be installed (but must be connected to the Internet during installation at this stage).


Acknowledgements:  Linux Kernel Organization (kernel.org), Canonical Ltd. (Ubuntu), Pierre-Louis Bossart (HDMI audio), Bastien Nocera (WiFi) and Larry Finger (Bluetooth).

Running Ubuntu on the Intel Compute Stick

UpdateThis work is superseded by my 'isorespin.sh' script which can respin an official ISO suitable for use on Intel Atom devices.



The Intel Compute Stick has formalised a new standard for computing devices. Plugged into any HDMI TV or monitor and with a keyboard and mouse connected either wirelessly, via Bluetooth or by USB it becomes a fully functional mini PC. While the first ARM SOC 'sticks' that appeared were to facilitate the conversion to a smart TV, the re-purposing as a mini PC was hampered by the restrictive shortfall of lack of HD graphics due to closed source drivers. With Intel SOC 'sticks' and the availability of open-source software, a 'stick' mini PC is finally achievable. And because Intel fully support the Compute Stick with updated drivers and most importantly updated BIOS which are all available as downloads from the Intel website, it is my chosen device for development.

When Intel released their first Compute Stick with Ubuntu, an open-source operating system based on Debian, it was the restrictive hardware specification that impacted the performance needed to run productivity applications, stream media or play games. Trying to install Ubuntu on the more powerful Windows model resulted in the loss of HDMI audio, WiFi and Bluetooth. Fortunately the latest Core M Intel Compute Sticks address all of these issues and perform exceptionally well although they come at a cost.
The challenge now became how to use a lower cost Intel Compute Stick with fully working hardware and Ubuntu or a recognised flavour that uses Ubuntu as its foundation. Because having the option of running a fast but lightweight operating system can take advantage of the lesser hardware specifications.

The difference between Ubuntu flavours is the set of packages included within the release and I've concentrated on the following:
  • Ubuntu uses Unity (a graphical shell for the GNOME desktop environment)
  • Lubuntu uses LXDE (the Lightweight X11 Desktop Environment)
  • Xubuntu uses the Xfce desktop environment
  • Kubuntu uses KDE's Plasma desktop environment
  • Ubuntu GNOME uses the GNOME desktop environment
  • Ubuntu MATE uses the MATE desktop environment
Officially supported releases are provided as ISO images which are single files that represent an entire CD/DVD of software. An ISO image can be written to a USB to create a 'live' USB drive that containing a full operating system that can be booted or used as installation media.

I've created ISO images specifically to work on the Intel Compute Stick with the latest 16.04 release by combining recent patches and source code and ported them with Canonical's kernel source to fully support HDMI audio, WiFi and Bluetooth. I've also included patches that try to reduce the random freezes that have been known to occur. But because the ISOs include a patched kernel to provide the missing functionality it means no automatic kernel updates from Canonical although other application packages will update as standard. Consequently I've also developed a manual patching process where a script can be downloaded and then executed to update the kernel to match those provided by Canonical.

All ISOs work on all of the Intel Compute Stick models including the Core M models which are supported for the sake of completeness. Lubuntu being a lightweight Ubuntu is highly suitable for the minimalist STCK1A8LFC model especially as I've configured it to use ZRAM both in the ISO and once installed. I've also configured them all to both run and install using either a 32-bit or 64-bit bootloader to provide the ability to easily dual-boot without needing to modify the BIOS. The BIOS settings can be accessed by powering-on the Intel Compute Stick and pressing the 'F2' option. On the Atom models in the 'Configuration' page the 'Select Operating System' option can be toggled between 'Ubuntu 64-bit'/'Windows 64-bit' and 'Windows 32-bit'. Finally each ISO can be written it to a USB using either 'Rufus' in Windows or 'dd' in Linux. The USB can then be used to boot from by pressing the 'F10' option immediately after powering-on the device. For installation to the device's internal storage simply run the installer and follow the on-screen instructions.

Some cautionary advice: The initial menu screen takes slightly longer to appear than with the official ISOs. Depending on the speed of the USB drive used it can be anything from fifteen to forty-five seconds before anything appears on the screen. After installing with a 32-bit bootloader booting sometimes results just in a blank/coloured (e.g. purple) screen. To prevent this and to ensure a successful boot it is best go through the BIOS using the F10 option followed by selecting the Ubuntu option. Also the ISOs only work on Intel Compute Sticks but they can be used with any model (STCK1A8LFC, STCK1A32WFC, STK1AW32SC, STK1A32SC, STK2M3W64CC, STK2M364CC and STK2MV64CC). Occasionally the Baytrail systems (STCK1A8LFC and STCK1A32WFC) have been observed to sometimes hang or freeze randomly. Further details are posted below.

To try an ISO download it from one of the links below and write it to a USB using either 'Rufus' in Windows or 'dd' in Linux.

Update: These ISOs may now fail if installation is attempted whilst connected to the internet due to a newly updated package. As the first point-release for Ubuntu 16.04 LTS (versioned 16.04.1) has now been released I will be respinning have respun the ISOs and posting updated links. Likewise for Lubuntu Yakkety Yak (16.10) Alpha 2 below.


Ubuntu
Ubuntu comes with everything. All the essential applications, like an office suite, browsers, email and media apps come pre-installed and thousands more games and applications are available in the Ubuntu Software Centre.


Lubuntu
Lubuntu is a fast, energy saving and lightweight variant of Ubuntu using LXDE. It is popular with PC and laptop users running on low-spec hardware.


Xubuntu
Xubuntu is an elegant and easy to use operating system. Xubuntu comes with Xfce, which is a stable, light and configurable desktop environment.


Kubuntu
Kubuntu offers the KDE Plasma Workspace experience, a good-looking system for home and office use.


Ubuntu GNOME
Ubuntu GNOME uses GNOME Shell along with a plethora of applications from the GNOME Desktop Environment.


Ubuntu MATE
Ubuntu MATE expresses the simplicity of a classic desktop environment. MATE is the continuation of the GNOME 2 desktop which was Ubuntu's default desktop.


To upgrade the kernel to match a version released for Ubuntu 16.04 first download the upgrade script, make it is executable (use 'chmod 755 <script>') and then run as 'root' ('./<script>'). Once the script has finished executing the device will need to be rebooted to use the updated (patched) kernel.


4.4.0-21.37

4.4.0-22.40

4.4.0-24.43

4.4.0-28-47

4.4.0-31-50 (current latest)


One issue that has been reported with Linux kernel versions newer than 3.16 on Baytrail processors (i.e. not specific to just on the Intel Compute Stick or with the Z3735F SOC) is a random freeze where the whole system hangs. Unfortunately no known fix or work-around currently exists. Consensus seems to have settled on limiting the processor (CPU) to a certain power state, or 'C-state', in order to reduce the frequency of such freezes and improve the stability of the system.

I incorporate this solution along with disabling IPv6 system wide (which may or may not of use) through editing the boot options on STCK1A8LFC and STCK1A32WFC devices.

Open a terminal session and enter the following command (on a single line):

sudo sed -i 's/\(GRUB_CMDLINE_LINUX=\)""/\1"ipv6.disable=1 intel_idle.max_cstate=1"/' /etc/default/grub

To implement the change enter:

sudo update-grub

and then reboot the system by entering:

sudo reboot

The above change only needs to be made once, typically following installation to eMMC storage.


There have been reports that later kernels may not be affected by the freeze issue. So I've compiled the latest stable 4.6.x kernels with configs based on Ubuntu together with the HDMI and WiFi patches and provide an update script for anyone who wants a bleeding edge kernel:

4.6.2-040602

4.6.3-040603

4.6.4-040604 (current latest)


Finally Lubuntu Yakkety Yak Alpha 1 (soon to be 16.10) has just been released:


So I've also created a version suitable for Intel Compute Sticks. It can be downloaded from https://goo.gl/2m1CJh and used as LiveUSB or it can be installed (but must be connected to the Internet during installation at this stage).


Acknowledgements:  Linux Kernel Organization (kernel.org), Canonical Ltd. (Ubuntu), Pierre-Louis Bossart (HDMI audio), Bastien Nocera (WiFi) and Larry Finger (Bluetooth).