Archive for the alsa Category

For those interested in Linux HDA sound troubleshooting, Eduardo Habkost’s Codecgraph tool finally gains a tarball and page.

Codecgraph is a tool to generate a graph based on the ALSA description of a High Definition Audio codec. The generated graph depicts the HDA codec layout and node connections, helping driver troubleshooting and maintenance. Codecgraph’s parser reads the codec description from /proc/asound/card*/codec#0 and parsed data is sent to Graphviz for actual graph generation.

I mentioned codecgraph before as the tool used to fix 5.1 sound in six and threestack ALC888-based HP systems, and recently it was used to fix 5.1/7.1 sound in the Dell Inspiron 530.

On New Year’s Eve a loose heatsink fried my old Asus motherboard northbridge, so I replaced the entire system with a nice and inexpensive Dell Inspiron 530. It’s a G33/ICH9-based system, which runs almost out-of-the box with Linux 2.6.23, except for the ethernet controller (you’ll need an upgraded e1000 driver from Intel) and HDA sound (multichannel and headphone detection not working). Use the following ALSA patch to fix both sound problems:

It adds the ALC888 6stack-dell mode for the Inspiron 530 and hopefully for other Dell systems based on the ALC888. The patch has already been submited upstream and should show up in the next kernel version. The patch has also been added to the current Mandriva Cooker kernel.

Today at lunch boto handled me a QNX Neutrino 6.3.2 CD he was using in virtualization tests for Red Hat. I quickly installed it on a spare machine to see how well xmp would build on it — and it built quite well. After fixing some trivial build problems I examined the new sound system used in QNX6 (since the old drivers for QNX4 didn’t compile), and I was pleased to find that it’s based on the old ALSA 0.5 API. Xmp has an ALSA 0.5 driver written in 2000 by Tijs van Bakel and Rob Adamson, and it worked out of the box in Neutrino 6. Source patch and binary are available in the SF download page.

xmp in QNX Neutrino

Next targets to test/port xmp include Plan9 (new port), BeOS and AIX (drivers exist, but never tested), and OS/2, IRIX, HP-UX and Solaris (used to work, but not tested for a long time). Contact me if you have access to one or more of those (or other) systems and have some free time to test the portability of an old mod player.

HDA codec graph

It is worth noting that my previous work with HDA fixing the 5.1 sound output of a couple of HP machines and the LG LW20 was made much easier with this very nice tool called codecgraph, which takes /proc/asound/cardX/codec#Y as input and generates a neat-looking graph using graphviz in such a way that you can see how mixers, amplifiers and pins are connected and visually follow the signal flow inside your HDA setup. I’ve even added some stuff to it — mostly new codec samples and other ancillary work since I’m illiterate in Python (yes, I know, I’ve tried but I just can’t like the language). You can clone my repository with git clone http://helllabs.org/git/codecgraph.git, or get the official tree from Boto’s repository. Codec sample contributions are welcome!

Update: Codecgraph project page published, with SVG renderings of all samples from our codec database.

These are mostly small quirk table additions to allow certain systems to be recognized by HDA driver without specifiying a parameter model when loading the module. The first three patches are for HP systems (Samba, Nettle, Lucknow, dx2200 and dx2250) and the fourth is for the Asus P5LD2 with the Realtek ALC882 codec:

For more ALSA patches for HP systems including the Nettle and Lucknow, see my previous ALSA HDA patches. 5.1 sound output in Realtek-based HDA systems is quite easy to fix, so feel free to contact me if you have such a system that’s not working properly (usually no 6ch option available, channels missing or no sound from the rear connectors).

Owners of the LG LW20 laptop (like me) have had poor sound support in Linux for over a year and possibly never noticed that. I had never used its 5.1 surround support, recorded from the line-in input or used the si3054-based modem before this week — had I tried it earlier, I would have noticed that these features didn’t work. So to complement the patch to fix 5.1 output I published a few days ago, here’s a couple of small fixes for the rest of the aforementioned issues:

Hopefully these patches can also fix issues in the LG LW25, which seems similar in many aspects to the LW20. If you have issues with sound on the LW20 or LW25, feel free to contact me so we can fix any remaining problem.

Let’s hypothesize for a moment that you must make an old, binary-only Conexant HSF softmodem driver (that you, for some reason, can’t upgrade) peacefully coexist with a newer 2.6.22 kernel ALSA HDA driver. “Oh, what an embarrassing situation!” you might think — but I assure you, this can actually happen to some unfortunate souls among us. A workaround for this problem is twofold: first, you must graft the HSF appendages to your existing HDA driver (the HSF driver comes with its own HDA driver that potentially won’t have some features you need), and then resolve a recursion in module loading since 2.6.22 merged snd-hda-codec and snd-hda-intel in a single module and the binary-only culprit used to sit between the two.

So without further ado, here is what it takes to have this setup working:

  1. Revert the hda-codec and hda-intel merge, to work around the HSF initialization recursion.
  2. Apply Herton’s HSF patch against 2.6.22 so you can use the binary-only portion with the stock HDA driver from your kernel.

Generally speaking, binary-only modules can be a pain in the ass and this situation illustrates well how. Always verify driver availability before purchasing hardware, and that can save you some headaches.

Here are some patches for ALSA to fix issues with 5.1 surround in some machines (LG LW20 laptop, HP Nettle, HP Lucknow), headphone detection (HP Spartan laptop), modem detection (Clevo m540 laptop, sold under different names such as Positivo V44 in Brazil) and USB MIDI quirk (Roland Juno-G synth). All those were sent to Takashi for inclusion in 2.6.23, but if you’re stuck with an older kernel, can’t upgrade your ALSA and have experienced problems with any of the pieces of hardware listed above, you can try one or more of the following patches: