I completed my review of PCG02U Ubuntu TV stick a few days ago, and I was quite satisfied with the device, but since Ubuntu 16.04 was released last month, I thought it might be fun to upgrade to the latest version of Ubuntu. I’m go through the complete steps including building a new kernel for HDMI audio, and the drivers for WiFi, but you should be able to install Ubuntu 16.04 for Bay Trail and Cherry Trail processor with the image made by Linuxium and a USB stick.
Star Cloud PCG02U OS Support and Warranty
Before I go through the instructions, you may want to read the conditions on MeLE’s Aliexpress PCG02U page.
They meant Ubuntu 14.04 instead of 14.0.4, but the important part is that if something goes wrong trying alternative OS, you may lose your warranty.
Upgrade Ubuntu 14.04 to Ubuntu 16.04
Upgrading from one LTS version to the next should be easy using the update manager…
1 2 3 |
sudo apt update sudo apt dist-upgrade sudo update-manager -d |
… or doing it through the terminal entirely:
1 2 3 |
sudo apt update sudo apt dist-upgrade sudo do-release-update -d |
However, it did not work for me, as it quickly ended with the message:
1 |
The required dependency 'apt (>= 1.0.1ubuntu2.13)' is not installed. |
I noticed that PCG02U was still stuck on Ubuntu 14.04.3 LTS, despite running dist-upgrade:
1 2 |
cat /etc/issue Ubuntu 14.04.3 LTS \n \l |
After trying several solutions, I eventually changed the Ubuntu mirror, and the steps above completed successfully with Ubuntu 16.04 running.
At least two little problems though: I lost HDMI audio with only Dummy Output available, and while Ethernet was still working after the update, WiFi support was gone… But if you don’t need either you’re good to go.
Enabling HDMI audio in PCG02U
Luckily we already have the instructions to enable HDMI audio for Bay Trail and Cherry Trail processors, all we need is a Linux 4.5 kernel and patch it. I’ll do everything inside PCG02U, and I have not used a separate build machine, which would likely be faster. Tip: you’ll need gcc 4.9 or greater. I used the instruction here and there.
First let’s build the dependencies required to build the kernel in Ubuntu.
1 |
sudo apt-get build-dep linux-image-$(uname -r) |
Now let’s get the patches in a working directory
1 2 3 4 5 |
mkdir linux wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5.1-wily/0001-base-packaging.patch wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5.1-wily/0002-debian-changelog.patch wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5.1-wily/0003-configs-based-on-Ubuntu-4.4.0-19.35.patch wget http://pastebin.com/raw/kZyiZMR5 -O hdmi_audio.patch |
as well as the Linux 4.5.1 kernel patched for Ubuntu and the Intel Atom HDMI audio support:
1 2 3 4 5 6 7 |
git clone git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack v4.5.1 cd v4.5.1 git checkout v4.5.1 patch -p1 < ../0001-base-packaging.patch patch -p1 < ../0002-debian-changelog.patch patch -p1 < ../0003-configs-based-on-Ubuntu-4.4.0-19.35.patch patch -p1 < ../hdmi_audio.patch |
Now we can configure the build:
1 2 3 4 5 |
chmod a+x debian/scripts/* chmod a+x debian/scripts/misc/* chmod a+x debian/rules fakeroot debian/rules clean fakeroot debian/rules editconfigs |
This will ask which config files to configure for AMD64, i386, ARM and so on. We only need to edit the first one (AMD64). Once you are in the config menu, use menuconfig search function to locate SUPPORT_HDMI option and enable it. Exit and save.
Before starting the build add something like “+some_string” to the end of the first version number in the debian.master/changelog> file. I added +hdmi_audio string:
1 |
linux (4.5.1-040501.201604121331+hdmi_audio) unstable; urgency=low |
You can now start the build with:
1 |
fakeroot debian/rules binary-headers binary-generic |
However, the build did not complete for me, with the error:
1 2 3 4 5 6 7 8 9 10 11 |
# # SPL/ZFS wants a fully built kernel before you can configure and build. # It seems to be impossible to tease out the application configuration # from the modules, but at least one can build just the modules. # install -d /home/jaufranc/linux/v4.5.1/debian/build/build-generic/spl rsync -a --exclude=dkms.conf --delete spl/ /home/jaufranc/linux/v4.5.1/debian/build/build-generic/spl/ rsync: change_dir "/home/jaufranc/linux/v4.5.1//spl" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1] debian/rules.d/2-binary-arch.mk:70: recipe for target '/home/jaufranc/linux/v4.5.1/debian/stamps/stamp-build-generic' failed make: *** [/home/jaufranc/linux/v4.5.1/debian/stamps/stamp-build-generic] Error 23 |
I followed the instructions on askubuntu, and disabled set do_zfs = false
in debian.master/rules.d/amd64.mk, and completed the build with the same command line. It took around 2 to 3 to complete the build on PCG02U, and I had a bunch of deb packages…
1 2 3 4 5 6 7 8 9 10 |
cd.. ls *.deb linux-cloud-tools-4.5.1-040501_4.5.1-040501.201604121331_amd64.deb linux-cloud-tools-4.5.1-040501-generic_4.5.1-040501.201604121331_amd64.deb linux-headers-4.5.1-040501_4.5.1-040501.201604121331_all.deb linux-headers-4.5.1-040501-generic_4.5.1-040501.201604121331_amd64.deb linux-image-4.5.1-040501-generic_4.5.1-040501.201604121331_amd64.deb linux-image-extra-4.5.1-040501-generic_4.5.1-040501.201604121331_amd64.deb linux-tools-4.5.1-040501_4.5.1-040501.201604121331_amd64.deb linux-tools-4.5.1-040501-generic_4.5.1-040501.201604121331_amd64.deb |
.. and I installed the headers and image:
1 2 |
sudo dpkg -i linux-headers-*.deb sudo dpkg -i linux-image-*.deb |
Rebooted the system, which booted successfully, and I could confirm HDMI audio was back. Yes!
But still no WiFi… and space was running now, so I did some cleaning which gave me a few gigabytes to play with:
1 2 |
sudo apt autoremove sudo apt clean |
Building Realtek RTL8723BS WiFi Driver in Ubuntu/Linux
Star Cloud PCG02U uses a WiFi and Bluetooth module with the common Realtek RTL8723BS chip, but the driver is not currently in mainline, so it needs to be compiled separately. That part is straightforward, and only take 2 minutes or less:
1 2 3 4 5 |
git clone https://github.com/hadess/rtl8723bs cd rtl8723bs make -j4 sudo make install sudo modprobe r8723bs |
That’s all and now the Wireless network is enabled:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
sudo lshw -C network *-network:0 description: Ethernet interface physical id: 1 logical name: eth0 serial: 00:ce:39:ca:20:36 size: 100Mbit/s capacity: 100Mbit/s capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=asix driverversion=22-Dec-2011 duplex=full firmware=ASIX AX88772B USB 2.0 Ethernet ip=192.168.0.113 link=yes multicast=yes port=MII speed=100Mbit/s *-network:1 description: Wireless interface physical id: 2 logical name: wlan0 serial: cc:79:cf:71:8a:bb capabilities: ethernet physical wireless configuration: broadcast=yes driver=rtl8723bs multicast=yes wireless=IEEE 802.11bgn |
I had no problems connecting to my wireless router, and the module is automatically loaded at boot time. So now we have the same level of support as in Ubuntu 14.04 with HDMI audio and WiFi.
Realtek RTL8732BS Bluetooth in Linux
However, the hardware also supports Bluetooth, so it would be nice to have this enabled too, and again RTL8723BS Linux Bluetooth driver is available thanks to one independent developer (lwfinger).
In theory, it’s pretty easy:
1 2 3 4 5 6 |
git clone https://github.com/lwfinger/rtl8723bs_bt cd rtl8723bs_bt/ make sudo make install sudo ~/rtl8723bs_bt/start_bt.sh Using device /dev/ttyS4 for Bluetooth |
But this did not work for me, despite Bluetooth apparently being located on /dev/ttyS4:
1 2 3 4 5 6 |
dmesg | grep tty [ 0.000000] console [tty0] enabled [ 1.831625] 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A [ 5.440955] systemd[1]: Created slice system-getty.slice. [ 6.004920] 80860F0A:00: ttyS4 at MMIO 0x90941000 (irq = 39, base_baud = 2764800) is a 16550A [ 6.020676] 80860F0A:01: ttyS5 at MMIO 0x90947000 (irq = 40, base_baud = 2764800) is a 16550A |
But the log would show a connection timeout:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
cat hciattach.txt Realtek Bluetooth init uart with init speed:115200, final_speed:115200, type:HCI UART H5 Realtek Bluetooth :Realtek hciattach version 2.5 Realtek Bluetooth :3-wire sync pattern resend : 1, len: 8 Realtek Bluetooth :3-wire sync pattern resend : 2, len: 8 Realtek Bluetooth :3-wire sync pattern resend : 3, len: 8 .... Realtek Bluetooth :3-wire sync pattern resend : 38, len: 8 Realtek Bluetooth :3-wire sync pattern resend : 39, len: 8 Realtek Bluetooth :3-wire sync pattern resend : 40, len: 8 Realtek Bluetooth ERROR: H5 sync timed out |
Sadly, I haven’t been able to find a solution in a reasonable amount of time, and changing the baudrate from 115200 in the script to 2764800 (as shown in dmesg) does not help.
Of course everything would be so much easier if HDMI audio Cherry Trial and Bay Trial and RTL8723BS drivers would be in mainline linux, as all you would have to do would be to install Mainline linux in Ubuntu, and everything would just work. This does require some work however, but if you are motivated, lwfinger is ready to submit the RTL8723BS WiFi code to mainline if somebody takes care of all the errors and warnings generated by checkpatch.pl.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
Thank you for this how-to I’ll try it whenever I’ll get the stick. But I read, that Atom Z3735F is unstable with 4.X Linux kernels, is that true? And what about the performance, is Ubuntu 16.04 faster or slower as 14.04 on this stick?
@Tomas Morkus
I have not used it that much, but the system did freeze once
I have not run benchmarks yet. I’ll post results soon.
@Tomas Morkus
Done. http://openbenchmarking.org/result/1605279-GA-1605228GA19
PCG02U appears to be much slower with Ubuntu 16.04 compared to Ubuntu 14.04.
It’s also less stable, as the system hanged twice this morning.
@cnxsoft: Thank you for your effort. So seems, that Ubuntu 14.04 will be better option. BTW: Is there possible to get working Bluetooth also under 14.04 version?
@Tomas Morkus
I’ve read Bluetooth requires Linux 3.13 or greater, and Ubuntu 14.04 ships with 3.16, so it should work if you can find why it’s not working. Others have exactly the same problem as I have by the way: https://github.com/lwfinger/rtl8723bs_bt/issues/7. But no solution so far.
I thought, that the Bluetooth issue is only in Ubuntu 16.04. It is bad, that there is no working solution so far.
BTW: The installed Ubuntu 14.04 is 64-bit version? Would hve sense to try 32-bit version? Because there is only 2GB RAM and 32-bit software has lower memory requirements.
@Tomas Morkus
Yes, it was Ubuntu 14.04 64-bit. Not sure the 32-bit version would work with 64-bit UEFI.
@Tomas Morkus
Do you have persistent problems with stability of 16.04?
Anyway, has anyone checked if preinstalled Ubuntu contains any malware or “calling home” software?
@Matej Kovačič
Maybe 2 to 3 times a day. When it happens I can see a kernel crash due to IRQ timeout.
I disabled WiFi yesterday evening, and today, the stick haven’t had any issues so far.
So maybe it’s related to the WiFi driver.
Hmm, this is good to hear – at least we know the source of the problem.
What about installing 16.04 with an older (14.04) kernel?
Hello,
I tried to upgrade to 16.04 but after the upgrade the PCG02 wouldn’t boot again. So I downloaded the image of linuxium, but this one wouldn’t boot also, I think because his kernel is specific for the Intel Compute stick. So I downloaded the regular ubuntu 64 image and it install’s without issues. It’s even working better then the original installed ubuntu 14.04. Although no wifi and probably no hdmi sound and no bluetooth. I tried the linuxium kernel with the patches but these don’t work on the PCG02, the system doesn’t want to boot with them.
Great article. I have a similar device but with only 1 GB of RAM. It would take quite a while to build the patched 4.5 kernel, so could you kindly share your finished .deb files somewhere?
@Chris Al
If you don’t feel like building your own kernel, you can always use Linuxium image mentioned in the introduction.
Linux 4.5 does not seem quite as stable as Linux 3.16 on Bay Trail though.
I have compiled the packages for HDMI audio on the Mele PCG02. If anyone wants them, I am happy to share them. Can anyone recommend a good place for sharing the packages?
@Laurens
Maybe upload then to Mega.
The link to compiled packages https://goo.gl/7nxPCy untar the packages and do sudo dpkg -i linux-headers-*.deb
and sudo dpkg -i linux-image-*.deb. To stop Ubunto freezing up add intel_idle.max_cstate=1 to /etc/default/grub on the line GRUB_CMDLINE_LINUX_DEFAULT=”” add this between the quotes and any other command already there. Once saved do sudo update-grub. This stopped the Mele PCG02U from freezing up on Ubuntu 16.04.
For anyone who wants to build their own packages these are the dependancies. It will save you a lot of time restarting the process of building:
sudo apt-get install gcc-4.9
sudo apt-get install git
sudo apt-get install kernel-wedge
sudo apt-get install libncurses5-dev
sudo apt-get install libssl-dev
sudo apt-get install gawk
@Laurens
thanks for sharing your work!
@Roel
Thanks. I have to confess however that none of the work here is my own. I was just following the great article from cnx-software.com and wanted to contribute by making the package available. However as I understand StarCloud / Mele has been unprofessional by incorporating the 14.04 release into their hardware product without giving the credits to the community and developers which made it possible in the first place. It’s thanks to the Linux / Ubuntu community and Ian Morrison (Linuxium) https://plus.google.com/+IanMORRISON/posts that we can use it.
Does somebody have the guts to try to upgrade the bios with the one of the Azulle Quantum access lan?
According me it’s just the same device: https://azulletech.com/product/quantum-access-lan-windows-10-fanless-mini-pc-stick/
Link to the bios: ftp://ftp.azulletech.com/Software/BIOS/Quantum%20Access/
I tried to flash it with the Azulle bios, but I have a brick now. So don’t try it. I will try to resurrect it with the original bios.