Hello dear MOD users
I’d like to share with everyone a great accomplishment we have recently reached: the MOD Duo OS is now based on the Mainline Linux kernel.
From a user standpoint, it is an unnoticeable change, but it carries a deep meaning and has important consequences to the future of the MOD Duo.
Here are an explanation and a historical overview of this process that started in 2014. More related info is going to be upcoming days.
The Duo was developed between 2014 and 2016, having its processing system based on the Allwinner A20 ARM chip with NAND storage and the OS based on a fork of the 3.4 Linux kernel, provided by sunxi-linux, a strong open-source community devoted to providing Linux support to the Allwinner CPUs.
At the time of the selection of our CPU, the so-called mainline Linux kernel - the official community-maintained version - was still starting to absorb the ARM architecture and many of the hardware elements of the ARM chips were not yet recognized by it.
The Linux kernel is in essence a big Hardware Abstraction Layer. It contains all the drivers for the hardware elements and makes the translation of the communication between the hardware and the software level. It “explains” the hardware to the software and vice-versa.
To overcome the lack of Linux support, the manufacturers of the ARM chip forked the Linux code and applied a series of patches to “make it work”. These patches are not compliant with the work-flow of the main Linux branch and thus were not incorporated upstream. Even worse, many times the working OSs for these boards include proprietary code or binary blobs. The existence of the sunxi-linux community actively working towards the maintenance of these patches was one of our reasons for selecting the A20 chip when designing the Duo.
For those interested in deeper information, you can check the sunxi-linux mainlining effort here:
https://linux-sunxi.org/Linux_mainlining_effort
The practical problem when you use these forks is that your OS is “frozen” and stuck in time, with most of its development being carried by the group that made the fork and missing the much bigger mainline Linux forward development.
The Linux kernel has more than 27 million lines of code and is maintained by a group of more than 10.000 developers.
Forks that get successful as the sunxi-linux have a bit more than a hundred developers. The sunxi-linux-3.4 fork is, at the time of this writing, 633.332 commits behind the mainline branch so, since the sunxi fork was made, more than 600 thousand modifications were made to the original code and most of those changes were not absorbed by the fork. This means two things:
1 - The many bug-fixes and improvements made to all subsystems are not incorporated into your OS.
2 - If a new version of the Linux kernel supports a new feature, you are not able to plug it to your OS. Practical examples for us are Bluetooth-over-MIDI, Audio-over-USB, simultaneous Audio, MIDI, and Network over USB (also known as “composite device”).
Due to these problems, the “mainlining effort” has always been something on our minds, as it ensures the stability, longevity, and growth of our products’ feature set.
As of 2016, when we released the Duo, most of the mainline drivers were in place except for the NAND storage driver. NAND chips were widely used from 2012 to 2018 but some of the specifics of this technology were never widely supported in Linux. It is very much prone to errors and in our system, we had to develop multiple workarounds to keep the system running steadily. Throughout our history we have multiple times quoted the development of NAND support by 3rd parties but costs were prohibitive and we kept stuck to the old 3.4 sunxi-linux.
Fast-forward to 2018 when we started selecting the CPU for our new unit, the Duo X. Not only we wanted a more powerful processor, but also one with the then ”new" eMMC storage (which has great Linux mainline support) instead of NAND. Once we chose a system that was Linux mainline compliant, we started working on porting our OS to be compatible with it.
During this period, as we communicated with our user-base about the issues we were facing, Paul Sherwood - aka @devcurmudgeon, a MOD Duo user and also the founder of Codethink - stepped up offering help and manifesting the interest to upgrade the original Duo kernel to mainline, sparing some of Codethink’s manpower for that aim.
Also in 2018 our supplier of the A20 CPU updated their modules and started offering the original A20 CPU module with eMMC storage instead of NAND. The switch was obvious and by the end of 2019, we started shipping Duo units with eMMC storage instead of NAND. This switch gave birth to the “Duo 2020” as we call it internally. You can distinguish the “Duo 2020” from the original Duo by the “MOD Duo” laser engraving on the top face, not present on the original model.
Even with the new eMMC modules, the Duo 2020 kept using the old 3.4 sunxi-linux kernel. In parallel, the slow but steady mainlining effort of the NAND based systems kept moving, and around last March all the elements necessary for the “mainline puzzle” were in place and a migration scheme was put into the planning.
I am glad to say that from version 1.91 onwards of our software, MOD Duo users can now make the switch to the mainline kernel and assure a bigger lifespan of their devices.
Personally, this is a great satisfaction - and also a relief - because the old sunxi-linux kernel was holding back the continuous development of the original Duo, jeopardizing our mission of keeping the feature set growing.
We will soon be publishing comprehensive explanations on the procedures so that everyone can safely update their units and enjoy them.
Stay tuned and let’s all step onto the future.