My friend Harold Wong gave me a Pine64 as a retirement present. My plans for this machine are:
I had a very old audio playback node called Piki the Poison Dart Frog, which died. I transferred another old machine into this role, but the Pine64 would make a very nice and power-efficient replacement.
Learn about ARM processors and set up procedures to support ARM on OpenSuSE.
I need a new mini-laptop. The available products with Intel processors are slugs, but the ones with ARM processors look attractive. I want to assess whether the ARM machine is going to be supportable in my ecosystem.
The Pine64 is a single board computer with these features:
There are newer variants with 1Gb or 2Gb RAM, gigabit Ethernet, and connectors for a camera and a display panel with touch.
Web resources:
The front page does something with dynamic content in the product hype, which takes a lot of CPU power for client-side scripting, so leave that page as quick as possible.
The FAQ appears to be for the original board. Later, two upgraded boards have come out which I don't see mentioned in the FAQ.
This is a open source community site that supports Allwinner SoC
based devices. These chips are designated sun4i, sun7i, etc., hence the
name sunxi. The one in the Pine64 is the sun50i.
This appears to be a Linux distro for ARM. They have what they call
a near-mainline
kernel port based on kernel 4.7 (not feature complete),
and a lot of interesting information about the Pine64 hardware details.
Pine64: The Un-Review
by Brian Benchoff (2016-04-21) on Hackaday. He had a lot of trouble
with his Pine64 and never got any of the available OS images to boot, hence
the un-review
title. There are a lot of comments; many people had no
problem getting their boards to boot and run. Brian and another commenter
complain that their motherboard was warped. Remember to attach your power
button, which is needed to turn off the Android image. jimc says: The symptoms
suggest a flaky wall wart (customer provided) that provides less than 2 amps.
You see the same problem on Raspberry Pi.
By Ray Hightower (2016-04-04). Highlights of the blog post:
As of the posting date, the kernel on the Arch Linux image has a bug in DMA; there is at least one other distro (not named) that has the same bug.
Images are distributed in RAR format; use unrar
to
decompress (its license does not qualify as free software). Using a
machine other than the Pine64 :-) copy the image onto your SD card
using dd
. Jimc says: It should be possible to use the p
command to unrar to extract to standard out which could be redirected
to the SD card raw device.
Move the SD card to the Pine64. Turn on power. His machine booted with no hassle. His Arch Linux image has 3 default users: root, guest, alarm. Password is the same as the loginID (super secure, change right away :-).
Pine64 uses 2.5 watts. Jimc says: According to the Pine64 FAQ,
this is the power once booted up, 0.5A (500mA) at 5V. It draws 2A
while booting (10W), and a smart charger
will not deliver over
0.5A without negotiation, which the A64 doesn't do (same for Raspberry
Pi). That would prevent booting; see the un-review
above. And
a wall wart with a marginal max current could cause unreliable but
sometimes successful booting.
The DMA bug manifests itself with the network device. He doesn't say much about the exact symptoms or what to do about it. (Jimc says: this could be the reason for slow networking reported by some forum posters.)
Jimc research: this commit on Github, dated about 2016-07-15, may or may not fix the DMA problem.
By Michael Larabel (2016-03-26) on Phoronix. He's testing the Pine64+ with 1Gb RAM; mine is the non-plus with 0.5Gb RAM and less features. Here's what the Pine64+ has:
Open source drivers for the Mali 400-MP2 GPU are not available, which means that you get unaccelerated 2D graphics. In contrast the Broadcom VC4 GPU on the Raspberry Pi has reverse engineered drivers.
The kernel used in this test, from Arch Linux, is Kernel3.10.65-2-pine64-longsleep (aarch64). Michael had no problem booting this image.
Benchmark results of the Pine64 are similar to Raspberry Pi-3, maybe 10% faster or slower depending on which test.
OpenSuSE has distro support for the Pine64. There are at present (2016-08-01) two variant images:
Based on kernel 4.5. This is a near-mainline
kernel and
is intended to mature eventually into something that can be included in
the Linux kernel tree. The serial port (UART) works, but not much else.
In particular you don't have Ethernet, USB, graphics or SMP (multiple
cores). Except the description says it is pre-configured to use DHCP to
request an IP address…
Based on Allwinner's hacked 3.10 kernel. This one is pathetically back-version and does not get driver or security updates. But ethernet, graphics, USB and presumably SMP all work.
Terra854 has updated the SuSE image (2016-08-05).
Download link, 1.9Gb, looks like uncompressed.
It has kernel 3.10.101-0-pine64-longsleep-39. Even so, rpm -qa
shows that package kernel-default-4.5.0-3.1.aarch64 is installed and
kernel-default-3.10.whatever isn't, and none of the files from 4.5.0 are
present whereas all the files from 3.10.101 are there.
The motherboard only. You provide your own wall wart, SD card, keyboard, mouse and display. Harold nicely included a non-smart wall wart rated for 5V 2A, the kind used for a Raspberry Pi. Referring to the review above by Brian Benchoff, my motherboard is not warped at all. RoHS compliant. Board dimensions: 126 x 80mm (5.0 x 3.25in). The RJ45 and USB connector stick out a few mm more.
I'm planning to get a new SD card. Forum posters report good results with the Samsung EVO product line and problems with low-priced ersatz cards, so I'm going to go with the crowd on this. SBSF Amazon, prices are $10 for 32Gb, $20 for 64Gb, $40 for 128Gb. SanDisk, Toshiba and Transcend are also mentioned as reputable.
I also want an enclosure. Amazon has a nice-looking wood one for $15; also some plastic/metal cases. I'll tell you if I like it when I get it. Ordering the Eleduino PINE64/ 64 plus Acrylic Enclosure Case (Black), $13.49. Nicely made, fits perfectly, has cutouts for the expansion buses, which are important for connecting the serial cable.
For kernel hacking I would need a UART to USB adapter for the serial
console. I'm not sure how much use I'm going to get out of this since
everything is supposed to just work
(yeah, sure),
but If I do mess with the SuSE 4.5
kernel I'm going to need the serial console to see what it's doing. It's
going to attach to pins on the Euler bus with flying leads (I guess). Gotcha:
when you disconnect power for a hard reset, current leakage from the UART
prevents a complete reset. Either disconnect the UART too, or add a reset
button to the board.
elinux.org wiki for Pine64
serial console. They have a link to a product, a 1 meter cable with
USB type A on one end, and 3 flea clips on the other. There is a Future
Technology (FTDI) UART to USB chip hiding inside and it appears on the host
as a USB TTY. Price $15 (USD) from Digikey. Several similar products are
available on Amazon; look for TTL-232R-RPI
and beware of cheap
imitations.
Combining info from the
datasheet for the TTL-232R-RPI on Allied Electronics and the
linux-sunxi.org wiki page for
Pine64 yields these connections for the serial console. Host to
client
means from your laptop to the Pine64, and vice versa. The EXP
bus is labelled and is between the Euler bus and the SD card slot;
pins 2, 9 and 10 are labelled.
The wiki page's pin labels are from the client's point of view (TXD means
Pine64 sends to laptop) whereas the datasheet labels them from the host's
point of view (TXD means laptop sends to Pine64). The same UART is accessible
on the Euler bus, but from the EXP bus there is a buffer so client RXD can't
leak power into the Pine64 preventing a proper shutdown.
You end up with the black wire on the pin closest to the edge of the
board and closest to the card slot; the yellow wire next to it; and the orange
wire as the yellow wire's cross street
neighbor. It works.
Color | Host | Client | EXP bus | Function |
---|---|---|---|---|
Black | GND | GND | 9 | Signal ground |
Orange | TXD | RXD | 8 | Host to client |
Yellow | RXD | TXD | 7 | Client to host |
Data written to the serial console will appear on
the Linux USB TTY. Use your favorite console emulator such as kermit to
see what it displays and to send commands. The wiki page author recommends
screen
with this command line, modified by jimc for Linux. Execute
as a user with write access to the TTY, e.g. root, and substitute the correct
device name if you have several of them.
screen /dev/ttyUSB0 115200
I got the SD card, the serial cable, and the case. These were my initial steps to check out the Pine64 board.
readin their title.
writein their title are a lot faster, 1.9 to 2.4 Gbytes/sec. This has got to be a cache effect: write the data into a mbuf, say it's done, but the data will actually be written when the driver gets around to it. If I had used the -s (synchronous) option, I might have gotten a better test.
I really want to do a simple defect scan. Here's a command line:
while dd if=/boot/initrd bs=1M status=none ; do /bin/true ; done > /mnt/testfile.datGuess what, it's going to take about 15 hours to write the stuff and then read it back and compare. Hmm, let's defer this to overnight.
This is the Eleduino PINE64/ 64 plus Acrylic Enclosure Case
.
The transparent parts have a protective film which you should remove.
The black part goes on the bottom. Preassemble the hexagonal spacers in the four corner holes using 4 of the provided screws.
Set the Pine64 board on the bottom sheet (orientation doesn't matter). Match up the cutouts in the sidewalls with connectors on the Pine64, and drop the sidewall's feet in their slots in the bottom plate. Several of the end connectors are surrounded by the holes in the sidewalls so you'll need to lift the Pine64 board. Finally, orient the top sheet so the cutouts match with the bus connectors, and set it over the sidewalls' upper feet. Attach the top sheet with the remaining 4 screws.
Jessieby Lenny Raposo with Longsleep kernel. 1.6Gb, took 25 mins. Renamed to debian-jessie-pine64.zip .
parted /dev/mmcblk0) reveals a BIOS/MBR partition table with two partitions: 52Mb FAT16, and 7.5Gb ext4. But you can't mount them. Quit. Remove the card and re-insert it; now the kernel re-reads the partition table. Unmount them, if an automouter mounts them automatically.
resize 2 100%. This allocates the rest of the space on the card to the root partition. Quit.
fsck -f -C /dev/mmcblk0p2(required by resize2fs, and is prudent anyway).
resize2fs /dev/mmcblk0p2(expands the filesystem to fill its partition).
fsck -f -C /dev/mmcblk0p2(again, for paranoia).
Jessie. Partition 1 (FAT16) has the kernel (11.7Mb) and the initrd (only 1.1Mb).
screenrunning on your
realmachine.
sudofor root access.
screenhas a lot of trouble with either missed or overlapping bytes: a lot of text is lost. This behavior went away in subsequent tries. I never found out what caused it.
digprogram, hiss, boo!
resize 2 100%to put all the space in the Linux partition, after which I ran
fsck -f -C /dev/mmcblk0p2(no complaints). The space is allocated but the filesystem does not cover it. I then ran
resize2fs /dev/mmcblk0p2(took 1 to 2 minutes). It looks reasonable on the laptop.
wicked ifdown eth0and ifup, it got the correct IPv4 and IPv6 addresses. On a subsequent reboot, the machine came up normally, with no hand labor.
uname -rsays 3.10.101-0-pine64-longsleep and /lib/modules has modules for this version. There is no sign of files from kernel 4.5.0. There is no installed package for 3.10.101. The Tumbleweed repo for aarch64 has kernel 4.5.0 only.
chvt 1or other numbers has no effect; nor does
echo XXXX > /dev/tty1.
Now I need to make a strategy decision: how to get the most use out of the Pine64 with the least work. So far the only bootable images (that I've tried) have been debian-jessie-pine64.zip (by Lenny Raposo) and openSUSE-pine64-08-05-16.img.xz, the recently updated one from Terra854 with MBR booting and the 3.10.101 kernel. Unless something awesome happens, all my experiments will have to start with the latter image. I'm looking at these branches:
Here's a likely better procedure:
tarto save the image content as files.
I should expand the installed distro, and particularly, I should install the X-Windows server, a Mali driver for it (from where?), an appropriate greeter (probably lightdm, warts and all), and a minimal desktop environment, perhaps LXDE, or XFCE which I use on all my other systems.
Results of starting display-manager with xorg-x11-drv-armsoc :
Before trying to compile the sunxi driver I'm going to try to find one among the already download images. Trying these images:
How to mount an image:
openSUSE-pine64-08-05-16.img.xz -- is the one I'm running now, no relevant driver.
debian-jessie-pine64.zip -- Drivers are in /usr/lib/xorg/modules/drivers whereas SuSE puts them in /usr/lib64/xorg/modules/drivers . Trying fbturbo_drv.so . This image also has fbdev_drv.so and modesetting_drv.so, which the Pine64 already has.
It looks to me like the X-server is not going to load anything other than fbdev by default. The Debian image has /etc/X11/xorg.conf which specifies the fbturbo driver explicitly.
fbturbo.so requires these shared libraries: libUMP.so.3 This is described as a Sunxi Mali-400 proprietary library. I need to steal it from the Debian image at /mnt/usr/local/lib/libUMP.so* . SuSE wants it in /usr/local/lib64, and run ldconfig after installing.
The module's ABI (18) does not match the server (20). Blecch. That's the end of Debian. When I ran this image there was no sign that the display was alive.
openSUSE-3.10-pine64.raw.xz -- This image has neither fbturbo_drv.so nor libUMP.so.
openSUSE-4.5-pine64.raw.xz
Brainwave! For the tests above, for connecting my display to the Pine64 I was using a HDMI to DVI adapter, a DVI to VGA adapter, and a VGA cable. Suppose the GPU does not drive the VGA (analog) signal lines? I stole a DVI cable from another machine.
This is turning into a time sink. I think I'm not motivated enough to make a real contribution to bringing to life the display on the Pine64. It's not promising that when I booted the Debian image it did not activate the display despite being configured to do so and having a supposedly working, though back-version, driver.
I should reinstall kernel 4.5.0, and in the unlikely case that it boots, I should test which hardware actually works, since the last report on that kernel is from 2016-04-xx, 4 months ago. It has the same UEFI configuration that openSUSE-3.10-pine64.raw.xz has, and does not boot.
I should see how much of my standard configuration I can install on the Pine64 -- probably quite a lot, but not all.
I'm reluctant to put work into setting up an enterprise mirror if the Pine64 is going to end up useless, but if it's promising then I'm going to be a whole lot happier with the packages on my own machine. But in a rolling distro, how do you keep packages up to date?
From struggling with the Pine64 I have learned a number of points.
I've seen a number of forum posts, although I concentrated on those specifically relevant to the Pine64. Although ARM CPUs typically reside as a component of a SOC, there are hundreds of designers of such devices, and they combine the CPU with a variety of other subsystems, particularly the graphics processor. Open source graphics drivers are rarely available; one exception is the Broadcom Videocore (VC4) GPU on the Raspberry Pi. The Pine64 uses a Mali 400-MP2 GPU with a proprietary driver.
SOC vendors compete intensely, and are terrified that competitors will steal their software work, and GPU providers have a similar issue at a higher level. Thus closed source is the rule for ARM.
A major disappointment is that I have not been able to put together
the desired combination of the operating system (OpenSuSE) and a graphics
driver that works. If I continue with the Pine64, or if I get an ARM-based
other kind of machine such as a mini-laptop, I will need to stick with
the kernel and graphics software (X-Windows) provided by the vendor.
For the Pine64 this is seriously back version. As of this writing,
the latest Linux kernel is 4.7.1 and the one in OpenSuSE Leap
42.1 (the distro used on most machines on my home net) is 4.1.27, whereas
the Allwinner kernel is 3.10.101; the 3.10 series began in 2013-06-xx
(3 years ago) and 4.1.x came out in 2015-06-xx (1 year ago).
The proprietary GPU driver is also back-version, two X-Windows ABI major
versions back.
I'm afraid that it's not acceptable to be stuck in a time warp like that, without security fixes and general bug fixes. Particularly for the proposed mini-laptop.
I looked at OpenSuSE's ARM support, and 90% of the packages in the main distro are also available for ARM. (This excludes non-open source packages and i586 packages.) That's 26351 packages for ARM. This is a pretty good collection. However, there is a problem with the provided images for Pine64: they don't boot. They are organized for UEFI booting, and the Allwinner A64 SOC cannot handle UEFI at all. Weren't they tested? Did nobody report a bug?
UEFI has its pros and cons, which are off topic for this document, but it doesn't look like rocket science to make UEFI work for ARM: use uboot (which is an accessory produced in the kernel build) to load Grub2's stage1 in the EFI partition. Compare with how SuSE does it on Intel boxes: the UEFI BIOS gets control, loads the shim module (which has a signature from Microsoft's key, if Secure Boot is turned on), and the shim then loads Grub2's stage1.
I'm not exactly happy that this relatively simple and important feature of the distro, being able to boot, slipped through the cracks. Bug report here, bug 994496 on SuSE's bugzilla.
The image that I did get to work, from Terra854, is community modified and is hosted on the Pine64 website, not SuSE's site.
The goal for this project was to use the Pine64 as an audio playback node, with reasonably normal integration into my network. But the sound card doesn't work, which kind of puts a damper on that goal. And I've never seen anything on the display, which prevents a role as a general purpose desktop machine; I also have a low priority need for one of those.
Unfortunately I have to declare that the Pine64 project has failed, and I have to stop putting effort into a project that's not going to have a result.