How to Get Rosegarden Sound Working on Fedora Core 7 (FC7) and Fedora 8 + 9

There are some great Rosegarden tutorials on the Internet and even some specifically dedicated to making sound using Rosegarden, e.g. this sourceforge tutorial. However, it took me quite some time to discover how to do it easily, on FC7, so here are some short easy notes that are up to date as of mid-FC7, but do not require the user to understand all the complexities of Rosegarden, ALSA, Jack etc.

I have also tried these instructions out on Fedora 8, and they work fine, but please note the reference to pulseaudio below. Apparently, these instructions work fine on Fedora 9 without any changes. If anyone would like to try them on Fedora 10 and feed-back, please email me at dwlegg [at] gmail [dot] com. See the email at the bottom for how to make them work in Ubuntu Intrepid and Linux Mint 5.

Of course, the simplest way of getting sound out of Rosegarden is just to export your composition to a MIDI file, then to use timidity++ (or another suitable MIDI synthesiser) to play it.

The next simplest way is simply to provide Rosegarden with a MIDI daemon to use to make sound through. This can be achieved by running timidity++ before starting Rosegarden:

timidity -iA

then start Rosegarden in the usual way. It works with Rosegarden inthis way out-of-the-box, and I personally find that it produces better quality sound than you get by following the rest of this tutorial and using jack, qsynth etc.

Another neat thing to do, then, is to provide a KDE icon to start yourself a timidity server with a single click:
$ cat > ~your_user_id/Desktop/Timidity\ Server.desktop
[Desktop Entry]
Comment=
Comment[en_GB]=
Exec[$e]=timidity -iA\n
GenericName=Timidity Server
GenericName[en_GB]=Timidity Server
Icon=arts
MimeType=
Name=Timidity Server
Name[en_GB]=Timidity Server
Path[$e]=
StartupNotify=true
Terminal=true
TerminalOptions=\s--noclose
Type=Application
X-DCOP-ServiceType=
X-KDE-SubstituteUID=false
X-KDE-Username=
[daddy@arcturus ~]$

Apparently, you can even issue the 'timidity -iA' command from within the Rosegarden start-up so that it starts automatically whenyou start Rosegarden.
However, if you still want to do Rosegarden with qsynch, jack and get real-time sound without any delay, read on ...

This guide uses a relatively simple arrangement of just three programs, like this:-
Picture of how ALSA, Rosegarden and Jackd relate

I am assuming:
  1. That you're using Fedora Core 7 (FC7) or Fedora 8 with SELinux disabled.
  2. That you have an Internet connection so that you can use yum.
  3. That you are using KDE V3.x, since Rosegarden is a KDE application.
  4. That you do not have a sound card that supports MIDI directly (because most of us don't).
1. Get the packages using yum
su -
yum install qsynth jack qjackctl lilypond rosegarden4 perl-XML-Twig
2. Edit the /etc/security/limits.conf file
The installation of jack will put this stuff at the bottom of your /etc/security/limits.conf file, meaning that only users in the jackuser group can use Jack.
## Automatically appended by jack-audio-connection-kit
@jackuser - rtprio 20
@jackuser - memlock 4194304
However, most users will want anyone to be able to use jack, so edit the file to look like this instead:
## Automatically appended by jack-audio-connection-kit
#@jackuser - rtprio 20
#@jackuser - memlock 4194304
*       -       rtprio 20
*       -       memlock 4194304
After this, you *must* reboot your system for the security-related real-time sound changes to take affect.

3. Get some sound fonts and install them in Qsynth
The tutorial that I referred to above suggests getting some sound fonts from here.

Unzip them and load them into Qsynth like this:
Qsynth setup menu to load sound fonts

4. Match settings in Jack and Qsynth
Here are some settings for qjackctl and qsynth that seem to work for me using an AMD 64 3500 (64 bit) on FC7 with a kernel-2.6.23.8-34.fc7 kernel. I have noticed that feeble processors (<3GHz ish) with on-board sound do not make a good job of doing real-time sound synthesis using jack. You really need a fast processor or a decent sound card or both. The important thing is to make qsynth and jack compatible with each other, or you will get no sound. Start qjackctl and qsynth from the KDE menus in that order.

qjackctl setup with command: artsshell -q terminate
Note the command 'artsshell -q terminate' in the qjackctl setup window above. This is useful because it kills the KDE sound daemon that would otherwise prevent jackd from talking directly to ALSA (in other words you would get no sound, and perhaps an error message.)
In Fedora 8, you also need to kill the pulseaudio daemon, so the command is:

artsshell -q terminate; pulseaudio -k

Also, and this is important, make sure that the 'Start JACK audio server on application startup' box is ticked under the Misc tab in the qjackctl setup.

qjackctl setup with Force=16bit and SampleRate=48000 entries
The entries 'Force 16bit' and SampleRate=48000 particularly need to match in qjackctl and qsynth. Others may require some experimentation to get your sound sounding good. The entry, Interface=hw:0, will often make the difference between sound and nosound.

qsynth setup with MIDI input enabled
Remember to enable MIDI input in qsynth. That's what it's for :).

qsynth setup with auto-connect Jack selected
The entry 'Auto-connect Jack Outputs' will enable you to start jack, Rosegarden and qsynth such that all the connections via jackd get made automatically. This saves a lot of hassle.

5. Check that the Rosegarden settings are sensible
Rosegarden setup using jackd transport
Tell Rosegarden to use the Jack transport.

Rosegarden setup not starting jackd automatically
No need to tell Rosegarden to start jack, as we will see in a minute. N.B. that the Jack Command is not needed if this guide is followed fully.

6. Test your Rosegarden, Jack and Qsynth Set-ups
From the KDE menus, start in this order: qjackctl, qsynth and rosegarden. There should be no error messages. The jackd transport should start automatically. Load a file into Rosegarden and hit the play button. The MIDI output from Rosegarden will immediately become sound! :) If not, turn on the log files in qjackctl and qsynth and start debugging or googling. If you get xruns in the jack log file and horrid sound quality, you either need to fiddle with the jack and qsynth setups, or you need a faster processor :(

7. Make Rosegarden, Qsynth and Jack start and stop together with a single click
Of course, if you start all three programs from the KDE menus, you have to do it in the right order. Then you have to kill them all individually too, which is a bit of a pain. Here is a script that can be run from a KDE icon easily. It starts and stops all three programs nicely:
#!/bin/sh
# V1.0 DWL 22/12/2007
qjackctl &
sleep 2         # Wait for qjackctl to start jackd
qsynth &
rosegarden --nofork
#
# Kill qjackctl, jackd and qsynth when rosegarden exits.
ps -ef | grep qsynth | grep -v start | awk '{print "kill -15 " $2}' | sh
ps -ef | grep jack   |                 awk '{print "kill -15 " $2}' | sh
exit;

Remember to chmod 755 the script and to reference it from a KDE icon so that you can start Rosegarden and its friends together.

Please send any improvements to this guide to dwlegg a t gmail d o t com.


Back to Main Menu Examples of Rosegarden files and MIDI files on this site: Father of Mercies Immortal Honours Our God, Our Help in Ages Past

Valid HTML 4.0 Transitional

Here is an email explaining how to make these above instructions work with other distributions:-

from	Maurice maurice.d at somewhere
to	dwlegg at somewhere.com
date	3 November 2008 13:26
subject	Rosegarden sound
mailed-by	tiscali.co.uk
	
hide details 3 Nov (3 days ago)
	
	
Reply
	
	
Hi,

Thank you for your Howto on getting Rosegarden sound working on Fedora
Core 7 and Fedora 8. I can confirm that the same instructions work fine
on Fedora 9 without any alterations. I have also used the same
instructions to configure Rosegarden in Ubuntu Intrepid and linux Mint 5
with the following minor changes.

Install Rosegarden from Synaptic Package Manager. The package includes
qjackctl, lilypond and jackd. Also from synaptic install qsynth,
libxml-twig-perl, xml-twig-tools and sox.

There was one error message complaining rosegarden is unable to find
snd-rtctimer. This was solved by changing a setting in Rosegarden,
Settings > Configure Rosegarden > Midi > General tab and changing
Sequence Timing Source from auto to system timer. Two minor changes to
the start up script made it more stable on Ubuntu. Increase the sleep
time to 7 seconds to give Jack time to start before Qsynth loads and add
a 2 second sleep between Qsynth and Rosegarden.

Once again, thank you for sorting out sound in this great software that
is now working perfectly.

Best wishes

Maurice