Friday, 1 December 2017

Linux on MINIX NEO Z83-4 and Z83-4 Pro

The final piece of the jigsaw is now in place for running Linux on the MINIX NEO Z83-4 and Z83-4 Pro devices with the mainline kernel now patched to support wifi, audio and bluetooth.

It has been an interesting kernel journey with:

v4.9 including the eMMC v5.0 driver required for accessing the internal storage
v4.11 including the HDMI audio driver.
v4.12 recognizing the BCM43455 wifi driver but suffered a regression with the release of v4.13
v4.13.2/v4.14 including a fix for BCM43455 wifi driver
v4.14 including a fix for the headphone audio driver
v4.15-rc1 now includes a fix for the bluetooth driver

However to run fully working Ubuntu on either device still requires additional steps.

Previously: The Canonical v4.15-rc1 mainline build was built using a patched config using default settings and does not include the changes required for including Intel ASoC Audio Drivers or the Serial Device Bus with serial drivers.

(previously)

So first it is necessary to create a new config and compile the kernel.

Update: The latest development kernel for Bionic ('unstable') now includes the required config changes and is available in the 'daily' Canonical build.

Then it is just respinning the official Ubuntu ISO using my 'isorespin.sh' script to add this kernel the compiled packages providing the latest kernel, the required UCM files and missing wifi firmware.

Unfortunately the most recent UCM file for the headphone audio driver isn't compatible so I've had to modify it specifically to work with these devices.

Also the wifi firmware file first needs to be extracted from the Windows installation where it is located at 'C:\Windows\System32\drivers\4345r6nvram.txt'.

At this stage it is still very early in the release cycle and there is still work to be undertaken to simplify the respinning of ISOs for these devices.

However the key point is that the mainline kernel now supports MINIX NEO Z83-4 and Z83-4 Pro devices. Meaning over time as various distros and OS migrate to the v4.15 kernel and later versions they should work flawlessly on them.

24 comments:

Hi Linuxium,I have some questions, some generic some other specific to my laptop:

1. How can I apply the patch, that you install to the kernel during the isorespin process, in an already installed linux ?

2. in your post you say that audio is working on 4.14 but it doesn't work for me. It didn't work also with the kernel that come from the isorespin process. [ 8.256512] bytcht_es8316 bytcht_es8316: ASoC: CODEC DAI ES8316 HiFi not registered [ 8.256526] bytcht_es8316 bytcht_es8316: snd_soc_register_card failed -517

I don't know if this lines are related to the audio, but the word "CODEC" let me think that.

I tried to copy UCM files from https://github.com/kernins/linux-chwhi12/tree/master/configs/audio/ucm/bytcht-es8316 and to put them in /usr/share/alsa/ucm/bytcht-es8316 but the results when I try it are: # alsaucm -c bytcht-es8316 set _verb HiFi set _disdev HSMic set _enadev IntMic ALSA lib main.c:432:(execute_sequence) unable to open ctl device 'hw:bytchtes8316' ALSA lib main.c:1698:(set_verb_user) error: failed to initialize new use case: HiFi alsaucm: error failed to set _verb=HiFi: No such device

3. also touchpad doesn't work. The only reaction I obtained is moving 3 fingers on it. The reaction obtained is like ALT-TAB : switching by windows. 4. no battery management

It is difficult to provide specific answers as you haven't specified your device nor included a 'dmesg' however:

1. Respinning doesn't apply any patch to the kernel so what patch are you referring to?

2. As the post is specific to MINIX NEO Z83-4 and Z83-4 Pro devices YMMV with the v4.14 kernel on different devices. Try editing the resultant file '/usr/share/alsa/ucm/bytcht-es8316' (see the comment on lines 135/136) and remove the comment hash ('#') from line 138 through to line 156 then reboot (if installed) or respin ISO with equivalent modification and post the result.

3. Have you added the Silead touchpad driver or equivalent depending on your device?

Hello,It looks like you have put a great piece of work into getting Ubuntu running on this device. I notices in you example that you used Ubuntu 17.04, will this work also for Lubuntu 16.04.3, I am a newby on this respin process, and i will have to go through your tutorial here, but before I do this I would like to know the chances for success.Thanx in Advance for your inputsRegardsJoe

Linixium, you're fantastic for your work on this. My wearable robotics work is waiting on a functional Ubuntu install (Ideally 16.04 for ROS Kinetic) on my Minix, and because it relies heavily on wifi for non-emergency messaging the old no-wifi constraint is not workable.

Is there anywhere specific we need to advocate for your fixes integration to be prioritized? I can point to a whole autonomous robotics class worth of minix Pros that are eagerly awaiting functional wifi, if it'd help!

Also, in your post you mention having to modify the headphone audio driver, and your respin command references multiple files I am not finding available anywhere. While we wait for the changes to make it into mainline, is there anywhere I can find the various files you respun it with?

When I run your script, I keep getting errors pertaining to files not being found. After Googling some of the names, I was able to grab a few of them, but when still cannot find the HdmiLpeAudio.conf file. Can you point me in the direction?

As mentioned I'm still developing what is required to respin an ISO for these devices and will post a solution later. Currrently it is dependent on the config change to be made (see https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1739939).

"However the key point is that the mainline kernel now supports MINIX NEO Z83-4 and Z83-4 Pro devices. Meaning over time as various distros and OS migrate to the v4.15 kernel and later versions they should work flawlessly on them."

I have installed Lubuntu 16.04.3 plus Mainline Kernel 4.15.3, Bluetooth works but not wifi. I understood that with kernel + 4.15 the respin should be not neccessary anymore, isn't it ?

I found out whats the problem the file brcmfmac43455-sdio.txt is missing in /lib/firmware/brcm/. The solution is to copy the file 4345r6nvram.txt from the Windows driver to /lib/firmware/brcm/ and rename it to brcmfmac43455-sdio.txt and reboot the device.