This is the story of how I managed to bring the TerraTec PHASE 88 RACK PCI audio cards back to life on Linux, with a little help from reverse engineering, kernel development, and, most importantly, AI.
The driver patch has now been accepted by the community, and hopefully it will soon be available in future Linux kernel releases.
A few years ago, I bought two TerraTec PHASE 88 RACK PCI audio cards for a very low price. They were interesting pieces of hardware: multiple analog inputs and outputs, MIDI connectivity, and an external rack unit.
Unfortunately, I soon discovered that the original Windows drivers were too old to work reliably with Windows 10 and Windows 11. I tried to get them running, but the system would frequently crash with blue screens.
I didn't want to give up on the cards, so I put the project aside for a while.
Later, I decided to investigate the Linux support.
The cards are based on the ICE1712 (Envy24) chipset, which is already supported by the Linux ALSA driver `snd-ice1712`. However, the PHASE 88 RACK has some hardware-specific differences that prevent it from working correctly with the standard driver.
I started investigating the hardware and tried adding some modifications to the existing Linux driver myself. This involved reverse engineering the card and understanding how its various components communicate.
I made some progress, but the work was becoming quite time-consuming. There were several hardware details to understand, and getting everything right required a lot of testing.
Once again, I put the project on hold.
Last month, I decided to try a different approach. I asked an AI coding model, Qwen 3.8 Flash, to help me develop a proper patch for the Linux `snd-ice1712` driver.
The AI was running on my workstation, equipped with an NVIDIA RTX 3060 12 GB GPU, a Xeon processor, and 256 GB of RAM. However, the actual development and testing environment was an old Core 2 Duo PC with just 8 GB of RAM, running Debian 13, pi agent.
I provided the model with all the material I had collected over the years:
- My previous hardware reverse-engineering notes.
- The original Windows 2000/XP drivers and the Mac OS 9 drivers.
- The hardware information and observations from my earlier experiments.
The AI analysed the original vendor drivers, including their disassembled code, and used that information to understand how the hardware was supposed to be initialized.
This turned out to be extremely useful. Instead of trying to guess how the card worked, we could compare the original vendor implementation with the existing Linux driver and identify what was missing.
The development process took approximately four days. The old Core 2 Duo machine was not particularly fast, and some operations still required my intervention. For example, I had to physically test the inputs, connect microphones and speakers, and verify that the hardware behaved as expected.
It was not a completely autonomous process: I acted as the hardware engineer and tester, while the AI helped with code analysis, implementation, debugging, and successive revisions.
After several iterations, we finally had a working driver.
The result was much better than I initially expected.
The patch addresses several hardware-specific issues in the existing ALSA ICE1712 driver, including:
- Correct initialization of the card's chip-select expander.
- Handling of the missing AC'97 codec.
- Proper initialization of the expander registers required by the audio converters.
- Support for selecting the front microphone input.
After implementing the changes, I also developed a collection of installation and configuration scripts.
These make it easier to install the patched driver, configure the audio cards, and automatically rebuild the driver module when the Linux kernel is updated.
An important detail is that you don't need to compile or install a custom kernel. The patched driver can be built as an external module against the headers of the installed Debian kernel.
I initially developed and tested the changes against Linux 6.18.55, and then adapted the solution for Debian's stable 6.12 kernel series as well.
I tested both cards, including their analog inputs and outputs, the front microphone input, and MIDI connectivity. Everything is now working reliably.
Once the driver was working and I had a reasonable set of installation and testing scripts, I decided to contribute the changes upstream.
This was another small adventure. I had never submitted a Linux kernel driver patch before, so I first had to understand the contribution process, the required format, the mailing-list workflow, and the conventions used by kernel developers.
I also used GPT-6 Luna to help me understand the process and prepare the patch submission. After a couple of iterations and some adjustments, the patch was accepted by the community.
This is a great result: the fix is no longer just a local modification on my machine. It has been accepted for upstream integration, and hopefully it will become part of a future Linux kernel release.
Today, I use the two PHASE 88 RACK cards in a small recording system that I lend to friends when they need to record something.
The setup runs Linux, with REAPER and JACK handling the audio. Even the old Core 2 Duo machine is powerful enough to handle multitrack recording with this hardware. Once the recording session is finished, the REAPER project can simply be moved to a more powerful computer for editing and mixing.
It is nice to see this old hardware still being useful, especially considering how inexpensive the cards were.
Without AI, I would probably have spent a huge amount of time studying the original drivers, understanding the hardware initialization sequences, navigating the ALSA codebase, and implementing and debugging the changes.
AI didn't magically solve everything, though. I still needed to understand the hardware, provide useful technical information, guide the development, review the code, run tests, and verify the results on real equipment. But it dramatically reduced the amount of time needed to get from an initial idea to a working solution and an accepted upstream contribution.
And that is probably the most interesting part of this story: AI allowed me to contribute a real hardware fix to the Linux kernel for a device that might otherwise have remained unsupported.
All the source code, hardware investigation notes, installation scripts, testing tools, and driver information are available on GitHub: https://github.com/davidegironi/terratec-phase88-rack-pci-linux-driver/
Hopefully, the changes will soon be included in the official ALSA drivers shipped with future Linux kernels.
Notes
- read risk disclaimer
- excuse my bad english

No comments:
Post a Comment