Using the Hammerfall HDSP on Linux

Gain new flexibility in how you route and process audio data with this versatile, professional sound card.

RME's Hammerfall HDSP sound card is a powerful, professional-level sound card used in sound studios worldwide. It also works under Linux using the ALSA Project drivers. Your average consumer sound card, for instance, a Sound Blaster Live!, is designed around outputting sounds to a single set of speakers, be it a stereo setup or surround sound. Sound input, such as from a microphone, is an unconnected function done by the rare program that needs it. The HDSP on the other hand is designed as a sound I/O device. It has inputs and outputs, and you can route sound between them arbitrarily. It's like the difference between a NIC and a router. Sure a NIC is useful, but if you want to run a network, or sound studio, you need a full-fledged router.

So what exactly makes the HDSP special? First of all, it actually comes in two pieces, a PCI or PCMCIA host card and an external sound I/O module. The card and module are connected by a 10-foot Firewire cable, though the protocol used isn't actually Firewire. Two types of sound modules are available, the Multiface and the Digiface. The Multiface offers eight channels of analog I/O and digital SPDIF, as well as ADAT in and out for a total of 20 channels of 24bit/96kHz audio. The Digiface offers three ADAT in and outs and SPDIF for a total of 26 channels. With this separated design you can buy, for instance, a single Multiface and share it between your desktop and a laptop. One example of where this is useful is in live DJing. You don't have to buy two complete sound cards, which saves you money, and you also can test software on your desktop knowing that the environment is the same as it will be on your laptop.

This article focuses on using the Multiface module with the PCI host card. If you have different hardware, most of this article should still be applicable, and wherever possible, I've included information on the differences.

Architecture

Figure 1 shows how sound is routed inside the HDSP. At the top are the inputs, Analog, ADAT and so on, with the channel numbers below. At the bottom are the outputs, again with channel numbers. In between is the Matrix Mixer, which does the actual sound routing. In the Matrix Mixer, any input channel can be routed to any number of output channels, each having a selectable gain. All routing is performed internally in HDSP with zero host CPU load. This gives you total flexibility in how your sound is routed, for instance, allowing you even to have an analog input go directly to a digital SPDIF output with no software in between and no load on the host CPU.

Figure 1. Routing Sound within the Hammerfall HDSP

The Playback box at the top actually refers to applications playing sound. Say you want to play a simple stereo MP3 with xmms. The first two playback channels would be used for left and right. These channels are mapped to channel numbers 26 and 27 and then are treated like any other input. What's interesting about this approach is that playback channels have the same flexibility as any other input channel. You can, for instance, send a playback channel to multiple hardware outputs at the same time and even mix a playback channel with a hardware input to produce an output. Unlike all other input channels, the playback channels have a master gain control for each channel.

Finally, due to various implementation details, the HDSP works a little differently with sample rates above 48kHz. Because the ADAT has eight channels with a sample rate less than or equal to 48kHz and only four channels for a sample rate greater than 48kHz, the card uses two modes to distinguish between them, SingleSpeed and DoubleSpeed mode. In SingleSpeed mode, on the Multiface there are 18 channels, input and output. In DoubleSpeed mode this is reduced to 14. This means that the channel numbers used by the application change. In SingleSpeed mode, SPDIF is on channels 16 and 17, and in DoubleSpeed this changes to 12 and 13. Unfortunately, ALSA has no way of informing applications that the number of channels is being reduced, so you must close all applications using the HDSP before switching between the two modes. However, the matrix mixer channel numbers do not change.

Hardware Setup

Download and install the latest stable release of the ALSA drivers from www.alsa-project.org. You need to compile and install the HDSP module and the hdsploader program in alsa-tools. It's a good idea to make sure the snd-hdsp module is loaded first at boot time, because it needs to reserve a few chunks of contiguous memory for DMA transfers. If it can't reserve this memory, the card won't work. Loading the HDSP module first, however, makes it the default sound device in ALSA. If you intend to use another card for general sound I/O, which is highly recommended, use the index parameter when you load the module. For instance, my modules.conf has these two lines at the top to load my HDSP first and then my Sound Blaster Live!:

snd-hdsp index=1
snd-emu10k1 index=0

All the command-line examples using amixer in this article assume you have your HDSP at index 1. Once that is finished run the hdsploader program to load the correct firmware into the Multiface or Digiface. It's best to make sure this is done every time the drivers are loaded, so add it to your bootup scripts. If you unplug your Multiface or Digiface, you also need to reload the snd-hdsp module and run hdsploader again when you plug it back in.

Finally, you should add a few lines to your .asoundrc file in /etc/asound.conf or your home directory. The HDSP operates in non-interleaved mode, which many applications can't use. You also usually want to work only on a subset of the many input and output channels available. With asoundrc you can attach labels to different sets of channels. So instead of referring to channels 16 and 17, you could refer to hdsp_spdif. An in-depth look at asoundrc configuration is beyond the scope of this article, but the following should be a good start for using the Multiface. If you have a Digiface the labels will be wrong; hdsp_analog will correspond to your first ADAT connector, hdsp_adat to your second and hdsp_spdif will be wrong. See the asoundrc documentation for details on configuring asoundrc properly in this case.

pcm.hdsp {
        type hw
        card 1
}

ctl.hdsp {
        type hw
        card 1
}

pcm.hdsp_analog {
        type plug
        ttable.0.0 1
        ttable.1.1 1
        ttable.2.2 1
        ttable.3.3 1
        ttable.4.4 1
        ttable.5.5 1
        ttable.6.6 1
        ttable.7.7 1
        slave.pcm hdsp
}

pcm.hdsp_adat {
        type plug
        ttable.0.8  1
        ttable.1.9  1
        ttable.2.10 1
        ttable.3.11 1
        ttable.4.12 1
        ttable.5.13 1
        ttable.6.14 1
        ttable.7.15 1
        slave.pcm hdsp
}

pcm.hdsp_spdif {
    type plug
    ttable.0.16 1
    ttable.1.17 1
    slave.pcm hdsp
}

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Getting Multiface to work with Pulseaudio oder Jack?

hamli's picture

Hi,

did someone succeed in getting the Multiface to work with Pulseaudio or Jack?

I am using Ubuntu Jaunty Jackalope and was successful so far to install the Multiface in such a way, that I can for instance play a music-file by entering the command "vlc --alsadev default". Even though I tried really hard I had no luck so far to integrate the Multiface in Pulseaudio oder Jack. Thus I currently cannot for instance use Rhythmbox together with my Multiface.

I someone out there who succeeded in that respect?

I partly succeeded myself in

Anonymous's picture

I partly succeeded myself in the meantime. I say "partly", because this solution creates trouble while watching videos. Anyway: The solution was, to use dmix. My file ~/.asoundrc looks like this:

pcm.hdsp {
        type hw
        card 1
}

ctl.hdsp {
        type hw
        card 1
}

pcm.hdsp_analog {
        type plug
        ttable.0.0 1
        ttable.1.1 1
        ttable.2.2 1
        ttable.3.3 1
        ttable.4.4 1
        ttable.5.5 1
        ttable.6.6 1
        ttable.7.7 1
        slave.pcm hdsp
}

pcm.hdsp_adat {
        type plug
        ttable.0.8  1
        ttable.1.9  1
        ttable.2.10 1
        ttable.3.11 1
        ttable.4.12 1
        ttable.5.13 1
        ttable.6.14 1
        ttable.7.15 1
        slave.pcm hdsp
}

pcm.hdsp_spdif {
    type plug
    ttable.0.16 1
    ttable.1.17 1
    slave.pcm hdsp
}

pcm.hdsp_dmix {
    type dmix
    ipc_key 1024
    slave {
        pcm {
            type hw
            card 1
        }
        rate 44100
        format S32_LE
        channels 18
    }
     bindings {
        0 16
        1 17
     }
}

Hammerfall DSP 9632 on Ubuntu Studio

Viktor Mastoridis's picture

Hi,

I just plugged my new Hammerfall DSP 9632 on Ubuntu Studio and it works out of the box! It's such a great quality and such a great pleasure to listen to that magic sound coming out of the speakers in my new Linux/Ubuntu Studio setup.

Thank you to the Linux world for all this great software (audio and other) and the humanity which one gets while computing.

Thank you David for the beautiful, inspiring and insightful articles about making music on Linux.

Hammerfall

rick park's picture

Hi!

Ok. This is going to be a long message, so please be prepared for a longer
read - I have tried everything i could in order to get my HDSP 9632 working
on Suse 9.1...people you're my last hope ;-)
I absolutely want to get this working in Linux (i know its possible somehow)
and don't want to go back to WinXP ever again.

I've been browsing the net and tried every possible solution i could find, I
spent ages in IRC to get an answer, but still no luck.

Hammerfall

Jeanny Winter's picture

Hey Rick ... where is the Message ???

re:Hammerfall

rick park's picture

Oh sorry - my Browser went crazy, when I started to include all the questions i wrote. I will try later again.

Re: Using the Hammerfall HDSP on Linux

Anonymous's picture

Apparently, the 9652 and the HDSP are quite different, so while this article didn't help me as much as it might have, it did give me some insights on where to start. Thanks a lot for that.
I have a suggestion, on the 9652 front. gamix is UGLY, but it works to set things from ADAT to Internal, which helps immensly, as doing it int he asound.state file isn't all that easy. I don't know if it would work/help for the HDSP, but I think it might.
After a week of futile efforts, my card is finally working, and a large part of that is due to the hints this article gave me. I'm highly grateful for the help.
Thanks again,
RyAnne

Re: Using the Hammerfall HDSP on Linux

Anonymous's picture

I'm struggling to get this working under SuSE. I'm running ALSA 1.04 but I can't modprobe snd-hdsp without errors.

Does anyone know where a good place to get some support, or just a friendly ear would be?

Hammer

Anonymous's picture

Well, this looks very intersting. When you can use every hardware you want, you are not limited to special vendors. I think, I will try one of those.

Thanks a lot for the Info.
Bye

tefl tesol tesl course, tefl certificate, teach English
teach travel, work travel, gap year, student travel, teach Asia

Re: Using the Hammerfall HDSP on Linux

Anonymous's picture

Re: Using the Hammerfall HDSP on Linux

Anonymous's picture

thanks for the article. I was trying to run my RME under a Knoppix boot from CD-rom. But reading this article it needs some files to be set up before it can run. I might try do a full install when I have the time...

Thanks! How do you specifiy other outputs besides 1,2

Anonymous's picture

In the example
aplay -D hdsp_analog some_stereo_file.wav
you get output on the first two analog outputs.

How do you indicate outputs 3,4 or 5,6 or 7,8 using this
type of command line?

Re: Using the Hammerfall HDSP on Linux

Anonymous's picture

Hi, alsa-tools also comes with a hdspmixer application - as of 0.9.8
at least. This allows you to control the matrix mixing function
graphically, very similar to the Windows application.

This provides an alternative to the 'src/dest/gain' mechanism.

Rosegarden

Anonymous's picture

Another music app you really should try is Rosegarden. (All you Debian or Gentoo users out there should be fine with apt-get install or emerge.) It is a sequencing application which works with GNU Lilypond for professional music typesetting. Quite a trick!

Re: Using the Hammerfall HDSP on Linux

Anonymous's picture

This is a great article! Thank you Todd. Does anyone know of something similar for the older, Hammerfall Digi9652?

Re: Using the Hammerfall HDSP on Linux

Anonymous's picture

Thank you for this wonderful article. Linux and RME on an Athlon64 = way to go.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix