Troubleshooting Linux Audio, Part 3b
August 30th, 2007 by Dave Phillips
In this final section I'll present some MIDI-specific troubleshooting tips, along with a brief description of the setup here at StudioDave, a few closing remarks, and of course some links to the Linux music-maker du jour.
Troubleshooting MIDI
MIDI problems are generally easier to diagnose than audio difficulties. As you might already know, MIDI does not carry audio data, and the tools for troubleshooting MIDI problems are quite simple to use and understand. Your MIDI troubleshooting toolkit should include at least a MIDI monitor program and the ALSA amidi utility. The amidi tool can be used to send an arbitrary MIDI command string to any MIDI device in your system, and the MIDI monitor can watch the data stream to see if your command was correctly sent and delivered. Figure 1 shows off the gmidimonitor at work receiving a program change message sent from amidi.

The problem-solving flowchart remains essentially the same for MIDI as with audio. Check your hardware connections and power-on status, make sure your MIDI devices are actually supported by ALSA and that the correct drivers are installed, and check the virtual connections between your sending and receiving devices.
One special MIDI problem exists for Linux. The default kernel configuration includes a setting (under Processor Type & Features) for the timer frequency resolution, which affects the timing resolution of a MIDI data stream. If this value is set too low your MIDI streams may feel sluggish and unaligned. The resolution should be set to 1000. If it is not you will need to either install a distribution with an optimized kernel or you will have to configure and install your own kernel.
Some MIDI programs require that the kernel include an active realtime clock (RTC). Media-optimized kernels will activate the RTC as a matter of course, but if you're in doubt (or if your application has responded with an error regarding the RTC) you can check its status with the cat /proc combo :
cat /proc/sys/dev/rtc/max-user-freq
Use this command to check set the clock to its optimal value :
echo 1024 > /proc/sys/dev/rtc/max-user-freq
To permanently add this setting to your boot options, become the root user and run the following command :
echo "dev.rtc.max-user-freq=1024" >> /etc/sysctl.conf
By the way, you should always copy the original file to a back-up location before working on it.
Some Further Tips And Recommendations
Sage advice to the interested reader: Scale your expectations. Some problems are directly due to economic necessity, i.e., what you can and can't afford. For Linux audio people that means hardware (our native software is famously inexpensive), and in this domain hardware means microphones, instruments, amplifiers, speakers, cables, mixing consoles, computers, and of course, soundcards and audio boards.
If you need professional-quality results from your Linux audio work, then your choices are few and clear. The M-Audio Delta systems are popular for serious desktop and project studio production, while the RME Hammerfall is the preferred interface for fully professional recording houses.
If your needs are more modest you might be happy with the Creative Labs SBLive and Audigy cards. Both are available with a break-out box for easy access to their audio and MIDI ports, and both provide a handy S/PDIF digital audio interface.
Standards-compliant USB audio devices should work with the kernel and ALSA USB modules. Some Firewire devices are already supported by the FFADO project; see the project archives and the archives of the Linux Audio Users/Developers mail lists for information regarding specific device support.
On-board audio chipsets are designed for consumer-grade sound support. Their quality varies with the overall quality of the motherboard, but in general you should avoid using on-board sound hardware for serious desktop audio production. This is especially true for laptops, most of which can accept high-quality USB or PCMCIA external hardware alternatives.
Studio Dave
I have a small home studio, suitable for good quality project recordings and MIDI composition. It includes three computers, all locally networked. Two AMD64-based machines are used for project audio and MIDI work. The third machine, a PII 366 MHz laptop, is MIDI-capable, but its audio abilities are relatively weak. If needed, a CoreSound PCMCIA card provides a high-quality digital audio input channel for the laptop. All machines are accessible via MIDI. routed through a Yamaha MJC8, an 8-in/8-thru MIDI junction controller. Audio output from the computers and external hardware is routed through a Yamaha DMP11 MIDI-controllable mixer. High-quality audio production is available to both desktop machines (both include an M-Audio Delta 66 digital audio interface).
Problems I've encountered and resolved include crackling JACK, USB interference, mixer channel noises, and of course hardware issues such as bad connectors and poor connections. Fortunately I've also found valuable advice and assistance from the members of various lists, forums, and wikis, and I've been able to resolve happily all the troubleshooting issues I've encountered to date. May your own experience be as fortunate.
Linux Music Makers
Some years ago I found a page named Miki's Music that contained pieces composed with the excellent Rosegarden audio/MIDI sequencer. In the passage of time, Miki has become Wingse, the music collection has grown, but Rosegarden is still the composer's preferred music composition software. Check out the entire collection, but for a sweet taste listen to June Rainy Hill, and if you're up for some undisguised humor in music check out the lively Celtic Dance.
Outro
I'll return in a few weeks with news and updates from around the Linux audio world. So much good stuff is happening here, it's hard to decide where to focus. New packages appear, old stalwarts get stronger, and I have some interesting new projects in the works. Let me know what you'd like to see reviewed and profiled here, just add a note to the Comments section and I'll get right on it.
__________________________
Special Magazine Offer -- 2 Free Trial Issues!
Receive 2 free trial issues of Linux Journal as well as instant online access to current and past issues. There's NO RISK and NO OBLIGATION to buy. CLICK HERE for offer
Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.
Sorry, offer available in the US only. International orders, click here.
Subscribe now!
The Latest
Featured Videos
Linux Journal Live - Oct 2, 2008
October 3rd, 2008 by Shawn Powers
The October 2, 2008 edition of Linux Journal Live! Associate Editor, Shawn Powers, and Steven Evatt, Online Development manager for The Houston Chronicle discuss surviving disaster with Linux.
Mastering IPTables, Part I
October 2nd, 2008 by Elliot Isaacson
Linux comes with a powerful firewall built-in, although the interface can be a little intimidating. This is the first in a multi-part tutorial on how to master basic and not-so-basic IPTables functionality and create the perfect firewall for your home network.
Recently Popular
From the Magazine
November 2008, #175
There aren't many numbers that put the US national debt to shame, but here's one: 1,100,000,000,000,000. What's that? That's how many floating-point operations per second the Roadrunner supercomputer at Las Alamos can perform. That's about 100 FLOPS per dollar of US debt (unfortunately, the debt is winning the second derivative race). Read the article about Roadrunner in this month's High Performance Computing issue of LJ.
Along with that, find out how to program the Cell processor and how to use CUDA with your NVIDIA GPU. Also in this issue: Mr HandS (aka Kyle Rankin) gives us a few tips on using Compiz, Chef Marcel shows you how to get blogging off your plate quicker, Mick Bauer talks about Samba security, Dan Sawyer interviews Cory Doctrow and Doc talks about how information technology can affect democracy and fix the national debt (just kidding about that last part). That and more for your reading pleasure in this month's Linux Journal.
Delicious
Digg
Reddit
Newsvine
Technorati








Works fine
On February 4th, 2008 Hans Blen (not verified) says:
It works fine for me.
I use this :
Use this command to check set the clock to its optimal value :
echo 1024 > /proc/sys/dev/rtc/max-user-freq
To permanently add this setting to your boot options, become the root user and run the following command :
echo "dev.rtc.max-user-freq=1024" >> /etc/sysctl.conf
No problem for me.
MIDI Interface
On September 27th, 2007 scribe63 aka jawara (not verified) says:
A strange issue that I'm experiencing with music production oriented Distros (64Studio-i386, Dynebolic, JAD 1.0) is, being able to access the systems with my MIDI controller via a 2 port MOTU Fastlane USB MIDI interface.
These Systems, MIDI Applications(muse/rosegarden), and Jack recognize the device being present, and 'lsusb' displays the device's id.
awara@daw:~$ cat /proc/asound/cards
0 [M66 ]: ICE1712 - M Audio Delta 66
M Audio Delta 66 at 0x24c0, irq 18
1 [Fastlane ]: USB-Audio - Fastlane
MOTU Fastlane at usb-0000:00:1d.1-2, full speed
jawara@daw:~$ lsusb
Bus 002 Device 003: ID 07fd:0001 Mark of the Unicorn
But i cannot play any softsynths, or view incoming MIDI data flow with 'cat /dev/[dmmidi1 or midi1], and MMC/MIDI CLock data are not outgoing as well.
The only system that the device works on is my home initial home brewed Gentoo 2006.0 DAW system with a 2.6.17-rc1 realtime kernel. Therefore i know the device is in working condition. So i'm comparing the kernel configs to see what needs to be turned on in the other Distros to get this issue resolve and recompile the kernels.
Beyond this basic but very important issue for me, being a keyboard player. GNU/Linux Audio Production System are great. Just wish i could get my Yamaha 01X to work - wishful thinking.
I noticed this problem as
On April 4th, 2008 Golf car (not verified) says:
I noticed this problem as well and in pawn my experiences to the Linux Kernel mailing list. A bug seems to have been introduced in kernel 2.6.18 which caused the MOTU Fastlane to stop end result. The RT patches you added enormousness have something to do square dance it. In the meantime, I'm finished looking for a USB frontier that'll wreath whim-wham disseminated distros. Nobody seems least interested in addressing this problem.
I noticed this problem as
On October 15th, 2007 David Griffith (not verified) says:
I noticed this problem as well and posted my experiences to the Linux Kernel mailing list. A bug seems to have been introduced in kernel 2.6.18 which caused the MOTU Fastlane to stop working. The RT patches you added might have something to do with it. In the meantime, I'm still looking for a USB interface that'll work with current distros. Nobody seems very interested in addressing this problem.
A USB midi interface that works
On March 15th, 2008 David Griffith (not verified) says:
Since poking around and upgrading, I've found that the very latest kernel, 2.6.24.3 still has this bug. If you want a USB midi interface that works and doesn't require firmware fiddling, get an E-MU Xmidi of some sort. I have the 2x2 model and it works fine, though the aesthetics are somewhat annoying.
Any experience, advice or comments about garage band ?
On September 18th, 2007 dbmuse (not verified) says:
I have a friend who is having so many issues with garage band. Its a lowly intel macbook but maxed out with 2 gigs ram. I am tempted to install some linux distribution (dual boot) on her machine and a bunch of linux software that I am seeing on this site but... what software compares and beats garageband on apple laptops ? Her issues have been mostly about the software stutering when playing or recording, midi controller not fully functional with gb. She is trying to compose songs or music. She wants to type the notes on the keyboard like a typewritter (at her own pace) rather then performing it at the keyboard. Plus she plays fiddle and other things that she records into tracks. When she is at the keyboard she is constantly stopping on a mistake and starting over. She wants to type in notes like a typewriter instead of performing the music into a recorder. Her technique is probably wrong, but she claims its too hard to cut it up and move the good pieces where they belong. I understand if this posting get deleted.
thanks
lhcj
Post new comment