Using the Hammerfall HDSP on Linux
Now that the modules are loaded, and hdsploader has been run we can try to play a sound using aplay. Like any other ALSA driver, the HDSP driver mutes all channels at startup, so first you need to set the gain control, or volume, properly for your playback channels. One way to do this is to simply run alsamixer -c 1. When the bars are at 50% the channel is output with approximately 0dB gain. A more precise way is using amixer directly. The gain is as follows:
0 = -inf dB
32768 = 0 dB
65535 = +6 dB
A simple way to set all channels to 0dB gain is to use the following script:
#!/bin/bash for i in $(seq 1 18);do amixer -c 1 cset name=Chn,index=$i 32768 done
Now that you've done that, hook up your speakers to the first two analog outputs, and try the following:
aplay -D hdsp_analog some_stereo_file.wav
If all goes well you should see something like this:
Playing WAVE 'some_stereo_file.wav' : Signed 16 bit
Little Endian, Rate 48000 Hz, Stereo
By default, playback channels are connected to their respective hardware outputs; if this isn't true in your setup, you won't hear anything. If this is the case, read the following section on configuring the matrix mixer.
You also can change the -D option to send audio to different channels. For instance, using hdsp_adat would send the audio to the first two adat channels; hdsp_spdif would go to the spdif outputs. All of this is controlled by asoundrc.
If playing a sound worked, try recording a sound with arecord. This time, hook up a sound source to your first two analog channels, and run the following:
arecord -D hdsp_analog -f dat recording.wav
Press Crtl-C to halt recording. If everything worked, recording.wav should be a stereo file at 48kHz. In this case, the matrix mixer has no effect on what's recorded; the first channel recorded always corresponds to the first hardware input and so on.
As mentioned above, all software using the HDSP must be closed before switching between SingleSpeed and DoubleSpeed mode. But normally, software sets the sample rate. So what now? Well, there is a setting related to the AutoSync functionality (more on that later) that can do the job, Sample Clock Source. I won't explain exactly how it works just yet, but basically, by setting the internal clock to different frequencies, the card automatically switches modes. For instance, to switch to DoubleSpeed mode run:
amixer -c 1 cset numid=11 6
To switch back to SingleSpeed mode run:
amixer -c 1 cset numid=11 3
In both cases, don't forget to make sure that no application currently is using the sound card.
Sound routing is the most powerful feature the HDSP has to offer. Unfortunately, because it is not a feature found on many sound cards, the interface used to control it is not an ALSA standard. As of ALSA version 0.9.3, the matrix mixer interface is somewhat of a hack and is subject to change. It's possible to write values to it but not to read them back. In any case, the syntax used is source,destination,gain, where gain is as explained above, and source and destination are as follows:
For the Multiface:
input: 0-7 (analog), 16-23 (adat),
24-25 (spdif), 26-43 (playback)
output: 0-7 (analog), 16-23 (adat)
24-25 (spdif), 26-27 (line out)
For the Digiface:
input_source : 0-25 (physical channels),
26-51 (playback)
output_source : 0-25 (physical channels),
26-27 (line out)
The routing for the Multiface is also shown in Figure 1. By default, the playback channels are routed to the hardware output channels in order. All other possible connections are muted (0 or -inf dB gain).
To change an entry, use the following command:
amixer -c 1 cset numid=5 src,dest,gain
For instance, you could direct the SPDIF input to analog out with the following:
amixer -c 1 cset numid=5 24,0,32768 amixer -c 1 cset numid=5 25,1,32768
When you're finished, run the commands again, but with 0 as the gain instead of 32768. Don't forget that you can have multiple channels going to a single output or multiple outputs from a single input. Any combination is possible—use your imagination.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Build a Skype Server for Your Home Phone System
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Why Python?
- A Topic for Discussion - Open Source Feature-Richness?
- Tech Tip: Really Simple HTTP Server with Python
- Great
44 min 9 sec ago - Reply to comment | Linux Journal
52 min 10 sec ago - Understanding the Linux Kernel
3 hours 6 min ago - General
5 hours 36 min ago - Kernel Problem
15 hours 39 min ago - BASH script to log IPs on public web server
20 hours 6 min ago - DynDNS
23 hours 42 min ago - Reply to comment | Linux Journal
1 day 14 min ago - All the articles you talked
1 day 2 hours ago - All the articles you talked
1 day 2 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
Getting Multiface to work with Pulseaudio oder Jack?
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
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
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
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
Hey Rick ... where is the Message ???
re:Hammerfall
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
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
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
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
http://forums.gentoo.org
Re: Using the Hammerfall HDSP on Linux
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
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
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
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
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
Thank you for this wonderful article. Linux and RME on an Athlon64 = way to go.