[Interview] Takashi Iwai, Japan/Germany (longtime ALSA maintainer, Linux kernel audio developer at SUSE)

Takashi Iwai is a longtime maintainer of the Advanced Linux Sound Architecture (ALSA) subsystem in the Linux kernel and a software engineer at SUSE. Alongside Jaroslav Kysela, he maintains the main ALSA sound subsystem, covering its kernel interfaces, core infrastructure, and a broad range of audio drivers. His work has included extensive contributions to the HD-audio subsystem, including support for Realtek codecs and the hardware-specific quirks needed to make audio work across different PC platforms. He is also the author of the Linux kernel’s Writing an ALSA Driver documentation, an important reference for developers working on ALSA kernel drivers.
Table of Contents
When PulseAudio and, more recently, PipeWire pushed Linux audio toward timer-based scheduling and tighter latency, what did these developments actually demand from the kernel side? Are there still limitations in ALSA that make low-latency audio unnecessarily difficult?
At the beginning of the introduction of the timer-based scheduling, reliability was the biggest issue. Especially HD-audio controllers tend to be loose about the interrupt timing and the position report, which is essential for timer-based scheduling. Along with the improvements in the driver side for such issues, we had to re-define the mechanics and API usages from the hardware to the user-space more strictly than before.
But, generally speaking, problems that hit wider audiences were rather the various hardware configurations such as mixers. In the end, we took an approach to adapt more Use-Case-Manager (UCM) profiles for specific implementations.
A remaining limitation for better latency would be the current PCM API design that is based on period transfer. That doesn’t always fit fully with the hardware using packet-based transfers such as USB-audio where the “period” might slightly vary (although it’s reasonably well working for now) – it’s just a question of “optimal”.
Looking at patch_realtek.c, the quirk table has grown considerably over the years. Which specific hardware implementation or firmware behavior surprised you the most when debugging HD-audio?
Honestly speaking, I didn’t expect that HD-audio would live for such a long time on tons of different devices; the initial driver design followed a pattern for the former AC97-based drivers, and that wasn’t scalable but tried to be rather simple & self-contained. So, the history of HD-audio driver is continuous and significant refactoring without breaking the existing usage, as you see. I had to write an emulator code and unit tests which helped a lot to catch corner cases at each evolution.
The recent major problems about HD-audio are, though, rather the changes of the hardware configurations: nowadays lots of devices are equipped with individual amps and DSPs behind the audio codec chip, which need yet more complexity, where a part of them are managed by completely different ASoC drivers and tied with HD-audio. That was a surprise to me because the amp itself could be represented in HD-audio topology. Vendors love to use vendor-specific features once when available – that’s a principal rule, and shown again to be true.
Can you walk us through one of the more difficult concurrency or locking problems you’ve encountered in ALSA’s PCM or timer infrastructure? What made it particularly challenging to diagnose and fix?
Most of such difficulties come from the design. For example, ALSA PCM API has a feature of linked streams that allow tying multiple streams. That caused a lot of problems because each stream has its own locking. As you know, when there are multiple instances do lock with each other, it’s an easy source of a deadlock. So, the basic concept for linked stream locking is to have a group lock on the top, then apply each stream lock belonging to the link group, while keeping the group itself intact via read/write lock during the operation.
For the timer, there are similar difficulties because ALSA timer API has a concept of “slave timer”. The timer instances are managed by linked lists, and the concurrent runs on those lists were often the cause of deadlocks.
Luckily, most of such locking problems have been identified by fuzzer or static analysis, and there was rarely an actual deadlock. But locking problems are still recurring issues even for the time being.
Why does the snd_ctl control API look the way it does today, and how have its control-naming conventions evolved over the years? How have userspace projects such as PulseAudio, PipeWire and UCM influenced the way controls are designed and exposed?
Initially we implemented an API for mixers that allow more structured data representation. But it turned out that this would bring too much complexity to both driver code and user-space, so we switched to a very simple flat array of control elements.
Also, for some more attributions such as dB info or control, we extended a TLV representation that is also relatively simple, per se.
But simplicity is another side of the coin and it’s a problem when you really need complexity: it couldn’t give enough information for constructing the topology graphs and explaining the intended features. So UCM was integrated into PA/PW scenes as mentioned in the above.
The UCM is still being enhanced, and covering more and more areas. Now it’s one of the most important pieces in the sound subsystem.
What is the worst regression you ever let slip into a release, and how did you eventually trace it?
Well, I try not to remember my failures for my mental health 🙂
Lol yes, well you handle a considerable volume of vendor-submitted patches every merge window. What is your actual workflow for reviewing code when you don’t have the physical hardware on your desk?
The most important point is whether I can (more or less) understand the code. That is, focusing on the clearness of the intention of the code, the logic and the implementation for the target features. Since I cannot test whether it actually works well or not, it’s purely depending on the patch author and other testers.
Now more and more patches are written by AI, and the rules above become more important, because the code generated by AI tends to be unnecessarily lengthy and sometimes messy. If it doesn’t look understandable enough, I just ask to rewrite, split or improve the code again.
Then the next step is syntax reviews and some CI tests – which are systematic and mostly automated. Now I’ve been trying to apply the AI code review in the pipeline, too.
How has the relationship between the main ALSA subsystem and ASoC evolved over the years? How do you coordinate with Jaroslav Kysela and the ASoC maintainers, including Mark Brown, when changes affect both sides of the architecture?
I have known these wonderful guys over years, and our cooperation works well for now as each of us focuses on different fields: Jaroslav takes care of mostly user-space stuff such as alsa-lib and UCM, and Mark takes care of (incredible amount of) ASoC code, while I’m caring for ALSA core and other drivers and coordinate for Linux kernel upstreaming.
How did you originally become involved in ALSA development and eventually take on its maintenance? How has your work at SUSE influenced your priorities as a Linux audio developer?
It was decades ago, and I developed a SoundBlaster Wave synth driver individually. When I moved to Germany as a researcher at University, I was informed about the (freshly born at that time) ALSA project, so I joined immediately. It was the time that Linux business started growing, too, and casually SUSE also started hiring developers, including the sound subsystem. So Jaroslav (also Abramo Bagnara) and I joined SUSE for developing ALSA project further.
Luckily, I could still work at SUSE for ALSA. Although I don’t spend full time for ALSA, I can manage the time by myself fairly freely; that allows me flexibility and it’s really good for me.
If you could redesign ALSA today without having to preserve decades of userspace compatibility, what parts of its architecture or API would you change or remove?
The absolute number one is the alsa-lib API design. It was a result of our focus – solid and extensible API – but in the end, it’s really cumbersome to use. We hoped applications will use a higher-level abstraction to wrap those, but it never happened.
Another thing would be the PCM period-based API mentioned in the above. This could be a bit more flexible that fits with other hardware designs, too.
Kernel subsystems often depend on a relatively small number of experienced maintainers. How do you see the future of ALSA maintenance, and are there developers who you expect to take on greater responsibilities in the coming years?
That’s a difficult question, and I have no good crystal ball. I see many great developers, and I guess they can take over at any time, as long as the project itself is attractive.
That said, if the development of sound subsystem itself is interesting, things can continue to run – that I’m sure.
Linux has a relatively strong ecosystem of professional audio applications, including Ardour, JACK and various low-latency audio tools. What do you think are the remaining kernel-level obstacles to making Linux a more predictable platform for professional audio production?
I don’t think there are so many obstacles on the Kernel side. The realtime support has been achieved, and the driver code is delivered for most devices in the market.
But, of course, some niche and specific devices are often behind other OSes, and this could be improved, if we have some more connections with vendors.
Where can people follow your work, or get involved in linux audio development?
I’m not much involved with SNS, so old-fashioned mailing lists are the best place to reach out. It’s still good enough for discussions.
