Using the Hammerfall HDSP on Linux
SPDIF on the HDSP Multiface is pretty straightforward; however, because ADAT and optical SPDIF share the same optical connectors you need to tweak a few mixer controls. The Digiface uses a similar setup as well, though not having access to one, I do not know the exact details. To enable optical input for the SPDIF, change the IEC958 Input Connector setting:
numid=6,iface=PCM,name='IEC958 Input Connector' ; type=ENUMERATED,access=rw---,values=1,items=3 ; Item #0 'ADAT1' ; Item #1 'Coaxial' ; Item #2 'Internal' : values=2
On later versions of the driver, setting the value to Internal seems to autoselect between optical (ADAT1) and coaxial, on others it does nothing. I don't know what the behavior will be with your driver, so you should check yourself.
Optical output is similar. By default, SPDIF output goes only to the coaxial connectors, but when the IEC958 Output (also on ADAT1, numid 7) is enabled, output goes to the optical connector as well.
Like all digital audio devices, the HDSP needs a clock source to function. This can be from either the internal clock generator or an external digital source, such as the ADAT or SPDIF inputs or the Word Clock. This is important when recording from external digital sources; if the clock is not synchronized properly, dropouts and clicks can result. When the clock is coming from an internal source, the HDSP is said to be operating in Master mode, and if the clock is from an external source, Slave mode. As shown in Figure 2, the various clock sources go into the AutoSync system, which then sends a single clock signal to the clock users.
AutoSync decides which clock signal to use. This is controlled by the Sample Clock Source setting and the Preferred Sync Reference setting. The former, Sample Clock Source, determines if the HDSP operates in Master or Slave mode. Its possible settings are as follows:
numid=11,iface=PCM,name='Sample Clock Source' ; type=ENUMERATED,access=rw---,values=1,items=7 ; Item #0 'AutoSync' ; Item #1 'Internal 32.0 kHz' ; Item #2 'Internal 44.1 kHz' ; Item #3 'Internal 48.0 kHz' ; Item #4 'Internal 64.0 kHz' ; Item #5 'Internal 88.2 kHz' ; Item #6 'Internal 96.0 kHz' : values=0
If you specify AutoSync, 0, the HDSP operates in slave mode and follows an external clock source. In this mode, playing a sound works only if the sample rate matches the external sample rate; otherwise, you receive an error message. Also, if there isn't a valid external clock available, the driver will not let you switch to AutoSync mode. Any other setting will set the Internal Clock Source sample rate to the specified frequency. Once the card is not in AutoSync mode, playing a sound at a different sample rate to the current one changes the current sample rate.
The other setting, Preferred Sync Reference, is useful when you have multiple possible clock sources connected but need to specify which one to use as the clock source. Suppose you had a consumer CD player connected with SPDIF and an eight-track tape recorder connected with ADAT to your HDSP. Almost no consumer CD players can operate in slave mode and receive a clock signal. So the CD player will have to be the master device. However, AutoSync normally tries to sync to the ADAT first. What now? Well, by setting Preferred Sync Reference to IEC958 (SPDIF), AutoSync will synchronize the clock to the CD player. The tape recorder then can be synchronized though other means. The possible settings of Preferred Sync Reference on the Multiface are as follows:
numid=13,iface=HWDEP,name='Preferred Sync Reference' ; type=ENUMERATED,access=rw---,values=1,items=4 ; Item #0 'Word' ; Item #1 'ADAT Sync' ; Item #2 'IEC958' ; Item #3 'ADAT1' : values=2
ADAT Sync and ADAT1 are different things. ADAT1 refers to the optical ADAT connection, and ADAT Sync refers to the D-sub 9-pin ADAT Sync connector. There are also a bunch of read-only mixer items that show various aspects of synchronization, type amixer -c 1 contents to see them all.
The most common Linux sound complaint is, “I'm getting clicks and dropouts in my sound!” This could be caused by a number of factors, such as PCI bus bandwidth, nonconforming PCI cards, too-small block sizes or latency. If possible, install the low-latency kernel patches or the 2.6 kernel if it's available by the time this article is published, and make sure your audio program is set to use real-time scheduling. You also can try increasing the block size your program uses. For hardware difficulties various PCI cards, such as some 3Com network cards and RAID controllers, have been known not to follow the PCI bus specification and use more bandwidth then they should, starving the HDSP of bandwidth. You also might need to change the PCI latency timer settings; for information on this see www-106.ibm.com/developerworks/library/l-hw2.html. Some motherboards also are known to have poorly performing PCI buses. RME's Web site is quite informative when it comes to hardware incompatibility. I recommend looking at the support section, both after and before buying a Hammerfall.
- October 2014 Issue of Linux Journal: Embedded
- Encrypt Your Dog (Mutt and GPG)
- Practical Tiny Core in the Fire Service
- DevOps for Dummies
- Tech Tip: Really Simple HTTP Server with Python
- Python Scripts as a Replacement for Bash Utility Scripts
- New Products
- RSS Feeds
- Open Axiom
- Cooking with Linux - Serious Cool, Sysadmin Style!
Free DevOps eBooks, Videos, and more!
Regardless of where you are in your DevOps process, Linux Journal can help!
We offer here the DEFINITIVE DevOps for Dummies, a mobile Application Development Primer, and advice & help from the expert sources like:
- Linux Journal