The MOD Duo is going mainline!

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.

30 Likes

Congratulations! I’ve worked with linux-sunxi kernels before, so I share your pain. Well done and thanks for all the hard work, looking forward to trying it out!

2 Likes

Wow, it’s cool to see the background of a device such as the Mod Duo… fortunately for the non-programmers/coders like me, you guys have a handle on this! My main takeaway from this is that knowing is that you are extending the life of our pedals and trusting that you have our best interests in mind.

As a former Line 6 user, I loved their products at the time, but hated how they came out with new products with incremental upgrades year after year. It’s nice to know that you guys are trying to squeeze more life out of my old Duo, and future proofing my upcoming Dwarf. Thanks @gianfranco and everyone else!

6 Likes

What does this means in regards to people who got a Duo before the 2020 edition?

The “nand” units need to go through a non-mandatory one-time manual process in order to get the mainline kernel update.

A detailed explanation is coming out on as soon as 1.91 is officially announced in the next days.

8 Likes

Thanks all.

All that I needed to know is that the owners of the “old boys” would not be left behind and I’m happy not to be disappointed. :smiley:

4 Likes

Is this then currently a sunxi-linux v5.8-rc6 kernel?
That would be a huge leap forward and would certainly have a positive effect on the mod in many areas. :smile:

1 Like

It is 5.4 since when we started the mainline efforts it was the most up-to-date LTS version.
You can even see our custom changes to the kernel https://github.com/moddevices/linux-mainline :slight_smile:

3 Likes

I imagine that working on this must have felt like going down the rabbit hole sometimes. Very happy and proud of you for sticking with your plan! … thanks a bunch for your efforts!

4 Likes

This is great news! In the sentence above, though, did you mean “end of 2019” or “beginning of 2020”?

Well done ! That is fantastic news

Hey there.

You’re right. I wrote it wrong. It should say “end of 2019”

Already fixed :wink:

1 Like

Eek, only just saw this! Woohoo!

Hey,

Updated my modduo yesterday. First I tried it the nand way, but it didn’t work. I did so because my mod duo has no logo at the top of the right screen. This seemed a little odd because I recieved it in June 2020. Then I did the auto update sequence, copied the update file and this worked fine.

Now I’m still curious about that missing laser engraving logo thingy. Maybe someone also has a 2020 model without the logo?

Greetings

If you go to the web gui advanced settings, what kernel version do you see? (the information on the top-right)
Kernel version 3.4 is the old one, 5.4 is the mainline one.

It says 5.4.38-rt21-modduo

So you are already on mainline, no need to do anything.

My duox shows a 4.4.167-rt176-duox - OS Version 1.9.1.1455, is that correct?

yes

1 Like

hi @roughael

“Duo 2020” is an internal way we use to distinguish the NAND and the eMMC units. This difference refers only to the storage chips used in the computing module and nothing else and it does not affect the usability.

From a product perspective they are equal: same CPU power and same Audio CODEC. For this reason we did not upgrade the software of the eMMC units before and kept working on the NAND ones till they were upgradeable too, after all, they are the same product.

NAND and eMMC units are both circulating the market simultaneously as inventories have not been emptied and refilled. We have recently swapped distributors in major areas and this leads to repurchase and redistribution of existing stock, so we have brand new NAND and eMMC units available across the market and we treat them as the same product from two different production batches.

Hope I have clarified.

3 Likes