Welcome to the most active Linux Forum on the web.
Go Back > Blogs > GlennsPref
User Name


Rate this Entry

Making Real-Time Audio with Linux v0.3 part 1

Posted 01-26-2009 at 11:05 PM by GlennsPref

Making Real-time audio with
Mandriva Linux and Roland's
Edirol UA-25ex (usb powered sound card), using
jackd, qjackctl, Ardour, Hydrogen, Rosegarden and fluidsynth.

Topical Index
	Current system Hardware
	Find appropriate Kernel
	rpm's info and choice
	I used a perl script to check my system, ref.
	Patching the kernel
		Manual (diy) Edirol Patch by blablack, ref.
		Manual (diy) RT Patch(Linux Journal video)ref.
	Configure the kernel, (use Gentoo guide...)
	Compile and install the Kernel
	Give apps real time access, install and configure set_rlimits
	Run perl script check edit files to comply with script
	Reconfigure and compile if required.
	Test recording in Ardour with Hydrogen Drums controlled by jackd (not documented yet, but it works for me)

To achieve real time monitoring of multi track sound recording on a personal computer with
Open Source Software. We will probably have to compile twice or more, until all the
requirements are met, so don't worry if you miss something the first time through.

Current System Hardware

My system, Mandriva 2009.0 official release kde4.1.3(mdv)
Asus M3n78-EH AM2 motherboard,
2x 1gig kingston 800mHz DDR2, AMD64x2 5600+,
Edirol UA-25EX (24/96) usb sound.
nVidia 9800gt 512Mb ddr3 (pci-e x16), Zalman ZM750-HP PSW
numerous usual storage devices.

Find appropriate Kernel, rpm's info and choice

First thing I had to do was get a kernel that supported the new usb audio card.

I started with the newest available, from Mandriva cooker, 2.6.28 rc...x86_64.(2009.1)

Once I turned off the on-board sound chip in bios, this kernel allowed the device to work out of
the box. (start-up music found it's way to the speakers, without configuring)

But I want Real-Time support!

The new kernel has the Edirol devices already installed. But I want Real-Time support.
I could not get a real-time patch for the new kernel, and to make one is out of my league.

Mandriva has RT type kernels available in .rpm packages from the contrib
and contrib/updates repositories. The real-time patched vanilla kernel...

The tmb kernel has Mandriva patches and third-party drivers I generally use so I'll start there as a
configuration basis, kernel-tmb-desktop-

Then I will patch the rt-kernel-source with the Edirol patch to get the usb-audio module to
recognise my new sound card.

rpm's info and choice...

The RT kernel is vanilla and has no Mandriva tweaks, so to keep the tweaks I configured the RT
source from the old tmb config file. The versions overlapped in the right order.

kernel-rt-source- - The source code for the Linux kernel                                                                                                                        
The kernel-rt-source package contains the source code files for the Linux kernel. The source files
are only needed if you want to build your own custom kernel that is better tuned to your particular
NOTE: This kernel has no Mandriva patches and no third-party drivers, only Ingo Molnar 
-rt (real-time) series patches applied to vanilla kernels.
kernel-tmb-desktop- - Linux Kernel for desktop use with x86_64                                                                                                                        
The kernel package contains the Linux kernel (vmlinuz), the core of your Mandriva Linux 
operating system.  The kernel handles the basic functions of the operating system:  memory
allocation, process allocation, device input and output, etc. This kernel is compiled for desktop 
use, single or multiple x86_64 processor(s)/core(s), using voluntary preempt, CFS cpu scheduler
and cfq i/o scheduler. This kernel relies on in-kernel smp alternatives to switch between up & smp
mode depending on detected hardware. To force the kernel to boot in single processor mode, 
use the "nosmp" boot parameter. 
The tmb kernels is an experimental kernel based on the kernels with added patches.
Some of them may/will never end up in the main kernels due to their experimental nature. 
Some refer to this kernel as a 'hackkernel' ... Use these kernels at your own risk !!
you can do this (install) on a Mandriva system with smart or urpmi, if you have a current rpm
and urpmi database...(for smart too?) Smart is a package manager, like synaptic,
available from the MDE repos. Ref. (I like it a lot)

smart install kernel-tmb-desktop- kernel-rt-source-
urpmi kernel-tmb-desktop- kernel-rt-source-
Note: I did not install the rt-kernel rpm, just the tmb-kernel and rt-kernel-source rpms,
to save on downloads and to keep the “Mandriva tweaks and proprietary drivers”.

RT= to bring hard real-time scheduling capabilities to the Linux Kernel,
with worst case latency and code execution in the tens of micro seconds.
(Linux Journal video)ref.

Note: I use the video also in manually patching the kernel with an rt patch and
setting rt access for the programs. I used that video and this perl script (next) to set up
my system for jackd.

I used a perl script to check my system,

By following this perl program, I found what I needed to change for optimum Audio Response

Check the system with “” (found here)...

perl script to report if you need to adjust ticks, or smp, etcetera.

you can run it from another shell terminal, (Konsole has tabs like firefox)
and it just reports to screen what needs to be done. Beautiful!

You can use the shift+PageUp or shift+uparrow to scroll back up the page.
Make a list, although they wont all be kernel config changes, It checks for several things,
Checking for Ingo Molnar's Real-Time Preemption, Checking for tick less time support
Checking for 1000hz clock, Checking for High Resolution Timers,
Checking filesystem types, Checking tmpfs mounted on /tmp
Checking filesystem 'noatime' parameter, Checking the ability to prioritize processes
with (re)nice, Checking whether you're in the 'audio' group, Checking for multiple 'audio' groups
Checking sysctl settings (inotify max_user_watches), Checking for resource-intensive background
processes, like kpowersave.
We'll run this check again later to be sure we have everything in it's list. “to be sure, to be sure!”

Patching the kernel...

Patch the kernel with the Edirol patch.
Patch the kernel with the RT patch.


Before I configured the kernel it needed to be patched and hacked a bit,

I edited the lines in the new Makefile to reflect the name I wanted to use for my kernel...
Posted in Uncategorized
Views 1105 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 06:15 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration