LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > GlennsPref
User Name
Password

Notices


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
Code:
	Objective
	Current system Hardware
	Find appropriate Kernel
	rpm's info and choice
	I used a perl script to check my system, ref. http://arnout.engelen.eu/files/dev/linuxmusicians/realTimeConfigQuickScan.pl
	Patching the kernel
		Preparations.
		Manual (diy) Edirol Patch by blablack, ref. http://ubuntuforums.org/archive/index.php/t-908845.html
		Manual (diy) RT Patch(Linux Journal video)ref. http://www.linuxjournal.com/video/hy...al-time-kernel
	Configure the kernel, (use Gentoo guide...)http://proaudio.tuxfamily.org/wiki/index.php?title=Howto_RT_Kernel
	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)
Objective

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.

http://www.edirol.net/products/en/UA-25EX/index.html

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...
kernel-rt-source-2.6.26.8-1.rt13.1mdv

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-2.6.26.3-1mdv

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-2.6.26.8-1.rt13.1mdv.
Code:
kernel-rt-source-2.6.26.8-1.rt13.1mdv - 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
hardware. 
NOTE: This kernel has no Mandriva patches and no third-party drivers, only Ingo Molnar 
-rt (real-time) series patches applied to vanilla kernel.org kernels.
kernel-tmb-desktop-2.6.26.3-1mdv.
Code:
kernel-tmb-desktop-2.6.26.3-1mdv - 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 kernel.org 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. http://www.mde.djura.org/index.html (I like it a lot)

Code:
smart install kernel-tmb-desktop-2.6.26.3-1mdv kernel-rt-source-2.6.26.8-1.rt13.1mdv
Code:
urpmi kernel-tmb-desktop-2.6.26.3-1mdv kernel-rt-source-2.6.26.8-1.rt13.1mdv
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”.


Quote:
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. http://www.linuxjournal.com/video/hy...al-time-kernel


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 “realTimeConfigQuickScan.pl” (found here)...

http://arnout.engelen.eu/files/dev/l...igQuickScan.pl

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,
Quote:
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...

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

Preparations

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 1371 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 10:06 AM.

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